Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8281262: Windows builds in different directories are not fully reprod…
…ucible

Backport-of: d442328bc2f2f4bc35dd054487a78552e3d9a759
  • Loading branch information
erikj79 committed Feb 16, 2022
1 parent 22f6195 commit d2492c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions make/TestImage.gmk
Expand Up @@ -35,8 +35,8 @@ BUILD_INFO_PROPERTIES := $(TEST_IMAGE_DIR)/build-info.properties
$(BUILD_INFO_PROPERTIES):
$(call MakeTargetDir)
$(ECHO) "# Build info properties for JDK tests" > $@
$(ECHO) "build.workspace.root=$(call FixPath, $(WORKSPACE_ROOT))" >> $@
$(ECHO) "build.output.root=$(call FixPath, $(OUTPUTDIR))" >> $@
$(ECHO) 'build.workspace.root=$(call FixPath, $(WORKSPACE_ROOT))' >> $@
$(ECHO) 'build.output.root=$(call FixPath, $(OUTPUTDIR))' >> $@

README := $(TEST_IMAGE_DIR)/Readme.txt

Expand Down
4 changes: 1 addition & 3 deletions make/autoconf/flags-cflags.m4
Expand Up @@ -782,10 +782,8 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
test "x$ENABLE_REPRODUCIBLE_BUILD" = xtrue; then
# There is a known issue with the pathmap if the mapping is made to the
# empty string. Add a minimal string "s" as prefix to work around this.
workspace_root_win=`$FIXPATH_BASE print "${WORKSPACE_ROOT%/}"`
# PATHMAP_FLAGS is also added to LDFLAGS in flags-ldflags.m4.
PATHMAP_FLAGS="-pathmap:${workspace_root_win//\//\\\\}=s \
-pathmap:${workspace_root_win}=s"
PATHMAP_FLAGS="-pathmap:${WORKSPACE_ROOT}=s"
FILE_MACRO_CFLAGS="$PATHMAP_FLAGS"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${FILE_MACRO_CFLAGS}],
PREFIX: $3,
Expand Down
7 changes: 7 additions & 0 deletions test/jdk/build/AbsPathsInImage.java
Expand Up @@ -96,6 +96,13 @@ public static void main(String[] args) throws Exception {
if (buildOutputRoot == null) {
throw new Error("Could not find build output root, test cannot run");
}
// Validate the root paths
if (!Paths.get(buildWorkspaceRoot).isAbsolute()) {
throw new Error("Workspace root is not an absolute path: " + buildWorkspaceRoot);
}
if (!Paths.get(buildOutputRoot).isAbsolute()) {
throw new Error("Output root is not an absolute path: " + buildOutputRoot);
}

List<byte[]> searchPatterns = new ArrayList<>();
expandPatterns(searchPatterns, buildWorkspaceRoot);
Expand Down

1 comment on commit d2492c4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.