Skip to content

Comments

meson: append install_rpath via patchelf#31436

Closed
lukateras wants to merge 1 commit intoNixOS:masterfrom
lukateras:meson/patchelf
Closed

meson: append install_rpath via patchelf#31436
lukateras wants to merge 1 commit intoNixOS:masterfrom
lukateras:meson/patchelf

Conversation

@lukateras
Copy link
Member

@lukateras lukateras commented Nov 9, 2017

Motivation for this change

This is based on @jtojnar's work in #31228. When patchelf has to grow rpath beyond original capacity, it sets dontStrip, to work around NixOS/patchelf#10.

Fixes #31222. Currently in the process of rebuilding stuff with patched meson.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Copy link
Member

@jtojnar jtojnar Nov 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation mismatch (tabs vs spaces)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't get Emacs to indent shell scripts properly...

This is based on Jan Tojnar's work in NixOS#31228.

When patchelf has to grow rpath beyond original capacity, it sets
dontStrip, to work around NixOS/patchelf#10.
@lukateras lukateras changed the title meson: set install_rpath via patchelf meson: append install_rpath via patchelf Nov 9, 2017
old_rpath = _patchelf('--print-rpath', self.bfile)
if old_rpath:
new_rpath = old_rpath + b':' + bytes(install_rpath, 'utf-8')
if len(old_rpath) < len(new_rpath):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not this always true?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. Thanks!

sha256 = "0qn5hyzvam3rimn7g3671s1igj7fbkwdnf5nc8jr4d5swy25mq61";
};

patchPhase = "cat ${./depfixer_patchelf.py} >> mesonbuild/scripts/depfixer.py";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be in postPatch in case we need to add patches in the future.

@jtojnar
Copy link
Member

jtojnar commented Nov 11, 2017

For the reference, I propose yet another solution in #31222 (comment)

@lukateras
Copy link
Member Author

Closing in favor of #31222 (comment).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants