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

[Backport 2.x] Fix non-x64 bwc build targets #16584

Merged
merged 1 commit into from
Nov 6, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,19 @@
if (name.contains("zip") || name.contains("tar")) {
int index = name.lastIndexOf('-');
String baseName = name.substring(0, index);
classifier = "-" + baseName + "-x64";
classifier = "-" + baseName;

Check warning on line 184 in buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java#L184

Added line #L184 was not covered by tests
// The x64 variants do not have the architecture built into the task name, so it needs to be appended
if (name.equals("darwin-tar") || name.equals("linux-tar") || name.equals("windows-zip")) {
classifier += "-x64";

Check warning on line 187 in buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java#L187

Added line #L187 was not covered by tests
}
extension = name.substring(index + 1);
if (extension.equals("tar")) {
extension += ".gz";
}
} else if (name.contains("deb")) {
classifier = "-amd64";
classifier = "_amd64";

Check warning on line 194 in buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java#L194

Added line #L194 was not covered by tests
} else if (name.contains("rpm")) {
classifier = "-x64";
classifier = ".x86_64";

Check warning on line 196 in buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java#L196

Added line #L196 was not covered by tests
}
} else {
extension = name.substring(4);
Expand Down Expand Up @@ -256,9 +260,21 @@
this.name = name;
this.projectPath = baseDir + "/" + name;
if (version.onOrAfter("1.1.0")) {
// Deb uses underscores (I don't know why...):
// https://github.com/opensearch-project/OpenSearch/blob/f6d9a86f0e2e8241fd58b7e8b6cdeaf931b5108f/distribution/packages/build.gradle#L139
final String separator = name.equals("deb") ? "_" : "-";
this.distFile = new File(
checkoutDir,
baseDir + "/" + name + "/build/distributions/opensearch-min-" + version + "-SNAPSHOT" + classifier + "." + extension
baseDir
+ "/"
+ name
+ "/build/distributions/opensearch-min"
+ separator
+ version
+ "-SNAPSHOT"
+ classifier
+ "."
+ extension
);
} else {
this.distFile = new File(
Expand Down
Loading