-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
[superstring] Building on newer macOS requires Apple’s version of GNU libiconv
#1045
Comments
OK, here's my research so far. How do we fix this?
Does this replace the existing conditional
|
I should also point out that our eventual fix here could be to vendorize |
Crashing and burning at this point; everything worked great until I tried to move my I think that I might also need to migrate
because my I'll probably have to put this away for the day, but I'll try to return to it tomorrow. |
None of what I said above seems to work anymore and I'm not entirely sure why it ever worked in the first place. There is a method that seems to work locally, though I haven't tried to build binaries with it yet. What's frustrating about our situation is that we have a copy of the library we want macOS to use. But because it's a dynamic library, it wants to link against it and leave it where it is. We, on the other hand, want it to claim that library for its own and carry it around, since we can't guarantee that the user's machine will have that version. This should be easy. It's a file, right? We need to reference its headers when we compile But macOS wants to reuse dynamic libraries aggressively. This was fine when we were willing to use the built-in We've got two copies of For each one, we can run
The version of But we could then run this command:
The format here is
The other copy of
(If we update both Once I do all of these things, it works. I can run Remember: we thought we had fixed this a few nights ago, but then an Apple Silicon user reported that they had encountered this error on first launch of a newly-produced Apple Silicon build:
The things it “tried” are file paths. But they are also install names. I realized as much when I was screwing up the The good news, theoretically, is that none of the work we did the other night needs to be backed out; we could write a script that fixes the install names for both instances of This is insane and I'm still 95% sure that there's a simpler way to do this. But this exists and is documented and I have proven that it works when running Pulsar with |
Once again, GitHub code search solves a problem for me. There are many examples of |
libiconv
libiconv
This is practically what we're doing now, though we'll probably switch to a more proper implementation of this with a The Homebrew version of Then, when faced with random crashes in Linux CI, we got paranoid and created a branch on our That means we'll be able to build binaries for all platforms — even Intel Mac if GitHub forces us onto a newer macOS version. But it also means we should proceed more cautiously with changes to Ideally, as we try to migrate it to N-API, we'd be able to run CI against both Pulsar-on-Electron-12 and Pulsar-on-latest-Electron. |
We fixed this! My musings from the last comment have been captured in superstring#14. |
Thanks in advance for your bug report!
What happened?
I'm going to try to knowledge-dump into this issue, since our
superstring
repo doesn't have issues enabled:libiconv
that has API incompatibilities with whatsuperstring
expects.brew install libiconv
, then adding the appropriate paths toLDFLAGS
andCPPFLAGS
before runningnpm install
…libiconv
. The built binary isn't portable because it requireslibiconv.dylib
to be present at the exact path we specified during the build process.libiconv
. As soon as the library wasn't present where Pulsar expected it to be, it failed to start properly.libiconv
— i.e., include it in the build. I think I was able to make this happen by copying the syntax from thisbinding.gyp
file I found via a GitHub code search. When I change my localnode_modules/superstring/binding.gyp
and runnode-gyp rebuild
— and then go back to the project root and runyarn build
to trigger anelectron-rebuild
— I end up with a local build of Pulsar that works just fine even if I rename my locallibiconv
directory.So at this point, I believe I know the solution. I'd like to do a bit more research on the best way to represent this complexity in the
binding.gyp
file. I imagine it should be an opt-in thing with a config flag, but the bottom line is that, in order to buildsuperstring
on macOS >=13, you'll have to provide the path to a compatible version oflibiconv
so that we can statically link against it.Right now I don't know:
libiconv
we've been given is compliantbinding.gyp
based on the version of macOS being usedyarn install
oryarn build
will automatically propagate to thenode-gyp rebuild
command of a library's dependencyMy tentative plan to get us unblocked is to have
superstring
’sbinding.gyp
check the value of an environment variable. That's probably not the best long-term solution, but it feels like it would work pretty well in CI and would allow us to get Apple Silicon binaries out the soonest.Pulsar version
(all)
Which OS does this happen on?
🍎 macOS
OS details
Which CPU architecture are you running this on?
None
What steps are needed to reproduce this?
(be on macOS >=13)
Additional Information:
No response
The text was updated successfully, but these errors were encountered: