You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the quantm application fails to compile within our Nix environment when using Go 1.23. This is primarily due to incompatibilities arising from the interaction between gomod2nix, the requirement of vendor/modules.txt and libgit2 version constraints.
The core issue is as follows:
Go 1.23 and modules.txt: Go 1.23 introduced a requirement for a vendor/modules.txt file when using go build -mod=vendor. This file tracks explicit dependencies and sub-modules. The current gomod2nix version doesn't properly handle this requirement out of the box, and this is addressed in gomod2nix PR #168, however, that PR requires a patch to the go toolchain in nixpkgs.
libgit2 Version: The current build process depends on libgit2 version 1.7.2. The current version of libgit2 in nixpkgs unstable/24.11 is 1.8, which is not compatible.
Root Cause
gomod2nix and Go 1.23:gomod2nix needs to generate vendor/modules.txt which was introduced in go 1.23 which is not the default behavior. This is addressed in the above mentioned PR. This requires a go toolchain patch in nixpkgs to work with this generated vendor/modules.txt file.
libgit2 Version: The libgit2 version 1.7.2 is required for a build however nixpkgs 24.11 has version 1.8, which causes compatibility issues.
Proposed Solution
To resolve this issue, we need to:
Update Nixpkgs: Upgrade our nixpkgs to the latest 24.11. (this has been done already)
Pin libgit2: Import the libgit2 package version 1.7.2 from the nixpkgs 24.05 using the following instruction found here. This ensures that the correct version is used during the build.
Incorporate gomod2nix Fix: Apply the changes from gomod2nix PR #168 which uses a go mod vendor command to generate the necessary modules.txt file.
Problem
Currently, the
quantm
application fails to compile within our Nix environment when using Go 1.23. This is primarily due to incompatibilities arising from the interaction betweengomod2nix
, the requirement ofvendor/modules.txt
andlibgit2
version constraints.The core issue is as follows:
Go 1.23 and
modules.txt
: Go 1.23 introduced a requirement for avendor/modules.txt
file when usinggo build -mod=vendor
. This file tracks explicit dependencies and sub-modules. The currentgomod2nix
version doesn't properly handle this requirement out of the box, and this is addressed in gomod2nix PR #168, however, that PR requires a patch to the go toolchain in nixpkgs.libgit2
Version: The current build process depends onlibgit2
version 1.7.2. The current version oflibgit2
in nixpkgs unstable/24.11 is 1.8, which is not compatible.Root Cause
gomod2nix
and Go 1.23:gomod2nix
needs to generatevendor/modules.txt
which was introduced in go 1.23 which is not the default behavior. This is addressed in the above mentioned PR. This requires a go toolchain patch in nixpkgs to work with this generatedvendor/modules.txt
file.libgit2
Version: Thelibgit2
version 1.7.2 is required for a build however nixpkgs 24.11 has version 1.8, which causes compatibility issues.Proposed Solution
To resolve this issue, we need to:
libgit2
: Import thelibgit2
package version 1.7.2 from the nixpkgs 24.05 using the following instruction found here. This ensures that the correct version is used during the build.gomod2nix
Fix: Apply the changes from gomod2nix PR #168 which uses ago mod vendor
command to generate the necessarymodules.txt
file.go build -mod=vendor
works with the generatedvendor/modules.txt
file.Additional Notes
nix develop
.Next Steps
quantm
build process.quantm
binary works as intended.This detailed issue should help us track the problem, understand its causes, and collaborate effectively to implement the necessary fixes.
The text was updated successfully, but these errors were encountered: