-
Notifications
You must be signed in to change notification settings - Fork 103
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
Darwin awards #1000
Darwin awards #1000
Conversation
it. Because lniking keg-only formulas is generally a terrible idea.
Probably harmless change, but at least it's referenced somewhere. c.f., man ld
We can't run 'em inside the same rule, as they cannot be run in // (we need the binary to be built & linked before being able to patch it!). Leverage an obscure GNU Make feature to achieve that. (https://www.gnu.org/software/make/manual/make.html#Double_002dColon)
To recap: * We want to load our own luajit, not brew's. * We want to pull our own depdendencies, not brew's. Take a roundabout way via otool -L, because sometimes, what's picked up is: * an absolute path to our own lib: GOOD * a relative path to our own lib: GOOD * an absolute path to brew's lib: BAD * a weird @rpath-prefix to our own lib, but not in the right place: BAD * a system path: BAD I love macOS. >_<".
ONE THOUSAND§§! (You couldn't have planned this one better.) |
Note that, of course, this might, to a certain extent, depend on what exactly you happen to have installed via brew... (Say, if you happened to have a matching tesseract or leptonica installed, something could potentially fuck those up, too). |
Also kind of forgot to patch my macOS tree, so, one build in the wind :D. |
-dylib is an LLD flag -dynamiclib is a Clang flag
Not a dep field. Yay. Fix it anyway.
$(shell) is make syntax, it gets expanded early, which explains the parallelism issues. Switch to pure shell syntax instead (i.e., backticks). It makes for an uglier echo, since it's not expanded, but it's less crazy ;).
Random remark: the latest SNAFU seems to confirm that the library's id is what gets used as a dependency in other libs that link to it, so fixing the id isn't as useless as I would have thought ;). |
Okay, fresh build is OK on my macOS box, so this should be good to go if the CI is clear ;). |
Attempt to appease the insanity currently happening w/ XCode 11
Relies on obscure GNU make features to defeat parallelism issues, hopefully the CI won't implode.
I have a Mojave build running in // to double-check.
Said insanity being completely broken dependencies in dynamic libraries: insane random @rpath, or brew libraries pulled instead of our own, or just plain broken paths. There's also often a self-reference in the deps (why is it here in the first place?) that's also broke 72.4% of the time.
I'm not actually familiar with the intricacies of the Mach-O format (nor with the relevant tools to mangle it), so, here be dragons.