When combining both p2panda-ffi/loro-go (both static libs using uniffi-bindgen-go), you end up with this error on a go build:
/rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library/std/src/sys/personality/gcc.rs:299:
multiple definition of `rust_eh_personality'; /home/d1/go/pkg/mod/github.com/aholstenson/loro-go@v0.4.0/libs/x86_64-unknown-linux-musl/libloro.a(loro-35f36eccdc2b111a.loro.62bc88e692b8cae9-cgu.0.rcgu.o):
loro.62bc88e692b8cae9-cgu.0:(.text.rust_eh_personality+0x0):
first defined here collect2: error: ld returned 1 exit status
This is a limitation on the Rust side of things: rust-lang/rust#44322.
I don't think doing lto = off is an option because of the huge binary size it results in. It also doesn't seem to work. I could work-around this issue with this glorious hack but that doesn't seem very accessible for others rust-lang/rust#44322 (comment).
PKG_NAME=p2panda_ffi
cd go/p2panda_ffi/libs/x86_64-unknown-linux-musl
ar x libp2panda_ffi.a
sed -i "s/rust_eh_personality/rust_eh_personaliti/g" $(ls *.rcgu.o)
ar cr lib${PKG_NAME}.a *.o
rm *.rcgu.o
The other option I saw was creating a wrapper crate which produces a "merged" static lib of both 🤔 I guess that starts to go beyond the scope of what should be provided by this repository. I can take a run at that unless you have some other tricks up your sleeves.
When combining both
p2panda-ffi/loro-go(both static libs usinguniffi-bindgen-go), you end up with this error on ago build:This is a limitation on the Rust side of things: rust-lang/rust#44322.
I don't think doing
lto = offis an option because of the huge binary size it results in. It also doesn't seem to work. I could work-around this issue with this glorious hack but that doesn't seem very accessible for others rust-lang/rust#44322 (comment).The other option I saw was creating a wrapper crate which produces a "merged" static lib of both 🤔 I guess that starts to go beyond the scope of what should be provided by this repository. I can take a run at that unless you have some other tricks up your sleeves.