-
Notifications
You must be signed in to change notification settings - Fork 39
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
3.0.0-alpha: Windows: bash script fails with "syntax error: unexpected end of file" #815
Comments
This issue is probably unrelated to the action. |
I should have mentioned that I have already tried this, but it didn't help. Also, this did work fine with the setup-ocaml 2.x.x. This is definitely a new issue with 3.0.0-beta. https://github.com/cknitt/setup-ocaml-repro/blob/main/.github/workflows/ci.yml So please reopen this issue @smorimoto |
You can use - name: Check if syntax subfolder has changed
id: syntax-diff
shell: bash
env:
SHELLOPTS: igncr
run: |
if git diff --name-only --exit-code HEAD^ HEAD -- jscomp/syntax; then
echo "syntax_status=unchanged" >>"$GITHUB_ENV"
else
echo "syntax_status=changed" >>"$GITHUB_ENV"
fi |
@smorimoto Thanks, but the proposed workaround with See https://github.com/cknitt/setup-ocaml-repro/blob/main/.github/workflows/ci.yml Why does the 3.0.0 extension need to modify the path in such a way that a different bash binary becomes the default when that obviously wasn't necessary in 2.x.x? This particular bash issue may not be the only side effect of this new behavior. |
Ah, overlooked the However, the question remains: Why this change? |
Ok, I can confirm that |
A better way to set it on Windows only is: - name: Set SHELLOPTS=igncr on Windows
if: runner.os == 'Windows'
run: echo "SHELLOPTS=igncr" >>"$GITHUB_ENV" |
The reason you need to do this from v3 is that, until v2, the opam you call was not the real opam: setup-ocaml/packages/setup-ocaml/src/opam.ts Lines 240 to 248 in 970719e
|
Thanks for the hint! |
does it make sense to have igncr as default on windows runners? |
Error was: line 1: $'\r': command not found See: ocaml/setup-ocaml#815 (comment)
Error was: line 1: $'\r': command not found See: ocaml/setup-ocaml#815 (comment)
Test with OCaml 5. Updated setup-ocaml to v3. Had to add `SHELLOPTS: igncr`, to fix: line 1: $'\r': command not found See ocaml/setup-ocaml#815 (comment) Removed opam-repository-mingw.git#sunset. It doesn't seem to be needed now, and was causing ocamlfind to fail to install.
Another 3.0.0-alpha issue, I hope this one makes more sense than my previous one 🙈.
So once correctly configured, setup-ocaml itself works perfectly fine on Windows, and we can use the OCaml 5.2.0 compiler to build our project.
However, after the setup-ocaml step and our successful OCaml build step, we have the following step:
This step works fine when using setup-ocaml 2.x.x, but fails with 3.0.0-alpha with the following error message:
So it seems that the setup-ocaml step changes something in the environment, causing this error.
See https://github.com/rescript-lang/rescript-compiler/actions/runs/9601379213/job/26481410755.
The text was updated successfully, but these errors were encountered: