You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running MAGIC_DIR=/opt/homebrew/Cellar/libmagic/5.44/lib MAGIC_STATIC=false cargo run
thread 'main' panicked at 'No libmagic.so found in "/opt/homebrew/Cellar/libmagic/5.44/lib"', /Users/viniciusmiguel-mba/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/magic-sys-0.3.0/build.rs:30:21
It seems build.rs still only looks for libmagic.so instead of libmagic.dylib on macOS, which causes the build to fail, despite #32
If I go to /opt/homebrew/Cellar/libmagic/5.44/lib and symlink libmagic.dylib to libmagic.so then it works correctly
When running MAGIC_DIR=/opt/homebrew/Cellar/libmagic/5.44/lib MAGIC_STATIC=true cargo run
= note: Undefined symbols for architecture arm64:
"_BZ2_bzDecompress", referenced from:
_uncompressbzlib in libmagic_sys-1608e149fbcfc5d0.rlib(compress.o)
"_BZ2_bzDecompressEnd", referenced from:
_uncompressbzlib in libmagic_sys-1608e149fbcfc5d0.rlib(compress.o)
"_BZ2_bzDecompressInit", referenced from:
_uncompressbzlib in libmagic_sys-1608e149fbcfc5d0.rlib(compress.o)
"_inflate", referenced from:
_uncompresszlib in libmagic_sys-1608e149fbcfc5d0.rlib(compress.o)
"_inflateEnd", referenced from:
_uncompresszlib in libmagic_sys-1608e149fbcfc5d0.rlib(compress.o)
"_inflateInit2_", referenced from:
_uncompresszlib in libmagic_sys-1608e149fbcfc5d0.rlib(compress.o)
"_inflateInit_", referenced from:
_uncompresszlib in libmagic_sys-1608e149fbcfc5d0.rlib(compress.o)
"_zError", referenced from:
_uncompresszlib in libmagic_sys-1608e149fbcfc5d0.rlib(compress.o)
ld: symbol(s) not found for architecture arm64
The text was updated successfully, but these errors were encountered:
For libmagic.dylib there's #30 which I didn't get to merge yet.
As for why libmagic is not found with just cargo build I'm not sure. I don't have a Mac, so can't really test how Brew behaves, especially on arm64. I can experiment by using GitHub Actions for this (see .github/workflows/mac.yml) but this is a bit cumbersome.
Can you check if the Brew directories are included in the default ld library paths?
The undefined symbols might be solved with using pkg-config, see #1
Could you check whether Brew installed a libmagic.pc or such and post it?
This might be a similar case as #16 (comment) and #30 (comment)
Hey there! I'm trying to use
magic-sys
on an app of mine but I'm having some issues compiling on macOSVersions
and
magic-sys
0.3.0Build outputs
When running
cargo build
When running
MAGIC_DIR=/opt/homebrew/Cellar/libmagic/5.44/lib MAGIC_STATIC=false cargo run
It seems
build.rs
still only looks forlibmagic.so
instead oflibmagic.dylib
on macOS, which causes the build to fail, despite #32If I go to
/opt/homebrew/Cellar/libmagic/5.44/lib
and symlinklibmagic.dylib
tolibmagic.so
then it works correctlyWhen running
MAGIC_DIR=/opt/homebrew/Cellar/libmagic/5.44/lib MAGIC_STATIC=true cargo run
The text was updated successfully, but these errors were encountered: