Skip to content

Commit 11a25f4

Browse files
authored
Use stable ReScript versions in Rewatch tests (#8546)
Signed-off-by: Christoph Knittel <ck@cca.io>
1 parent 0c1bc3d commit 11a25f4

5 files changed

Lines changed: 89 additions & 52 deletions

File tree

rewatch/testrepo/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Rewatch integration-test fixture
2+
3+
This workspace models package layouts that Rewatch must handle. Its `rescript`
4+
dependencies intentionally use distinct published versions: the workspace root
5+
uses 12.0.0, while `packages/nohoist` uses 12.3.0. Keeping those versions
6+
different makes Yarn install separate root and nested copies, which exercises
7+
dependency discovery in hoisted and non-hoisted layouts. Do not update both
8+
dependencies to the same version without replacing that coverage.
9+
10+
These published packages are not the compiler and runtime under test. When the
11+
suite runs a native Rewatch executable, `tests/suite.sh` sets
12+
`RESCRIPT_BSC_EXE` and `RESCRIPT_RUNTIME` to the artifacts built from the
13+
current repository. The `rescript` packages installed here primarily provide a
14+
realistic package-manager dependency tree; the version printed from
15+
`node_modules/.bin/rescript` during setup is informational.
16+
17+
When changing either fixture version, regenerate this directory's `yarn.lock`
18+
and verify that `yarn why rescript` still reports separate root and nested
19+
installations.

rewatch/testrepo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
]
2525
},
2626
"dependencies": {
27-
"rescript": "12.0.0-beta.1"
27+
"rescript": "12.0.0"
2828
},
2929
"scripts": {
3030
"build": "../target/release/rescript build .",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@testrepo/nohoist",
33
"dependencies": {
4-
"rescript": "12.0.0-beta.3",
4+
"rescript": "12.3.0",
55
"rescript-bun": "patch:rescript-bun@npm%3A2.1.0#~/.yarn/patches/rescript-bun-npm-2.1.0-d9adc91a04.patch"
66
}
77
}

rewatch/testrepo/yarn.lock

Lines changed: 66 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,76 @@ __metadata:
55
version: 8
66
cacheKey: 10c0
77

8-
"@rescript/darwin-arm64@npm:12.0.0-beta.1":
9-
version: 12.0.0-beta.1
10-
resolution: "@rescript/darwin-arm64@npm:12.0.0-beta.1"
8+
"@rescript/darwin-arm64@npm:12.0.0":
9+
version: 12.0.0
10+
resolution: "@rescript/darwin-arm64@npm:12.0.0"
1111
conditions: os=darwin & cpu=arm64
1212
languageName: node
1313
linkType: hard
1414

15-
"@rescript/darwin-arm64@npm:12.0.0-beta.3":
16-
version: 12.0.0-beta.3
17-
resolution: "@rescript/darwin-arm64@npm:12.0.0-beta.3"
15+
"@rescript/darwin-arm64@npm:12.3.0":
16+
version: 12.3.0
17+
resolution: "@rescript/darwin-arm64@npm:12.3.0"
1818
conditions: os=darwin & cpu=arm64
1919
languageName: node
2020
linkType: hard
2121

22-
"@rescript/darwin-x64@npm:12.0.0-beta.1":
23-
version: 12.0.0-beta.1
24-
resolution: "@rescript/darwin-x64@npm:12.0.0-beta.1"
22+
"@rescript/darwin-x64@npm:12.0.0":
23+
version: 12.0.0
24+
resolution: "@rescript/darwin-x64@npm:12.0.0"
2525
conditions: os=darwin & cpu=x64
2626
languageName: node
2727
linkType: hard
2828

29-
"@rescript/darwin-x64@npm:12.0.0-beta.3":
30-
version: 12.0.0-beta.3
31-
resolution: "@rescript/darwin-x64@npm:12.0.0-beta.3"
29+
"@rescript/darwin-x64@npm:12.3.0":
30+
version: 12.3.0
31+
resolution: "@rescript/darwin-x64@npm:12.3.0"
3232
conditions: os=darwin & cpu=x64
3333
languageName: node
3434
linkType: hard
3535

36-
"@rescript/linux-arm64@npm:12.0.0-beta.1":
37-
version: 12.0.0-beta.1
38-
resolution: "@rescript/linux-arm64@npm:12.0.0-beta.1"
36+
"@rescript/linux-arm64@npm:12.0.0":
37+
version: 12.0.0
38+
resolution: "@rescript/linux-arm64@npm:12.0.0"
3939
conditions: os=linux & cpu=arm64
4040
languageName: node
4141
linkType: hard
4242

43-
"@rescript/linux-arm64@npm:12.0.0-beta.3":
44-
version: 12.0.0-beta.3
45-
resolution: "@rescript/linux-arm64@npm:12.0.0-beta.3"
43+
"@rescript/linux-arm64@npm:12.3.0":
44+
version: 12.3.0
45+
resolution: "@rescript/linux-arm64@npm:12.3.0"
4646
conditions: os=linux & cpu=arm64
4747
languageName: node
4848
linkType: hard
4949

50-
"@rescript/linux-x64@npm:12.0.0-beta.1":
51-
version: 12.0.0-beta.1
52-
resolution: "@rescript/linux-x64@npm:12.0.0-beta.1"
50+
"@rescript/linux-x64@npm:12.0.0":
51+
version: 12.0.0
52+
resolution: "@rescript/linux-x64@npm:12.0.0"
5353
conditions: os=linux & cpu=x64
5454
languageName: node
5555
linkType: hard
5656

57-
"@rescript/linux-x64@npm:12.0.0-beta.3":
58-
version: 12.0.0-beta.3
59-
resolution: "@rescript/linux-x64@npm:12.0.0-beta.3"
57+
"@rescript/linux-x64@npm:12.3.0":
58+
version: 12.3.0
59+
resolution: "@rescript/linux-x64@npm:12.3.0"
6060
conditions: os=linux & cpu=x64
6161
languageName: node
6262
linkType: hard
6363

64+
"@rescript/runtime@npm:12.0.0":
65+
version: 12.0.0
66+
resolution: "@rescript/runtime@npm:12.0.0"
67+
checksum: 10c0/32121f3a78154cf9ab8ae4939819b9807d4a70552d7c2594872f838456c63026eddca4d6b562220fe5431d56afa96e0e276f09e5d9028b15b03f2570a52f1d30
68+
languageName: node
69+
linkType: hard
70+
71+
"@rescript/runtime@npm:12.3.0":
72+
version: 12.3.0
73+
resolution: "@rescript/runtime@npm:12.3.0"
74+
checksum: 10c0/6d7b58078cec4444a3abd50fdb2ef35dfcc155c45cf824219dbc20180caef1aa891b10f4edf0c13396f7438023014eff0ab9289c9c8fae31d1a6e9d3849924a4
75+
languageName: node
76+
linkType: hard
77+
6478
"@rescript/webapi@npm:0.1.0-experimental-73e6a0d":
6579
version: 0.1.0-experimental-73e6a0d
6680
resolution: "@rescript/webapi@npm:0.1.0-experimental-73e6a0d"
@@ -79,16 +93,16 @@ __metadata:
7993
languageName: node
8094
linkType: hard
8195

82-
"@rescript/win32-x64@npm:12.0.0-beta.1":
83-
version: 12.0.0-beta.1
84-
resolution: "@rescript/win32-x64@npm:12.0.0-beta.1"
96+
"@rescript/win32-x64@npm:12.0.0":
97+
version: 12.0.0
98+
resolution: "@rescript/win32-x64@npm:12.0.0"
8599
conditions: os=win32 & cpu=x64
86100
languageName: node
87101
linkType: hard
88102

89-
"@rescript/win32-x64@npm:12.0.0-beta.3":
90-
version: 12.0.0-beta.3
91-
resolution: "@rescript/win32-x64@npm:12.0.0-beta.3"
103+
"@rescript/win32-x64@npm:12.3.0":
104+
version: 12.3.0
105+
resolution: "@rescript/win32-x64@npm:12.3.0"
92106
conditions: os=win32 & cpu=x64
93107
languageName: node
94108
linkType: hard
@@ -149,7 +163,7 @@ __metadata:
149163
version: 0.0.0-use.local
150164
resolution: "@testrepo/nohoist@workspace:packages/nohoist"
151165
dependencies:
152-
rescript: "npm:12.0.0-beta.3"
166+
rescript: "npm:12.3.0"
153167
rescript-bun: "patch:rescript-bun@npm%3A2.1.0#~/.yarn/patches/rescript-bun-npm-2.1.0-d9adc91a04.patch"
154168
languageName: unknown
155169
linkType: soft
@@ -218,15 +232,16 @@ __metadata:
218232
languageName: node
219233
linkType: hard
220234

221-
"rescript@npm:12.0.0-beta.1, rescript@npm:^12.0.0-alpha.13":
222-
version: 12.0.0-beta.1
223-
resolution: "rescript@npm:12.0.0-beta.1"
235+
"rescript@npm:12.0.0":
236+
version: 12.0.0
237+
resolution: "rescript@npm:12.0.0"
224238
dependencies:
225-
"@rescript/darwin-arm64": "npm:12.0.0-beta.1"
226-
"@rescript/darwin-x64": "npm:12.0.0-beta.1"
227-
"@rescript/linux-arm64": "npm:12.0.0-beta.1"
228-
"@rescript/linux-x64": "npm:12.0.0-beta.1"
229-
"@rescript/win32-x64": "npm:12.0.0-beta.1"
239+
"@rescript/darwin-arm64": "npm:12.0.0"
240+
"@rescript/darwin-x64": "npm:12.0.0"
241+
"@rescript/linux-arm64": "npm:12.0.0"
242+
"@rescript/linux-x64": "npm:12.0.0"
243+
"@rescript/runtime": "npm:12.0.0"
244+
"@rescript/win32-x64": "npm:12.0.0"
230245
dependenciesMeta:
231246
"@rescript/darwin-arm64":
232247
optional: true
@@ -244,19 +259,20 @@ __metadata:
244259
rescript: cli/rescript.js
245260
rescript-legacy: cli/rescript-legacy.js
246261
rescript-tools: cli/rescript-tools.js
247-
checksum: 10c0/ec18e0ccd0791dec7b2bfaa44e0a011e1f171025d0743e06b51f7f4d81c8333bdf3b02f47b72f5b9a5cfa409bdf51e64998833696314e77b6f51afe376a4c3ad
262+
checksum: 10c0/8fc92a806d86825fe593cc2c23accc39c95236b4885f9c6d9874fc1b375dd6dd07f8a99ef4c8bbbb273a6f44d47439b5cb4a62577a57ab9ecb0c7ad15021846c
248263
languageName: node
249264
linkType: hard
250265

251-
"rescript@npm:12.0.0-beta.3":
252-
version: 12.0.0-beta.3
253-
resolution: "rescript@npm:12.0.0-beta.3"
266+
"rescript@npm:12.3.0, rescript@npm:^12.0.0-alpha.13":
267+
version: 12.3.0
268+
resolution: "rescript@npm:12.3.0"
254269
dependencies:
255-
"@rescript/darwin-arm64": "npm:12.0.0-beta.3"
256-
"@rescript/darwin-x64": "npm:12.0.0-beta.3"
257-
"@rescript/linux-arm64": "npm:12.0.0-beta.3"
258-
"@rescript/linux-x64": "npm:12.0.0-beta.3"
259-
"@rescript/win32-x64": "npm:12.0.0-beta.3"
270+
"@rescript/darwin-arm64": "npm:12.3.0"
271+
"@rescript/darwin-x64": "npm:12.3.0"
272+
"@rescript/linux-arm64": "npm:12.3.0"
273+
"@rescript/linux-x64": "npm:12.3.0"
274+
"@rescript/runtime": "npm:12.3.0"
275+
"@rescript/win32-x64": "npm:12.3.0"
260276
dependenciesMeta:
261277
"@rescript/darwin-arm64":
262278
optional: true
@@ -274,7 +290,7 @@ __metadata:
274290
rescript: cli/rescript.js
275291
rescript-legacy: cli/rescript-legacy.js
276292
rescript-tools: cli/rescript-tools.js
277-
checksum: 10c0/da264d99199f600dcaf78d8907b70200333dc1cc3a45a52f2fa2c72e2f5f393a8dedd01ebbcf46de94cbbe59a997a4685d6e20648739cd2234560cfb94cd7832
293+
checksum: 10c0/f16231ef95bb4371e531485c33dfd9227cbddc079c06dab9a8395d444b5e8a8cfb844e018667dfaf36465138eb832cf219f6f71c7c37b65621a5fe0db781809c
278294
languageName: node
279295
linkType: hard
280296

@@ -303,6 +319,6 @@ __metadata:
303319
version: 0.0.0-use.local
304320
resolution: "testrepo@workspace:."
305321
dependencies:
306-
rescript: "npm:12.0.0-beta.1"
322+
rescript: "npm:12.0.0"
307323
languageName: unknown
308324
linkType: soft

rewatch/tests/suite.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ if [ -n "$STALE_PIDS" ]; then
3737
fi
3838
success "No stale rescript processes found"
3939

40+
# The published ReScript versions model dependency layouts; compilation uses
41+
# the repository-built compiler and runtime. See ../testrepo/README.md.
4042
bold "Yarn install"
4143
(cd ../testrepo && yarn)
4244

0 commit comments

Comments
 (0)