Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

cgo compile fails with v1.16.0 #35

Closed
ncw opened this issue Apr 10, 2019 · 1 comment
Closed

cgo compile fails with v1.16.0 #35

ncw opened this issue Apr 10, 2019 · 1 comment

Comments

@ncw
Copy link

ncw commented Apr 10, 2019

Since v1.16.0 was released, my checks have been failing like this

Eg https://golangci.com/r/github.com/ncw/rclone/pulls/3101

analyze (1.0s)
$ GOLANGCI_COM_RUN=1 golangci-lint run --out-format=json --issues-exit-code=0 --deadline=5m --new=false --new-from-rev= --new-from-patch=../changes.patch
    Running error: context loading failed: failed to load program with go/packages: go [list -e -json -compiled -test=true -export=false -deps=true -find=false -tags cmount -- ./...]: exit status 2: # github.com/ncw/rclone/vendor/github.com/billziss-gh/cgofuse/fuse
    vendor/github.com/billziss-gh/cgofuse/fuse/host.go:39:18: fatal error: fuse.h: No such file or directory
     #include <fuse.h>
                      ^
    compilation terminated.

What appears to be happening is that it is trying to compile cgo code and failing because the FUSE library isn't installed.

This is guarded by a build tag cmount so isn't built normally.

I'm not sure how to fix this. It is certainly a regression since v1.15.0 worked just fine, but perhaps there is something I can do?

Thanks for a great tool

@ncw
Copy link
Author

ncw commented Apr 12, 2019

I figured out what was going on.

In my config file I had

run:
  build-tags:
    - cmount

Which was causing the files to be tested. This did work with 1.15 but does not work with 1.16 since they actually need to be compiled. This build tag requires cgo and a library installed so does not compile with 1.16.

I've removed the build tag from the config file and now pass it in from the Makefile when appropriate.

I do think this is a regression, but I'm going to close this since I've figured out a work-around and I expect you've got enough on your plate :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant