goreplay icon indicating copy to clipboard operation
goreplay copied to clipboard

deb / rpm install failed & go get : cannot parse import comment

Open nl8590687 opened this issue 3 years ago • 4 comments

At the beginning, I wanted to install gor by the package you provided (like deb and rpm) but I got an error like this: In Ubuntu 18.04 server:

$ dpkg -i gor_v1.2.0_amd64.deb
dpkg: error processing archive gor_v1.2.0_amd64.deb (--install):
 parsing file '/var/lib/dpkg/tmp.ci/control' near line 2 package 'gor':
 error in 'Version' field string 'v1.2.0': version number does not start with digit
Errors were encountered while processing:
 gor_v1.2.0_amd64.deb

and in Fedora 32 server:

$ rpm -i gor-v1.2.0-1.x86_64.rpm
        软件包 gor-v1.2.0-1.x86_64 是针对 different 操作系统的

It said this package is aimed at a different OS.

So, I followed your document for tutorials of Compilation, but I got another error problem.

When I used go get:

$ go get github.com/buger/gor
buger/gor/input_raw.go:12:2: /root/gocode/src/github.com/buger/goreplay/capture/doc.go:1: cannot parse import comment
buger/gor/input_raw.go:15:2: /root/gocode/src/github.com/buger/goreplay/tcp/doc.go:1: cannot parse import comment

and then:

$ go build LDFLAGS = -ldflags "-extldflags \"-static\""
can't load package: package LDFLAGS: cannot find package "LDFLAGS" in any of:
        /usr/lib/go-1.10/src/LDFLAGS (from $GOROOT)
        /root/gocode/src/LDFLAGS (from $GOPATH)
can't load package: package =: cannot find package "=" in any of:
        /usr/lib/go-1.10/src/= (from $GOROOT)
        /root/gocode/src/= (from $GOPATH)
can't load package: package -ldflags: cannot find package "-ldflags" in any of:
        /usr/lib/go-1.10/src/-ldflags (from $GOROOT)
        /root/gocode/src/-ldflags (from $GOPATH)
can't load package: package -extldflags "-static": cannot find package "-extldflags \"-static\"" in any of:
        /usr/lib/go-1.10/src/-extldflags "-static" (from $GOROOT)
        /root/gocode/src/-extldflags "-static" (from $GOPATH)

Whatever OS I used, I got the same compilation result. Therefore, I can not install gor with any way. Please what's wrong with it? Thanks!

Operating environment:

  1. Fedora 32 with go v1.14.13 linux/amd64
  2. Ubuntu 18.04 with go v1.10.4 linux/amd64

nl8590687 avatar Mar 10 '21 14:03 nl8590687

@nl8590687 install libpcap and do git clone instead of go get. go build . without any flag will be enough and those errors will be fixed.

urbanishimwe avatar Mar 10 '21 17:03 urbanishimwe

It works, the problem is solved, thank you!

nl8590687 avatar Mar 11 '21 05:03 nl8590687

Seeing same issue with built deb as an FYI - from error in 'Version' field string 'v1.2.0': version number does not start with digit

Reproduced on ubuntu version

/tmp# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

And reproduced via

cd /tmp
wget https://github.com/buger/goreplay/releases/download/v1.2.0/gor_v1.2.0_amd64.deb
dpkg --install gor_v1.2.0_amd64.deb

You appear to have a malformed .deb configuration

rtkgjacobs avatar Mar 24 '21 17:03 rtkgjacobs

use dpkg --force-bad-version -i can fix it. the deb packaging is irregular

maplebeats avatar Jul 26 '21 06:07 maplebeats