I’m currently trying to update opensnitch, basing my work off the previous draft PR (#118329) and rebasing/updating sources, but I’m running into trouble with the vendoring.
What I currently have is here on my fork. I obtained vendorSha256
by running nix build .#opensnitch
with vendorSha256 = "";
before pasting in the expected hash, but then the second nix build .#opensnitch
gives me
go: inconsistent vendoring in /build/source/daemon:
golang.org/x/net@v0.0.0-20190311183353-d8887717615a: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
golang.org/x/sys@v0.0.0-20190606203320-7fc4e5ec1444: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
golang.org/x/net@v0.0.0-20191028085509-fe3aa8a45271: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
golang.org/x/sys@v0.0.0-20191029155521-f43be2a4598c: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
To ignore the vendor directory, use -mod=readonly or -mod=mod.
To sync the vendor directory, run:
go mod vendor
As I’m not a Go developer, I’m not sure how to fix this—vendoring in a fresh clone
$ git clone https://github.com/evilsocket/opensnitch --branch=v1.4.2 --depth=1
$ cd opensnitch; rm .git -rf # remove .git to make as close to Nix as possible
$ nix develop path/to/nixpkgs#opensnitch
(nix-shell)$ runHook preBuild
(nix-shell)$ go mod vendor
gives me the same vendor/
folder contents as nix build
gave me, so buildGoModule
seems to be vendoring right. Doing a simple go build
after also works fine.
Does anyone have any ideas/suggestions for what I could try next? Thank you!