-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
pypy3: remove runtime-wrapper #52635
Conversation
Just noticed on a different machine, that I am missing something. Stay tuned. |
sys.prefix is incorrect. |
LD_LIBRARY_PATH can break executables of child processes that are linked against different libc versions. Since pypy uses cffi for all c-extensions we no longer need this mechanism as our cc wrapper will set rpath on all shared objects properly. This makes the build a lot simpler. The disadvantage is that we can no longer run tests with this compilation mode.
eb0ee9c
to
7830b7d
Compare
Ok. Everything works now. I had to disable the tests though the binaries are compiled slighty different when compiling for distribution vs in-tree builds. pypy3 -c "import sys; print(sys.prefix)"
/nix/store/9za6kr3k9i9fyviycdkrja848qg18qsa-pypy3-6.0.0/share/pypy |
cc @andersk |
Why pypy3 and not pypy2? Removing the runtime wrapper seems like generally a good idea, but I don’t see what the path changes have to do with that, and disabling all the tests is disappointing—can we just set |
We already set LD_LIBRARY_PATH during the build. However the way it is currently build one cannot run the tests because the build is not configured for an in-tree build. |
I don’t understand. The current package sets |
After removing LD_LIBRARY_PATH it was set to |
I built diff --git a/pkgs/development/interpreters/python/pypy/3/default.nix b/pkgs/development/interpreters/python/pypy/3/default.nix
index 23e239d925b..7a68ea43628 100644
--- a/pkgs/development/interpreters/python/pypy/3/default.nix
+++ b/pkgs/development/interpreters/python/pypy/3/default.nix
@@ -1,7 +1,7 @@
{ stdenv, substituteAll, fetchurl
, zlib ? null, zlibSupport ? true, bzip2, pkgconfig, libffi
, sqlite, openssl, ncurses, python, expat, tcl, tk, tix, xlibsWrapper, libX11
-, makeWrapper, callPackage, self, gdbm, db, lzma
+, callPackage, self, gdbm, db, lzma
, python-setup-hook
# For the Python package set
, packageOverrides ? (self: super: {})
@@ -26,7 +26,7 @@ in stdenv.mkDerivation rec {
sha256 = "0lwq8nn0r5yj01bwmkk5p7xvvrp4s550l8184mkmn74d3gphrlwg";
};
- nativeBuildInputs = [ pkgconfig makeWrapper ];
+ nativeBuildInputs = [ pkgconfig ];
buildInputs = [
bzip2 openssl pythonForPypy libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 gdbm db lzma
] ++ stdenv.lib.optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc
@@ -96,15 +96,6 @@ in stdenv.mkDerivation rec {
ln -s $out/pypy3-c/include $out/include/${libPrefix}
ln -s $out/pypy3-c/lib-python/3 $out/lib/${libPrefix}
- # We must wrap the original, not the symlink.
- # PyPy uses argv[0] to find its standard library, and while it knows
- # how to follow symlinks, it doesn't know about wrappers. So, it
- # will think the wrapper is the original. As long as the wrapper has
- # the same path as the original, this is OK.
- wrapProgram "$out/pypy3-c/pypy3-c" \
- --set LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:$out/lib" \
- --set LIBRARY_PATH "${LIBRARY_PATH}:$out/lib"
-
# verify cffi modules
$out/bin/pypy3 -c "import tkinter;import sqlite3;import curses;import lzma"
|
Sorry I could not test your change.
|
I've added derivations for using prebuilt PyPy to #53123. Using those for translating/building speeds it up considerably. Also, what do you think of separating the translating/building from the installing (and testing)? |
That might help. I guess I can close this for now as I would need to re-add stuff on top of https://github.com/NixOS/nixpkgs/pull/53123/files anyway. |
I opened a PR for my more minimal change: #54013. |
LD_LIBRARY_PATH can break executables of child processes that are linked
against different libc versions. Since pypy uses cffi for all c-extensions
we no longer need this mechanism as our cc wrapper will set rpath on all
shared objects properly. This makes the build a lot simpler.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)