Skip to content

Commit 9989c3a

Browse files
committed
[GR-16229] ci utils
PullRequest: graalpython/534
2 parents 673fbca + 73de9a7 commit 9989c3a

File tree

5 files changed

+37
-11
lines changed

5 files changed

+37
-11
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local const = import 'ci_common/constants.libsonnet';
33
local builder = import 'ci_common/builder.libsonnet';
44

55
{
6-
overlay: "123dda879b0003af4b8d529e71fceb15bb26e94e",
6+
overlay: "5c24d0dc41c15d1f00635f91c50c51e8cefae33e",
77

88
// ======================================================================================================
99
//

ci_common/builder.libsonnet

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,17 @@ local mixins = import 'mixins.libsonnet';
6262
testGateTime(type, platform, timelimit)::
6363
baseGraalGate + {tags:: "python-"+type} + mixins.getPlatform(platform) + {name: "python-"+ type +"-"+platform} + {timelimit: timelimit},
6464

65-
local styleGate = baseGraalGate + mixins.eclipse + mixins.linux + {
66-
tags:: "style,fullbuild,python-license",
65+
local baseStyleGate = baseGraalGate + mixins.eclipse + mixins.linux + {
66+
tags:: "style",
6767
name: "python-style",
6868

6969
timelimit: const.TIME_LIMIT["1h"],
7070
},
71+
baseStyleGate:: baseStyleGate,
72+
73+
local styleGate = baseStyleGate + {
74+
tags:: super.tags + ",fullbuild,python-license",
75+
},
7176
styleGate:: styleGate,
7277

7378
local graalVmGate = baseGraalGate + mixins.linux {

ci_common/utils.libsonnet

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,27 @@
1717
// utility for array contains
1818
contains(array, value)::
1919
std.count(array, value) > 0,
20+
21+
// validation
22+
isGraalVmVm(name)::
23+
std.startsWith(name, "graalvm_"),
24+
25+
isGraalPythonVm(name)::
26+
std.startsWith(name, "graalpython"),
27+
28+
isBaselineVm(name)::
29+
std.startsWith(name, "cpython") || std.startsWith(name, "pypy"),
30+
31+
local isBuilder = function(builder)
32+
std.objectHas(builder, "run"),
33+
isBuilder:: isBuilder,
34+
35+
// make a builder run with a given primary suite
36+
withPrimarySuite(suite, builder)::
37+
if (std.type(builder) == 'array') then [
38+
b + (if isBuilder(b) then {environment +: {'MX_PRIMARY_SUITE_PATH': suite}} else {})
39+
for b in builder
40+
]
41+
else
42+
builder + (if (isBuilder(builder)) then {environment +: {'MX_PRIMARY_SUITE_PATH': suite}} else {}),
2043
}

mx.graalpython/mx_graalpython.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -908,16 +908,14 @@ def import_python_sources(args):
908908
# add ci verification util
909909
#
910910
# ----------------------------------------------------------------------------------------------------------------------
911-
def verify_ci(dest_suite, args=None):
911+
def verify_ci(dest_suite, common_ci_dir="ci_common", args=None, ext=('.jsonnet', '.libsonnet')):
912912
"""Verify CI configuration"""
913913
base_suite = SUITE
914-
if not isinstance(dest_suite, mx.SourceSuite) or not isinstance(base_suite, mx.SourceSuite):
915-
raise mx.abort("Can not use verify-ci on binary suites: {} and {} need to be source suites".format(
916-
SUITE.name, dest_suite.name))
917914
assert isinstance(base_suite, mx.SourceSuite)
918-
for ext in [".libsonnet", ".jsonnet"]:
919-
mx.log("CI setup verifying *{} files ... ".format(ext))
920-
mx.verify_ci(args, base_suite, dest_suite, common_dirs=['ci_common'], extension=ext)
915+
916+
ci_files = mx.suite_ci_files(SUITE, common_ci_dir, extension=ext)
917+
mx.log("CI setup checking common file(s): \n\t{0}".format('\n\t'.join(map(str, ci_files))))
918+
mx.verify_ci(args, base_suite, dest_suite, common_file=ci_files)
921919

922920

923921
# ----------------------------------------------------------------------------------------------------------------------

mx.graalpython/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# METADATA
66
#
77
# --------------------------------------------------------------------------------------------------------------
8-
"mxversion": "5.211.0",
8+
"mxversion": "5.219.2",
99
"name": "graalpython",
1010
"versionConflictResolution": "latest",
1111

0 commit comments

Comments
 (0)