Skip to content

Commit 5e6300b

Browse files
committed
OPAM 2.4.0
1 parent a24ebb8 commit 5e6300b

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ jobs:
7575

7676
runs-on: ${{matrix.os}}
7777

78+
env:
79+
# Also adjust in `uses:` when changed!
80+
# This version of setup-ocaml comes with OPAM 2.4.0.
81+
SETUP_OCAML_VERSION: 3.4.0
82+
7883
steps:
7984
- name: "Windows: Set git config"
8085
if: runner.os == 'Windows'
@@ -141,7 +146,7 @@ jobs:
141146
# matrix.ocaml_compiler may contain commas
142147
- name: Get OPAM cache key
143148
shell: bash
144-
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
149+
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ env.SETUP_OCAML_VERSION }}-{{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
145150

146151
- name: Restore OPAM environment
147152
id: cache-opam-env
@@ -157,7 +162,7 @@ jobs:
157162
key: ${{ env.opam_cache_key }}
158163

159164
- name: Use OCaml ${{matrix.ocaml_compiler}}
160-
uses: ocaml/setup-ocaml@v3.3.2
165+
uses: ocaml/setup-ocaml@v3.4.0
161166
if: steps.cache-opam-env.outputs.cache-hit != 'true'
162167
with:
163168
ocaml-compiler: ${{matrix.ocaml_compiler}}
@@ -177,7 +182,11 @@ jobs:
177182
178183
- name: Install OPAM dependencies
179184
if: steps.cache-opam-env.outputs.cache-hit != 'true'
180-
run: opam install . --deps-only --with-test
185+
run: |
186+
# With OPAM 2.4, it is not sufficient to have the flow-parser package in `pin-depends` in rescript.opam.template,
187+
# we need to pin it explicitly using `opam pin add`.
188+
opam pin add flow_parser git+https://github.com/rescript-lang/flow.git#9ea4062c0b7e037415c4413a7634c459ebd5c31b --no-action
189+
opam install . --deps-only --with-test
181190
182191
- name: Cache OPAM environment
183192
if: steps.cache-opam-env.outputs.cache-hit != 'true'

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ opam init
5353
# then you need to run `opam update && opam upgrade` first
5454
opam switch create 5.3.0
5555

56-
# Install dev dependencies from OPAM
56+
# Pin flow parser
57+
opam pin add flow_parser git+https://github.com/rescript-lang/flow.git#9ea4062c0b7e037415c4413a7634c459ebd5c31b --no-action
58+
59+
# Install dependencies from OPAM, including dev/test dependencies
5760
opam install . --deps-only --with-test --with-dev-setup -y
5861
```
5962

@@ -397,7 +400,7 @@ To build a new version and release it on NPM, follow these steps:
397400

398401
To reproduce issues, it can be helpful to the team to install a specific version of the compiler.
399402

400-
ReScript uses [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new) for continuous releases. Once tests are passed successfully, the bot comment is available.
403+
ReScript uses [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new) for continuous releases. Once tests are passed successfully, the bot comment is available.
401404

402405
Follow the instructions from the comment, which are like:
403406

rescript.opam.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ depends: [
1414
"wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.0.1"}
1515
]
1616
pin-depends: [
17+
# If using OPAM 2.4.0, this also needs to be pre-pinned using
18+
# opam pin add flow_parser git+https://github.com/rescript-lang/flow.git#9ea4062c0b7e037415c4413a7634c459ebd5c31b --no-action
1719
["flow_parser.0.267.0" "git+https://github.com/rescript-lang/flow.git#9ea4062c0b7e037415c4413a7634c459ebd5c31b"]
1820
]

0 commit comments

Comments
 (0)