Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming the library is broken #166

Closed
cschwan opened this issue Feb 15, 2021 · 5 comments · Fixed by #170
Closed

Renaming the library is broken #166

cschwan opened this issue Feb 15, 2021 · 5 comments · Fixed by #170
Assignees
Labels
bug Something isn't working

Comments

@cschwan
Copy link

cschwan commented Feb 15, 2021

Renaming the library and the pkg-config file seems to be broken. I can only rename the header using package.metadata.capi.header in Cargo.toml. If I try to use

[package]
name = "a"

[package.metadata.capi.library]
name = "b"

to rename the library I get

   Compiling a v0.1.0 (/tmp/a)
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
    Building pkg-config file
    Building pkg-config file
    Building header file using cbindgen
Error: CliError { error: Some(Cannot copy /tmp/a/target/./debug/libb.so to /tmp/a/target/./debug/libb.so.0.1.0.

Caused by:
    No such file or directory (os error 2)), exit_code: 101 }

It seems the first path is wrong.

Finally package.metadata.capi.pkg_config seems to be ignored. The content of the *.pc seems to be correct though:

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: b
Description: 
Version: 0.1.0
Libs: -L${libdir} -lb
Cflags: -I${includedir}/a
Libs.private: -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc

The complete MWE is here: https://gist.github.com/cschwan/0cb317b682541ed6962dcab65cda1b7a

@sdroege
Copy link
Contributor

sdroege commented Feb 15, 2021

Finally package.metadata.capi.pkg_config seems to be ignored. The content of the *.pc seems to be correct though:

What do you mean with ignored? name (for the name inside the file, not the file name!), version and description seem to work fine for me. You also want to change the filename?

@cschwan
Copy link
Author

cschwan commented Feb 15, 2021

My bad, I didn't read it properly, which means I need a way to also rename the .pc file. Shall I open a separate issue?

@cschwan cschwan changed the title Renaming the library and pc file is broken Renaming the library is broken Feb 15, 2021
@sdroege
Copy link
Contributor

sdroege commented Feb 15, 2021

Best to open a separate issue for that, yes. Less confusing :)

@sdroege
Copy link
Contributor

sdroege commented Feb 15, 2021

I'll take a look in the next days

@lu-zero
Copy link
Owner

lu-zero commented Feb 17, 2021

The current cargo made supporting it much simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants