From cb26e8f8bded5689813f5735db9faa19c877a946 Mon Sep 17 00:00:00 2001 From: Joseph Guhlin Date: Tue, 7 Jan 2025 11:40:55 +1300 Subject: [PATCH] Prep release --- CHANGELOG.md | 2 +- README.md | 6 +++++- minimap2-sys/Cargo.lock | 47 +++++++++++++++++++++++------------------ minimap2-sys/Cargo.toml | 2 +- minimap2-sys/README.md | 5 +++-- minimap2-sys/src/lib.rs | 19 ++++++++--------- 6 files changed, 46 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3322c0..717c599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ ### 0.1.23 minimap2 2.28 ++ Functions to set flag opts for MapOpt and IdxOpt @dwpeng + Fixed memory leak when not dropping mm_idx_t properly. This is done by adding in syntactic sugar in minimap2-sys @jguhlin ### 0.1.22 minimap2 2.28 -#### Changes + Fixed a memory segfault when re-using a thread local buffer. Not sure why it occurs, but this fix seems to solve it. ### 0.1.21 minimap2 2.28 diff --git a/README.md b/README.md index 5863961..7fe1e1f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ minimap2-sys is the raw FFI bindings to minimap2. minimap2 is the more opinionat # How to use ## Requirements ```toml -minimap2 = "0.1.22+minimap2.2.28" +minimap2 = "0.1.23+minimap2.2.28" ``` Also see [Features](#features) @@ -274,6 +274,8 @@ See [customization](#customization) for how to use these. ## Mapping Flags (`MM_F_*`) +These can be set with helper functions. Please see the docs for IdxOpt and MapOpt. + | Flag Constant | Value | Description | |-------------------------|----------------|-----------------------------------------------------------------| | `MM_F_NO_DIAG` | `1` | Skip seed pairs on the same diagonal. | @@ -328,6 +330,8 @@ See [customization](#customization) for how to use these. ## Indexing Flags (`MM_I_*`) +These can be set with helper functions. Please see the docs for IdxOpt and MapOpt. + | Flag Constant | Value | Description | |-------------------|--------|----------------------------------------------------------| | `MM_I_HPC` | `1` | Use homopolymer-compressed k-mers for indexing. | diff --git a/minimap2-sys/Cargo.lock b/minimap2-sys/Cargo.lock index 31af4b2..4729d3c 100644 --- a/minimap2-sys/Cargo.lock +++ b/minimap2-sys/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.70.1" +version = "0.71.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" dependencies = [ "bitflags", "cexpr", @@ -37,9 +37,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "cc" -version = "1.2.1" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "shlex", ] @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.51" +version = "0.1.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" dependencies = [ "cc", ] @@ -87,9 +87,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "itertools" @@ -102,15 +102,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.164" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets", @@ -143,11 +143,12 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "minimap2-sys" -version = "0.1.20+minimap2.2.28" +version = "0.1.21+minimap2.2.28" dependencies = [ "bindgen", "cc", "libz-sys", + "paste", "pkg-config", ] @@ -161,6 +162,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "pkg-config" version = "0.3.31" @@ -178,9 +185,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -216,9 +223,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "shlex" @@ -228,9 +235,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "syn" -version = "2.0.89" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", diff --git a/minimap2-sys/Cargo.toml b/minimap2-sys/Cargo.toml index 5559ab7..bde0402 100644 --- a/minimap2-sys/Cargo.toml +++ b/minimap2-sys/Cargo.toml @@ -41,7 +41,7 @@ pkg-config = "0.3" [build-dependencies.bindgen] optional = true -version = "0.70" +version = "0.71" default-features = false features = ["which-rustfmt", "runtime"] diff --git a/minimap2-sys/README.md b/minimap2-sys/README.md index f800064..8e5b9ac 100644 --- a/minimap2-sys/README.md +++ b/minimap2-sys/README.md @@ -5,7 +5,7 @@ Use this if you need lower-level bindings for minimap2. Minimap2 2.28 ## Breaking Changes -### 0.0.18 +### 0.1.18 mm2-fast and minimap2 have diverged. At this point mm2-fast is no longer supported. Please use a previous crate version. ## Features @@ -20,7 +20,8 @@ mm2-fast and minimap2 have diverged. At this point mm2-fast is no longer support ## Changelog ### 0.1.21 minimap2.2.28 -Syntactic sugar for mm_idx_t to support Drop, Deref, and DerefMut +* Flag functions for IdxOpt and MapOpt @dwpeng +* Syntactic sugar for mm_idx_t to support Drop, Deref, and DerefMut ### 0.1.20 minimap2.2.28 * Move Drop impl to -sys crate diff --git a/minimap2-sys/src/lib.rs b/minimap2-sys/src/lib.rs index a54b503..670ac68 100644 --- a/minimap2-sys/src/lib.rs +++ b/minimap2-sys/src/lib.rs @@ -62,6 +62,15 @@ impl Default for mm_mapopt_t { } } +impl Default for mm_idxopt_t { + fn default() -> Self { + unsafe { + let mut opt = MaybeUninit::uninit(); + mm_idxopt_init(opt.as_mut_ptr()); + opt.assume_init() + } + } +} macro_rules! add_flag_methods { ($ty:ty, $struct_name:ident, $(($set_name:ident, $unset_name:ident, $flag:expr)),+) => { @@ -136,16 +145,6 @@ add_flag_methods!( (set_no_name, unset_no_name, MM_I_NO_NAME) ); -impl Default for mm_idxopt_t { - fn default() -> Self { - unsafe { - let mut opt = MaybeUninit::uninit(); - mm_idxopt_init(opt.as_mut_ptr()); - opt.assume_init() - } - } -} - // TODO: Add more tests! #[cfg(test)] mod tests {