On Fri, 7 Aug 2026 20:46:53 GMT, Erik Joelsson <[email protected]> wrote:
>> Ashay Rane has updated the pull request with a new target base due to a
>> merge or a rebase. The incremental webrev excludes the unrelated changes
>> brought in by the merge/rebase. The pull request contains three additional
>> commits since the last revision:
>>
>> - Merge branch 'master' into JDK-8389209-add-sccache-support
>> - Fix quoting level in call to `AC_MSG_ERROR()`
>>
>> It seems an extra level of quoting is required because of the
>> `IF_ENABLED` callback.
>>
>> Also detects instances when the code is unable to determine the version.
>> - Add sccache support to Linux, Windows, and macOS builds
>>
>> This patch enables the `--enable-sccache` flag to enable build caching
>> using sccache. Specifically, if the toolchain is one among gcc, clang,
>> or MSVC and if the sccache version is 0.10 and above, then the build
>> prefixes all compiler invocations with the path to the sccache binary.
>>
>> Since sccache is incompatible with ccache and precompiled headers, this
>> patch makes the build fail if either ccache or precompiled headers are
>> enabled in addition to sccache at the same time.
>>
>> Validated this patch on {Linux, Windows, macOS} x {x64, aarch64}
>> machines. In the best-case scenario (i.e. when there are no changes to
>> the source files), the time required to run the "make images" step is
>> roughly cut in half. Side note: the individual machines have very
>> different configurations, so build times _across_ machines aren't
>> comparable.
>>
>> - Windows/x64: 2,107s -> 848s
>> - Windows/ARM64: 1,264s -> 748s
>> - macOS/x64: 808s -> 243s
>> - macOS/AArch64: 480s -> 142s
>> - Linux/x64: 225s -> 111s
>> - Linux/AArch64: 364s -> 246s
>
> make/autoconf/build-performance.m4 line 306:
>
>> 304: if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
>> 305: SCCACHE_DIR_FOR_SCCACHE=`$FIXPATH_BASE -m print
>> "$SCCACHE_DIR_FOR_SCCACHE"`
>> 306: fi
>
> Please use `UTIL_FIXUP_PATH` to normalize file/directory paths.
It looks like we can't use `UTIL_FIXUP_PATH`, since it first tests whether the
directory exists. I made the following change:
diff --git a/make/autoconf/build-performance.m4
b/make/autoconf/build-performance.m4
index 76332e0b7f8..620f3b5a461 100644
--- a/make/autoconf/build-performance.m4
+++ b/make/autoconf/build-performance.m4
@@ -300,11 +303,8 @@ AC_DEFUN([BPERF_SETUP_SCCACHE],
if test "x$with_sccache_dir" != x; then
SCCACHE_DIR="$with_sccache_dir"
- SCCACHE_DIR_FOR_SCCACHE="$SCCACHE_DIR"
- if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
- SCCACHE_DIR_FOR_SCCACHE=`$FIXPATH_BASE -m print
"$SCCACHE_DIR_FOR_SCCACHE"`
- fi
- SET_SCCACHE_DIR="SCCACHE_DIR=$SCCACHE_DIR_FOR_SCCACHE"
+ UTIL_FIXUP_PATH(SCCACHE_DIR)
+ SET_SCCACHE_DIR="SCCACHE_DIR=$SCCACHE_DIR"
if test "x$SCCACHE" = x; then
AC_MSG_WARN([--with-sccache-dir has no meaning when sccache is not
enabled])
fi
but the build fails if the specified directory does not exist:
checking if sccache is available... yes
checking if sccache is enabled... enabled, from command line
configure: The path of SCCACHE_DIR, which is given as "/tmp/x", can not be
properly resolved.
configure: Please see the section "Special Considerations" in building.md.
configure: This is the error message given by fixpath:
fixpath: warning: Path '/tmp/x' does not exist
/tmp/x
configure: error: Cannot continue
configure exiting with result code 1
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/32059#discussion_r3762347429