Skip to content

Commit

Permalink
Fix non-x64 bwc build targets (opensearch-project#16575)
Browse files Browse the repository at this point in the history
There were a few issues here: the '-x64' suffix was being unconditionally
appeneded, debian uses underscores not hyphens, and the rpm target uses the
'.86_64' suffix.

Signed-off-by: Andrew Ross <[email protected]>
  • Loading branch information
andrross authored Nov 6, 2024
1 parent 034bd2b commit 9f790ee
Showing 1 changed file with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,19 @@ private static List<DistributionProject> resolveArchiveProjects(File checkoutDir
if (name.contains("zip") || name.contains("tar")) {
int index = name.lastIndexOf('-');
String baseName = name.substring(0, index);
classifier = "-" + baseName + "-x64";
classifier = "-" + baseName;
// 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";
}
extension = name.substring(index + 1);
if (extension.equals("tar")) {
extension += ".gz";
}
} else if (name.contains("deb")) {
classifier = "-amd64";
classifier = "_amd64";
} else if (name.contains("rpm")) {
classifier = "-x64";
classifier = ".x86_64";
}
} else {
extension = name.substring(4);
Expand Down Expand Up @@ -256,9 +260,21 @@ private static class DistributionProject {
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

0 comments on commit 9f790ee

Please sign in to comment.