Skip to content

Commit 749995c

Browse files
committed
changes to work on nim 2.0 (force refc for gc)
1 parent 7fd4a85 commit 749995c

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ jobs:
6060
if: runner.os == 'Linux'
6161
run: |
6262
cd
63-
git clone --recursive https://github.com/samtools/htslib.git
64-
cd htslib && git checkout 1.11 && autoheader && autoconf && ./configure --enable-libcurl
63+
git clone -b 1.18 --recursive https://github.com/samtools/htslib.git
64+
cd htslib && autoheader && autoconf && ./configure --enable-libcurl
6565
sudo make -j 4 install
6666
sudo ldconfig
6767
#echo "::set-env name=LD_LIBRARY_PATH::${LD_LIBRARY_PATH}:${HOME}/htslib"
@@ -101,7 +101,7 @@ jobs:
101101
run: chmod +x mosdepth && mkdir bin && cp mosdepth bin/mosdepth_debug_${{ matrix.os }}
102102

103103
- name: "Build and Copy release binary"
104-
run: nim c -d:danger -d:release -o:bin/mosdepth_${{ matrix.os }} mosdepth
104+
run: nim c --mm:refc -d:danger -d:release -o:bin/mosdepth_${{ matrix.os }} mosdepth
105105

106106
- name: Functional Tests
107107
env:

functional-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ set -o nounset
1212

1313

1414
set -e
15-
nim c --boundChecks:on -x:on mosdepth.nim
16-
nim c -r tests/funcs.nim
15+
nim c --boundChecks:on -x:on -d:useSysAssert -d:useGcAssert --lineDir:on --debuginfo --mm:refc mosdepth.nim
16+
nim c -x:on --mm:refc -d:useSysAssert -d:useGcAssert --lineDir:on --debuginfo -r tests/funcs.nim
1717
set +e
1818
exe=./mosdepth
1919
bam=/data/human/NA12878.subset.bam

mosdepth.nim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ proc write_thresholds(fh:BGZI, tid:int, arr:var coverage_t, thresholds:seq[int],
504504
return
505505

506506
var counts = new_seq[int](len(thresholds))
507-
shallow(arr)
507+
when NimMajor < 2:
508+
shallow(arr)
508509

509510
# iterate over the region and count bases >= request cutoffs.
510511
for v in arr[start..<stop]:
@@ -630,7 +631,8 @@ proc main(bam: hts.Bam, chrom: region_t, mapq: int, min_len: int, max_len: int,
630631
window = uint32(S.parse_int(region))
631632
else:
632633
bed_regions = bed_to_table(region)
633-
shallow(arr)
634+
when NimMajor < 2:
635+
shallow(arr)
634636

635637
var cs = initCountStat[uint32](size=if use_median: 65536 else: 0)
636638

mosdepth.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "MIT"
77

88
# Dependencies
99

10-
requires "hts >= 0.3.22", "docopt == 0.7.0", "nim >= 1.0.0", "https://github.com/brentp/d4-nim >= 0.0.3"
10+
requires "hts >= 0.3.22", "docopt == 0.7.1", "nim >= 1.0.0", "https://github.com/brentp/d4-nim >= 0.0.3"
1111

1212
bin = @["mosdepth"]
1313
skipDirs = @["tests"]

0 commit comments

Comments
 (0)