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

Fix libjulia install name and libjulia-internal rpath on OS X #47053

Conversation

jonathan-conder-sm
Copy link
Contributor

Fixes #40246.

This PR makes 3 main changes:

  • change the RPATH of libjulia-internal.dylib, by analogy with libjulia-internal.so
  • set the install name of libjulia.dylib to libjulia.1.dylib
  • change JL_LIBJULIA_SONAME to @rpath/libjulia.1.dylib on Mac

I'm not sure if all 3 are necessary but I think they're all good changes in any case. In particular #2 means you can package libjulia.1.dylib without a libjulia.dylib symlink.

I also removed JL_LIBJULIA_INTERNAL_SONAME because it seems to be unused.

I made a small test case to check that this fixes the issue (for me, at least).

It builds and runs a test program which embeds julia indirectly, via libtest.dylib. These both live in the parent directory of libjulia.dylib, with RPATHs set accordingly.

The test results can be viewed here. Note that src/mac_embedding_test/test.sh julia is the patched build, and prints sqrt(2.0) successfully. On the other hand src/mac_embedding_test/test.sh julia-1.6.7 uses the official Julia 1.6.7 build, and segfaults when libjulia-internal.dylib tries to get a handle to libjulia.dylib.

Copy link
Member

@staticfloat staticfloat left a comment

Choose a reason for hiding this comment

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

These look good to me! Can you also make a PR to master with the relevant changes there as well?

Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
@jonathan-conder-sm jonathan-conder-sm force-pushed the mac_embedding branch 2 times, most recently from 8e06e4e to bd35d71 Compare October 5, 2022 22:06
@jonathan-conder-sm
Copy link
Contributor Author

These look good to me! Can you also make a PR to master with the relevant changes there as well?

Sure but it doesn't seem like this bug is present in master. Not sure why though, I'll take a look

@jonathan-conder-sm
Copy link
Contributor Author

BTW this change might break ABI compatibility, not sure if you want to preserve that between minor/patch versions or something

@staticfloat
Copy link
Member

BTW this change might break ABI compatibility, not sure if you want to preserve that between minor/patch versions or something

I see this as kind of a bug fix; the RPATH was just strictly wrong before. In terms of changing the SONAME, I think this is also something of a bugfix. :P @vtjnash do you agree?

@giordano giordano added building Build system, or building Julia or its dependencies system:mac Affects only macOS labels Oct 19, 2022
@ViralBShah ViralBShah closed this Dec 6, 2022
@ViralBShah ViralBShah reopened this Dec 6, 2022
@ViralBShah ViralBShah added this to the 1.6.x milestone Dec 6, 2022
@ViralBShah
Copy link
Member

Let's merge this once #47220 appears to be ok for a few days on master.

@ViralBShah
Copy link
Member

I suppose the old testers are unlikely to work on 1.6. It would be nice to have this run on macos64 CI.

@DilumAluthge What should we do here?

@vtjnash vtjnash closed this Mar 8, 2024
@vtjnash
Copy link
Member

vtjnash commented Mar 8, 2024

No v1.6 releases are planned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies system:mac Affects only macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants