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

Support multiple lib crate types #67

Merged
merged 6 commits into from
Jan 21, 2020
Merged

Conversation

andir
Copy link
Collaborator

@andir andir commented Jan 21, 2020

As of now we did only support building rust shared .rlib's or binaries.
A common case is to build shared libraries that will be called from
C/C++/Python/… code. To make those work we need to follow the
crate-type specified in the Cargo.toml.

This potentially fixes #31

As of now we did only support building rust shared .rlib's or binaries.
A common case is to build shared libraries that will be called from
C/C++/Python/… code. To make those work we need to follow the
`crate-type` specified in the Cargo.toml.
@kolloch kolloch merged commit 73db5f1 into nix-community:master Jan 21, 2020
@kolloch
Copy link
Collaborator

kolloch commented Jan 22, 2020

Hi Andreas,

thanks a lot for yet another PR! I restricted and simplified the logic a bit. Also I changed it so that type = [ "lib" ] will not be rendered, since it is the default? Didn't look into the logic of the crate types too much so I hope my assumptions are correct.

Thank you for also providing a test.

@andir
Copy link
Collaborator Author

andir commented Jan 22, 2020

thanks a lot for yet another PR! I restricted and simplified the logic a bit. Also I changed it so that type = [ "lib" ] will not be rendered, since it is the default?

Yeah that is the default (at least in buildRustCrate). It is probably fine. I just didn't want to have a dependency on the defaults between both projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crate2nix ignores crate-type
2 participants