https://www.boundaryml.com logo
Hey everyone 👋 - I've run into a bit
# contributing
o
Hey everyone 👋 - I've run into a bit of a blocker at my work re: running BAML on x86 alpine It appears that the musl build isn't clean of glibc references... (The cause of [#1466](https://github.com/BoundaryML/baml/issues/1466)). Running ldd within my container gives me this:
Copy code
> [build 6/6] RUN ldd /app/node_modules/.../baml.linux-x64-musl.node && exit 1:
0.122   /lib/ld-musl-x86_64.so.1 (0x7ffffff5a000)
0.123   libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7ffffccaf000)
0.123   libc.so.6 => /lib/ld-musl-x86_64.so.1 (0x7ffffff5a000)
0.123   ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7ffffcca8000)
0.123 Error relocating /app/node_modules/.../baml.linux-x64-musl.node: __register_atfork: symbol not found
...
Admittedly, I'm a bit out of my depth here - but my understanding is that we shouldn't be seeing dynamic linking libraries with a musl output? This lead me to napi-rs. Poking around the docs there, I see a nice example on how to do cross-compilation, curiously, I notice they are using the
-x
(equivalent to
--cross-compile
) [option](https://github.com/napi-rs/cross-build/blob/77d4d8cd22fff4d27588a35d8cd2f26be9b39bd4/.github/workflows/pure-rust-build-on-linux.yml#L33) for the musl targets (instead of
--use-napi-cross
). I wonder if reflecting this change would fix the issue? I've attempted to try this locally, but I'm having a hard time getting the build to work - would anybody mind lending me a hand with this? Oh, and Merry Christmas! 🎄
v
hi @Oscar let me know if you have some tiem to sync up. Happy to hop on to try and get teh repo working. Whats the build issue you're running into btw?
o
Before I was trying to recreate the build process that is currently done in the pipeline, I guess with the intention of a clear before & after... No need for that I suppose. With the installed version (Build with
--use-napi-cross
):
Copy code
require("@boundaryml/baml");
...
Error: Error loading shared library ld-linux-x86-64.so.2:
...
With the one I built locally (on my aarch64 mac) (with
pnpm build:napi-release --target x86_64-unknown-linux-musl -x
instead), the require executes as expected:
Copy code
require("./baml.linux-x64-musl.node");
Now this isn't really my wheelhouse, but if it looks like it works... it probably works? 🤞 I'm wondering what the next steps are here, do you want me to make a PR updating the pipeline?
v
Yep that would be it. Just need to update the release ci / cd scripts and in theory it should just work!
o
v
running the CI/CD workflows and reviewing!
do you know what we need:
Copy code
apt-get update && apt-get install -y zig
and tagging @aaronv (BAML) who's much more intimately familiar with our release
a
Wow this would be clutch if it works
im going to try to run this on a dryrun release Oscar, will keep ya posted
iterating on this https://github.com/BoundaryML/baml/pull/2885 (currently fixing a zig issue)
will go out on the next release, thanks for your research!
ok i manged to load it successfully
2 Views