Skip to content

Commit 40d4297

Browse files
committed
Reenable windows upload and fix archive paths
When windows builds fail, we need the local logs for diagnosing the issue. This commit re-enables archiving the log files from windows builds for upload. It also fixes that archive to use the correct tar entry path separator on windows. relates #115449
1 parent 547d4a4 commit 40d4297

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchBuildCompletePlugin.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void apply(Project target) {
6666
? System.getenv("BUILD_NUMBER")
6767
: System.getenv("BUILDKITE_BUILD_NUMBER");
6868
String performanceTest = System.getenv("BUILD_PERFORMANCE_TEST");
69-
if (buildNumber != null && performanceTest == null && GradleUtils.isIncludedBuild(target) == false && OS.current() != OS.WINDOWS) {
69+
if (buildNumber != null && performanceTest == null && GradleUtils.isIncludedBuild(target) == false) {
7070
File targetFile = calculateTargetFile(target, buildNumber);
7171
File projectDir = target.getProjectDir();
7272
File gradleWorkersDir = new File(target.getGradle().getGradleUserHomeDir(), "workers/");
@@ -276,7 +276,12 @@ private static void createBuildArchiveTar(List<File> files, File projectDir, Fil
276276

277277
@NotNull
278278
private static String calculateArchivePath(Path path, Path projectPath) {
279-
return path.startsWith(projectPath) ? projectPath.relativize(path).toString() : path.getFileName().toString();
279+
String archivePath = path.startsWith(projectPath) ? projectPath.relativize(path).toString() : path.getFileName().toString();
280+
if (OS.current() == OS.WINDOWS) {
281+
// tar always uses forward slashes
282+
archivePath = archivePath.replace("\\", "/");
283+
}
284+
return archivePath;
280285
}
281286
}
282287
}

0 commit comments

Comments
 (0)