Building from source no longer links with Homebrew PCRE
Attempting to build from source with brew install --build-from-source fastfec no longer links with Homebrew PCRE, but the system-provided one instead.
This seems to be due to a change in Zig 0.9.0 (Homebrew/homebrew-core@72b36e94fb1495399e518bee15000bb4c9daf64e).
❯ brew install --quiet --build-from-source fastfec
==> zig build -Dvendored-pcre=false
🍺 /usr/local/Cellar/fastfec/0.0.4: 6 files, 982.8KB, built in 11 seconds
==> Running `brew cleanup fastfec`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
❯ brew linkage fastfec
System libraries:
/usr/lib/libSystem.B.dylib
/usr/lib/libcurl.4.dylib
/usr/lib/libpcre.0.dylib
I've poked at this for a bit, but I don't use Zig so I'm unsure how to get this to ignore the system libpcre. Passing --search-prefix doesn't work. I'd appreciate it if you could take a look. Thanks!
Taking a look! Planning to update to 0.0.5 shortly so maybe it can be rolled in. Thanks for reporting!
Hi @carlocab, I've finally had some time to get around to this. Thanks again for pointing this out. Would linking to Zig 0.8.x solve the above issue? I have no problem pinning my code to this version. Alternatively, it may be worth it if we open an issue about this in Zig.
Oh, wow, I just noticed that you opened an issue in Zig! Thank you so much for being proactive on this -- happy to lend my support however I can towards getting this fixed in Zig
https://github.com/ziglang/zig/issues/10957
Would linking to Zig 0.8.x solve the above issue? I have no problem pinning my code to this version.
We only ship the latest version of Zig, so that's not currently an option. Let's see if we can get this fixed in Zig, since this seems like a rather serious regression there.
Well, ultimately to move the project forward I removed all external deps from this project per #33. I should be able to contribute a Homebrew PR that simplifies the formula to remove the deps soon, too, then hopefully we can get an up-to-date release
Linking with curl worked fine though (IIRC); it's linking with pcre that's the issue. So I'm not sure this issue justified removing curl (but it seems like you had other reasons to do so?)
I will say removing curl support made cross-compiling for every platform from an Ubuntu runner possible, and it also added support for a few more platform combos that weren't working. So I still think it's for the best.
If/when Zig is able to cross-compile Curl or an equivalent library entirely from one OS I'd say it's worth moving back.
But most power users seem to be using the Python library anyhow because staying up-to-date with the latest changes in FEC filings is important / the ease of the new release process makes that more appealing.
Also re: pcre I just bundled the source code in a non-dependency way. I think it's justified because pcre v1 will not have future updates (it's EOL). And it fixed some Zig issues with linking dependencies, even local ones, for cross-platform compilation. I ended up merging pcre's license to accommodate that
This is now fixed upstream, but we need #56 to be able to build this for distribution in Homebrew.