Closed xxchan closed 9 months ago
I thought it might be because of our linker config
# Extra flags for Linux targets.
[target.'cfg(target_os = "linux")']
rustflags = [
"-Clink-arg=-fuse-ld=lld", #2781
"-Clink-arg=-Wl,--no-rosegment", #4574
]
But after removing it, compilation still fails (with a different msg)
= note: /usr/bin/ld: /home/ubuntu/risingwave/target/debug/deps/libprotobuf_native-a25d55b0a835aa3f.rlib(0139aaaaf1d215a5-io.rs.o): in function `protobuf_native$io$cxxbridge1$DeleteCodedOutputStream':
/home/ubuntu/risingwave/target/debug/build/protobuf-native-dd44909f657c749c/out/cxxbridge/sources/protobuf-native/src/io.rs.cc:1087: undefined reference to `protobuf_native::io::DeleteCodedOutputStream(google::protobuf::io::CodedOutputStream*)'
collect2: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
error: could not compile `risingwave_cmd_all` (bin "risingwave") due to previous error
I tried this, and them compilation succeeded..
diff --git a/Cargo.toml b/Cargo.toml
index dc38b19e2..a5663eccb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -193,6 +193,9 @@ redundant_explicit_links = "allow"
[profile.dev]
lto = 'off'
+[profile.dev.package.protobuf-native]
+codegen-backend = "llvm"
+
[profile.release]
debug = "full"
split-debuginfo = "packed"
Sorry for the delay, was busy for the last couple of days. I can reproduce this by trying to compile the test suite of protobuf-native. I don't have a clue what the issue could be though unfortunately. I indeed can't find any definition of the symbol in question. In fact I can't find where it is supposed to be defined anywhere in the source code.
This is actually a bug in rust-protobuf-native, I opened a PR: https://github.com/MaterializeInc/rust-protobuf-native/pull/12
Thanks for letting me know!
returns error: