From ad2b981d1c9680d9085ce49b18e3fa2d6dac34cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=B6lder?= Date: Fri, 3 May 2024 14:56:46 +0200 Subject: [PATCH 01/14] set host to macos-12 --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index df43edc40..e06f9776e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -121,7 +121,7 @@ jobs: Testing-MacOS: needs: Formatting - runs-on: macos-latest + runs-on: macos-12 strategy: matrix: target: From 53b11b11d3249fcd882311b0ca967e73248b8d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=B6lder?= Date: Fri, 3 May 2024 15:01:25 +0200 Subject: [PATCH 02/14] set host to macos-13 --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e06f9776e..f33ec8909 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -121,7 +121,7 @@ jobs: Testing-MacOS: needs: Formatting - runs-on: macos-12 + runs-on: macos-13 strategy: matrix: target: From 3b2daff1fcb4d6f901f40031c621d34b2cd88053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=B6lder?= Date: Mon, 6 May 2024 14:51:24 +0200 Subject: [PATCH 03/14] update hts-sys --- .github/workflows/rust.yml | 42 ++++++++++++++++---------------------- Cargo.toml | 2 +- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f33ec8909..7c6eb68ad 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -125,29 +125,28 @@ jobs: strategy: matrix: target: - - intel-catalina - - intel-bigsur - - m1-bigsur + - intel-monterey + - intel-ventura + - silicon-sonoma include: - - target: intel-catalina - os: macOS-10.15 + - target: intel-monterey + os: macOS-12.0 toolchain_target: x86_64-apple-darwin toolchain: stable - aux_args: "" - default: false - - target: intel-bigsur - os: macOS-11.0 + aux_args: --target x86_64-apple-darwin + default: true + - target: intel-ventura + os: macOS-13.0 toolchain_target: x86_64-apple-darwin toolchain: stable + aux_args: --target x86_64-apple-darwin + default: true + - target: silicon-sonoma + os: macOS-14.0 + toolchain_target: aarch64-apple-darwin + toolchain: stable aux_args: "" default: false - # TODO enable again and try to find out why this fails - # - target: m1-bigsur - # os: macOS-11.0 - # toolchain_target: aarch64-apple-darwin - # toolchain: nightly - # aux_args: --target aarch64-apple-darwin - # default: true steps: - name: Checkout repository @@ -158,19 +157,14 @@ jobs: - name: Install stable toolchain uses: actions-rs/toolchain@v1.0.6 with: - toolchain: stable + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.toolchain_target }} override: true + default: ${{ matrix.default }} - name: Install htslib dependencies run: brew install bzip2 zlib xz curl-openssl - #- uses: actions-rs/toolchain@v1.0.6 - # with: - # toolchain: ${{ matrix.toolchain }} - # target: ${{ matrix.toolchain_target }} - # #override: true - # default: ${{ matrix.default }} - - name: Test uses: actions-rs/cargo@v1.0.1 with: diff --git a/Cargo.toml b/Cargo.toml index 65239b59b..f1ebd79c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ bio-types = ">=0.9" byteorder = "1.3" custom_derive = "0.1" derive-new = "0.5" -hts-sys = {version = "2.1.1", default-features = false} +hts-sys = {version = "2.1.3", default-features = false} ieee754 = "0.2" lazy_static = "1.4" libc = "0.2" From 50f2396f05863e7cdbdad6b7d250550cfea0eb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=B6lder?= Date: Mon, 6 May 2024 15:25:22 +0200 Subject: [PATCH 04/14] set macos-latest --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7c6eb68ad..2a9890772 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -121,7 +121,7 @@ jobs: Testing-MacOS: needs: Formatting - runs-on: macos-13 + runs-on: macos-latest strategy: matrix: target: From 0e24617531b8f7c368cfd0676eac0a85322ea47f Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 09:24:59 +0200 Subject: [PATCH 05/14] fix type --- src/bam/record.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bam/record.rs b/src/bam/record.rs index 8ddd35c12..22e6c8bdb 100644 --- a/src/bam/record.rs +++ b/src/bam/record.rs @@ -152,8 +152,8 @@ impl Record { let mut sam_string = htslib::kstring_t { s: sam_copy.as_ptr() as *mut c_char, - l: sam_copy.len() as u64, - m: sam_copy.len() as u64, + l: sam_copy.len(), + m: sam_copy.len(), }; let succ = unsafe { From 40793b8c0b64658d23196d8f1278848134f3044d Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 10:04:38 +0200 Subject: [PATCH 06/14] fix internal insert size naming (isize vs isize_) --- src/bam/mod.rs | 2 +- src/bam/record.rs | 4 ++-- src/bam/record_serde.rs | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bam/mod.rs b/src/bam/mod.rs index daaf08351..5d4f012f0 100644 --- a/src/bam/mod.rs +++ b/src/bam/mod.rs @@ -1580,7 +1580,7 @@ CCCCCCCCCCCCCCCCCCC"[..], assert_eq!(c1.inner().core.l_qname, b1.inner().core.l_qname); assert_eq!(c1.inner().core.n_cigar, b1.inner().core.n_cigar); assert_eq!(c1.inner().core.l_qseq, b1.inner().core.l_qseq); - assert_eq!(c1.inner().core.isize, b1.inner().core.isize); + assert_eq!(c1.inner().core.isize_, b1.inner().core.isize_); //... except m_data } } diff --git a/src/bam/record.rs b/src/bam/record.rs index 22e6c8bdb..83aded002 100644 --- a/src/bam/record.rs +++ b/src/bam/record.rs @@ -286,12 +286,12 @@ impl Record { /// Get insert size. pub fn insert_size(&self) -> i64 { - self.inner().core.isize + self.inner().core.isize_ } /// Set insert size. pub fn set_insert_size(&mut self, insert_size: i64) { - self.inner_mut().core.isize = insert_size; + self.inner_mut().core.isize_ = insert_size; } fn qname_capacity(&self) -> usize { diff --git a/src/bam/record_serde.rs b/src/bam/record_serde.rs index 7d457c7b7..651867030 100644 --- a/src/bam/record_serde.rs +++ b/src/bam/record_serde.rs @@ -29,7 +29,7 @@ impl Serialize for Record { state.serialize_field("seq_len", &core.l_qseq)?; state.serialize_field("mtid", &core.mtid)?; state.serialize_field("mpos", &core.mpos)?; - state.serialize_field("isize", &core.isize)?; + state.serialize_field("isize", &core.isize_)?; state.serialize_field("data", Bytes::new(self.data()))?; state.end() } @@ -138,7 +138,7 @@ impl<'de> Deserialize<'de> for Record { let mpos = seq .next_element()? .ok_or_else(|| de::Error::invalid_length(0, &self))?; - let isize = seq + let isize_ = seq .next_element()? .ok_or_else(|| de::Error::invalid_length(0, &self))?; let data = seq @@ -159,7 +159,7 @@ impl<'de> Deserialize<'de> for Record { m.l_qseq = seq_len; m.mtid = mtid; m.mpos = mpos; - m.isize = isize; + m.isize_ = isize_; } rec.set_data(&data); @@ -271,7 +271,7 @@ impl<'de> Deserialize<'de> for Record { let seq_len = seq_len.ok_or_else(|| de::Error::missing_field("seq_len"))?; let mtid = mtid.ok_or_else(|| de::Error::missing_field("mtid"))?; let mpos = mpos.ok_or_else(|| de::Error::missing_field("mpos"))?; - let isize = isize.ok_or_else(|| de::Error::missing_field("isize"))?; + let isize_ = isize.ok_or_else(|| de::Error::missing_field("isize"))?; let data = data .ok_or_else(|| de::Error::missing_field("data"))? .into_vec(); @@ -289,7 +289,7 @@ impl<'de> Deserialize<'de> for Record { m.l_qseq = seq_len; m.mtid = mtid; m.mpos = mpos; - m.isize = isize; + m.isize_ = isize_; } rec.set_data(&data); From f9807c0e273755678242ac74aea9d8384a887aa9 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 10:14:51 +0200 Subject: [PATCH 07/14] fix type --- src/bam/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bam/mod.rs b/src/bam/mod.rs index 5d4f012f0..fad5cb1a1 100644 --- a/src/bam/mod.rs +++ b/src/bam/mod.rs @@ -1127,7 +1127,7 @@ impl Writer { ); (*rec).text = text as *mut c_char; - (*rec).l_text = l_text as u64; + (*rec).l_text = l_text; rec }; From 1c89f12124f2a5afcdf8c25458762e96d1f12729 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 10:53:12 +0200 Subject: [PATCH 08/14] fix --- Cargo.toml | 2 +- src/bam/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f1ebd79c5..0335ec6fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ bio-types = ">=0.9" byteorder = "1.3" custom_derive = "0.1" derive-new = "0.5" -hts-sys = {version = "2.1.3", default-features = false} +hts-sys = {version = "2.1.3", default-features = false, features = ["bindgen"]} ieee754 = "0.2" lazy_static = "1.4" libc = "0.2" diff --git a/src/bam/mod.rs b/src/bam/mod.rs index fad5cb1a1..f232401e5 100644 --- a/src/bam/mod.rs +++ b/src/bam/mod.rs @@ -1392,9 +1392,9 @@ impl HeaderView { header_string.len(), ); - let rec = htslib::sam_hdr_parse((l_text + 1) as u64, text as *const c_char); + let rec = htslib::sam_hdr_parse((l_text + 1), text as *const c_char); (*rec).text = text as *mut c_char; - (*rec).l_text = l_text as u64; + (*rec).l_text = l_text; rec }; From 2b901e0ed3fbc54d147e5e97cad0e1fb5456bad1 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 10:57:06 +0200 Subject: [PATCH 09/14] fix --- src/bcf/record.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bcf/record.rs b/src/bcf/record.rs index a5778d1ac..c1066cd30 100644 --- a/src/bcf/record.rs +++ b/src/bcf/record.rs @@ -1008,7 +1008,7 @@ impl Record { } pub fn remove_alleles(&mut self, remove: &[bool]) -> Result<()> { - let rm_set = unsafe { htslib::kbs_init(remove.len() as u64) }; + let rm_set = unsafe { htslib::kbs_init(remove.len()) }; for (i, &r) in remove.iter().enumerate() { if r { From 9bb53d1bfa47e157bfc392aefb46b982ac39cba3 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 11:02:50 +0200 Subject: [PATCH 10/14] fix --- src/bgzf/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bgzf/mod.rs b/src/bgzf/mod.rs index a99af4de4..46ffcd8c7 100644 --- a/src/bgzf/mod.rs +++ b/src/bgzf/mod.rs @@ -115,7 +115,7 @@ impl std::io::Read for Reader { htslib::bgzf_read( self.inner, buf.as_mut_ptr() as *mut libc::c_void, - buf.len() as u64, + buf.len(), ) }; if nbytes < 0 { From a4f3a2d18b87c53f7b32f597d76d95478d571950 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 11:03:59 +0200 Subject: [PATCH 11/14] fmt --- src/bgzf/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/bgzf/mod.rs b/src/bgzf/mod.rs index 46ffcd8c7..e558d01f8 100644 --- a/src/bgzf/mod.rs +++ b/src/bgzf/mod.rs @@ -112,11 +112,7 @@ impl Reader { impl std::io::Read for Reader { fn read(&mut self, buf: &mut [u8]) -> std::io::Result { let nbytes = unsafe { - htslib::bgzf_read( - self.inner, - buf.as_mut_ptr() as *mut libc::c_void, - buf.len(), - ) + htslib::bgzf_read(self.inner, buf.as_mut_ptr() as *mut libc::c_void, buf.len()) }; if nbytes < 0 { Err(std::io::Error::new( From 9a9b3d16cd8fb6d2caf7c2e94c17085021c52f5a Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 11:07:35 +0200 Subject: [PATCH 12/14] fix --- src/bgzf/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bgzf/mod.rs b/src/bgzf/mod.rs index e558d01f8..69fae4ed1 100644 --- a/src/bgzf/mod.rs +++ b/src/bgzf/mod.rs @@ -257,7 +257,7 @@ impl std::io::Write for Writer { htslib::bgzf_write( self.inner, buf.as_ptr() as *mut libc::c_void, - buf.len() as u64, + buf.len(), ) }; if nbytes < 0 { From 77d7052131a5c5c7b58970532e933642e5b889d3 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 11:09:35 +0200 Subject: [PATCH 13/14] fmt --- src/bgzf/mod.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/bgzf/mod.rs b/src/bgzf/mod.rs index 69fae4ed1..06d6ee7a1 100644 --- a/src/bgzf/mod.rs +++ b/src/bgzf/mod.rs @@ -253,13 +253,8 @@ impl Writer { impl std::io::Write for Writer { fn write(&mut self, buf: &[u8]) -> std::io::Result { - let nbytes = unsafe { - htslib::bgzf_write( - self.inner, - buf.as_ptr() as *mut libc::c_void, - buf.len(), - ) - }; + let nbytes = + unsafe { htslib::bgzf_write(self.inner, buf.as_ptr() as *mut libc::c_void, buf.len()) }; if nbytes < 0 { Err(std::io::Error::new( std::io::ErrorKind::Other, From 5eb729bf35ea653688ac25f6cea82bc6e06c9442 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 10 May 2024 11:46:16 +0200 Subject: [PATCH 14/14] bump hts-sys --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 0335ec6fb..b12df281b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ bio-types = ">=0.9" byteorder = "1.3" custom_derive = "0.1" derive-new = "0.5" -hts-sys = {version = "2.1.3", default-features = false, features = ["bindgen"]} +hts-sys = {version = "2.1.4", default-features = false, features = ["bindgen"]} ieee754 = "0.2" lazy_static = "1.4" libc = "0.2"