RFR: 8326685: Linux builds not reproducible if two builds configured in different build folders
Erik Joelsson
erikj at openjdk.org
Mon Feb 26 22:07:42 UTC 2024
On Mon, 26 Feb 2024 21:20:25 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> make/autoconf/flags-cflags.m4 line 126:
>>
>>> 124: DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS
>>> 125: DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS -fdebug-prefix-map=\$(SUPPORT_OUTPUTDIR)/="
>>> 126: DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS -fdebug-prefix-map=\$(HOTSPOT_OUTPUTDIR)/="
>>
>> This is only a problem if the build directory is located outside the workspace root. In the case where the build directory is inside the root, I think it would be preferable to stick to just the one prefix map, for consistent relative paths for all affected files. If the build directory is outside, like in your example, I would suggest adding just `$(OUTPUTDIR)/=` to both `-fdebug-prefix-map` and `-fmacro-prefix-map` for consistency. We don't seem to have a variable indicating if the OUTPUTDIR is inside WORKSPACE_ROOT or not, but we can add one in basic.m4 where the OUTPUTDIR is initialized. Then you can conditionally add the extra prefix maps based on that variable.
>
> I have not thought this fully through, but just throwing out a question: would this work even if one build directory were inside the workspace root, and the other not?
Oh you are right, we should always add the OUTPUTDIR to both maps regardless of if it's internal to the WORKSPACE_ROOT or not. Paths relative to the OUTPUTDIR should be stable across builds in different output directories, but paths inside the OUTPUTDIR, expressed as relative to the WORKSPACE_ROOT will vary.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18009#discussion_r1503367524
More information about the build-dev
mailing list