Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go get error #15

Closed
tatsuiman opened this issue Feb 25, 2020 · 4 comments
Closed

go get error #15

tatsuiman opened this issue Feb 25, 2020 · 4 comments
Assignees
Labels
Type: Bug Something isn't working.

Comments

@tatsuiman
Copy link

tatsuiman commented Feb 25, 2020

I tried to install with go get but I got an error.

$ docker run --rm -it golang bash
# go get -u github.com/forensicanalysis/artifactcollector
package github.com/pierrec/lz4/v3: cannot find package "github.com/pierrec/lz4/v3" in any of:
	/usr/local/go/src/github.com/pierrec/lz4/v3 (from $GOROOT)
	/go/src/github.com/pierrec/lz4/v3 (from $GOPATH)

I see you're running quite old version modules.

@cugu cugu self-assigned this Feb 25, 2020
@cugu cugu added the Type: Bug Something isn't working. label Feb 25, 2020
@cugu
Copy link
Member

cugu commented Feb 25, 2020

Thanks for the issue.

Interesting error, as the following is working:

git clone https://github.com/forensicanalysis/artifactcollector
cd artifactcollector
go build .
# or go install .

cugu added a commit that referenced this issue Feb 25, 2020
@tatsuiman
Copy link
Author

tatsuiman commented Feb 25, 2020

go build appears to work correctly.
However, when I tried to output windows binaries, I got the following error:

$ GOOS=windows GOARCH=amd64 go build .

on windows 10

2020/02/25 10:43:32 run.go:259: Start to collect forensic artifacts. This might take a while.
2020/02/25 10:43:32 jsonlite.go:129: Store does not exist MyPC-01_2020-02-25T10-43-32.forensicstore\item.db
2020/02/25 10:43:32 run.go:259: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

@cugu
Copy link
Member

cugu commented Feb 25, 2020

Cross compilation is complicated, as CGO is used in the sqlite package. You need a cross compiler e.g. mingw. Then set the CGO_ENABLED=1 and CC=i686-w64-mingw32-gcc as well.

@tatsuiman
Copy link
Author

tatsuiman commented Feb 27, 2020

The build was completed successfully and the operation was confirmed.
Thank you very much

windows 32bit

CGO_ENABLED=1 CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go build .

windows 64bit

CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build .

@cugu cugu mentioned this issue Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working.
Development

No branches or pull requests

2 participants