Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-37257] Bringup on darwin-aarch64 #2657

Merged
merged 13 commits into from
May 30, 2022
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

New features:

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

Bug fixes:

Expand Down Expand Up @@ -554,7 +555,7 @@ New features:
* `foreign_object.to_s` now uses `InteropLibrary#toDisplayString()` (and still `asString()` if `isString()`).
* `foreign_object.inspect` has been improved to be more useful (include the language and meta object).
* `foreign_object.class` now calls `getMetaObject()` (except for Java classes, same as before).
* Add basic support for Linux ARM64.
* Add basic support for Linux AArch64.
* `foreign_object.name = value` will now call `Interoplibrary#writeMember("name", value)` instead of `invokeMember("name=", value)`.
* Always show the Ruby core library files in backtraces (#1414).
* 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).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ TruffleRuby is actively tested on the following systems:
Architectures:

* AMD64 (aka `x86_64`): Supported
* AArch64 (aka `arm64`): Supported on Linux (from 21.2)
* AArch64 (aka `arm64`): Supported on Linux (from 21.2) and on macOS (from 22.2)

You may find that TruffleRuby will not work if you severely restrict the
environment, for example, by unmounting system filesystems such as `/dev/shm`.
Expand Down
97 changes: 62 additions & 35 deletions ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -199,27 +199,28 @@ local part_definitions = {
HOST_VM_CONFIG: "graal-enterprise",
},
},
local svm = {
gdb_svm: {
downloads+: {
GDB: { name: "gdb", version: "7.11.1", platformspecific: true },
},
environment+: {
GDB_BIN: "$GDB/bin/gdb",
HOST_VM: "svm",
},
},
native: {
mx_env:: "native",
environment+: {
HOST_VM: "svm",
HOST_VM_CONFIG: "graal-core",
},
} + svm,
},
native_ee: {
mx_env:: "native-ee",
environment+: {
HOST_VM: "svm",
HOST_VM_CONFIG: "graal-enterprise",
},
} + svm,
},
},

jdk: {
Expand Down Expand Up @@ -248,7 +249,13 @@ local part_definitions = {
},
},

local darwin_deps = common.sulong.deps.darwin_amd64 + {
local darwin_amd64_deps = common.sulong.deps.darwin_amd64 + {
packages+: {
ruby: "==3.0.2",
},
},

local darwin_aarch64_deps = common.sulong.deps.darwin_aarch64 + {
packages+: {
ruby: "==3.0.2",
},
Expand All @@ -263,15 +270,15 @@ local part_definitions = {
bench_machine: ["x52"] + self.normal_machine + ["no_frequency_scaling"],
},
},
linux_arm64: linux_deps + {
platform_name:: "LinuxARM64",
linux_aarch64: linux_deps + {
platform_name:: "LinuxAArch64",
platform: "linux",
arch:: "aarch64",
"$.cap":: {
normal_machine: ["linux", "aarch64"],
},
},
darwin: darwin_deps + {
darwin_amd64: darwin_amd64_deps + {
platform_name:: "DarwinAMD64",
platform: "darwin",
arch:: "amd64",
Expand All @@ -282,6 +289,17 @@ local part_definitions = {
LANG: "en_US.UTF-8",
},
},
darwin_aarch64: darwin_aarch64_deps + {
platform_name:: "DarwinAArch64",
platform: "darwin",
arch:: "aarch64",
"$.cap":: {
normal_machine: ["darwin", "aarch64"],
},
environment+: {
LANG: "en_US.UTF-8",
},
},
},

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

// Order: platform, jdk, mx_env. Keep aligned for an easy visual comparison.
"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" },
"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" },
"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" },
"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" },
"ruby-test-fast-linux-arm64": $.platform.linux_arm64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + native_config + { timelimit: "45:00" },
"ruby-test-fast-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + { timelimit: "45:00" }, # To catch missing slow tags
"ruby-test-mri-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" },
"ruby-test-mri-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" },
"ruby-test-integration-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_integration,
"ruby-test-cexts-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.use.sqlite331 + $.run.test_cexts,
"ruby-test-cexts-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" },
"ruby-test-gems-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
"ruby-test-gems-darwin": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
"ruby-test-ecosystem-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.node + $.use.sqlite331 + $.use.gem_test_pack + $.run.test_ecosystem,
"ruby-test-standalone-linux": $.platform.linux + $.jdk.v11+ gate_no_build + $.run.test_make_standalone_distribution,
# Order: platform, jdk, mx_env. Keep aligned for an easy visual comparison.
"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" },
"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" },
"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" },
"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" },
"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" },
"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" },
"ruby-test-fast-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + native_config + { timelimit: "45:00" },
"ruby-test-fast-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + { timelimit: "45:00" }, # To catch missing slow tags
"ruby-test-mri-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" },
"ruby-test-mri-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:10:00" },
"ruby-test-mri-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" },
"ruby-test-mri-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_mri + { timelimit: "01:30:00" },
"ruby-test-integration-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.run.test_integration,
"ruby-test-cexts-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.use.sqlite331 + $.run.test_cexts,
"ruby-test-cexts-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" },
"ruby-test-cexts-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_cexts + { timelimit: "01:20:00" },
"ruby-test-gems-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
"ruby-test-gems-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
"ruby-test-gems-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
"ruby-test-ecosystem-linux": $.platform.linux + $.jdk.v11 + $.env.jvm + gate + $.use.node + $.use.sqlite331 + $.use.gem_test_pack + $.run.test_ecosystem,
"ruby-test-standalone-linux": $.platform.linux + $.jdk.v11+ gate_no_build + $.run.test_make_standalone_distribution,

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

"ruby-test-svm-graal-core-linux-11": $.platform.linux + $.jdk.v11 + $.env.native + gate + native_tests,
"ruby-test-svm-graal-core-linux-17": $.platform.linux + $.jdk.v17 + $.env.native + gate + native_tests,
"ruby-test-svm-graal-core-darwin-11": $.platform.darwin + $.jdk.v11 + $.env.native + gate + native_tests,
"ruby-test-svm-graal-core-darwin-17": $.platform.darwin + $.jdk.v17 + $.env.native + gate + native_tests,
"ruby-test-svm-graal-enterprise-linux": $.platform.linux + $.jdk.v11 + $.env.native_ee + gate + native_tests,
"ruby-test-svm-graal-enterprise-darwin": $.platform.darwin + $.jdk.v11 + $.env.native_ee + gate + native_tests,
"ruby-test-svm-graal-core-linux-11": $.platform.linux + $.jdk.v11 + $.env.native + $.env.gdb_svm + gate + native_tests,
"ruby-test-svm-graal-core-linux-17": $.platform.linux + $.jdk.v17 + $.env.native + $.env.gdb_svm + gate + native_tests,
"ruby-test-svm-graal-core-darwin-amd64-11": $.platform.darwin_amd64 + $.jdk.v11 + $.env.native + $.env.gdb_svm + gate + native_tests,
"ruby-test-svm-graal-core-darwin-amd64-17": $.platform.darwin_amd64 + $.jdk.v17 + $.env.native + $.env.gdb_svm + gate + native_tests,
"ruby-test-svm-graal-core-darwin-aarch64-11": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.native + gate + native_tests,
"ruby-test-svm-graal-core-darwin-aarch64-17": $.platform.darwin_aarch64 + $.jdk.v17 + $.env.native + gate + native_tests,
"ruby-test-svm-graal-enterprise-linux": $.platform.linux + $.jdk.v11 + $.env.native_ee + $.env.gdb_svm + gate + native_tests,
"ruby-test-svm-graal-enterprise-darwin-aarch64 ": $.platform.darwin_aarch64 + $.jdk.v11 + $.env.native_ee + gate + native_tests,
},

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

"svm-graal-core": shared + $.env.native,
"svm-graal-enterprise": shared + $.env.native_ee,
"svm-graal-core": shared + $.env.native + $.env.gdb_svm,
"svm-graal-enterprise": shared + $.env.native_ee + $.env.gdb_svm,
},

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

"ruby-generate-native-config-linux-amd64": $.platform.linux + $.jdk.v11 + shared + $.run.generate_native_config,
"ruby-generate-native-config-linux-aarch64": $.platform.linux_arm64 + $.jdk.v11 + shared + $.run.generate_native_config,
"ruby-generate-native-config-darwin-amd64": $.platform.darwin + $.jdk.v11 + shared + $.run.generate_native_config,
"ruby-generate-native-config-linux-amd64": $.platform.linux + $.jdk.v11 + shared + $.run.generate_native_config,
"ruby-generate-native-config-linux-aarch64": $.platform.linux_aarch64 + $.jdk.v11 + shared + $.run.generate_native_config,
"ruby-generate-native-config-darwin-amd64": $.platform.darwin_amd64 + $.jdk.v11 + shared + $.run.generate_native_config,
"ruby-generate-native-config-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.v11 + shared + $.run.generate_native_config,
},

builds:
Expand Down
2 changes: 1 addition & 1 deletion lib/cext/ABI_check.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2
3
2 changes: 2 additions & 0 deletions lib/cext/include/ruby/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#if defined(__x86_64__)
#include <truffleruby/config_darwin_amd64.h>
#elif defined(__aarch64__)
#include <truffleruby/config_darwin_aarch64.h>
#else
#error Unsupported platform
#endif
Expand Down
Loading