First attempt at running on darwin aarch64 (#67103)

This PR is a first attempt to get the build to run on an Apple M1 (ARM 64 / aarch64) machine.
I think the changes are mostly reasonable, apart from some hard-coding to use the Azul JVM,
which at the time of writing seems to be the only available JVM. I'll follow up when our preferred
JVM is available.
This commit is contained in:
Rory Hunter 2021-01-11 14:10:10 +00:00 committed by GitHub
parent af179ab2f5
commit 7540259d99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 93 additions and 15 deletions

View file

@ -115,6 +115,13 @@ distribution_archives {
}
}
darwinAarch64Tar {
archiveClassifier = 'darwin-aarch64'
content {
archiveFiles(modulesFiles(false, 'darwin-aarch64'), 'tar', 'darwin', 'aarch64', false, true)
}
}
ossDarwinTar {
archiveClassifier = 'darwin-x86_64'
content {
@ -122,6 +129,13 @@ distribution_archives {
}
}
ossDarwinAarch64Tar {
archiveClassifier = 'darwin-aarch64'
content {
archiveFiles(modulesFiles(true, 'darwin-aarch64'), 'tar', 'darwin', 'aarch64', true, true)
}
}
noJdkDarwinTar {
archiveClassifier = 'no-jdk-darwin-x86_64'
content {
@ -136,6 +150,20 @@ distribution_archives {
}
}
noJdkDarwinAarch64Tar {
archiveClassifier = 'no-jdk-darwin-aarch64'
content {
archiveFiles(modulesFiles(false, 'darwin-aarch64'), 'tar', 'darwin', 'aarch64', false, false)
}
}
ossNoJdkDarwinAarch64Tar {
archiveClassifier = 'no-jdk-darwin-aarch64'
content {
archiveFiles(modulesFiles(true, 'darwin-aarch64'), 'tar', 'darwin', 'aarch64', true, false)
}
}
linuxAarch64Tar {
archiveClassifier = 'linux-aarch64'
content {
@ -184,4 +212,4 @@ subprojects {
apply plugin: 'elasticsearch.internal-distribution-archive-check'
group = "org.elasticsearch.distribution.${name.startsWith("oss-") ? "oss" : "default"}"
}
}

View file

@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -0,0 +1,2 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -304,11 +304,11 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
// Setup all required JDKs
project.jdks {
['darwin', 'windows', 'linux'].each { platform ->
(platform == 'linux' ? ['x64', 'aarch64'] : ['x64']).each { architecture ->
(platform == 'linux' || platform == 'darwin' ? ['x64', 'aarch64'] : ['x64']).each { architecture ->
"bundled_${platform}_${architecture}" {
it.platform = platform
it.version = VersionProperties.getBundledJdk(platform)
it.vendor = VersionProperties.bundledJdkVendor
it.vendor = (platform == 'darwin' && architecture == 'aarch64') ? 'azul' : VersionProperties.bundledJdkVendor
it.architecture = architecture
}
}
@ -369,7 +369,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
modulesFiles = { oss, platform ->
copySpec {
eachFile {
if (it.relativePath.segments[-2] == 'bin' || (platform == 'darwin-x86_64' && it.relativePath.segments[-2] == 'MacOS')) {
if (it.relativePath.segments[-2] == 'bin' || ((platform == 'darwin-x86_64' || platform == 'darwin-aarch64') && it.relativePath.segments[-2] == 'MacOS')) {
// bin files, wherever they are within modules (eg platform specific) should be executable
// and MacOS is an alternative to bin on macOS
it.mode = 0755
@ -383,7 +383,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
} else {
buildModules = buildDefaultModulesTaskProvider
}
List excludePlatforms = ['linux-x86_64', 'linux-aarch64', 'windows-x86_64', 'darwin-x86_64']
List excludePlatforms = ['linux-x86_64', 'linux-aarch64', 'windows-x86_64', 'darwin-x86_64', 'darwin-aarch64']
if (platform != null) {
excludePlatforms.remove(excludePlatforms.indexOf(platform))
} else {
@ -675,6 +675,7 @@ subprojects {
['archives:windows-zip', 'archives:oss-windows-zip',
'archives:darwin-tar', 'archives:oss-darwin-tar',
'archives:darwin-aarch64-tar', 'archives:oss-darwin-aarch64-tar',
'archives:linux-aarch64-tar', 'archives:oss-linux-aarch64-tar',
'archives:linux-tar', 'archives:oss-linux-tar',
'archives:integ-test-zip',