I've been trying to build a vendored C library with cc, but I get this error message:
warning: test-cc@0.1.0: ar: '/home/runner/work/test-cc-glib/test-cc-glib/target/debug/build/test-cc-d41d4b076b508ca8/out/libglib.a': No such file
error: failed to run custom build command for `test-cc v0.1.0 (/home/runner/work/test-cc-glib/test-cc-glib)`
Caused by:
process didn't exit successfully: `/home/runner/work/test-cc-glib/test-cc-glib/target/debug/build/test-cc-2f258154f2fe7cf4/build-script-build` (exit status: 1)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
cargo:rerun-if-env-changed=AR_x86_64-unknown-linux-gnu
AR_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=AR_x86_64_unknown_linux_gnu
AR_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_AR
HOST_AR = None
cargo:rerun-if-env-changed=AR
AR = None
cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-linux-gnu
ARFLAGS_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_linux_gnu
ARFLAGS_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_ARFLAGS
HOST_ARFLAGS = None
cargo:rerun-if-env-changed=ARFLAGS
ARFLAGS = None
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
cargo:warning=ar: '/home/runner/work/test-cc-glib/test-cc-glib/target/debug/build/test-cc-d41d4b076b508ca8/out/libglib.a': No such file
--- stderr
error occurred: Command "ar" "s" "/home/runner/work/test-cc-glib/test-cc-glib/target/debug/build/test-cc-d41d4b076b508ca8/out/libglib.a" with args ar did not execute successfully (status code exit status: 1).
I've been following this guide hoping that "just giving a list of .c files to the cc crate" would be sufficient. I expected the C library to finish compiling successfully, but I guess something fails around the archive step. Maybe I'm missing something unrelated to cc?
I've been trying to build a vendored C library with
cc
, but I get this error message:I've been following this guide hoping that "just giving a list of
.c
files to thecc
crate" would be sufficient. I expected the C library to finish compiling successfully, but I guess something fails around the archive step. Maybe I'm missing something unrelated tocc
?I reproduced a minimal example of the repo along with a build action.
build.rs
:Any reasons why the
ar
command would fail here? Thanks for your help.