-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
keg: don't fix ids of dylibs rooted in the build directory #10075
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty wide-ranging and likely to negatively affect other formulae beyond just fixing your case. I think something more tightly scoped may make sense. Have requested reviews from others to see what they think.
Thanks for the feedback @MikeMcQuaid - I agree it's a pretty broad change. I was kind of hoping there was a way to validate changes like these against all/most formulae but thinking about it that really doesn't seem feasible. I've done some more debugging and found that the problem isn't really that the dylib ID is being changed, but that after being changed, all of the The root of the issue is that the libgccjit-compiled dylibs have an ID ending
|
Why? That seems to be the real problem here |
I'm not opposed to this fix but I think it would make more sense to figure out a way to get this to work on a formula level rather than making a potentially huge change for all of Homebrew for the sake of a single non-Homebrew formula. Some alternatives in vague order of what I think are the smallest to biggest changes are:
I think that's just how libgccjit works. I believe it creates a temporary fake.s which is compiled to fake.so and then unlinked.
It would be straightforward to script this but you'd need to fetch bottles for all formulae and examine which have install names rooted in the temporary directory, which would take a bit of time and bandwidth. |
My 2 cents:
IMHO this should be the default.
I guess this is the most flexible solution. |
We're not going to change the Homebrew defaults for a single formula.
Similarly, I'd like to avoid a new DSL unless we can find 5+ Homebrew/core formulae that need it. |
@MikeMcQuaid I understand your points. What would you suggest as a possible approach to fix similar issues? |
To be clear, this means that you'd write a |
@jonchang: now I understand what you mean. Unfortunately this is not possible :( |
Can you explain why not? This is what I think would be the preferred option. |
The main reason for this is that the "base" .eln files are generated just after the GNU/Emacs bootstrap. This is part of
|
As I understand it, we'd need to pretty much recreate the entire build in post_install because the eln generation is tightly coupled with the rest of the build. One option that might be worth exploring is to tar up the eln files at the end of the install step so that they don't get relocated, and then untar them in the post_install step back to their original locations. |
@simonomis I have tried to change the .eln files dylib ID before post-install phase and it seems to be working. Probably I could use it as a workaround before we find a more nicer solution:
|
Thanks for the investigation and pull request, everyone. I don't think we'll be merging this since there are multiple workarounds available and the potential of impact to all formulae is both not currently well-understood and potentially quite negative. For maintainability on your end, I suggest submitting a patch for emacs that will pass the |
Thanks for the help and suggestions @jonchang. I'll take a look into the |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?brew man
locally and committed any changes?Fix for #9526, where emacs's native-compiled elisp modules, which are compiled from elisp to
*.eln
dylibs during the emacs build, were having their dylib IDs changed after being installed. Which resulted in the references from emacs/libgccjit to the compiled functions being broken, resulting in a fatal error when starting emacs:This PR changes the logic so that dylib IDs that are rooted in the temp directory after install are not updated. The fix is based on the assumption that normal dylibs will have IDs rooted in the cellar. That seems to hold true for a few libs that I've spot-checked, but I could do with a second opinion on that as I'm really not too familiar with how library linkage works on macos.