Skip to content

Commit d2f7b7a

Browse files
committed
[GR-37257] Bringup on darwin-aarch64
PullRequest: truffleruby/3348
2 parents ea64d1f + 54ab458 commit d2f7b7a

File tree

21 files changed

+1366
-53
lines changed

21 files changed

+1366
-53
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
New features:
44

5+
* Add support for `darwin-aarch64` (macOS M1) (#2181, @lewurm, @chrisseaton, @eregon).
56

67
Bug fixes:
78

@@ -558,7 +559,7 @@ New features:
558559
* `foreign_object.to_s` now uses `InteropLibrary#toDisplayString()` (and still `asString()` if `isString()`).
559560
* `foreign_object.inspect` has been improved to be more useful (include the language and meta object).
560561
* `foreign_object.class` now calls `getMetaObject()` (except for Java classes, same as before).
561-
* Add basic support for Linux ARM64.
562+
* Add basic support for Linux AArch64.
562563
* `foreign_object.name = value` will now call `Interoplibrary#writeMember("name", value)` instead of `invokeMember("name=", value)`.
563564
* Always show the Ruby core library files in backtraces (#1414).
564565
* The Java stacktrace is now shown when sending SIGQUIT to the process, also on TruffleRuby Native, see [Debugging](doc/user/debugging.md) for details (#2041).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ TruffleRuby is actively tested on the following systems:
9696
Architectures:
9797

9898
* AMD64 (aka `x86_64`): Supported
99-
* AArch64 (aka `arm64`): Supported on Linux (from 21.2)
99+
* AArch64 (aka `arm64`): Supported on Linux (from 21.2) and on macOS (from 22.2)
100100

101101
You may find that TruffleRuby will not work if you severely restrict the
102102
environment, for example, by unmounting system filesystems such as `/dev/shm`.

ci.jsonnet

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -199,27 +199,28 @@ local part_definitions = {
199199
HOST_VM_CONFIG: "graal-enterprise",
200200
},
201201
},
202-
local svm = {
202+
gdb_svm: {
203203
downloads+: {
204204
GDB: { name: "gdb", version: "7.11.1", platformspecific: true },
205205
},
206206
environment+: {
207207
GDB_BIN: "$GDB/bin/gdb",
208-
HOST_VM: "svm",
209208
},
210209
},
211210
native: {
212211
mx_env:: "native",
213212
environment+: {
213+
HOST_VM: "svm",
214214
HOST_VM_CONFIG: "graal-core",
215215
},
216-
} + svm,
216+
},
217217
native_ee: {
218218
mx_env:: "native-ee",
219219
environment+: {
220+
HOST_VM: "svm",
220221
HOST_VM_CONFIG: "graal-enterprise",
221222
},
222-
} + svm,
223+
},
223224
},
224225

225226
jdk: {
@@ -248,7 +249,13 @@ local part_definitions = {
248249
},
249250
},
250251

251-
local darwin_deps = common.sulong.deps.darwin_amd64 + {
252+
local darwin_amd64_deps = common.sulong.deps.darwin_amd64 + {
253+
packages+: {
254+
ruby: "==3.0.2",
255+
},
256+
},
257+
258+
local darwin_aarch64_deps = common.sulong.deps.darwin_aarch64 + {
252259
packages+: {
253260
ruby: "==3.0.2",
254261
},
@@ -263,15 +270,15 @@ local part_definitions = {
263270
bench_machine: ["x52"] + self.normal_machine + ["no_frequency_scaling"],
264271
},
265272
},
266-
linux_arm64: linux_deps + {
267-
platform_name:: "LinuxARM64",
273+
linux_aarch64: linux_deps + {
274+
platform_name:: "LinuxAArch64",
268275
platform: "linux",
269276
arch:: "aarch64",
270277
"$.cap":: {
271278
normal_machine: ["linux", "aarch64"],
272279
},
273280
},
274-
darwin: darwin_deps + {
281+
darwin_amd64: darwin_amd64_deps + {
275282
platform_name:: "DarwinAMD64",
276283
platform: "darwin",
277284
arch:: "amd64",
@@ -282,6 +289,17 @@ local part_definitions = {
282289
LANG: "en_US.UTF-8",
283290
},
284291
},
292+
darwin_aarch64: darwin_aarch64_deps + {
293+
platform_name:: "DarwinAArch64",
294+
platform: "darwin",
295+
arch:: "aarch64",
296+
"$.cap":: {
297+
normal_machine: ["darwin", "aarch64"],
298+
},
299+
environment+: {
300+
LANG: "en_US.UTF-8",
301+
},
302+
},
285303
},
286304

287305
cap: {
@@ -502,34 +520,42 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
502520
local native_config = $.run.generate_native_config + $.run.check_native_config,
503521
local native_tests = $.run.testdownstream_aot + $.run.test_integration + $.run.test_compiler,
504522

505-
// Order: platform, jdk, mx_env. Keep aligned for an easy visual comparison.
506-
"ruby-test-specs-linux-11": $.platform.linux + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" },
507-
"ruby-test-specs-linux-17": $.platform.linux + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" },
508-
"ruby-test-specs-darwin-11": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" },
509-
"ruby-test-specs-darwin-17": $.platform.darwin + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" },
510-
"ruby-test-fast-linux-arm64": $.platform.linux_arm64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + native_config + { timelimit: "45:00" },
511-
"ruby-test-fast-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + { timelimit: "45:00" }, # To catch missing slow tags
512-
"ruby-test-mri-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" },
513-
"ruby-test-mri-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" },
514-
"ruby-test-integration-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_integration,
515-
"ruby-test-cexts-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.use.sqlite331 + $.run.test_cexts,
516-
"ruby-test-cexts-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" },
517-
"ruby-test-gems-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
518-
"ruby-test-gems-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
519-
"ruby-test-ecosystem-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.node + $.use.sqlite331 + $.use.gem_test_pack + $.run.test_ecosystem,
520-
"ruby-test-standalone-linux": $.platform.linux + $.jdk.v11+ gate_no_build + $.run.test_make_standalone_distribution,
523+
# Order: platform, jdk, mx_env. Keep aligned for an easy visual comparison.
524+
"ruby-test-specs-linux-11": $.platform.linux + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" },
525+
"ruby-test-specs-linux-17": $.platform.linux + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" },
526+
"ruby-test-specs-darwin-amd64-11": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" },
527+
"ruby-test-specs-darwin-amd64-17": $.platform.darwin_amd64 + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" },
528+
"ruby-test-specs-darwin-aarch64-11": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" },
529+
"ruby-test-specs-darwin-aarch64-17": $.platform.darwin_aarch64 + $.jdk.v17 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" },
530+
"ruby-test-fast-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + native_config + { timelimit: "45:00" },
531+
"ruby-test-fast-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + { timelimit: "45:00" }, # To catch missing slow tags
532+
"ruby-test-mri-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" },
533+
"ruby-test-mri-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" },
534+
"ruby-test-mri-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" },
535+
"ruby-test-mri-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" },
536+
"ruby-test-integration-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_integration,
537+
"ruby-test-cexts-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.use.sqlite331 + $.run.test_cexts,
538+
"ruby-test-cexts-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" },
539+
"ruby-test-cexts-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" },
540+
"ruby-test-gems-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
541+
"ruby-test-gems-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
542+
"ruby-test-gems-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
543+
"ruby-test-ecosystem-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.node + $.use.sqlite331 + $.use.gem_test_pack + $.run.test_ecosystem,
544+
"ruby-test-standalone-linux": $.platform.linux + $.jdk.v11+ gate_no_build + $.run.test_make_standalone_distribution,
521545

522546
"ruby-test-compiler-graal-core-11": $.platform.linux + $.jdk.v11 + $.env.jvm_ce + gate + $.use.truffleruby + $.run.test_compiler,
523547
"ruby-test-compiler-graal-core-17": $.platform.linux + $.jdk.v17 + $.env.jvm_ce + gate + $.use.truffleruby + $.run.test_compiler,
524548
"ruby-test-compiler-graal-enterprise-11": $.platform.linux + $.jdk.v11 + $.env.jvm_ee + gate + $.use.truffleruby + $.run.test_compiler,
525549
"ruby-test-compiler-graal-enterprise-17": $.platform.linux + $.jdk.v17 + $.env.jvm_ee + gate + $.use.truffleruby + $.run.test_compiler,
526550

527-
"ruby-test-svm-graal-core-linux-11": $.platform.linux + $.jdk.v11 + $.env.native + gate + native_tests,
528-
"ruby-test-svm-graal-core-linux-17": $.platform.linux + $.jdk.v17 + $.env.native + gate + native_tests,
529-
"ruby-test-svm-graal-core-darwin-11": $.platform.darwin + $.jdk.v11 + $.env.native + gate + native_tests,
530-
"ruby-test-svm-graal-core-darwin-17": $.platform.darwin + $.jdk.v17 + $.env.native + gate + native_tests,
531-
"ruby-test-svm-graal-enterprise-linux": $.platform.linux + $.jdk.v11 + $.env.native_ee + gate + native_tests,
532-
"ruby-test-svm-graal-enterprise-darwin": $.platform.darwin + $.jdk.v11 + $.env.native_ee + gate + native_tests,
551+
"ruby-test-svm-graal-core-linux-11": $.platform.linux + $.jdk.v11 + $.env.native + $.env.gdb_svm + gate + native_tests,
552+
"ruby-test-svm-graal-core-linux-17": $.platform.linux + $.jdk.v17 + $.env.native + $.env.gdb_svm + gate + native_tests,
553+
"ruby-test-svm-graal-core-darwin-amd64-11": $.platform.darwin_amd64 + $.jdk.v11 + $.env.native + $.env.gdb_svm + gate + native_tests,
554+
"ruby-test-svm-graal-core-darwin-amd64-17": $.platform.darwin_amd64 + $.jdk.v17 + $.env.native + $.env.gdb_svm + gate + native_tests,
555+
"ruby-test-svm-graal-core-darwin-aarch64-11": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.native + gate + native_tests,
556+
"ruby-test-svm-graal-core-darwin-aarch64-17": $.platform.darwin_aarch64 + $.jdk.v17 + $.env.native + gate + native_tests,
557+
"ruby-test-svm-graal-enterprise-linux": $.platform.linux + $.jdk.v11 + $.env.native_ee + $.env.gdb_svm + gate + native_tests,
558+
"ruby-test-svm-graal-enterprise-darwin-aarch64 ": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.native_ee + gate + native_tests,
533559
},
534560

535561
local other_rubies = {
@@ -545,8 +571,8 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
545571
local svm_configurations = {
546572
local shared = $.cap.bench + $.cap.daily + $.use.truffleruby + $.use.build,
547573

548-
"svm-graal-core": shared + $.env.native,
549-
"svm-graal-enterprise": shared + $.env.native_ee,
574+
"svm-graal-core": shared + $.env.native + $.env.gdb_svm,
575+
"svm-graal-enterprise": shared + $.env.native_ee + $.env.gdb_svm,
550576
},
551577

552578
bench_builds:
@@ -700,9 +726,10 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
700726
manual_builds: {
701727
local shared = $.use.common + $.cap.manual + { timelimit: "15:00" },
702728

703-
"ruby-generate-native-config-linux-amd64": $.platform.linux + $.jdk.v11 + shared + $.run.generate_native_config,
704-
"ruby-generate-native-config-linux-aarch64": $.platform.linux_arm64 + $.jdk.v11 + shared + $.run.generate_native_config,
705-
"ruby-generate-native-config-darwin-amd64": $.platform.darwin + $.jdk.v11 + shared + $.run.generate_native_config,
729+
"ruby-generate-native-config-linux-amd64": $.platform.linux + $.jdk.v11 + shared + $.run.generate_native_config,
730+
"ruby-generate-native-config-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + shared + $.run.generate_native_config,
731+
"ruby-generate-native-config-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + shared + $.run.generate_native_config,
732+
"ruby-generate-native-config-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + shared + $.run.generate_native_config,
706733
},
707734

708735
builds:

lib/cext/ABI_check.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2
1+
3

lib/cext/include/ruby/config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#if defined(__x86_64__)
55
#include <truffleruby/config_darwin_amd64.h>
6+
#elif defined(__aarch64__)
7+
#include <truffleruby/config_darwin_aarch64.h>
68
#else
79
#error Unsupported platform
810
#endif

0 commit comments

Comments
 (0)