-
Notifications
You must be signed in to change notification settings - Fork 79
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
feat: add musl target support #111
Conversation
03ff8cf
to
c999356
Compare
Changes: - explicitly declare deps for `bzip2` and `lzma` feature. - add musl target support using `cc` crate. Though I choose to link native deps with the `bzip2-sys` and `lzma-sys` crates, note that the deps could be done with cargo's `target` selector. Let me know if you do not want to link it by default. /cc rust-bio#80
9dae7ab
to
640e70e
Compare
Error description(see https://travis-ci.org/rust-bio/rust-htslib/builds/424648253): ``` kcov: warning: kcov: WARNING: kcov has been built without libbfd-dev (or kcov: binutils-dev), so the --verify option will not do anything. Can't set personality: Operation not permitted kcov: error: Can't start/attach to /home/travis/build/rust-bio/rust-htslib/target/debug/deps/rust_htslib-b4e39d181972c8d6 Child hasn't stopped: ff00 kcov: error: Can't start/attach to /home/travis/build/rust-bio/rust-htslib/target/debug/deps/rust_htslib-b4e39d181972c8d6 error: test failed ``` Reference: roblabla/cargo-travis#38
@@ -13,6 +13,9 @@ documentation = "https://docs.rs/rust-htslib" | |||
|
|||
[dependencies] | |||
libc = "0.2" | |||
libz-sys = "1.0" | |||
bzip2-sys = { version = "0.1.6", git = "https://github.com/alexcrichton/bzip2-rs.git", optional = true } |
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.
Not sure I understand this. I thought these sys crates are just the bindings, but we don't need bindings here do we?
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.
Do they also ship the libs?
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.
libz-sys is here
@@ -39,17 +48,28 @@ fn main() { | |||
if !use_bzip2 { | |||
let bzip2_patterns = vec!["s/ -lbz2//", "/#define HAVE_LIBBZ2/d"]; | |||
sed_htslib_makefile(&out, &bzip2_patterns, "bzip2"); | |||
} else if let Ok(inc) = env::var("DEP_BZIP2_ROOT") |
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.
Why are these additional env vars needed?
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.
Do they come from the bzip2-sys crate?
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.
that's so sad I mistakenly deleted the commonts 😢 , maybe you could see them in email?
Looks really nice! just a few questions of somebody not so experienced with C compilation. |
Explained here(:cry: seems that I'm not familiar with the github review behaviors...): The
|
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.
Amazing! Really nice and very good to know.
Last question, does it make sense to follow a similar pattern for zlib as well (libz-sys)? If so, would you mind adding that here as well? If I understand correctly, this could make the build entirely self-contained. |
|
Why would we need windows testing? As far as I know, htslib does not support windows, see here. Also, windows is not really relevant as a platform for the kind of bioinformatics analyses that can be done with htslib and rust-htslib. |
ignore it and make your decision then. |
Yes, I think libz-sys support would be nice. Do you want to add it in this PR? |
did you mean add libz-sys dep? it has already been included. or libz-sys like build scripts for htslib??? maybe my english is urgly.... |
I just meant adding at a dependency and using it. I was confused by the fact that there is no feature for it, and apparently it is not used in the build.rs. Is that intentional? |
see any else? |
Thank you! |
Changes:
bzip2
andlzma
feature.cc
crate.Though I choose to link native deps via the
bzip2-sys
andlzma-sys
crates,note that the deps could be done with cargo's
target
selector.Let me know if you do not want to link it by default.
/cc #80