Closed hcarty closed 2 years ago
I had the same issues on https://github.com/LexiFi/gen_js_api ; See build https://github.com/LexiFi/gen_js_api/runs/6654501298?check_suite_focus=true .
This seems to impact 4.14.x as well - https://github.com/hcarty/ppx_defer/runs/6658713004?check_suite_focus=true
The problem is with Git's configurable handling of CRLF.
Adding a step for & "C:\Program Files\Git\bin\git.exe" config --system core.autocrlf input
before setup-ocaml
mitigates the issue. For example https://github.com/diskuv/dkml-c-probe/commit/8c1b4ab2eefe785723215835e70b7ceef8f342f5 ... essential bits are:
- name: Hack Git CRLF for ocaml/setup-ocaml issue #529
if: ${{ startsWith(matrix.os, 'windows-') }}
run: |
& "C:\Program Files\Git\bin\git.exe" config --system core.autocrlf input
- uses: ocaml/setup-ocaml@v2
That is a hack of course. Correct answer is one of the following:
core.autocrlf
itself when it installs Cygwin's git package (don't rely on whatever default GitHub Actions has ... which may change in the future)*.ml.in text eol=lf
Perhaps someone on the core OCaml team has some guidance which approach seems better.
@jonahbeckford This fixed my build, thank you!
While we wait for the fix, thanks for the hack!!!
The workaround is good for now, yes! There was a PR for opam I did a few years back which worked by computing two checksums for these files, but it didn’t get merged… somewhere I have a revised “strategy” for it!
The PR was https://github.com/ocaml/opam/pull/3407, but it was reverted prior to opam 2.0. I think the correct fix in opam is to specifically do the CRLF-agnostic hashing for git remotes only
I think https://github.com/ocaml/opam-repository/commit/166ce80c3d9774e5aa972ff9608f86fcf59a3693 fixed this. Or am I confusing something?
No, actually it was not. I just released v2.0.5
which reverts the changes I made in v2.0.4
.
I started a build and looks like Windows works again for ocaml-orx! Thank you @smorimoto! https://github.com/orx/ocaml-orx/runs/6711418597?check_suite_focus=true
The error is that there is a checksum error for one of the files in
ocaml-config
.Example of a failed run: https://github.com/orx/ocaml-orx/runs/6644786129?check_suite_focus=true
Error output: