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

v3 regression over v2: opam exec now fails with "Exec format error" on shell scripts on Windows #866

Open
JasonGross opened this issue Sep 20, 2024 · 2 comments
Labels
question Further information is requested

Comments

@JasonGross
Copy link

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/10953316111/job/30413386004

logs_28625164728.zip

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 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 exec -- chmod +x test.sh
    - run: opam exec -- cat test.sh
    - run: opam exec -- ./test.sh
@smorimoto
Copy link
Member

Is it related to this? #815

@smorimoto smorimoto added the question Further information is requested label Oct 4, 2024
@JasonGross
Copy link
Author

You are suggesting that it might be related to #815 (comment) in particular, where perhaps indirecting through ocaml-env exec -- opam.exe exec instead of jumping straight to opam exec might change something? Or that opam exec might sometimes recognize bash scripts depending on what shell its run from? (The problem is that opam is trying to run the bash script as a binary executable, but I don't know what's causing that issue.) Is there a way to disentangle opam version issues from setup-ocaml version issues by changing something at https://github.com/JasonGross/test/blob/d70236be3e6d76e9bcac5a65b68298784b33f44d/.github/workflows/main.yml ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants