Skip to content

Commit 573706c

Browse files
committed
[GR-44299] Use the new ci/common.jsonnet
PullRequest: truffleruby/3651
2 parents 0ac4374 + 6414de9 commit 573706c

File tree

5 files changed

+279
-216
lines changed

5 files changed

+279
-216
lines changed

ci.jsonnet

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ local restrict_builds_to = [];
2020
# and it would still work.
2121
local utils = import "utils.libsonnet";
2222

23-
local common = import "common.json";
23+
local common = import "ci/common.jsonnet";
2424

2525
# All builds are composed **directly** from **independent disjunct composable**
2626
# jsonnet objects defined in here. Use `+:` to make the objects or arrays
@@ -33,22 +33,13 @@ local part_definitions = {
3333

3434
use: {
3535
common: {
36-
python_version: "3", # To use the correct virtualenv
37-
3836
environment+: {
3937
path+:: [],
4038
TRUFFLERUBY_CI: "true",
4139
RUBY_BENCHMARKS: "true",
42-
MX_PYTHON: "python3.8",
4340
PATH: std.join(":", self.path + ["$PATH"]),
4441
},
4542

46-
packages+: {
47-
mx: common.mx_version,
48-
python3: "==3.8.10", # For mx
49-
"pip:ninja_syntax": "==1.7.2", # Required by NFI and mx
50-
},
51-
5243
setup+: [
5344
# We don't want to proxy any internet access
5445
[
@@ -74,18 +65,9 @@ local part_definitions = {
7465
"*.log",
7566
],
7667

77-
catch_files+: [
78-
"Graal diagnostic output saved in (?P<filename>.+\\.zip)",
79-
],
80-
8168
mx_build_options:: [],
8269
},
8370

84-
maven: {
85-
downloads+: { MAVEN_HOME: { name: "maven", version: "3.3.9" } },
86-
environment+: { path+:: ["$MAVEN_HOME/bin"] },
87-
},
88-
8971
build: {
9072
setup+: [["mx", "sversions"]] +
9173
# aot-build.log is used for the build-stats metrics, in other cases it does no harm
@@ -227,90 +209,75 @@ local part_definitions = {
227209
jdk: {
228210
local with_path = { environment+: { path+:: ["$JAVA_HOME/bin"] } },
229211

230-
v17: with_path {
231-
downloads+: {
232-
JAVA_HOME: common.jdks["labsjdk-ce-17"],
233-
},
212+
v17: with_path + common.jdks.labsjdk17ce + {
234213
environment+: {
235214
JT_JDK: "17",
236215
},
237216
},
238217

239-
v20: with_path {
240-
downloads+: {
241-
JAVA_HOME: common.jdks["labsjdk-ce-20"],
242-
},
218+
v20: with_path + common.jdks.labsjdk20ce + {
243219
environment+: {
244220
JT_JDK: "20",
245221
},
246222
},
247223
},
248224

249225
platform: {
250-
local linux_amd64_deps = common.sulong.deps.common + {
226+
local linux_amd64_deps = common.deps.sulong + {
251227
packages+: {
252-
git: ">=1.8.3",
253228
binutils: ">=2.30",
254229
ruby: "==" + mri_version,
255230
},
256231
},
257232

258-
local linux_aarch64_deps = common.sulong.deps.common + {
233+
local linux_aarch64_deps = common.deps.sulong + {
259234
packages+: {
260235
ruby: "==3.0.2",
261236
},
262237
},
263238

264-
local darwin_amd64_deps = common.sulong.deps.common + {
239+
local darwin_amd64_deps = common.deps.sulong + {
265240
packages+: {
266241
ruby: "==3.0.2",
267242
},
268243
},
269244

270-
local darwin_aarch64_deps = common.sulong.deps.common + {
245+
local darwin_aarch64_deps = common.deps.sulong + {
271246
packages+: {
272247
ruby: "==3.0.2",
273248
},
274249
},
275250

276-
linux: linux_amd64_deps + {
251+
linux: common.linux_amd64 + linux_amd64_deps + {
277252
platform_name:: "LinuxAMD64",
278-
platform: "linux",
279-
arch:: "amd64",
280253
"$.cap":: {
281-
normal_machine: ["linux", "amd64"],
254+
normal_machine: [],
282255
bench_machine: ["x52"] + self.normal_machine + ["no_frequency_scaling"],
283256
},
284257
docker: {
285258
image: "buildslave_ol7",
286259
mount_modules: true,
287260
},
288261
},
289-
linux_aarch64: linux_aarch64_deps + {
262+
linux_aarch64: common.linux_aarch64 + linux_aarch64_deps + {
290263
platform_name:: "LinuxAArch64",
291-
platform: "linux",
292-
arch:: "aarch64",
293264
"$.cap":: {
294-
normal_machine: ["linux", "aarch64"],
265+
normal_machine: [],
295266
},
296267
},
297-
darwin_amd64: darwin_amd64_deps + {
268+
darwin_amd64: common.darwin_amd64 + darwin_amd64_deps + {
298269
platform_name:: "DarwinAMD64",
299-
platform: "darwin",
300-
arch:: "amd64",
301270
"$.cap":: {
302-
normal_machine: ["darwin_mojave", "amd64"],
271+
normal_machine: ["darwin_mojave"],
303272
},
304273
environment+: {
305274
LANG: "en_US.UTF-8",
306275
},
307276
},
308-
darwin_aarch64: darwin_aarch64_deps + {
277+
darwin_aarch64: common.darwin_aarch64 + darwin_aarch64_deps + {
309278
platform_name:: "DarwinAArch64",
310-
platform: "darwin",
311-
arch:: "aarch64",
312279
"$.cap":: {
313-
normal_machine: ["darwin", "aarch64"],
280+
normal_machine: [],
314281
},
315282
environment+: {
316283
LANG: "en_US.UTF-8",
@@ -420,14 +387,14 @@ local part_definitions = {
420387
],
421388
run+: [
422389
["env",
423-
"LD_LIBRARY_PATH=$BUILD_DIR/graal/sulong/mxbuild/" + self.platform + "-" + self.arch + "/SULONG_HOME/native/lib:$LD_LIBRARY_PATH", # for finding libc++
390+
"LD_LIBRARY_PATH=$BUILD_DIR/graal/sulong/mxbuild/" + self.os + "-" + self.arch + "/SULONG_HOME/native/lib:$LD_LIBRARY_PATH", # for finding libc++
424391
"PATH=$TOOLCHAIN_PATH:$PATH",
425392
"ruby", "tool/generate-native-config.rb"],
426393
["cat", "src/main/java/org/truffleruby/platform/" + self.platform_name + "NativeConfiguration.java"],
427394

428395
# Uses the system compiler as using the toolchain for this does not work on macOS
429396
["tool/generate-config-header.sh"],
430-
["cat", "lib/cext/include/truffleruby/config_" + self.platform + "_" + self.arch + ".h"],
397+
["cat", "lib/cext/include/truffleruby/config_" + self.os + "_" + self.arch + ".h"],
431398
],
432399
},
433400

@@ -535,7 +502,7 @@ local part_definitions = {
535502
};
536503

537504
# composition_environment inherits from part_definitions all building blocks
538-
# (parts) can be addressed using jsonnet root syntax e.g. $.use.maven
505+
# (parts) can be addressed using jsonnet root syntax e.g. $.use.build
539506
local composition_environment = utils.add_inclusion_tracking(part_definitions, "$", false) {
540507

541508
test_builds:
@@ -779,7 +746,7 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
779746
$.<group_name>.<part_name>
780747
- Each part is included in a build at most once. A helper function is
781748
checking it and will raise an error otherwise with a message
782-
`Parts ["$.use.maven", "$.use.maven"] are used more than once in build: ruby-metrics-svm-graal-core. ...`
749+
`Parts ["$.use.build", "$.use.build"] are used more than once in build: ruby-metrics-svm-graal-core. ...`
783750
- All parts have to be disjoint and distinct.
784751
- All parts have to be compose-able with each other. Therefore all fields
785752
like setup or run should end with '+' to avoid overriding.

0 commit comments

Comments
 (0)