-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add the metadata needed by cargo-c #176
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
==========================================
- Coverage 92.47% 91.98% -0.49%
==========================================
Files 41 44 +3
Lines 14174 14835 +661
==========================================
+ Hits 13107 13646 +539
- Misses 1067 1189 +122 ☔ View full report in Codecov by Sentry. |
> tree target | ||
target | ||
├── CACHEDIR.TAG | ||
└── x86_64-unknown-linux-gnu | ||
└── release | ||
├── libz_rs.a | ||
├── libz_rs.d | ||
├── libz_rs.pc | ||
├── libz_rs.so | ||
└── libz_rs-uninstalled.pc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lu-zero is there a reason cargo cbuild
puts its things in target/<target tripple>/release
rather than just target/release
? it's annoyingly inconsistent with a standard cargo build
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is required until cargo learns to differentiate the RUSTFLAGS for the build.rs and the RUSTFLAGS for the host.
using cargo cbuild -v
it emits a note with the uninstalled pkg-config path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you aware of a cargo issue that describes the problem?
I'll be meeting with some members of the cargo team in October, and I'd like to prepare some concrete things to make progress on. Given how crucial this is for sneaking rust into C code bases I think progress can be made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rust-lang/cargo#4423 is another way to see the problem and rust-lang/cargo#9452 is how to solve it.
But normally cinstall
is used to produce the .a
that is then linked in the bigger C project. Even C projects support cross compilation ^^.
I guess I should really prepare a blogpost showing how to use cargo-c in many deployment scenarios :)
Fixes #174
It does not install any header, uses
libz_rs
as name in pkg-config andz_rs
as library name.The default cargo
cinstall --destdir=/some/place
would produce this on macos: