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

evaluate phases in nix develop the same way as genericBuild #7023

Closed
wants to merge 1 commit into from

Conversation

arianvp
Copy link
Member

@arianvp arianvp commented Sep 11, 2022

This way nix develop [--configure|--build] works with meson, cmake etc; which set the xxxPhase= environment variable instead of overriding the xxxPhase function.

open question. I think in these cases foundMakefile=1 should not be set. But we'd need to fix that in https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh first I think

This way `nix develop` works with  meson, cmake etc; which set the `xxxPhase=` environment variable instead
of overriding the `xxxPhase` function.
Copy link

@kira-bruneau kira-bruneau left a comment

Choose a reason for hiding this comment

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

Thanks for this fix @arianvp! I noticed this problem too, but never really looked into it before 😅

open question. I think in these cases foundMakefile=1 should not be set. But we'd need to fix that in https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh first I think

Hmm, yeah. It looks like checkPhase and installCheckPhase should check for the makefile themselves so they aren't dependent on the buildPhase. I wonder how many other places we have dependencies between phases like this?

@firestack
Copy link

uhhhh, related? flox@c03252c

#6202

@fricklerhandwerk fricklerhandwerk added the new-cli Relating to the "nix" command label Sep 12, 2022
Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

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

Duh, I though that's what runHook was meant to do 😕

Thanks for the fix then :) That looks good (well, it's literally what the stdenv does, so it better be…)

Can you just add a test for that? I guess you can add a new derivation (with a custom buildPhase) in tests/shell.nix and run nix develop --build on it in tests/nix-shell.sh.

@arianvp
Copy link
Member Author

arianvp commented Sep 14, 2022

It feels more elegant to fix stdenv. Let me give that a try first

@thufschmitt
Copy link
Member

It feels more elegant to fix stdenv. Let me give that a try first

All right 👍

I'll close the PR in the meantime, feel free to reopen it if the stdenv fix doesn't work out well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-cli Relating to the "nix" command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants