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

importCargoLock: introduce alternative parameter lockFileContents #137395

Merged
merged 1 commit into from
Sep 20, 2021
Merged

importCargoLock: introduce alternative parameter lockFileContents #137395

merged 1 commit into from
Sep 20, 2021

Conversation

dermetfan
Copy link
Member

Motivation for this change

In restricted mode (and therefore with flakes) builtins.readFile may not be the result of builtins.toFile,
making it impossible to use a generated lockFile (with or without IFD),
and thereby causing evaluation to fail if system != builtins.currentSystem on Hydra
so the jobs are not delegated to eligible build machines that support that system.

This is done in a way that avoids rebuilds.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@jonringer
Copy link
Contributor

cc @Mic92 @danieldk this looks pretty harmless.

diff LGTM to me

Copy link
Contributor

@danieldk danieldk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but it would be nice if a test is added for this.

In restricted mode (and therefore with flakes) `builtins.readFile` may not be the result of `builtins.toFile`,
making it impossible to use a generated lockFile (with or without IFD),
and thereby causing evaluation to fail if `system != builtins.currentSystem` on Hydra
so the jobs are not delegated to eligible build machines that support that system.

This is done in a way that avoids rebuilds.
@dermetfan
Copy link
Member Author

Test added 🙂

@danieldk
Copy link
Contributor

@ofborg build tests.importCargoLock

Copy link
Contributor

@danieldk danieldk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I don't want to hold up this PR any further, but could you make a follow-up PR that adds this option to the nixpkgs Rust docs?

@danieldk danieldk merged commit 24b5074 into NixOS:master Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants