termoshtt / ocipkg

An OCI registry client for Rust desiged to use distribute static library as a "container"
Apache License 2.0
48 stars 8 forks source link

Duplicated linking of rust-std #68

Open termoshtt opened 2 years ago

termoshtt commented 2 years ago

https://github.com/termoshtt/ocipkg/runs/7785162736?check_suite_focus=true

 = note: /usr/bin/ld: /home/runner/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-69edc9ac8de4d39c.rlib(std-69edc9ac8de4d39c.std.2a45fe64-cgu.0.rcgu.o): in function `rust_oom':
          /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/alloc.rs:334: multiple definition of `rust_oom'; /home/runner/.local/share/ocipkg/ghcr.io/termoshtt/ocipkg/static/rust/__0dbc47b/libocipkg_static_rust.a(std-7ca39ac42651c3df.std.41a414a5-cgu.0.rcgu.o):/rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/alloc.rs:334: first defined here

example/static/rust/exe causes above link error, which caused by linking rust-std twice; first linked in creating static library, and second is when building exe crate. It seems that this did not happen if two rust-std version matches.