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
hepmc3: 3.2.0 -> 3.2.2 #92078
hepmc3: 3.2.0 -> 3.2.2 #92078
Conversation
@veprbl I had to stop the |
Thanks for the bump! I have a comment about numpy:
I assume you mean a different numpy package? IIRC, ROOT links against the numpy library, so using it with any other numpy library could break. Python libraries in nixpkgs usually use |
then we should probably use something like cc @FRidh |
Must admit, I did not know about this:
I still don't see how this is a problem of this specific expression. If you change it, you might as well change it everywhere in pkgs/development/python-modules. |
de87ef7
to
73524da
Compare
I altered hepmc3 to override the python interpreter passed to root, so they should be coherent. But not a very elegant solution
because root is defined in For example, the
|
|
I also added an installcheckphase, just to make sure it's able to be imported
|
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.
Thanks for the test in hepmc3
.
Regarding your "root: don't propagated python interpreter" commit. You remove the explicit python
dependency, which means that you treat interpreter propagation as a useful feature that we should rely on, but then you remove pythonPackages.numpy
from propagatedBuildInputs
and motivate that by saying that the users will not expect interpreter to be propagated. I would really like some clarification on what is our stance on interpreter propagation before starting changing things back and forth.
I'm coming from the user's perspective. It's surprising to have the interpreter I didn't ask for in my nix-shell environment, but for the build environment, i feel like it's much less surprising to have the interpreter present. If I had the following shell.nix:
I would expect to have python37 as my python interpreter, and for
|
doInstallCheck = withPython; | ||
# prevent nix from trying to dereference a null python | ||
installCheckPhase = stdenv.lib.optionalString withPython '' | ||
PYTHONPATH=${placeholder "out"}/${python.sitePackages} python -c 'import pyHepMC3' |
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.interpreter}
You can never expect About the propagation one can say it's bad either way. If we propagate, packages may get
That is something you cannot expect because Now I don't know how these tools use |
It was also causing a build failure for |
Let me summarize my understanding of the situation. The python interpreter propagation originally added 6 years ago in ab423e6 and its original purpose for introducing it was for convenience of use in nix-shell. It is currently implemented as:
As we can see, it affects only python packages defined using the
Then, I think, the @jonringer 's original concern was that one does not expect a package referred to as
I actually was not worried too much because if someone is using a ROOT API which returns a numpy array (like
I don't know, but I am curious what other kind of propagation we could do. Overall it doesn't seem like the interpreter propagation feature is doing much good for us. It doesn't seem to be mentioned in the manual (which, contrary to the common practice, is heavily biased towards using I also would like to mention the case when the python interpreter binaries are not needed at all. For example, Blender is linking to the interpreter directly and needs to import and depend on python packages like |
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 don't mind disabling the numpy
propagation.
buildInputs = [ gl2ps pcre python zlib libxml2 lz4 lzma gsl xxHash ] | ||
++ stdenv.lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ] | ||
++ stdenv.lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ] | ||
buildInputs = [ gl2ps pcre zlib libxml2 lz4 lzma gsl xxHash python.pkgs.numpy ] |
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 prefer to keep python dependency explicitly. One of the reasons being that ROOT can be built without numpy but with python.
@@ -3,19 +3,21 @@ | |||
let | |||
pythonVersion = with stdenv.lib.versions; "${major python.version}${minor python.version}"; | |||
withPython = python != null; | |||
# ensure that root is built with the same python interpreter, as it links against numpy | |||
root_py = if withPython then root.override { inherit python; } else root; |
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 don't think this makes a lot of sense to do this as HepMC doesn't interact with ROOT via any python API.
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.
it felt bad writing it, I'm just not aware of a different way to ensure that they both use the same interpreter version (if it's even important).
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.
Well it is an idiomatic code to ensure matching interpreter versions, but that is not needed in this particular case.
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.
right but just saying root
doesn't give an indication what python interpreter will be used. As opposed to python37Packages.hepmc3
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 suppose HepMC3 links only to libRIO, which is not affected by python in any way. And root
's setupHook
will set LD_LIBRARY_PATH, so hepmc might end up working with a different build of ROOT in some cases.
merging to fix build, if additional improvements are needed, they can be done in another PR |
Motivation for this change
noticed it was failing on #91886
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)