Skip to content

Only ship Linux binaries for the correct architecture #55256

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions distribution/archives/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,25 @@ tasks.register('buildIntegTestZip', Zip) {
tasks.register('buildWindowsZip', Zip) {
configure(commonZipConfig)
archiveClassifier = 'windows-x86_64'
with archiveFiles(modulesFiles(false, 'windows'), 'zip', 'windows', 'x64', false, true)
with archiveFiles(modulesFiles(false, 'windows-x86_64'), 'zip', 'windows', 'x64', false, true)
}

tasks.register('buildOssWindowsZip', Zip) {
configure(commonZipConfig)
archiveClassifier = 'windows-x86_64'
with archiveFiles(modulesFiles(true, 'windows'), 'zip', 'windows', 'x64', true, true)
with archiveFiles(modulesFiles(true, 'windows-x86_64'), 'zip', 'windows', 'x64', true, true)
}

tasks.register('buildNoJdkWindowsZip', Zip) {
configure(commonZipConfig)
archiveClassifier = 'no-jdk-windows-x86_64'
with archiveFiles(modulesFiles(false, 'windows'), 'zip', 'windows', 'x64', false, false)
with archiveFiles(modulesFiles(false, 'windows-x86_64'), 'zip', 'windows', 'x64', false, false)
}

tasks.register('buildOssNoJdkWindowsZip', Zip) {
configure(commonZipConfig)
archiveClassifier = 'no-jdk-windows-x86_64'
with archiveFiles(modulesFiles(true, 'windows'), 'zip', 'windows', 'x64', true, false)
with archiveFiles(modulesFiles(true, 'windows-x86_64'), 'zip', 'windows', 'x64', true, false)
}

Closure commonTarConfig = {
Expand All @@ -154,61 +154,61 @@ Closure commonTarConfig = {
tasks.register('buildDarwinTar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'darwin-x86_64'
with archiveFiles(modulesFiles(false, 'darwin'), 'tar', 'darwin', 'x64', false, true)
with archiveFiles(modulesFiles(false, 'darwin-x86_64'), 'tar', 'darwin', 'x64', false, true)
}

tasks.register('buildOssDarwinTar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'darwin-x86_64'
with archiveFiles(modulesFiles(true, 'darwin'), 'tar', 'darwin', 'x64', true, true)
with archiveFiles(modulesFiles(true, 'darwin-x86_64'), 'tar', 'darwin', 'x64', true, true)
}

tasks.register('buildNoJdkDarwinTar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'no-jdk-darwin-x86_64'
with archiveFiles(modulesFiles(false, 'darwin'), 'tar', 'darwin', 'x64', false, false)
with archiveFiles(modulesFiles(false, 'darwin-x86_64'), 'tar', 'darwin', 'x64', false, false)
}

tasks.register('buildOssNoJdkDarwinTar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'no-jdk-darwin-x86_64'
with archiveFiles(modulesFiles(true, 'darwin'), 'tar', 'darwin', 'x64', true, false)
with archiveFiles(modulesFiles(true, 'darwin-x86_64'), 'tar', 'darwin', 'x64', true, false)
}

tasks.register('buildLinuxAarch64Tar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'linux-aarch64'
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'aarch64', false, true)
with archiveFiles(modulesFiles(false, 'linux-aarch64'), 'tar', 'linux', 'aarch64', false, true)
}

tasks.register('buildLinuxTar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'linux-x86_64'
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'x64', false, true)
with archiveFiles(modulesFiles(false, 'linux-x86_64'), 'tar', 'linux', 'x64', false, true)
}

tasks.register('buildOssLinuxAarch64Tar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'linux-aarch64'
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'aarch64', true, true)
with archiveFiles(modulesFiles(true, 'linux-aarch64'), 'tar', 'linux', 'aarch64', true, true)
}

tasks.register('buildOssLinuxTar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'linux-x86_64'
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'x64', true, true)
with archiveFiles(modulesFiles(true, 'linux-x86_64'), 'tar', 'linux', 'x64', true, true)
}

tasks.register('buildNoJdkLinuxTar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'no-jdk-linux-x86_64'
with archiveFiles(modulesFiles(false, 'linux'), 'tar', 'linux', 'x64', false, false)
with archiveFiles(modulesFiles(false, 'linux-x86_64'), 'tar', 'linux', 'x64', false, false)
}

tasks.register('buildOssNoJdkLinuxTar', SymbolicLinkPreservingTar) {
configure(commonTarConfig)
archiveClassifier = 'no-jdk-linux-x86_64'
with archiveFiles(modulesFiles(true, 'linux'), 'tar', 'linux', 'x64', true, false)
with archiveFiles(modulesFiles(true, 'linux-x86_64'), 'tar', 'linux', 'x64', true, false)
}

Closure tarExists = { it -> new File('/bin/tar').exists() || new File('/usr/bin/tar').exists() || new File('/usr/local/bin/tar').exists() }
Expand Down
6 changes: 3 additions & 3 deletions distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
modulesFiles = { oss, platform ->
copySpec {
eachFile {
if (it.relativePath.segments[-2] == 'bin' || (platform == 'darwin' && it.relativePath.segments[-2] == 'MacOS')) {
if (it.relativePath.segments[-2] == 'bin' || (platform == 'darwin-x86_64' && 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
Expand All @@ -310,15 +310,15 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
} else {
buildModules = project(':distribution').buildDefaultModules
}
List excludePlatforms = ['linux', 'windows', 'darwin']
List excludePlatforms = ['linux-x86_64', 'linux-aarch64', 'windows-x86_64', 'darwin-x86_64']
if (platform != null) {
excludePlatforms.remove(excludePlatforms.indexOf(platform))
} else {
excludePlatforms = []
}
from(buildModules) {
for (String excludePlatform : excludePlatforms) {
exclude "**/platform/${excludePlatform}-x86_64/**"
exclude "**/platform/${excludePlatform}/**"
}
}
if (project.path.startsWith(':distribution:packages')) {
Expand Down
2 changes: 1 addition & 1 deletion distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
with libFiles(oss)
}
into('modules') {
with modulesFiles(oss, 'linux')
with modulesFiles(oss, 'linux-' + ((architecture == 'x64') ? 'x86_64' : architecture))
}
if (jdk) {
into('jdk') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,8 @@ private XPackSettings() {
public static final Setting<Boolean> GRAPH_ENABLED = Setting.boolSetting("xpack.graph.enabled", true, Setting.Property.NodeScope);

/** Setting for enabling or disabling machine learning. Defaults to true. */
public static final Setting<Boolean> MACHINE_LEARNING_ENABLED = Setting.boolSetting(
"xpack.ml.enabled",
"aarch64".equals(System.getProperty("os.arch")) ? false : true,
value -> {
if (value && "aarch64".equals(System.getProperty("os.arch"))) {
throw new IllegalArgumentException("[xpack.ml.enabled] can not be set to [true] on [aarch64]");
}
},
Setting.Property.NodeScope);
public static final Setting<Boolean> MACHINE_LEARNING_ENABLED = Setting.boolSetting("xpack.ml.enabled", true,
Setting.Property.NodeScope);

/** Setting for enabling or disabling rollup. Defaults to true. */
public static final Setting<Boolean> ROLLUP_ENABLED = Setting.boolSetting("xpack.rollup.enabled", true,
Expand Down