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

Override the nix version to build against? #136

Open
mikepurvis opened this issue Aug 9, 2023 · 2 comments
Open

Override the nix version to build against? #136

mikepurvis opened this issue Aug 9, 2023 · 2 comments

Comments

@mikepurvis
Copy link

I'm pulled in the Harmonia flake, added it to my system configuration, and am setting services.harmonia-dev.enable = true, but then having it fail to build with:

The following warnings were emitted during compilation:

warning: src/nix.cpp: In function 'rust::cxxbridge1::String libnixstore::make_fixed_output_path(bool, rust::cxxbridge1::Str, rust::cxxbridge1::Str, rust::cxxbridge1::Str)':
warning: src/nix.cpp:261:8: error: 'FixedOutputInfo' is not a member of 'nix'; did you mean 'FixedOutputHash'?
warning:   261 |   nix::FixedOutputInfo info{
warning:       |        ^~~~~~~~~~~~~~~
warning:       |        FixedOutputHash
warning: src/nix.cpp:269:71: error: 'info' was not declared in this scope
warning:   269 |   nix::StorePath path = store->makeFixedOutputPath(STRING_VIEW(name), info);
warning:       |                                                                       ^~~~
warning: src/nix.cpp:257:42: warning: unused parameter 'recursive' [-Wunused-parameter]
warning:   257 | rust::String make_fixed_output_path(bool recursive, rust::Str algo,
warning:       |                                     ~~~~~^~~~~~~~~
warning: src/nix.cpp:257:63: warning: unused parameter 'algo' [-Wunused-parameter]
warning:   257 | rust::String make_fixed_output_path(bool recursive, rust::Str algo,
warning:       |                                                     ~~~~~~~~~~^~~~
warning: src/nix.cpp:258:47: warning: unused parameter 'hash' [-Wunused-parameter]
warning:   258 |                                     rust::Str hash, rust::Str name) {
warning:       |                                     ~~~~~~~~~~^~~~

error: failed to run custom build command for `libnixstore v0.4.0 (/build/h6slmxl6l21qnw7pvxlx0qvhhv2w145g-source/libnixstore)`

However, when I nix build the harmonia binary from this repo's flake outside the module, it works perfectly fine. It appears that something about the module system is causing an incompatible Nix to be passed into the Harmonia build— I'm using 2.16.1 on my outer system, but I'm also using nixpkgs/nixos-23.05 as the basis and I suspect that I'm therefore getting 2.15 as the "unstable" version being consumed here:

nixVersions.unstable

Would it be possible to parameterize the harmonia-dev module so that it's possible to pass in an exact nix against which to link, or even just specify the Harmonia package to use, similar to how Hydra's module works (then that package could be overridden and passed the newer nixpkgs that I guess it wants):

https://github.com/NixOS/hydra/blob/60e2c377d305b72cee39c51b5892d215e4238278/hydra-module.nix#L69-L74

As a novice to NixOS administration, I continue to find the module system extremely difficult to reason about or debug, so it's possible this is a PEBKAC issue and there's some much easier solution, but it's surprising to me that even with flakes it's so hard to get the development versions of Hydra and Harmonia running together on the same machine.

@mikepurvis
Copy link
Author

mikepurvis commented Aug 9, 2023

I think master...mikepurvis:harmonia:config-package is basically what I'm proposing, though I see that that's partially unwinding the changes made in b8f3f06.

And having tried it, I see now that Harmonia 0.7.1 actually depends on NixOS/nix#8650, which is only in Nix 2.17— however, with these changes together, I was able to get my system built.

@phaer
Copy link
Member

phaer commented Nov 27, 2024

I think this might be be solved, now that harmonia does not link libnix anymore?

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

2 participants