Closed
Description
When trying to keep nice filenames with hyphens, cargo-c creates both the wanted files and mess from cargo ('-' replaced by '_').
E.g. after
[package.metadata.capi.library]
name = "test-foo"
there will be created (when building from scratch)
libtest-foo.a
libtest-foo.so
libtest_foo.a
libtest_foo.so
When doing changes, only the underscore variants will be rebuilt. Then the hash function calculates the hash function over the requested files (which have not been changed) to see if something changed and exits without regenerating headers.
E.g. content of build directory is (note the dates)
-rw-r--r--. Feb 10 18:52 libtest-foo.a
-rwxr-xr-x. Feb 10 18:52 libtest-foo.so
-rw-r--r--. Feb 10 18:53 libtest_foo.a
-rw-r--r--. Feb 10 18:52 libtest_foo.d
-rwxr-xr-x. Feb 10 18:53 libtest_foo.so
Effect is, that when running cargo cbuild
on
#[no_mangle]
pub extern "C" fn add(left: u64, right: u64) -> u64 {
left + right
}
and changing this later to
#[no_mangle]
pub extern "C" fn sub(left: u64, right: u64) -> u64 {
left - right
}
the generated wrapper header still contains
uint64_t add(uint64_t left, uint64_t right);
but not sub()
.
Metadata
Metadata
Assignees
Labels
No labels
Activity