Skip to content

Features & build cleanups #189

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 35 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d248a5a
make bindgen optional
pmarks Feb 22, 2020
de6085a
fix
pmarks Feb 22, 2020
fcf9cbb
Merge remote-tracking branch 'origin/master' into pmarks/optional-bin…
pmarks Mar 14, 2020
eac323f
right version
pmarks Mar 14, 2020
91ca105
test prebuilt bindings
pmarks Mar 14, 2020
1d14046
merge master
pmarks Mar 20, 2020
377d014
use correct htslib
pmarks Mar 20, 2020
3d7e400
update prebuilt linux bindings
pmarks Mar 20, 2020
da5f6e5
add pre-built osx bindings
pmarks Mar 20, 2020
f3d8833
Merge branch 'master' into pmarks/optional-bindgen
brainstorm Jun 2, 2020
697c1ac
Merge branch 'master' into pmarks/optional-bindgen
brainstorm Jun 2, 2020
1994584
Merge remote-tracking branch 'origin/master' into pmarks/optional-bin…
pmarks Jun 4, 2020
ecc24c0
fix optional bindgen branch
pmarks Jun 4, 2020
fc8e7df
better setup for optional features. build with cc rather than Make
pmarks Jun 7, 2020
bf87acf
fixed up support for libdeflate
pmarks Jun 7, 2020
6e4ebc3
use url of temp libdeflater
pmarks Jun 7, 2020
d244d3d
fmt
pmarks Jun 7, 2020
30ac31d
add support for gcs and s3
pmarks Jun 8, 2020
386dcd2
Merge remote-tracking branch 'origin/master' into pmarks/optional-bin…
pmarks Jun 8, 2020
3412318
need direct dep on openssl
pmarks Jun 8, 2020
9be1a64
Merge branch 'pmarks/optional-bindgen' of https://github.com/rust-bio…
pmarks Jun 8, 2020
595393c
fix tarpaulin args
pmarks Jun 8, 2020
e629961
exclude prebuilt bindings from tarpaulin
pmarks Jun 8, 2020
ec97afe
run version.sh and write version.h
pmarks Jun 8, 2020
62d015d
use new -sys setup in libdeflate
pmarks Jun 8, 2020
035543e
restore rerun directives for header files
pmarks Jun 9, 2020
619c05c
Merge branch 'master' into pmarks/optional-bindgen
brainstorm Jun 9, 2020
6cd1d54
hts-sys/Cargo.toml
pmarks Jun 9, 2020
2d62bc3
Merge branch 'master' into pmarks/optional-bindgen
brainstorm Jun 11, 2020
e0473d8
use released libdeflater
pmarks Jun 11, 2020
24a0779
add static bak to top toml
pmarks Jun 11, 2020
ad5bc78
get s3 working
pmarks Jun 11, 2020
7616ef7
add test for http access
pmarks Jun 12, 2020
5c9a1e3
don't use bindgen by default
pmarks Jun 12, 2020
80fcfe3
fmt
pmarks Jun 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,26 @@ jobs:
- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
args: '--out Lcov -- --test-threads 1'
args: '--out Lcov --exclude-files hts-sys/*_prebuilt_bindings.rs -- --test-threads 1'

- name: Upload coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info

- name: Test standard build without default features
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features

- name: Test standard build with all features
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features

- name: Test musl build without default features
env:
CFLAGS: -I/usr/local/musl/include
Expand All @@ -92,5 +104,4 @@ jobs:
with:
use-cross: true
command: build
args: --target x86_64-unknown-linux-musl --all-features

args: --target x86_64-unknown-linux-musl --all-features
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ hts-sys = { version = "^1.10", path = "hts-sys", default-features = false }
default = ["bzip2", "lzma", "curl"]
bzip2 = ["hts-sys/bzip2"]
lzma = ["hts-sys/lzma"]
bindgen = ["hts-sys/bindgen"]
curl = ["hts-sys/curl"]
libdeflate = ["hts-sys/libdeflate-sys"]
s3 = ["hts-sys/s3"]
gcs = ["hts-sys/gcs"]
static = ["hts-sys/static"]
serde = ["serde_base", "serde_bytes"]
static = []

[dev-dependencies]
tempdir = "0.3"
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ If you only want to use the library, there is no need to clone the repository. G

## Requirements

To compile this crate you need docker and cross:
rust-htslib comes with pre-built bindings to htslib for Mac and Linux. You will need a C toolchain compatible with the `cc` crate. The build script for this crate will automatically build a link htslib.


### MUSL build
To compile this for MUSL crate you need docker and cross:

```shell
$ cargo install cross
Expand Down Expand Up @@ -62,7 +66,16 @@ with these compression methods, you can deactivate these features to reduce you
rust-htslib = { version = "*", default-features = false }
```

`rust-htslib` also has optional support for `serde`, to allow (de)serialization of `bam::Record` via any serde-supported format:
`rust-htslib` has optional support for `serde`, to allow (de)serialization of `bam::Record` via any serde-supported format.

Http access to files is available with the `curl` feature.

Beta-level S3 and Google Cloud Storge support is available with the `s3` and `gcs` features.

`rust-htslib` can optionally use `bindgen` to generate bindings to htslib. This can slow down the build substantially. Enabling the `bindgen` feature will
cause `hts-sys` to use a create a binding file for your architecture. Pre-built bindings are supplied for Mac and Linux. The `bindgen` feature on Windows is untested - please file a bug if you need help.



```toml
[dependencies]
Expand Down
19 changes: 12 additions & 7 deletions hts-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,25 @@ tag-message = "Version {{version}} of Rust-HTSlib."

[dependencies]
libz-sys = { version = "1.0.25", features = ["static"] }
# https://github.com/alexcrichton/bzip2-rs/issues/56
bzip2-sys = { version = "0.1.8", optional = true }
lzma-sys = { version = "0.1.16", optional = true, features = ["static"] }
curl-sys = { version = "0.4.31", optional = true, features = ["static-curl", "static-ssl"] }
curl-sys = { version = "0.4.31", optional = true, features = ["static-curl", "static-ssl", "protocol-ftp"] }
libdeflate-sys = { version = "0.5", optional = true }

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
openssl-sys = { version = "0.9", optional = true }

[features]
default = ["bzip2", "lzma"]
default = ["bzip2", "lzma", "curl"]
bzip2 = ["bzip2-sys"]
lzma = ["lzma-sys"]
curl = ["curl-sys"]
static = []
curl = ["curl-sys", "openssl-sys"]
gcs = ["curl"] # Google Cloud Storage support
s3 = ["curl"] # Amazon S3 support
static = [] # Don't dynamically link to other libraries

[build-dependencies]
fs-utils = "1.1"
bindgen = { version = "0.53.2", default-features = false, features = ["runtime"] }
cc = "1.0"
bindgen = { version = "0.53.2", default-features = false, features = ["runtime"], optional = true }
cc = { version = "1.0", features = ["parallel"] }
glob = "0.3.0"
Loading