ocaml / setup-ocaml

GitHub Action for the OCaml programming language
https://ocaml.org/
MIT License
199 stars 39 forks source link

Windows: "ERROR while compiling opam-depext.1.2.3" #850

Closed nmote closed 3 months ago

nmote commented 3 months ago

opam-depext 1.2.3 was released today. Since then, we have been consistently encountering failures when using this action on Windows. Here's the beginning of our GitHub Actions config:

jobs:
  job:
    defaults:
      run:
        shell: bash
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
        with:
          lfs: true
          submodules: true
      - uses: ocaml/setup-ocaml@v2
        with:
          ocaml-compiler: "4.14"
          opam-local-packages: dont_install_local_packages.opam
          opam-repositories: |
            opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
            default: https://github.com/ocaml/opam-repository.git

And here is an excerpt of the log failure from the setup-ocaml step:

sh -ex shell/build.sh
+ ocamlc -I src_ext/lib unix.cma cmdliner.cma -o opam-depext $'depext.ml\r'
don't know what to do with depext.ml
Usage: ocamlc <options> <files>
Try 'ocamlc --help' for more information.
  -a  Build a library
  -alert <list>  Enable or disable alerts according to <list>:
        +<alertname>  enable alert <alertname>
        -<alertname>  disable alert <alertname>
        ++<alertname> treat <alertname> as fatal error
        --<alertname> treat <alertname> as non-fatal
        @<alertname>  enable <alertname> and treat it as fatal error
    <alertname> can be 'all' to refer to all alert names

Perhaps this action could pin to the previous version of opam-depext until this is resolved?

nmote commented 3 months ago

I've just realized that we are using an old version of this action. I will try with the latest and report back.

nmote commented 3 months ago

Updating to v3 fixed the issue with this job, though now in later steps we are getting issues with carriage returns (\r) in Bash scripts, which weren't causing problems before. For example:

./configure: line 6: $'\r': command not found

Line 6 is just a blank line at the beginning of the script.

Anyway, I'll close this since while this is weird, it's not clear to me that it's due to an issue with setup-ocaml.

cknitt commented 3 months ago

@nmote Regarding the issue with \r, see https://github.com/ocaml/setup-ocaml/issues/815#issuecomment-2204838759.