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
[wip] wafHook: don’t depend directly on python #69310
Conversation
@@ -1,9 +1,9 @@ | |||
{ lib, stdenv, pkgs, python, makeSetupHook, waf }: | |||
{ lib, stdenv, pkgs, python3, makeSetupHook, waf }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this go to the callPackage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too tend to agree with this approach - perhaps we should have 2 different wafHook
s - one that's called with default python
and the other with { python = python3 }
.
What is the motivation? What issue does it solve? |
motivation #69305 (comment) |
@@ -10,6 +10,11 @@ wafConfigurePhase() { | |||
wafConfigureFlags="${prefixKey:---prefix=}$prefix $wafConfigureFlags" | |||
fi | |||
|
|||
if ! command -v python >/dev/null 2>&1; then | |||
echo "Adding python to path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: it would be cool to have a nix bash library for this kind of situation. I had added nix_debug / nix_info in pkgs/development/interpreters/lua-5/setup-hook.sh for instance (that act conditionnaly on NIX_DEBUG).
the indentation seems off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "Adding python to path" | |
echo "Adding python to path" |
Why not move |
@veprbl |
@FRidh As far as I am concerned, |
what's the status of this ? I would like to convince ns-3 folks to try nix (they have lots of problem with the different dependency interactions that could be solved with nix) and this is kinda blocking. |
substitutions = { | ||
inherit waf; | ||
python = python3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python = python3; | |
inherit python; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too would like this to be merged - seems impactfull on closure size etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue for removing the fallback Python altogether. This kind of backwards incompatibility is trivial to fix and it will simplify the packaging.
Either that or removing the python fallback which feels hackish. |
@matthewbauer: Slightly off topic but since the change anyways require mass rebuild: Have you considered also making |
@xbreak There is no need to piggyback things just because there is a mass rebuild. If you think that you need a certain change and you can implement it yourself, then do it and just submit it as a separate PR. |
@xbreak has a point here, all waf project I know embed their own waf. If we don't consider waf as a library, making it optional from the hook forces the user to set a python version. It's a convolutad way of doing the equivalent of python3Packages.wafHook but less hackish than the current one. |
This comment has been minimized.
This comment has been minimized.
It is slightly different than how we work with hooks typically, but to me this seems like the best solution proposed thus far. |
I'm not sure I understand what is being proposed here. Do I understand correctly, that this will result in the following two options:
? And then a more explicitly coupled way could look like:
|
@veprbl right that's how I see it. |
Any status on this, ns-3 really needs an update and relies on this (being something) getting merged. |
@eyJhb Would you like to finish this? |
If I had the competences to do so, I really would! :) |
Closing in favor of #106533. |
Uses python as fallback when it is not in the environment.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @