Skip to content

Commit

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

Co-authored-by: Erik Joelsson <erikj@openjdk.org>
Reviewed-by: erikj, ihse
  • Loading branch information
2 people authored and magicus committed Feb 10, 2022
1 parent c820d1a commit d442328
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

3 comments on commit d442328

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on d442328 Mar 21, 2022

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on d442328 Mar 21, 2022

Choose a reason for hiding this comment

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

@GoeLin the backport was successfully created on the branch GoeLin-backport-d442328b in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit d442328b from the openjdk/jdk repository.

The commit being backported was authored by Maxim Kartashev on 10 Feb 2022 and was reviewed by Erik Joelsson and Magnus Ihse Bursie.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-d442328b:GoeLin-backport-d442328b
$ git checkout GoeLin-backport-d442328b
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-d442328b

Please sign in to comment.