Skip to content

Commit

Permalink
Merge branch 'master' into #407-trailing-omitted-format
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester authored Feb 23, 2024
2 parents d8f21f2 + b6aeba4 commit a8d7fb1
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 109 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
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)


### Features

* adding function to get sequence length to faidx mod ([#410](https://github.com/rust-bio/rust-htslib/issues/410)) ([ae79eba](https://github.com/rust-bio/rust-htslib/commit/ae79eba82ef6929105bdbe08246a8e973660899e))


### Bug Fixes

* Loosen acceptable types to support current linux build on aarch64 ([#415](https://github.com/rust-bio/rust-htslib/issues/415)) ([1d78d12](https://github.com/rust-bio/rust-htslib/commit/1d78d1251a052461605d28cd8cf832ccad93ef73))

## [0.44.1](https://github.com/rust-bio/rust-htslib/compare/v0.44.0...v0.44.1) (2023-06-21)


Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ license = "MIT"
name = "rust-htslib"
readme = "README.md"
repository = "https://github.com/rust-bio/rust-htslib.git"
version = "0.44.1"
version = "0.46.0"

[package.metadata.release]
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"
Expand Down
11 changes: 0 additions & 11 deletions Cross.toml

This file was deleted.

30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
7 changes: 0 additions & 7 deletions docker/Dockerfile.gnu

This file was deleted.

16 changes: 0 additions & 16 deletions docker/Dockerfile.musl

This file was deleted.

17 changes: 0 additions & 17 deletions docker/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions docker/config-musl-cross-make.mak

This file was deleted.

6 changes: 3 additions & 3 deletions src/bam/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ impl RecordBuffer {
}

/// Return start position of buffer
fn start(&self) -> Option<u64> {
pub fn start(&self) -> Option<u64> {
self.inner.front().map(|rec| rec.pos() as u64)
}

/// Return end position of buffer.
fn end(&self) -> Option<u64> {
pub fn end(&self) -> Option<u64> {
self.inner.back().map(|rec| rec.pos() as u64)
}

fn tid(&self) -> Option<i32> {
pub fn tid(&self) -> Option<i32> {
self.inner.back().map(|rec| rec.tid())
}

Expand Down
8 changes: 5 additions & 3 deletions src/bam/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// except according to those terms.

use std::convert::TryFrom;
use std::convert::TryInto;
use std::ffi;
use std::fmt;
use std::marker::PhantomData;
Expand Down Expand Up @@ -2216,7 +2217,7 @@ impl fmt::Display for CigarStringView {
pub struct BaseModificationMetadata {
pub strand: i32,
pub implicit: i32,
pub canonical: i8,
pub canonical: u8,
}

/// struct containing the internal state required to access
Expand Down Expand Up @@ -2314,7 +2315,8 @@ impl BaseModificationState<'_> {
unsafe {
let mut strand: i32 = 0;
let mut implicit: i32 = 0;
let mut canonical: i8 = 0;
// This may be i8 or u8 in hts_sys.
let mut canonical: c_char = 0;

let ret = hts_sys::bam_mods_query_type(
self.state,
Expand All @@ -2329,7 +2331,7 @@ impl BaseModificationState<'_> {
return Ok(BaseModificationMetadata {
strand,
implicit,
canonical,
canonical: canonical.try_into().unwrap(),
});
}
}
Expand Down

0 comments on commit a8d7fb1

Please sign in to comment.