Skip to content

add export-symbols feature flag #322

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

Merged
merged 2 commits into from
Mar 27, 2025
Merged

Conversation

folkertdev
Copy link
Collaborator

closes #321

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
libz-rs-sys/src/lib.rs 48.69% <ø> (-17.71%) ⬇️
test-libz-rs-sys/src/lib.rs 98.10% <100.00%> (+0.01%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@folkertdev folkertdev force-pushed the export-symbols-feature-flag branch 2 times, most recently from fa60abb to 1f10919 Compare March 27, 2025 11:51
@folkertdev folkertdev requested a review from bjorn3 March 27, 2025 12:02
@@ -15,11 +15,14 @@ name = "z_rs" # turns into e.g. `libz_rs.so`
crate-type=["cdylib"]

[features]
default = ["c-allocator"] # when used as a cdylib crate, use the c allocator
# when used as a cdylib crate, use the c allocator, and export the symbols so they are visible to the linker
default = ["c-allocator", "export-symbols"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think libz-rs-sys-cdylib should unconditionally enable the export-symbols feature of libz-rs-sys. There is no way to use it with export-symbols disabled. Rustc will simply not export the symbols from the cdylib if it isn't and will likely remove almost the entirety of the cdylib as dead code.

@folkertdev folkertdev force-pushed the export-symbols-feature-flag branch from 1f10919 to e2a8e71 Compare March 27, 2025 14:01
@folkertdev folkertdev force-pushed the export-symbols-feature-flag branch from e2a8e71 to 3a915a0 Compare March 27, 2025 14:04
@folkertdev folkertdev merged commit 1a2a8e1 into main Mar 27, 2025
20 checks passed
@folkertdev folkertdev deleted the export-symbols-feature-flag branch March 27, 2025 14:08
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.

Proposal: add export-symbols feature flag
2 participants