Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows builds via GitHub Actions #1796

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

jkbonfield
Copy link
Contributor

The AppVeyor builds have become slower to launch and they're also a bit slow on execution. GitHub Actions runs in about half the time.

Note this needs samtools/htscodecs#123 merging first, but for purposes of testing I just incorporated it in this PR via an extra commit to change the submodule commit. If the htscodecs PR gets modified in any way, changing the hash, then I'll update this appropriately.

Also, if you wish to see these tests in-situ here, we could copy this PR branch to samtools/htslib from jkbonfield/htslib as otherwise it won't enable the workflow. (As I did for htscodecs)

@jmarshall
Copy link
Member

jmarshall commented Jun 26, 2024

I was initially going to suggest a git config core.autocrlf-core.eol-etc step before the checkout step (on the basis that it would be better to affect only the action runner rather than all Windows users as adding to .gitattributes does), but after reading through actions/checkout#135 I have changed my mind. Fixing this for the test files for all Windows users is actually the right thing to do!

That's a long thread, but actions/checkout#135 (comment) makes a very good point that just doing a blanket ** -text that would also affect *.c files would be the wrong thing to do. So I'm glad to see this PR just does ‑text more specifically for a bunch of test file extensions.

@jkbonfield
Copy link
Contributor Author

I confess for the Samtools one I gave up worrying about every little extension and just went for test/**, but I do accept there are some C files in there. I wonder if we can then do text/*.c +text or similar to reenable it as an exception to the blanket rule? I doubt it matters though tbh as I'm not convinced we'll be getting many, if any, PRs from windows developers, and even if so the code tools typically all support nl anyway.

@daviesrob daviesrob self-assigned this Jun 27, 2024
@jkbonfield jkbonfield marked this pull request as ready for review June 27, 2024 13:34
run: |
export PATH=/mingw64/bin:$PATH
export MSYSTEM=MINGW64
make check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared with the old script, we've lost make test-shlib-exports. Assuming it does actually work on Windows, it's probably useful to have.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot. I'm assuming it does work as it was in the appveyor config. I'll put it back and see what happens.

@jkbonfield
Copy link
Contributor Author

Hmm, disappointingly adding back the test-shlib-exports now fails:

Checking shared library exports
kh_begin
kh_clear_##name
kh_del_##name
kh_destroy_##name
kh_get_##name
kh_init_##name
kh_put_##name
kh_resize_##name
ks_destroy
ks_getuntil2
ks_init
kseq_destroy
kseq_init
kseq_read
Error: Found unexported symbols (listed above)

I initially thought they're all erroneous things from the templates-in-C style of klib, but kseq_read is more normal, although it's still done as a macro with a SCOPE define. I'll need to dig deeper into what it's attempting to do and why we're no longer passing this script.

@jkbonfield jkbonfield force-pushed the windows-actions branch 2 times, most recently from b5f0997 to 8ca61a7 Compare July 4, 2024 11:09
Also amend .gitattributes file for more Windows text-mode removal as
for some reason the GitHub Actions git is much more likely to use
CR-LF line endings.

Added libdeflate to the windows build.

Corrected test/header_syms.pl to work on windows line endings.
@jkbonfield
Copy link
Contributor Author

Fixing the header checking perl script to cope with windows line endings worked. So I've patched that and done some rebasing and squashing of commits. Assuming it now passes this is ready for re-review.

@daviesrob
Copy link
Member

As foretold, the htscodecs submodule commit needs to be adjusted. It also might be good to leave the AppVeyor configuration in place for now, for a less messy transition. Once the couple of recent pull requests that straddle the change have been committed, (#1797, #1799) we can turn it off in the settings and push a commit to remove the configuration.

@jkbonfield
Copy link
Contributor Author

Ah yes I meant to update the htscodecs submodule and forgot.

I was assuming we'd just turn off the appveyor, rerun tests, and if it passed merge it. But we can do it in two separate PRs if really needed. It's minor fluff tbh.

@daviesrob daviesrob merged commit b8145e6 into samtools:develop Jul 4, 2024
9 checks passed
daviesrob added a commit to daviesrob/htslib that referenced this pull request Jul 8, 2024
Completes the migration of Windows testing to GitHub actions.
GitHub actions tests were added in commit 624e95b (PR samtools#1796).
daviesrob added a commit that referenced this pull request Jul 8, 2024
Completes the migration of Windows testing to GitHub actions.
GitHub actions tests were added in commit 624e95b (PR #1796).
gpertea added a commit to gpertea/htslib that referenced this pull request Mar 17, 2025
Notice: this is the last SAMtools / HTSlib release where CRAM 3.0
will be the default CRAM version.  From the next we will change to
CRAM 3.1 unless the version is explicitly specified, for example
using "samtools view -O cram,version=3.0".

Updates
-------

* Extend annot-tsv with several new command line options.
    --delim permits use of other delimiters.
    --headers for selection of other header formats.
    --no-header-idx to suppress column index numbers in header.
  Also removed -h as it is now short for --headers.  Note --help
  still works. (PR samtools#1779)

* Allow annot-tsv -a to rename annotations. (PR samtools#1709)

* Extend annot-tsv --overlap to be able to specify the overlap
  fraction separately for source and target. (PR samtools#1811)

* Added new APIs to facilitate low-level CRAM container
  manipulations, used by   the new "samtools cat" region
  filtering code. Functions are:
    cram_container_get_coords()
    cram_filter_container()
    cram_index_extents()
    cram_container_num2offset()
    cram_container_offset2num()
    cram_num_containers()
    cram_num_containers_between()
  Also improved cram_index_query() to cope with HTS_IDX_NOCOOR
  regions.  (PR samtools#1771)

* Bgzip now retains file modification and access times when
  compressing and decompressing. (PR samtools#1727, fixes samtools#1718.
  Requested by Gert Hulselmans.)

* Use FNV1a for string hashing in khash.  The old algorithm was
  particularly weak with base-64 style strings and lead to a large
  number of collisions.  (PR samtools#1806.  Fixes samtools/samtools#2066,
  reported by Hans-Joachim Ruscheweyh)

* Improve the speed of the nibble2base() function on Intel (PR samtools#1667,
  PR samtools#1764, PR samtools#1786, PR samtools#1802, thanks to Ruben Vorderman) and ARM
  (PR samtools#1795, thanks to John Marshall).

* bgzf_getline() will now warn if it encounters UTF-16 data. (PR
  samtools#1487, thanks to John Marshall)

* Speed up bgzf_read().  While this does not reduce CPU
  significantly, it does increase the maximum parallelism
  available permitting 10-15% faster decoding. (PR samtools#1772, PR
  samtools#1800, Issue samtools#1798)

* Speed up faidx by use of better isgraph methods (PR samtools#1797) and
  whole-line reading (PR samtools#1799, thanks to John Marshall).

* Speed up kputll() function, speeding up BAM -> SAM conversion by
  about 5% and also samtools depth.  (PR samtools#1805)

* Added more example code, covering fasta/fastq indexing, tabix
  indexing and use of the thread pool. (PR samtools#1666)

Build Changes
-------------

* Code warning fixes for pedantic compilers (PR samtools#1777) and avoid some
  undefined behaviour (PR samtools#1810, PR samtools#1816, PR samtools#1828).

* Windows based CI has been migrated from AppVeyor to GitHub Actions.
  (PR samtools#1796, PR samtools#1803, PR samtools#1808)

* Miscellaneous minor build infrastructure and code fixes. (PR samtools#1807,
  PR samtools#1829, both thanks to John Marshall)

* Updated htscodecs submodule to version 1.6.1 (PR samtools#1828)

* Fixed an awk script in the Makefile that only worked with gawk. (PR
  samtools#1831)

Bug fixes
---------

* Fix small OSS-Fuzz reported issues with CRAM encoding and long
  CIGARS and/or illegal positions. (PR samtools#1775, PR samtools#1801, PR samtools#1817)

* Fix issues with on-the-fly indexing of VCF/BCF (bcftools
  --write-index) when not using multiple threads. (PR samtools#1837.
  Fixes samtools/bcftools#2267, reported by Giulio Genovese)

* Stricter limits on POS / MPOS / TLEN in sam_parse1().  This fixes a
  signed overflow reported by OSS-Fuzz and should help prevent other
  as-yet undetected bugs. (PR samtools#1812)

* Check that the underlying file open worked for preload: URLs.
  Fixes a NULL pointer dereference reported by OSS-Fuzz. (PR samtools#1821)

* Fix an infinite loop in hts_itr_query() when given extremely large
  positions which cause integer overflow.  Also adds hts_bin_maxpos()
  and hts_idx_maxpos() functions. (PR samtools#1774, thanks to John Marshall
  and reported by Jesus Alberto Munoz Mesa)

* Fix an out of bounds read in hts_itr_multi_next() when switching
  chromosomes.  This bug is present in releases 1.11 to 1.20. (PR
  samtools#1788. Fixes samtools/samtools#2063, reported by acorvelo)

* Work around parsing problems with colons in CHROM names. Fixes
  samtools/bcftools#2139.  (PR samtools#1781, John Marshall / James Bonfield)

* Correct the CPU detection for Mac OS X 10.7.  cpuid is used by
  htscodecs (see samtools/htscodecs#116), and the corresponding
  changes in htslib are PR samtools#1785.  Reported by Ryan Carsten Schmidt.

* Make BAM zero-length intervals work the same as CRAM; permitted
  and returning overlapping records. (PR samtools#1787.  Fixes
  samtools/samtools#2060, reported by acorvelo)

* Replace assert() with abort() in BCF synced reader.  This is not an
  ideal solution, but it gives consistent behaviour when compiling
  with or without NDEBUG.  (PR samtools#1791, thanks to Martin Pollard)

* Fixed failure to change the write block size on compressed SAM or
  VCF files due to an internal type confusion.  (PR samtools#1826)

* Fixed an out-of-bounds read in cram_codec_iter_next() (PR samtools#1832)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants