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

Beta versions of the compiler support could be improved #232

Open
kit-ty-kate opened this issue Sep 1, 2021 · 9 comments
Open

Beta versions of the compiler support could be improved #232

kit-ty-kate opened this issue Sep 1, 2021 · 9 comments
Labels
documentation Improvements or additions to documentation

Comments

@kit-ty-kate
Copy link
Member

With the following workflow file: https://github.com/ocaml/merlin/blob/56e0601ad40995421ae9e3537158af30559fb65f/.github/workflows/main.yml

 ocaml-compiler:
          - 4.13.0~beta1

Is not understood as a valid compiler version and will instead expect it to be a package name, which makes opam fail with:

> Install OCaml
  /opt/hostedtoolcache/opam/2.0.9/x86_64/opam switch create . --no-install --packages 4.13.0~beta1
  opam: option `--packages': invalid element in list (`4.13.0~beta1'): Invalid
        character in package name "4.13.0~beta1"
  am switch [OPTION]... [COMMAND] [ARG]...
  Try `opam switch --help' or `opam --help' for more information.
  Error: The process '/opt/hostedtoolcache/opam/2.0.9/x86_64/opam' failed with exit code 2

This is a valid version string for opam and expliciting ocaml-base-compiler.4.13.0~beta1 shouldn't be required.

@voodoos
Copy link

voodoos commented Sep 1, 2021

And using ocaml-base-compiler.4.13.0~beta1 the result is:

/opt/hostedtoolcache/opam/2.0.9/x86_64/opam switch create . --no-install --packages ocaml-base-compiler.4.13.0~beta1
[ERROR] Could not resolve set of base packages:
       The following dependencies couldn't be met:
         - ocaml-base-compiler → ocaml-beta
             unmet availability conditions: enable-ocaml-beta-repository
                ```

@dra27
Copy link
Member

dra27 commented Sep 1, 2021

@voodoos - you need to add the ocaml-beta-repository explicitly, then that should work

@dra27
Copy link
Member

dra27 commented Sep 1, 2021

I don’t think it should be extended to recognise that version string - the input is it intended to be an opam package version, but access to betas could definitely be improved, perhaps more along the lines of:

ocaml-compiler: 4.13.x
enable-beta-compilers: true

or some such. The main thing would be not specify the alpha, beta or rc number

@kit-ty-kate
Copy link
Member Author

I totally agree. Well in the first place I was expecting setup-ocaml to use opam 2.1 so having a enable-beta-compilers field shouldn't be needed, but since it doesn't i guess this is one way to do it, though I think ocaml-beta-repository should always be set in CI with opam 2.0 in my opinion, that would take care of everything automatically be it on opam 2.0 or 2.1

@voodoos
Copy link

voodoos commented Sep 2, 2021

For the record here is the configuration that works for us:

  build:
    strategy:
      matrix:
        os:
          - macos-latest
          - ubuntu-latest
          - windows-latest
        ocaml-compiler:
          - ocaml-base-compiler.4.13.0~beta1
        
    runs-on: ${{ matrix.os }}

    steps:
      - ...

      - name: Set up OCaml ${{ matrix.ocaml-compiler }}
        uses: ocaml/setup-ocaml@v2
        with:
          # Version of the OCaml compiler to initialise
          ocaml-compiler: ${{ matrix.ocaml-compiler }}
          opam-repositories: |
            default: https://github.com/ocaml/opam-repository.git
            beta: https://github.com/ocaml/ocaml-beta-repository.git

@dra27
Copy link
Member

dra27 commented Sep 3, 2021

@kit-ty-kate - you're right, it shouldn't be necessary to have to specify either the beta repository or the fact betas are wanted. Saying 4.13.x gives everything that's needed: the fact it's been added to a workflow now tells you that betas are needed and then that automatically becomes 4.13.0 when the release cycle finishes. The only thing we might want to do is to have a special so that 4.14.x is an error (now) because - at least for now - no one wants to be running CI against OCaml's trunk!

@smorimoto
Copy link
Member

@voodoos' suggestion is good. Also, in the jsoo repository, I wrote something quite similar: https://github.com/ocsigen/js_of_ocaml/blob/c5b53bf1eb034a229a47e1f226097d81b5b279ba/.github/workflows/build.yml#L59-L84

@smorimoto smorimoto added the documentation Improvements or additions to documentation label Sep 23, 2021
@smorimoto smorimoto reopened this Sep 23, 2021
@kit-ty-kate
Copy link
Member Author

Any chance this could be fixed? Making PRs for adding 4.14 support is really painful

kit-ty-kate added a commit to kit-ty-kate/ppx_import that referenced this issue Jan 22, 2022
@smorimoto
Copy link
Member

I was just looking at this. There are already enough features to do this, so if we are going to improve this, we have to add a higher level of functionality, and I'm still not sure how meaningful that really is.

sim642 added a commit to sim642/ppx_viewpattern that referenced this issue Mar 7, 2022
ajbt200128 added a commit to semgrep/semgrep that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants