-
-
Notifications
You must be signed in to change notification settings - Fork 13k
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 module workspaces #203039
Comments
Don't understand what you mean? nixpkgs/pkgs/build-support/go/module.nix Line 168 in eaf80fc
nixpkgs/pkgs/build-support/go/module.nix Lines 180 to 181 in eaf80fc
|
master...urandom2:nixpkgs:atlas EDIT: let me know what additional context you are curious about? |
That isn't using |
|
sorry, misread the source; but you piqued my interest and meta question, why is |
I think I'm seeing this bug (here's the flake with the problem: https://gist.github.com/MatrixManAtYrService/ac040f60d3602fc2df871623b1d09bf7). In my case, adding
I'm posting 90% because I want to help collect data that helps with fixing bugs and 10% because maybe sombody can tell me how to work around it in my flake 😉 . Thanks all. |
UPDATE: I got it working using this tip to force regenerating the vendor has. Ran into this myself while trying to upgrade a package :( Unfortunately, the Given this:
The build fails with:
If I remove the |
I'm not sure we should add a builder for Go workspaces, but in case we decide to do so, there is an interesting change in Go 1.22 that allows to vendor dependencies of a Go workspace:
|
This jumps Mattermost ESR Versions (see [1] for their release cycle). The new version makes use of Go's workspace feature, which unfortunately the buildGoModule function does not (yet?) support [2], which breaks the previous build process for mattermost. Further, the new release also makes use of private modules only included in the (non-free) enterprise version of mattermost which makes it impossible to build in the usual way even outside of nixpkgs's build abstractions [3]. Both issues can be solved by using Go 1.22, which has added support for vendoring when using workspaces, and instructing it to ignore errors with the -e flag. This requires overriding the go-modules derivation's buildPhase, and still produces a functional binary. [1] https://docs.mattermost.com/upgrade/extended-support-release.html [2] NixOS#203039 [3] mattermost/mattermost#26221
for cross-reference: #299096 |
Describe the bug
while attempting to package atlas for #197774, it became apparent that
buildGoModule
is not capable of handling the new go module workspace mode.technically the versions of go we have supports it, but because workspaces contradict
-mod=vendor
, see golang/go#54130, we may need to addbuildGoWorkspace
?Steps To Reproduce
Steps to reproduce the behavior:
go.mod
andgo.work
buildGoModule
Expected behavior
derivation builds correctly
Additional context
since we are using
GOPROXY=file://
to inject dependencies, we should not need to use -mod=vendor.Notify maintainers
@c00w @kalbasit @Mic92 @zowoq
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: