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

make-derivation.nix: allow equality-test of meta-check-failing derivations #213096

Closed
wants to merge 3 commits into from
Closed

make-derivation.nix: allow equality-test of meta-check-failing derivations #213096

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 28, 2023

Description of changes

This allows checking the equality of derivations whose meta-checks fail.

A throw still occurs if you try to instantiate or build a meta-check-failing derivation, or a derivation which uses such a derivation as an inputDrv.

This PR is a more general fix for the issue that #212832 solves; both of them result in the following no longer incorrectly failing:

nix-instantiate -A pkgsCross.x86_64-freebsd.__splicedPackages.docutils.__spliced.buildHost

#212832 also cleans up some really hard-to-read expressions in interpreters/python, so this is not a replacement for it. However this PR will prevent similar problems from arising in the future.

Things done
  • Built on platform(s)
    • x86_64-linux
    • powerpc64le-linux
    • aarch64-linux
  • Fits CONTRIBUTING.md.

Adam Joseph added 2 commits January 27, 2023 23:20
This allows the conditions `assert`ed for `drvPath` and `outPath` to
be set individually.
…tions

This allows checking the equality of derivations whose meta-checks
fail.

A `throw` still occurs if you try to instantiate or build a
meta-check-failing derivation, or a derivation which uses such a
derivation as an `inputDrv`.
@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Jan 28, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 28, 2023
@ghost ghost marked this pull request as ready for review January 28, 2023 07:58
@ghost
Copy link
Author

ghost commented Jan 28, 2023

This also improves the eval report numbers by 5%-10%, which is totally plausible.

The only eval changes are:

  • nixos-install-tools, since it is a verbatim copy of nixpkgs/lib
  • tests.nixos-functions.nixos-test, since it depends on nixos-install-tools

@alyssais
Copy link
Member

This also improves the eval report numbers by 5%-10%, which is totally plausible.

Wow!

Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

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

LGTM but I'm hoping for more eyes in case there's some non-obvious problem with this a non-expert like me would miss.

@ghost
Copy link
Author

ghost commented Jan 28, 2023

Wow!

Yeah, that was too good to be true. Disabling the meta checks entirely gives about the same improvement. I thought it was much worse.

I need to take a closer look at this.

@ghost ghost marked this pull request as draft January 28, 2023 12:44
@alyssais
Copy link
Member

I did some investigation of how many packages would have their evaluation fixed when cross-compiling:

This fixes evaluation of 3066 packages when cross-compiling from { system = "x86_64-linux"; } to { system = "x86_64-freebsd"; useLLVM = true; }. Mine only fixes eval of 254.

For a cross case that's more typical of most Nixpkgs users, { system = "x86_64-linux"; } to { system = "aarch64-linux"; }, there are still 941 packages that can now be evaluated as a result of this change.

@alyssais
Copy link
Member

When this is ready, it should include a revert of b682fef, which it will obsolete.

@ghost
Copy link
Author

ghost commented Jan 28, 2023

Yeah unfortunately I fear that this PR's fix might just be skipping some of the meta checks entirely.

I'm about to leave town so I won't be able to investigate this with the care it deserves for another week or two. You should definitely merge your PR.

@alyssais
Copy link
Member

You should definitely merge your PR.

Already done. :)

@alyssais
Copy link
Member

@amjoseph-nixpkgs are you still planning on looking at this? Just hit a case where it would be useful (lib.meta.availableOn stdenv.hostPlatform pkgsStatic.stdenv.cc.libc).

@alyssais alyssais added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 28, 2023
@alyssais alyssais mentioned this pull request Apr 28, 2023
12 tasks
@ghost
Copy link
Author

ghost commented May 5, 2023

I do plan on coming back to this, but not until after 23.05 branches off, and didn't plan on making it a particularly high priority. But I can adjust that. What did you have in mind?

@alyssais
Copy link
Member

What did you have in mind?

Just that it would be useful to be able to check whether Musl is supported on the current architecture, to opportunistically use static builds in some special cases.

@ghost ghost closed this Oct 22, 2023
@ghost ghost deleted the review/212832 branch October 22, 2023 07:38
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: stdenv Standard environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant