From 01c884945686e7a6756406b579fde28657f70b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=B6lder?= Date: Thu, 22 Feb 2024 17:05:09 +0100 Subject: [PATCH 1/4] fix: fix building libz-sys (#420) --- .github/workflows/rust.yml | 15 --------------- Cargo.toml | 1 + Cross.toml | 11 ----------- README.md | 30 ------------------------------ docker/Dockerfile.gnu | 7 ------- docker/Dockerfile.musl | 16 ---------------- docker/README.md | 17 ----------------- docker/config-musl-cross-make.mak | 6 ------ 8 files changed, 1 insertion(+), 102 deletions(-) delete mode 100644 Cross.toml delete mode 100644 docker/Dockerfile.gnu delete mode 100644 docker/Dockerfile.musl delete mode 100644 docker/README.md delete mode 100644 docker/config-musl-cross-make.mak diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6ac254080..df43edc40 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -85,9 +85,6 @@ jobs: target: - no-default-features - all-features - - musl-release-no-default-features - - musl-release-all-features - - musl-all-features include: - target: no-default-features args: --no-default-features @@ -96,18 +93,6 @@ jobs: args: --all-features toolchain_target: x86_64-unknown-linux-musl use_cross: false - - target: musl-release-no-default-features - args: --release --target x86_64-unknown-linux-musl --no-default-features - toolchain_target: x86_64-unknown-linux-musl - use_cross: true - - target: musl-release-all-features - args: --release --target x86_64-unknown-linux-musl --all-features --verbose - toolchain_target: x86_64-unknown-linux-musl - use_cross: true - - target: musl-all-features - args: --target x86_64-unknown-linux-musl --all-features --verbose - toolchain_target: x86_64-unknown-linux-musl - use_cross: true steps: - name: Checkout repository diff --git a/Cargo.toml b/Cargo.toml index 8520507d2..c965e9379 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ pre-release-commit-message = "release version {{version}}" tag-message = "Version {{version}} of Rust-HTSlib." [dependencies] +libz-sys = ">=1.1.15" bio-types = ">=0.9" byteorder = "1.3" custom_derive = "0.1" diff --git a/Cross.toml b/Cross.toml deleted file mode 100644 index c6bb51e09..000000000 --- a/Cross.toml +++ /dev/null @@ -1,11 +0,0 @@ -[build.env] -passthrough = [ - "RUST_DEBUG", - "RUST_BACKTRACE", - "CFLAGS" -] - -[target.x86_64-unknown-linux-musl] -image = "brainstorm/cross-x86_64-unknown-linux-musl:1.0.4" -[target.x86_64-unknown-linux-gnu] -image = "brainstorm/cross-x86_64-unknown-linux-gnu:1.0.4" diff --git a/README.md b/README.md index 3a5343405..0662a4cc8 100644 --- a/README.md +++ b/README.md @@ -22,36 +22,6 @@ If you only want to use the library, there is no need to clone the repository. G 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 -$ cross build # will build with GNU GCC or LLVM toolchains -``` - -If you want to run rust-htslib code on AWS lambda, [you'll need to statically compile it with MUSL](https://github.com/awslabs/aws-lambda-rust-runtime/issues/17#issuecomment-577490373) as follows: - -```shell -$ cross build --target x86_64-unknown-linux-musl # will build with MUSL toolchain -``` - -Alternatively, you can also install it locally by installing the development headers of zlib, bzip2 and xz. For instance, in Debian systems one needs the following dependencies: - -```shell -$ sudo apt-get install zlib1g-dev libbz2-dev liblzma-dev clang pkg-config -``` - -We provide Dockerfile bases that provide these dependencies. Refer to the [docker](https://github.com/rust-bio/rust-htslib/tree/master/docker) directory in this repository for the latest instructions, including LLVM installation. - -On OSX: - -```shell -$ brew install FiloSottile/musl-cross/musl-cross -$ brew install bzip2 zlib xz curl-openssl -``` - ## Usage Add this to your `Cargo.toml`: diff --git a/docker/Dockerfile.gnu b/docker/Dockerfile.gnu deleted file mode 100644 index 6c2078bf2..000000000 --- a/docker/Dockerfile.gnu +++ /dev/null @@ -1,7 +0,0 @@ -FROM rustembedded/cross:x86_64-unknown-linux-gnu - -ENV LIBCLANG_PATH /usr/lib/llvm-10/lib -ENV LLVM_CONFIG_PATH /usr/bin -RUN apt-get update -RUN apt-get install -y build-essential wget gnupg lsb-release software-properties-common apt-transport-https ca-certificates # Otherwise LLVM bump below fails -RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" diff --git a/docker/Dockerfile.musl b/docker/Dockerfile.musl deleted file mode 100644 index 4988ab7e4..000000000 --- a/docker/Dockerfile.musl +++ /dev/null @@ -1,16 +0,0 @@ -FROM brainstorm/cross-x86_64-unknown-linux-musl:upstream - -ENV DEBIAN_FRONTEND noninteractive -ENV PKG_CONFIG_ALLOW_CROSS 1 - -ENV LIBCLANG_PATH /usr/lib/llvm-10/lib -ENV LLVM_CONFIG_PATH /usr/bin - -WORKDIR /root - -# Otherwise LLVM bump below fails -RUN apt-get install -y wget gnupg lsb-release software-properties-common apt-transport-https ca-certificates - -# Autodetect and fetch latest LLVM repos for the current distro, avoids LLVM warnings and other issues, might generate slower builds for now though, see: -# https://www.phoronix.com/scan.php?page=news_item&px=Rust-Hurt-On-LLVM-10 -RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 8ce0ee1cd..000000000 --- a/docker/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# cross rustembedded containers - -Allows to compile (rust-)htslib in a variety of environments and architectures via [rustembedded cross](https://github.com/rust-embedded/cross). - -## Quickstart - -```shell -$ cd docker -$ docker build -t brainstorm/cross-x86_64-unknown-linux-musl:1.0.0 . -f Dockerfile.musl -$ docker build -t brainstorm/cross-x86_64-unknown-linux-gnu:1.0.0 . -f Dockerfile.gnu -``` - -Then, to build and test rust-htslib with the above containers, proceed as you would with `cargo`, using `cross` instead, i.e: - -```shell -$ cross build --target x86_64-unknown-linux-musl -``` diff --git a/docker/config-musl-cross-make.mak b/docker/config-musl-cross-make.mak deleted file mode 100644 index 424678462..000000000 --- a/docker/config-musl-cross-make.mak +++ /dev/null @@ -1,6 +0,0 @@ -TARGET = x86_64-linux-musl -OUTPUT = /usr/local/musl -GCC_VER = 9.2.0 -BINUTILS_VER = 2.33.1 -MUSL_VER=1.2.0 - From e12fffe7e7779bcc50427731c17fdf54248d5471 Mon Sep 17 00:00:00 2001 From: Addimator <44083468+Addimator@users.noreply.github.com> Date: Thu, 22 Feb 2024 20:28:25 +0100 Subject: [PATCH 2/4] Making several RecordBuffer methods public (#419) --- src/bam/buffer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bam/buffer.rs b/src/bam/buffer.rs index 0e71fdfa7..07bd17d35 100644 --- a/src/bam/buffer.rs +++ b/src/bam/buffer.rs @@ -57,16 +57,16 @@ impl RecordBuffer { } /// Return start position of buffer - fn start(&self) -> Option { + pub fn start(&self) -> Option { self.inner.front().map(|rec| rec.pos() as u64) } /// Return end position of buffer. - fn end(&self) -> Option { + pub fn end(&self) -> Option { self.inner.back().map(|rec| rec.pos() as u64) } - fn tid(&self) -> Option { + pub fn tid(&self) -> Option { self.inner.back().map(|rec| rec.tid()) } From 6757f5219955fd4edba4f61e62978ce1e001068e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=B6lder?= Date: Thu, 22 Feb 2024 21:16:21 +0100 Subject: [PATCH 3/4] feat: making several RecordBuffer methods public From b6aeba4534bb66abfc57a0f380796393c971e451 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 21:21:32 +0100 Subject: [PATCH 4/4] chore(master): release 0.46.0 (#421) --- CHANGELOG.md | 12 ++++++++++++ Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e29c1814..e195e3f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [0.46.0](https://github.com/rust-bio/rust-htslib/compare/v0.45.0...v0.46.0) (2024-02-22) + + +### Features + +* making several RecordBuffer methods public ([6757f52](https://github.com/rust-bio/rust-htslib/commit/6757f5219955fd4edba4f61e62978ce1e001068e)) + + +### Bug Fixes + +* fix building libz-sys ([#420](https://github.com/rust-bio/rust-htslib/issues/420)) ([01c8849](https://github.com/rust-bio/rust-htslib/commit/01c884945686e7a6756406b579fde28657f70b36)) + ## [0.45.0](https://github.com/rust-bio/rust-htslib/compare/v0.44.1...v0.45.0) (2024-02-07) diff --git a/Cargo.toml b/Cargo.toml index c965e9379..65239b59b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" name = "rust-htslib" readme = "README.md" repository = "https://github.com/rust-bio/rust-htslib.git" -version = "0.45.0" +version = "0.46.0" [package.metadata.release] pre-release-commit-message = "release version {{version}}"