-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
python3.pkgs.ninja-python: replace with a stub implementation #246963
Conversation
I also went ahead and optimistically renamed |
Instead of packaging the upstream package, which downloads Ninja from the web, we can stub it out to use ninja from nixpkgs.
I am hoping this can be a transparent shim for most if not all Python packages that acts as a proxy to the actual ninja package in nixpkgs. If this works, doing it this way simplifies rolling out the new Python build hooks that do stricter build dependency validation.
I think I figured out how to do this properly. We don't need to propagate the original tool in the PATH. We only need to:
|
This is a build tool that depends on a ninja binary directly, not through the ninja PyPI package.
I believe python2 is broken by this PR; it lands on master via #248496, and I can get python2 to build on its parent but afterward, not anymore. Maybe it's time to give up python2 and mark it as broken... |
Can you share the command you're running? I will try to build Python 2 in a little bit, but the reason I ask is because this doesn't seem connected to Python 2 itself but perhaps some package that is using it? Were you building |
It builds fine on both master and staging-next. |
Hey sorry for the lack of details; the direct failure is always from
However, the commit history of |
Ah my bad, it should be |
This makes sense to me! I'll see what I can do to fix it. |
I think I roughly understand what happened now: the only reason that reverting this PR works for me is because here |
I opened #251548 to undo this change on Python 2 and buy myself some time to think about how to make this better. I'm sorry about the breakage. |
Wow, awesome! Thank you very much for the help! |
Description of changes
This maps to the ninja package on PyPI, which downloads ninja from the web. This was packaged in #243967.
@999eagle, @SuperSandro2000 I would like to replace that implementation with a stub that directly uses ninja in nixpkgs. This capability was requested by @FRidh in scikit-build/ninja-python-distributions#127 – however upstream would like to delegate this capability to PEP 517 backends.
Only certain backends support this out-of-the-box, such as scikit-build-core and (maybe) meson-python. Notably, some projects are still using the older scikit-build, which does not support this. This impacts #245509 because the way I have set up
build
does dependency validation and those projects either need to include this ninja package (picking up its version of ninja) or we need to patch their pyproject.toml.Hence, I'd like to stub out this package and converge on using just the single ninja program provided in nixpkgs.
If this sounds reasonable, I'd also like some opinions on whether it's worth changing the name of this package to just ninja. On the one hand, duplicate names can be confusing. On the other hand, it could also be confusing to someone building a Python package and reading the pyproject.toml that they need to use ninja-python instead of simply ninja.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)