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

rtags: link to libclang.dylib at absolute path on darwin #25309

Merged
merged 1 commit into from May 17, 2017

Conversation

acowley
Copy link
Contributor

@acowley acowley commented Apr 29, 2017

Motivation for this change

I encountered a runtime link failure without this change. Perhaps the executables could be left using @rpath in conjunction with some other configuration, but I am not sure what the advantage to that arrangement is versus linking to the libclang in scope at build time.

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
    • Linux
  • 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.

@mention-bot
Copy link

@acowley, thanks for your PR! By analyzing the history of the files in this pull request, we identified @anderspapitto, @periklis and @copumpkin to be potential reviewers.

@joachifm joachifm added the 6.topic: darwin Running or building packages on Darwin label Apr 30, 2017
@LnL7
Copy link
Member

LnL7 commented Apr 30, 2017

I noticed similar behaviour with #25352, not sure if there's a reason for it but that's set in the library id of libclang.

$ otool -D result/lib/libclang.dylib
result/lib/libclang.dylib:
@rpath/libclang.dylib

@acowley
Copy link
Contributor Author

acowley commented May 1, 2017

I don't have any strong feelings regarding fixing it here or there. This is where it bit me, but changing the clang derivation is fine by me. I have another PR open to add something to llvmPackages, but I don't think that PR will force much of a rebuild. Changing libclang.dylib would do so, afaics, so we could postpone that until something else comes up to bundle them together... though I don't know how we'd avoid losing track of wanting to make this change.

@domenkozar
Copy link
Member

Relevant: #21624

@LnL7
Copy link
Member

LnL7 commented May 2, 2017

Previous versions of libclang have an absolute path for the library id, so I don't expect any issues if we rewrite it. I'm testing the clang changes to see if that fixes the problem.

@matthewbauer
Copy link
Member

@domenkozar: fixDarwinDylibNames doesn't seem to fix this because the problem is in linking the binaries incorrectly. It looks like rtags is doing something weird with CMake changing rtags in weird ways. Either way this patch does fix rtags for me while fixDarwinDylibNames doesn't change anything.

@LnL7
Copy link
Member

LnL7 commented May 17, 2017

@matthewbauer the fixDarwinDylibNames needs to run on clang to fix the library id there.

This commit LnL7@972631c fixes the issue, but the clang builds keep timing out 😕 http://hydra.nixos.org/eval/1358432. I would prefer to make sure everything looks good before pushing that to staging.

@acowley
Copy link
Contributor Author

acowley commented May 17, 2017

@LnL7 This is dragging out a bit. If there isn't much of a hue and cry around nixpkgs due to the libclang name, the benefits of the right fix (i.e. what you've done) may not be a whole lot more than fixing rtags. Can we apply this spot fix now and hope that the timeout situation gets resolved at some point in the future allowing you to more confidently push the right fix?

@LnL7
Copy link
Member

LnL7 commented May 17, 2017

Agreed, I didn't expect testing my changes to stall this long. This is also not a problem when lib clang is fixed, it just becomes a noop.

@LnL7 LnL7 merged commit a4f7724 into NixOS:master May 17, 2017
@LnL7 LnL7 mentioned this pull request May 25, 2017
6 tasks
@acowley acowley deleted the rtags-id branch October 9, 2017 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants