Renaming CPU architecture to have consistent naming (#612)
* Renaming CPU architecture from x86_64, aarch64 to x64, arm64 Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
This commit is contained in:
parent
c5a3c3cb41
commit
0e9f74e35f
|
@ -185,7 +185,7 @@ if (project != rootProject) {
|
|||
distribution project(':distribution:archives:windows-zip')
|
||||
distribution project(':distribution:archives:darwin-tar')
|
||||
distribution project(':distribution:archives:linux-tar')
|
||||
distribution project(':distribution:archives:linux-aarch64-tar')
|
||||
distribution project(':distribution:archives:linux-arm64-tar')
|
||||
|
||||
integTestRuntimeOnly(project(":libs:opensearch-core"))
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ class DistributionDownloadPluginFuncTest extends AbstractGradleFuncTest {
|
|||
|
||||
then:
|
||||
result.tasks.size() == 3
|
||||
result.output.count("Unpacking opensearch-${version}-linux-x86_64.tar.gz " +
|
||||
result.output.count("Unpacking opensearch-${version}-linux-x64.tar.gz " +
|
||||
"using SymbolicLinkPreservingUntarTransform.") == 1
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class DistributionDownloadFixture {
|
|||
private static String urlPath(String version, OpenSearchDistribution.Platform platform) {
|
||||
String fileType = ((platform == OpenSearchDistribution.Platform.LINUX ||
|
||||
platform == OpenSearchDistribution.Platform.DARWIN)) ? "tar.gz" : "zip"
|
||||
"/releases/core/opensearch/${version}/opensearch-${version}-${platform}-x86_64.$fileType"
|
||||
"/releases/core/opensearch/${version}/opensearch-${version}-${platform}-x64.$fileType"
|
||||
}
|
||||
|
||||
private static byte[] filebytes(String urlPath) throws IOException {
|
||||
|
|
|
@ -102,7 +102,7 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest
|
|||
result.output.contains("[8.0.1] > Task :distribution:archives:darwin-tar:assemble")
|
||||
normalizedOutput(result.output)
|
||||
.contains("distfile /distribution/bwc/bugfix/build/bwc/checkout-8.0/distribution/archives/darwin-tar/" +
|
||||
"build/distributions/opensearch-8.0.1-SNAPSHOT-darwin-x86_64.tar.gz")
|
||||
"build/distributions/opensearch-8.0.1-SNAPSHOT-darwin-x64.tar.gz")
|
||||
}
|
||||
|
||||
def "bwc expanded distribution folder can be resolved as bwc project artifact"() {
|
||||
|
|
|
@ -36,7 +36,7 @@ subprojects {
|
|||
destinationDirectory.set(file('build/distributions'))
|
||||
archiveBaseName.set("opensearch")
|
||||
archiveVersion.set("8.0.1-SNAPSHOT")
|
||||
archiveClassifier.set("darwin-x86_64")
|
||||
archiveClassifier.set("darwin-x64")
|
||||
archiveExtension.set('tar.gz')
|
||||
}
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ class ClusterFormationTasks {
|
|||
|
||||
Version version = Version.fromString(opensearchVersion)
|
||||
String os = getOs()
|
||||
String classifier = "-${os}-x86_64"
|
||||
String classifier = "-${os}-x64"
|
||||
String packaging = os.equals('windows') ? 'zip' : 'tar.gz'
|
||||
String artifactName = 'opensearch'
|
||||
Object dependency
|
||||
|
|
|
@ -35,7 +35,7 @@ package org.opensearch.gradle;
|
|||
public enum Architecture {
|
||||
|
||||
X64,
|
||||
AARCH64;
|
||||
ARM64;
|
||||
|
||||
public static Architecture current() {
|
||||
final String architecture = System.getProperty("os.arch", "");
|
||||
|
@ -44,7 +44,7 @@ public enum Architecture {
|
|||
case "x86_64":
|
||||
return X64;
|
||||
case "aarch64":
|
||||
return AARCH64;
|
||||
return ARM64;
|
||||
default:
|
||||
throw new IllegalArgumentException("can not determine architecture from [" + architecture + "]");
|
||||
}
|
||||
|
|
|
@ -187,11 +187,11 @@ public class DistributionDownloadPlugin implements Plugin<Project> {
|
|||
|
||||
Version distroVersion = Version.fromString(distribution.getVersion());
|
||||
String extension = distribution.getType().toString();
|
||||
String classifier = ":x86_64";
|
||||
String classifier = ":x64";
|
||||
if (distribution.getType() == Type.ARCHIVE) {
|
||||
extension = distribution.getPlatform() == Platform.WINDOWS ? "zip" : "tar.gz";
|
||||
if (distroVersion.onOrAfter("7.0.0")) {
|
||||
classifier = ":" + distribution.getPlatform() + "-x86_64";
|
||||
classifier = ":" + distribution.getPlatform() + "-x64";
|
||||
} else {
|
||||
classifier = "";
|
||||
}
|
||||
|
|
|
@ -120,9 +120,10 @@ public class Jdk implements Buildable, Iterable<File> {
|
|||
}
|
||||
|
||||
public void setArchitecture(final String architecture) {
|
||||
if (ALLOWED_ARCHITECTURES.contains(architecture) == false) {
|
||||
String jdkArchitecture = translateJdkArchitecture(architecture);
|
||||
if (ALLOWED_ARCHITECTURES.contains(jdkArchitecture) == false) {
|
||||
throw new IllegalArgumentException(
|
||||
"unknown architecture [" + architecture + "] for jdk [" + name + "], must be one of " + ALLOWED_ARCHITECTURES
|
||||
"unknown architecture [" + jdkArchitecture + "] for jdk [" + name + "], must be one of " + ALLOWED_ARCHITECTURES
|
||||
);
|
||||
}
|
||||
this.architecture.set(architecture);
|
||||
|
@ -229,4 +230,11 @@ public class Jdk implements Buildable, Iterable<File> {
|
|||
hash = jdkVersionMatcher.group(5);
|
||||
}
|
||||
|
||||
private String translateJdkArchitecture(String architecture) {
|
||||
/*
|
||||
* Jdk uses aarch64 from ARM. Translating from arm64 to aarch64 which Jdk understands.
|
||||
*/
|
||||
return architecture == "arm64" ? "aarch64" : architecture;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
|
|||
String artifactName = "opensearch";
|
||||
|
||||
String suffix = artifactFileName.endsWith("tar.gz") ? "tar.gz" : artifactFileName.substring(artifactFileName.length() - 3);
|
||||
int archIndex = artifactFileName.indexOf("x86_64");
|
||||
int archIndex = artifactFileName.indexOf("x64");
|
||||
|
||||
bwcProject.getConfigurations().create(distributionProject.name);
|
||||
bwcProject.getArtifacts().add(distributionProject.name, distributionProject.getDistFile(), artifact -> {
|
||||
|
@ -146,7 +146,7 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
|
|||
String classifier = "";
|
||||
if (archIndex != -1) {
|
||||
int osIndex = artifactFileName.lastIndexOf('-', archIndex - 2);
|
||||
classifier = "-" + artifactFileName.substring(osIndex + 1, archIndex - 1) + "-x86_64";
|
||||
classifier = "-" + artifactFileName.substring(osIndex + 1, archIndex - 1) + "-x64";
|
||||
}
|
||||
artifact.setClassifier(classifier);
|
||||
});
|
||||
|
@ -171,7 +171,7 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
|
|||
if (name.contains("zip") || name.contains("tar")) {
|
||||
int index = name.lastIndexOf('-');
|
||||
String baseName = name.substring(0, index);
|
||||
classifier = "-" + baseName + "-x86_64";
|
||||
classifier = "-" + baseName + "-x64";
|
||||
extension = name.substring(index + 1);
|
||||
if (extension.equals("tar")) {
|
||||
extension += ".gz";
|
||||
|
@ -179,7 +179,7 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
|
|||
} else if (name.contains("deb")) {
|
||||
classifier = "-amd64";
|
||||
} else if (name.contains("rpm")) {
|
||||
classifier = "-x86_64";
|
||||
classifier = "-x64";
|
||||
}
|
||||
} else {
|
||||
extension = name.substring(4);
|
||||
|
|
|
@ -381,8 +381,8 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
)) {
|
||||
for (boolean bundledJdk : Arrays.asList(true, false)) {
|
||||
if (bundledJdk == false) {
|
||||
// We'll never publish an ARM (aarch64) build without a bundled JDK.
|
||||
if (architecture == Architecture.AARCH64) {
|
||||
// We'll never publish an ARM (arm64) build without a bundled JDK.
|
||||
if (architecture == Architecture.ARM64) {
|
||||
continue;
|
||||
}
|
||||
// All our Docker images include a bundled JDK so it doesn't make sense to test without one.
|
||||
|
|
|
@ -89,51 +89,51 @@ distribution_archives {
|
|||
}
|
||||
|
||||
windowsZip {
|
||||
archiveClassifier = 'windows-x86_64'
|
||||
archiveClassifier = 'windows-x64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', true)
|
||||
archiveFiles(modulesFiles('windows-x64'), 'zip', 'windows', 'x64', true)
|
||||
}
|
||||
}
|
||||
|
||||
noJdkWindowsZip {
|
||||
archiveClassifier = 'no-jdk-windows-x86_64'
|
||||
archiveClassifier = 'no-jdk-windows-x64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false)
|
||||
archiveFiles(modulesFiles('windows-x64'), 'zip', 'windows', 'x64', false)
|
||||
}
|
||||
}
|
||||
|
||||
darwinTar {
|
||||
archiveClassifier = 'darwin-x86_64'
|
||||
archiveClassifier = 'darwin-x64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', true)
|
||||
archiveFiles(modulesFiles('darwin-x64'), 'tar', 'darwin', 'x64', true)
|
||||
}
|
||||
}
|
||||
|
||||
noJdkDarwinTar {
|
||||
archiveClassifier = 'no-jdk-darwin-x86_64'
|
||||
archiveClassifier = 'no-jdk-darwin-x64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', false)
|
||||
archiveFiles(modulesFiles('darwin-x64'), 'tar', 'darwin', 'x64', false)
|
||||
}
|
||||
}
|
||||
|
||||
linuxAarch64Tar {
|
||||
archiveClassifier = 'linux-aarch64'
|
||||
linuxArm64Tar {
|
||||
archiveClassifier = 'linux-arm64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('linux-aarch64'), 'tar', 'linux', 'aarch64', true)
|
||||
archiveFiles(modulesFiles('linux-arm64'), 'tar', 'linux', 'arm64', true)
|
||||
}
|
||||
}
|
||||
|
||||
linuxTar {
|
||||
archiveClassifier = 'linux-x86_64'
|
||||
archiveClassifier = 'linux-x64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', true)
|
||||
archiveFiles(modulesFiles('linux-x64'), 'tar', 'linux', 'x64', true)
|
||||
}
|
||||
}
|
||||
|
||||
noJdkLinuxTar {
|
||||
archiveClassifier = 'no-jdk-linux-x86_64'
|
||||
archiveClassifier = 'no-jdk-linux-x64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false)
|
||||
archiveFiles(modulesFiles('linux-x64'), 'tar', 'linux', 'x64', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -312,7 +312,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
|||
modulesFiles = { 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-x64' && 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
|
||||
|
@ -321,7 +321,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
|||
}
|
||||
}
|
||||
def buildModules = buildModulesTaskProvider
|
||||
List excludePlatforms = ['linux-x86_64', 'linux-aarch64', 'windows-x86_64', 'darwin-x86_64']
|
||||
List excludePlatforms = ['linux-x64', 'linux-arm64', 'windows-x64', 'darwin-x64']
|
||||
if (platform != null) {
|
||||
excludePlatforms.remove(excludePlatforms.indexOf(platform))
|
||||
} else {
|
||||
|
@ -408,6 +408,12 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
|||
|
||||
jdkFiles = { Project project, String platform, String architecture ->
|
||||
return copySpec {
|
||||
/*
|
||||
* Jdk uses aarch64 from ARM. Translating from arm64 to aarch64 which Jdk understands.
|
||||
*/
|
||||
if ("arm64".equals(architecture)) {
|
||||
architecture = "aarch64"
|
||||
}
|
||||
from project.jdks."bundled_${platform}_${architecture}"
|
||||
exclude "demo/**"
|
||||
/*
|
||||
|
@ -585,11 +591,11 @@ subprojects {
|
|||
|
||||
['archives:windows-zip',
|
||||
'archives:darwin-tar',
|
||||
'archives:linux-aarch64-tar',
|
||||
'archives:linux-arm64-tar',
|
||||
'archives:linux-tar',
|
||||
'archives:integ-test-zip',
|
||||
'packages:rpm', 'packages:deb',
|
||||
'packages:aarch64-rpm', 'packages:aarch64-deb'
|
||||
'packages:arm64-rpm', 'packages:arm64-deb'
|
||||
].forEach { subName ->
|
||||
Project subproject = project("${project.path}:${subName}")
|
||||
Configuration configuration = configurations.create(subproject.name)
|
||||
|
|
|
@ -24,22 +24,22 @@ apply plugin: 'opensearch.rest-resources'
|
|||
testFixtures.useFixture()
|
||||
|
||||
configurations {
|
||||
aarch64DockerSource
|
||||
arm64DockerSource
|
||||
dockerSource
|
||||
}
|
||||
|
||||
dependencies {
|
||||
aarch64DockerSource project(path: ":distribution:archives:linux-aarch64-tar", configuration:"default")
|
||||
arm64DockerSource project(path: ":distribution:archives:linux-arm64-tar", configuration:"default")
|
||||
dockerSource project(path: ":distribution:archives:linux-tar", configuration:"default")
|
||||
}
|
||||
|
||||
ext.expansions = { Architecture architecture, DockerBase base, boolean local ->
|
||||
String classifier
|
||||
if (local) {
|
||||
if (architecture == Architecture.AARCH64) {
|
||||
classifier = "linux-aarch64"
|
||||
if (architecture == Architecture.ARM64) {
|
||||
classifier = "linux-arm64"
|
||||
} else if (architecture == Architecture.X64) {
|
||||
classifier = "linux-x86_64"
|
||||
classifier = "linux-x64"
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported architecture [" + architecture + "]")
|
||||
}
|
||||
|
@ -82,13 +82,13 @@ RUN curl --retry 8 -S -L \\
|
|||
|
||||
private static String buildPath(Architecture architecture, DockerBase base) {
|
||||
return 'build/' +
|
||||
(architecture == Architecture.AARCH64 ? 'aarch64-' : '') +
|
||||
(architecture == Architecture.ARM64 ? 'arm64-' : '') +
|
||||
'docker'
|
||||
}
|
||||
|
||||
private static String taskName(String prefix, Architecture architecture, DockerBase base, String suffix) {
|
||||
return prefix +
|
||||
(architecture == Architecture.AARCH64 ? 'Aarch64' : '') +
|
||||
(architecture == Architecture.ARM64 ? 'Arm64' : '') +
|
||||
suffix
|
||||
}
|
||||
|
||||
|
@ -123,8 +123,8 @@ void addCopyDockerContextTask(Architecture architecture, DockerBase base) {
|
|||
|
||||
with dockerBuildContext(architecture, base, true)
|
||||
|
||||
if (architecture == Architecture.AARCH64) {
|
||||
from configurations.aarch64DockerSource
|
||||
if (architecture == Architecture.ARM64) {
|
||||
from configurations.arm64DockerSource
|
||||
} else {
|
||||
from configurations.dockerSource
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ def createAndSetWritable(Object... locations) {
|
|||
|
||||
opensearch_distributions {
|
||||
Architecture.values().each { eachArchitecture ->
|
||||
"docker${ eachArchitecture == Architecture.AARCH64 ? '_aarch64' : '' }" {
|
||||
"docker${ eachArchitecture == Architecture.ARM64 ? '_arm64' : '' }" {
|
||||
architecture = eachArchitecture
|
||||
type = 'docker'
|
||||
version = VersionProperties.getOpenSearch()
|
||||
|
@ -225,10 +225,10 @@ subprojects { Project subProject ->
|
|||
if (subProject.name.endsWith('-export')) {
|
||||
apply plugin: 'distribution'
|
||||
|
||||
final Architecture architecture = subProject.name.contains('aarch64-') ? Architecture.AARCH64 : Architecture.X64
|
||||
final Architecture architecture = subProject.name.contains('arm64-') ? Architecture.ARM64 : Architecture.X64
|
||||
final DockerBase base = DockerBase.CENTOS
|
||||
|
||||
final String arch = architecture == Architecture.AARCH64 ? '-aarch64' : ''
|
||||
final String arch = architecture == Architecture.ARM64 ? '-arm64' : ''
|
||||
final String extension = 'docker.tar'
|
||||
final String artifactName = "opensearch${arch}_test"
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
|
|||
if (architecture == 'x64') {
|
||||
arch('amd64')
|
||||
} else {
|
||||
assert architecture == 'aarch64' : architecture
|
||||
assert architecture == 'arm64' : architecture
|
||||
arch('arm64')
|
||||
}
|
||||
} else {
|
||||
|
@ -124,13 +124,13 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
|
|||
if (architecture == 'x64') {
|
||||
arch('X86_64')
|
||||
} else {
|
||||
assert architecture == 'aarch64' : architecture
|
||||
assert architecture == 'arm64' : architecture
|
||||
arch('aarch64')
|
||||
}
|
||||
}
|
||||
// Follow opensearch's file naming convention
|
||||
String jdkString = jdk ? "" : "-no-jdk"
|
||||
String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
||||
String prefix = "${architecture == 'arm64' ? 'arm64-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
||||
destinationDirectory = file("${prefix}/build/distributions")
|
||||
|
||||
// SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself
|
||||
|
@ -166,7 +166,7 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
|
|||
with libFiles()
|
||||
}
|
||||
into('modules') {
|
||||
with modulesFiles('linux-' + ((architecture == 'x64') ? 'x86_64' : architecture))
|
||||
with modulesFiles('linux-' + ((architecture == 'x64') ? 'x64' : architecture))
|
||||
}
|
||||
if (jdk) {
|
||||
into('jdk') {
|
||||
|
@ -345,8 +345,8 @@ Closure commonDebConfig(boolean jdk, String architecture) {
|
|||
}
|
||||
}
|
||||
|
||||
tasks.register('buildAarch64Deb', Deb) {
|
||||
configure(commonDebConfig(true, 'aarch64'))
|
||||
tasks.register('buildArm64Deb', Deb) {
|
||||
configure(commonDebConfig(true, 'arm64'))
|
||||
}
|
||||
|
||||
tasks.register('buildDeb', Deb) {
|
||||
|
@ -382,8 +382,8 @@ Closure commonRpmConfig(boolean jdk, String architecture) {
|
|||
}
|
||||
}
|
||||
|
||||
tasks.register('buildAarch64Rpm', Rpm) {
|
||||
configure(commonRpmConfig(true, 'aarch64'))
|
||||
tasks.register('buildArm64Rpm', Rpm) {
|
||||
configure(commonRpmConfig(true, 'arm64'))
|
||||
}
|
||||
|
||||
tasks.register('buildRpm', Rpm) {
|
||||
|
|
|
@ -647,7 +647,7 @@ public class InstallPluginCommandTests extends OpenSearchTestCase {
|
|||
final Path pluginDir = createPluginDir(temp);
|
||||
final Path resourcesDir = pluginDir.resolve("resources");
|
||||
final Path platformDir = pluginDir.resolve("platform");
|
||||
final Path platformNameDir = platformDir.resolve("linux-x86_64");
|
||||
final Path platformNameDir = platformDir.resolve("linux-x64");
|
||||
final Path platformBinDir = platformNameDir.resolve("bin");
|
||||
Files.createDirectories(platformBinDir);
|
||||
|
||||
|
@ -664,7 +664,7 @@ public class InstallPluginCommandTests extends OpenSearchTestCase {
|
|||
final Path fake = env.v2().pluginsFile().resolve("fake");
|
||||
final Path resources = fake.resolve("resources");
|
||||
final Path platform = fake.resolve("platform");
|
||||
final Path platformName = platform.resolve("linux-x86_64");
|
||||
final Path platformName = platform.resolve("linux-x64");
|
||||
final Path bin = platformName.resolve("bin");
|
||||
assert755(fake);
|
||||
assert644(fake.resolve("fake-" + Version.CURRENT + ".jar"));
|
||||
|
|
|
@ -92,7 +92,7 @@ user_agent_parsers:
|
|||
# Pingdom
|
||||
- regex: '(Pingdom\.com_bot_version_)(\d+)\.(\d+)'
|
||||
family_replacement: 'PingdomBot'
|
||||
# 'Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PingdomTMS/0.8.5 Safari/534.34'
|
||||
# 'Mozilla/5.0 (Unknown; Linux x64) AppleWebKit/534.34 (KHTML, like Gecko) PingdomTMS/0.8.5 Safari/534.34'
|
||||
- regex: '(PingdomTMS)/(\d+)\.(\d+)\.(\d+)'
|
||||
family_replacement: 'PingdomBot'
|
||||
|
||||
|
@ -1093,8 +1093,8 @@ os_parsers:
|
|||
# Note, this needs to come before the windows parsers as the app doesn't
|
||||
# properly identify as Chrome OS
|
||||
#
|
||||
# ex: Mozilla/5.0 (X11; Windows aarch64 10718.88.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.118 Safari/537.36 CitrixChromeApp
|
||||
- regex: '(x86_64|aarch64)\ (\d+)\.(\d+)\.(\d+).*Chrome.*(?:CitrixChromeApp)$'
|
||||
# ex: Mozilla/5.0 (X11; Windows arm64 10718.88.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.118 Safari/537.36 CitrixChromeApp
|
||||
- regex: '(x64|arm64)\ (\d+)\.(\d+)\.(\d+).*Chrome.*(?:CitrixChromeApp)$'
|
||||
os_replacement: 'Chrome OS'
|
||||
|
||||
##########
|
||||
|
@ -1209,27 +1209,27 @@ os_parsers:
|
|||
os_v2_replacement: '$2'
|
||||
os_v3_replacement: '$3'
|
||||
# Leopard
|
||||
- regex: ' (Dar)(win)/(9).(\d+).*\((?:i386|x86_64|Power Macintosh)\)'
|
||||
- regex: ' (Dar)(win)/(9).(\d+).*\((?:i386|x64|Power Macintosh)\)'
|
||||
os_replacement: 'Mac OS X'
|
||||
os_v1_replacement: '10'
|
||||
os_v2_replacement: '5'
|
||||
# Snow Leopard
|
||||
- regex: ' (Dar)(win)/(10).(\d+).*\((?:i386|x86_64)\)'
|
||||
- regex: ' (Dar)(win)/(10).(\d+).*\((?:i386|x64)\)'
|
||||
os_replacement: 'Mac OS X'
|
||||
os_v1_replacement: '10'
|
||||
os_v2_replacement: '6'
|
||||
# Lion
|
||||
- regex: ' (Dar)(win)/(11).(\d+).*\((?:i386|x86_64)\)'
|
||||
- regex: ' (Dar)(win)/(11).(\d+).*\((?:i386|x64)\)'
|
||||
os_replacement: 'Mac OS X'
|
||||
os_v1_replacement: '10'
|
||||
os_v2_replacement: '7'
|
||||
# Mountain Lion
|
||||
- regex: ' (Dar)(win)/(12).(\d+).*\((?:i386|x86_64)\)'
|
||||
- regex: ' (Dar)(win)/(12).(\d+).*\((?:i386|x64)\)'
|
||||
os_replacement: 'Mac OS X'
|
||||
os_v1_replacement: '10'
|
||||
os_v2_replacement: '8'
|
||||
# Mavericks
|
||||
- regex: ' (Dar)(win)/(13).(\d+).*\((?:i386|x86_64)\)'
|
||||
- regex: ' (Dar)(win)/(13).(\d+).*\((?:i386|x64)\)'
|
||||
os_replacement: 'Mac OS X'
|
||||
os_v1_replacement: '10'
|
||||
os_v2_replacement: '9'
|
||||
|
@ -1339,15 +1339,15 @@ os_parsers:
|
|||
# CFNetwork macOS Apps (must be before CFNetwork iOS Apps
|
||||
# @ref: https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
|
||||
##########
|
||||
- regex: 'CFNetwork/.* Darwin/17\.\d+.*\(x86_64\)'
|
||||
- regex: 'CFNetwork/.* Darwin/17\.\d+.*\(x64\)'
|
||||
os_replacement: 'Mac OS X'
|
||||
os_v1_replacement: '10'
|
||||
os_v2_replacement: '13'
|
||||
- regex: 'CFNetwork/.* Darwin/16\.\d+.*\(x86_64\)'
|
||||
- regex: 'CFNetwork/.* Darwin/16\.\d+.*\(x64\)'
|
||||
os_replacement: 'Mac OS X'
|
||||
os_v1_replacement: '10'
|
||||
os_v2_replacement: '12'
|
||||
- regex: 'CFNetwork/8.* Darwin/15\.\d+.*\(x86_64\)'
|
||||
- regex: 'CFNetwork/8.* Darwin/15\.\d+.*\(x64\)'
|
||||
os_replacement: 'Mac OS X'
|
||||
os_v1_replacement: '10'
|
||||
os_v2_replacement: '11'
|
||||
|
@ -1625,7 +1625,7 @@ os_parsers:
|
|||
# Wget/x.x.x (linux-gnu)
|
||||
- regex: '\(linux-gnu\)'
|
||||
os_replacement: 'Linux'
|
||||
- regex: '\(x86_64-redhat-linux-gnu\)'
|
||||
- regex: '\(x64-redhat-linux-gnu\)'
|
||||
os_replacement: 'Red Hat'
|
||||
- regex: '\((freebsd)(\d+)\.(\d+)\)'
|
||||
os_replacement: 'FreeBSD'
|
||||
|
@ -5099,7 +5099,7 @@ device_parsers:
|
|||
model_replacement: '$1$2,$3'
|
||||
# @note: newer desktop applications don't show device info
|
||||
# This is here so as to not have them recorded as iOS-Device
|
||||
- regex: 'CFNetwork/.* Darwin/\d+\.\d+\.\d+ \(x86_64\)'
|
||||
- regex: 'CFNetwork/.* Darwin/\d+\.\d+\.\d+ \(x64\)'
|
||||
device_replacement: 'Mac'
|
||||
brand_replacement: 'Apple'
|
||||
model_replacement: 'Mac'
|
||||
|
|
|
@ -69,13 +69,13 @@ public class Platforms {
|
|||
|
||||
/**
|
||||
* Return the platform name based on the OS name and architecture, for example:
|
||||
* - darwin-x86_64
|
||||
* - linux-x86-64
|
||||
* - windows-x86_64
|
||||
* - darwin-x64
|
||||
* - linux-x64
|
||||
* - windows-x64
|
||||
* For *nix platforms this is more-or-less `uname -s`-`uname -m` converted to lower case.
|
||||
* However, for consistency between different operating systems on the same architecture
|
||||
* "amd64" is replaced with "x86_64" and "i386" with "x86".
|
||||
* For Windows it's "windows-" followed by either "x86" or "x86_64".
|
||||
* "amd64" is replaced with "x64" and "i386" with "x86".
|
||||
* For Windows it's "windows-" followed by either "x86" or "x64".
|
||||
*/
|
||||
public static String platformName(final String osName, final String osArch) {
|
||||
final String lowerCaseOs = osName.toLowerCase(Locale.ROOT);
|
||||
|
@ -91,7 +91,7 @@ public class Platforms {
|
|||
final String lowerCaseArch = osArch.toLowerCase(Locale.ROOT);
|
||||
final String normalizedArch;
|
||||
if (lowerCaseArch.equals("amd64")) {
|
||||
normalizedArch = "x86_64";
|
||||
normalizedArch = "x64";
|
||||
} else if (lowerCaseArch.equals("i386")) {
|
||||
normalizedArch = "x86";
|
||||
} else {
|
||||
|
|
|
@ -50,13 +50,13 @@ public class PluginsTests extends OpenSearchTestCase {
|
|||
}
|
||||
|
||||
public void testMakeSpecificPlatformNames() {
|
||||
assertEquals("darwin-x86_64", Platforms.platformName("Mac OS X", "x86_64"));
|
||||
assertEquals("linux-x86_64", Platforms.platformName("Linux", "amd64"));
|
||||
assertEquals("darwin-x64", Platforms.platformName("Mac OS X", "x64"));
|
||||
assertEquals("linux-x64", Platforms.platformName("Linux", "amd64"));
|
||||
assertEquals("linux-x86", Platforms.platformName("Linux", "i386"));
|
||||
assertEquals("windows-x86_64", Platforms.platformName("Windows Server 2008 R2", "amd64"));
|
||||
assertEquals("windows-x64", Platforms.platformName("Windows Server 2008 R2", "amd64"));
|
||||
assertEquals("windows-x86", Platforms.platformName("Windows Server 2008", "x86"));
|
||||
assertEquals("windows-x86_64", Platforms.platformName("Windows 8.1", "amd64"));
|
||||
assertEquals("sunos-x86_64", Platforms.platformName("SunOS", "amd64"));
|
||||
assertEquals("windows-x64", Platforms.platformName("Windows 8.1", "amd64"));
|
||||
assertEquals("sunos-x64", Platforms.platformName("SunOS", "amd64"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,18 +33,18 @@ List projects = [
|
|||
'distribution:archives:no-jdk-windows-zip',
|
||||
'distribution:archives:darwin-tar',
|
||||
'distribution:archives:no-jdk-darwin-tar',
|
||||
'distribution:archives:linux-aarch64-tar',
|
||||
'distribution:archives:linux-arm64-tar',
|
||||
'distribution:archives:linux-tar',
|
||||
'distribution:archives:no-jdk-linux-tar',
|
||||
'distribution:docker',
|
||||
'distribution:docker:docker-aarch64-build-context',
|
||||
'distribution:docker:docker-aarch64-export',
|
||||
'distribution:docker:docker-arm64-build-context',
|
||||
'distribution:docker:docker-arm64-export',
|
||||
'distribution:docker:docker-build-context',
|
||||
'distribution:docker:docker-export',
|
||||
'distribution:packages:aarch64-deb',
|
||||
'distribution:packages:arm64-deb',
|
||||
'distribution:packages:deb',
|
||||
'distribution:packages:no-jdk-deb',
|
||||
'distribution:packages:aarch64-rpm',
|
||||
'distribution:packages:arm64-rpm',
|
||||
'distribution:packages:rpm',
|
||||
'distribution:packages:no-jdk-rpm',
|
||||
'distribution:bwc:bugfix',
|
||||
|
|
Loading…
Reference in New Issue