Skip to content

Commit f0af43b

Browse files
committed
Migrate from rust-htslib to noodles (pure Rust)
Replace the C htslib dependency with noodles, a pure Rust bioinformatics I/O library. This eliminates all C compilation requirements, enabling Windows builds and removing the glib vulnerability from Cargo.lock. Changes: - read_count.rs: noodles BAM indexed reader + CIGAR ops - io/vcf.rs: text-based VCF/VCF.GZ reader (BGZF via noodles) - output/vcf.rs: noodles BGZF writer, tabix via external command - pipeline/processing.rs: noodles BAM reader in worker threads - src-tauri/commands.rs: noodles BAM viewer, custom FASTA reader - error.rs: removed htslib error conversion Dropped: - rust-htslib dependency (both crates) - bio dependency (src-tauri) - BCF input support (rare; use bcftools view to convert) - Built-in tabix indexing (uses external tabix command) Added: - noodles 0.109 (bam, bgzf, vcf, bcf, csi, tabix, sam, core) - Windows build target in release workflow 224 tests passing, 0 clippy warnings.
1 parent c5ce34f commit f0af43b

11 files changed

Lines changed: 1113 additions & 1658 deletions

File tree

.github/workflows/release.yml

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- platform: ubuntu-22.04
2525
rust_target: x86_64-unknown-linux-gnu
2626
args: "--target x86_64-unknown-linux-gnu"
27+
- platform: windows-latest
28+
rust_target: x86_64-pc-windows-msvc
29+
args: "--target x86_64-pc-windows-msvc"
2730

2831
runs-on: ${{ matrix.platform }}
2932

@@ -57,14 +60,41 @@ jobs:
5760
libayatana-appindicator3-dev \
5861
librsvg2-dev \
5962
patchelf \
60-
libfuse2 \
61-
libbz2-dev \
62-
liblzma-dev \
63-
libcurl4-openssl-dev \
64-
libssl-dev \
65-
zlib1g-dev \
66-
autoconf \
67-
automake
63+
libfuse2
64+
65+
- name: Setup Python (Windows only)
66+
if: matrix.platform == 'windows-latest'
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version: "3.11"
70+
71+
- name: Generate Windows .ico
72+
if: matrix.platform == 'windows-latest'
73+
shell: pwsh
74+
run: |
75+
python -m pip install --upgrade pip
76+
python -m pip install pillow
77+
$py = @(
78+
'from PIL import Image',
79+
'from pathlib import Path',
80+
'png = Path("src-tauri/icons/icon.png")',
81+
'ico = Path("src-tauri/icons/icon.ico")',
82+
'if not png.exists(): raise SystemExit(f"Missing {png}")',
83+
'ico.parent.mkdir(parents=True, exist_ok=True)',
84+
'img = Image.open(png).convert("RGBA")',
85+
'sizes = [(16,16),(24,24),(32,32),(48,48),(64,64),(256,256)]',
86+
'img.save(ico, format="ICO", sizes=sizes)',
87+
'print(f"Generated {ico}")'
88+
)
89+
$py | Set-Content -Encoding utf8 gen_ico.py
90+
python gen_ico.py
91+
$confPath = "src-tauri/tauri.conf.json"
92+
$json = Get-Content $confPath -Raw | ConvertFrom-Json
93+
if (-not $json.bundle.icon) { $json.bundle.icon = @() }
94+
if ($json.bundle.icon -notcontains "icons/icon.ico") {
95+
$json.bundle.icon += "icons/icon.ico"
96+
}
97+
$json | ConvertTo-Json -Depth 100 | Set-Content -Encoding utf8 $confPath
6898
6999
- name: Install and build frontend
70100
run: |

0 commit comments

Comments
 (0)