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

autogen: try fixing on darwin #90284

Merged
merged 1 commit into from Jun 14, 2020
Merged

Conversation

vcunat
Copy link
Member

@vcunat vcunat commented Jun 14, 2020

and cause no rebuild elsewhere.
In commit 2988780 I forgot that patchelf makes no sense there.

and cause no rebuild elsewhere.
In commit 2988780 I forgot that patchelf makes no sense there.
@vcunat
Copy link
Member Author

vcunat commented Jun 14, 2020

@GrahamcOfBorg build autogen
IIRC references to /build/ shouldn't be a problem on Darwin, but better get some overall verification anyway.

@FRidh
Copy link
Member

FRidh commented Jun 14, 2020

autogen on x86_64-darwin — Success

@vcunat vcunat merged commit e1b9380 into NixOS:staging-next Jun 14, 2020
@vcunat vcunat deleted the p/autogen-darwin branch June 14, 2020 09:39
@tomberek
Copy link
Contributor

Possible lingering issue with RPATH on ARMv7l:

checking for references to /tmp/nix-build-autogen-5.18.16.drv-0/ in /nix/store/vkxyf46py2kspqmsl4ivm2wlkcrh1x5f-autogen-5.18.16-bin...
RPATH of binary /nix/store/vkxyf46py2kspqmsl4ivm2wlkcrh1x5f-autogen-5.18.16-bin/bin/autogen contains a forbidden reference to /tmp/nix-build-autogen-5.18.16.drv-0/
builder for '/nix/store/28fqbf4c4k6h3v29s56rxg9lqabzyvcz-autogen-5.18.16.drv' failed with exit code 1

@tomberek
Copy link
Contributor

This seems to help:

diff --git a/pkgs/development/tools/misc/autogen/default.nix b/pkgs/development/tools/misc/autogen/default.nix
index 3e634bedfd1..66a56669e4b 100644
--- a/pkgs/development/tools/misc/autogen/default.nix
+++ b/pkgs/development/tools/misc/autogen/default.nix
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
   '' + stdenv.lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
     # remove /build/** from RPATHs
     for f in "$bin"/bin/*; do
-      local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)/build/[^:]*:@\1@g')"
+      local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)/build/[^:]*:@\1@g' | sed -E 's@(:|^)/tmp/nix-build[^:]*:@\1@g')"
       patchelf --set-rpath "$nrp" "$f"
     done
   '';

Sandbox on my ARMv7l is set to false, so the build path is /tmp/nix-build-*

@vcunat
Copy link
Member Author

vcunat commented Aug 10, 2020

It would be best to "compute" the path that's being used, but it gets more complicated, as the path might contain sed-special characters.

@tomberek
Copy link
Contributor

tomberek commented Aug 10, 2020

Perhaps be explicit?

${stdenv.lib.makeLIbraryPath [ guile boehm glibc]}:$lib/lib

Edit: this can get ugly too and break easy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants