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

"cannot find module providing package" when specifying go 1.23 in go.mod #183

Open
rcambrj opened this issue Jan 10, 2025 · 5 comments
Open

Comments

@rcambrj
Copy link

rcambrj commented Jan 10, 2025

I'm attempting to build bicipi with gomod2nix and coming across the following error:

$ nix build .#packages.x86_64-linux.bicipi
[...]
error: builder for '/nix/store/4sp13glivjl3h1zihnn8vzzl3i1rr24x-bicipi-0.1.drv' failed with exit code 1;
       last 18 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/vzibmb9578q8ghhay6dx09n84xi7qx9w-57s3c5a6xzrfn69af4z5d4xmfxywcl59-source
       > source root is 57s3c5a6xzrfn69af4z5d4xmfxywcl59-source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Building subPackage .
       > go: ignoring package github.com/sirupsen/logrus which exists in the vendor directory but is missing from vendor/modules.txt. To sync the vendor directory run go mod vendor.
       > go: ignoring package tinygo.org/x/bluetooth which exists in the vendor directory but is missing from vendor/modules.txt. To sync the vendor directory run go mod vendor.
       > go: ignoring package github.com/montanaflynn/stats which exists in the vendor directory but is missing from vendor/modules.txt. To sync the vendor directory run go mod vendor.
       > go: ignoring package go.bug.st/serial which exists in the vendor directory but is missing from vendor/modules.txt. To sync the vendor directory run go mod vendor.
       > go: ignoring package github.com/google/gousb which exists in the vendor directory but is missing from vendor/modules.txt. To sync the vendor directory run go mod vendor.
       > ftms/fitness_machine_service.go:6:2: cannot find module providing package github.com/sirupsen/logrus: import lookup disabled by -mod=vendor
       > ftms/commands.go:8:2: cannot find module providing package tinygo.org/x/bluetooth: import lookup disabled by -mod=vendor
       > tacx/tacx.go:9:2: cannot find module providing package github.com/montanaflynn/stats: import lookup disabled by -mod=vendor
       > tacx/serial/commander.go:9:2: cannot find module providing package go.bug.st/serial: import lookup disabled by -mod=vendor
       > tacx/usb/commander.go:8:2: cannot find module providing package github.com/google/gousb: import lookup disabled by -mod=vendor
       For full logs, run 'nix log /nix/store/4sp13glivjl3h1zihnn8vzzl3i1rr24x-bicipi-0.1.drv'.

That's almost all of the direct dependencies failing (github.com/google/go-cmp seems ok...?)

I suppose this might be related to #20, but it looks like that was resolved.

Any support would be much appreciated.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/gomod2nix-cannot-find-module-providing-package/54558/4

@randomizedcoder
Copy link

Gday mate - I ended up getting this working, and have a repo with it. Hopefully this is useful.
https://github.com/randomizedcoder/gomod2nix-example

@rcambrj
Copy link
Author

rcambrj commented Jan 15, 2025

@randomizedcoder thanks for your response.

I'd been banging my head against this wall for some days when you responded, at which point I decided to bang some more. It turns out that the fix is to downgrade go.mod from 1.23 to 1.22. Even though the go version locked in the flake's nixpkgs is 1.23, along with inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs".

The version in your go.mod is 1.17. Do you remember what it was that fixed this problem for you?

I hope this helps others to move forward, but I'm concerned that versions beyond 1.22 are all going to be broken. I'll rename this issue to better reflect the problem and see if I can continue my investigation at some point.

@rcambrj rcambrj changed the title cannot find module providing package "cannot find module providing package" when specifying go 1.23 in go.mod Jan 15, 2025
@randomizedcoder
Copy link

@rcambrj

Actually, I tried to create a PR to update the go version. Go 1.23 has a bunch of very nice improvements, particularly for timers.

#173

@rcambrj
Copy link
Author

rcambrj commented Jan 17, 2025

@randomizedcoder I still get cannot find module providing package when switching gomod2nix to your branch:

    inputs.gomod2nix.url = "github:randomizedcoder/gomod2nix?ref=update";

I'm not sure what's broken, but I don't think that's it 🙁

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

No branches or pull requests

3 participants