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

add configuration to build a dynamic library #57

Merged
merged 6 commits into from
Dec 2, 2024

Conversation

folkertdev
Copy link
Collaborator

No description provided.

@folkertdev folkertdev requested a review from bjorn3 December 2, 2024 14:59
@folkertdev
Copy link
Collaborator Author

still needs some CI checks I think (for e.g. bzpipe working)

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

see 1 file with indirect coverage changes

rust-version = "1.82" # MSRV

[lib]
name = "bz2_rs" # turns into e.g. `libz_rs.so`
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/libz_rs.so/libbz2_rs.so/

libbzip2-rs-sys-cdylib/Cargo.toml Outdated Show resolved Hide resolved
libbzip2-rs-sys-cdylib/Cargo.toml Outdated Show resolved Hide resolved
libbzip2-rs-sys-cdylib/Cargo.toml Outdated Show resolved Hide resolved
@folkertdev folkertdev force-pushed the build-dynamic-library branch 3 times, most recently from 8537a4f to f34e208 Compare December 2, 2024 16:28
@folkertdev folkertdev force-pushed the build-dynamic-library branch from f34e208 to 02573a9 Compare December 2, 2024 16:34
Comment on lines 433 to 441
# - name: "cdylib: no_std"
# env:
# LD_LIBRARY_PATH: "target/${{matrix.target}}/release/deps"
# working-directory: libbzip2-rs-sys-cdylib
# run: |
# cargo build --release --target ${{matrix.target}} --no-default-features
# cc -o bzpipe_no_std bzpipe_no_std.c target/${{matrix.target}}/release/deps/libbz2_rs.so -I ../
# ./bzpipe_no_std < Cargo.toml | ./bzpipe_no_std -d > out.txt
# cmp -s Cargo.toml out.txt
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm still not sure how this works for zlib-rs and doesn't here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got it, the [lib] section of the main crate needs to be removed; that's allright, it is only meant to be used as a crate anyway, building libraries should happen with the cdylib crate.

Copy link
Collaborator

@bjorn3 bjorn3 left a comment

Choose a reason for hiding this comment

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

With the above zlib references fixed.

@folkertdev folkertdev force-pushed the build-dynamic-library branch 3 times, most recently from 95fad82 to 9a01ee7 Compare December 2, 2024 18:51
@folkertdev folkertdev force-pushed the build-dynamic-library branch from 9a01ee7 to 28f5427 Compare December 2, 2024 18:54
@folkertdev folkertdev merged commit 5ea9653 into main Dec 2, 2024
16 checks passed
@folkertdev folkertdev deleted the build-dynamic-library branch December 2, 2024 18:57
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.

2 participants