opam
opam copied to clipboard
opam exec fails with Exec format error on bash scripts in 2.2.1 on Windows
Not sure if I should be reporting this here or in https://github.com/ocaml/setup-ocaml/issues/866, so I've reported it in both places.
opam config report (failing version 2.2.1)
# opam config report
# opam-version 2.2.1
# self-upgrade no
# system arch=x86_64 os=win32 os-distribution=cygwin os-version=10.0.20348
# solver builtin-mccs+glpk
# install-criteria -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs 3
# repositories 1 (version-controlled)
# pinned 0
# current-switch D:\a\test\test
# invariant ocaml-base-compiler = 4.13.1
# compiler-packages arch-x86_64.1, conf-mingw-w64-gcc-x86_64.1, flexdll.0.43, ocaml-base-compiler.4.13.1, ocaml-env-mingw64.1, ocaml-options-vanilla.1, system-mingw.1
# mingw-w64-shims:runtime-x86_64 D:\cygwin\usr\x86_64-w64-mingw32\sys-root\mingw\bin
# mingw-w64-shims:runtime-i686
# ocaml:native true
# ocaml:native-tools true
# ocaml:native-dynlink true
# ocaml:stubsdir D:/a/test/test/_opam/lib/ocaml/stublibs;D:/a/test/test/_opam/lib/ocaml
# ocaml:preinstalled false
# ocaml:compiler 4.13.1
opam config report (succeeding version 2.0.10)
# opam config report
# opam-version 2.0.10
# self-upgrade no
# system arch=x86_64 os=win32 os-distribution=cygwinports os-version=10.0.20348
# solver builtin-mccs+glpk
# install-criteria -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria -removed,-count[version-lag,solution],-new
# jobs 4
# repositories 1 (version-controlled)
# pinned 0
# current-switch D:/a/test/test
opam exec -- ./test.sh
Fatal error: exception C:\hostedtoolcache\windows\opam\2.2.1\x86_64\opam.exe: "create_process" failed on ./test.sh: Exec format error
https://github.com/JasonGross/test/actions/runs/10953434095/job/30413705930
Full yml file
name: Example Workflow
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
name: build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 4.13.1
- run: opam config report
- run: opam exec -- chmod +x test.sh
- run: opam exec -- cat test.sh
- run: opam exec -- ./test.sh
buildv2:
runs-on: windows-latest
name: buildv2
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.13.1
- run: opam config report
- run: opam exec -- chmod +x test.sh
- run: opam exec -- cat test.sh
- run: opam exec -- ./test.sh