RFR: 8326685: Linux builds not reproducible if two builds configured in different build folders

Magnus Ihse Bursie ihse at openjdk.org
Tue Feb 27 10:34:53 UTC 2024


On Tue, 27 Feb 2024 08:19:11 GMT, Andrew Leonard <aleonard at openjdk.org> wrote:

>>> 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?
>> 
>> Yes, I have tested that scenario as well, and does work. It was in fact the scenario in which I discovered the problem in the first place.
>
>> 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.
> 
> @erikj79 @magicus Yes, it needs to always be present as you've pointed out the OUTPUTDIR when within the WORKSPACE will be eg.WORKSPACE/build/linux-aarch64-server-release/support and the standard WORKSPACE mapping will make that build/linux-aarch64-server-release/support, but a build dir outside will be simply <any_path>/support

It seems correct to include the output dir in the remapping, but I have two objections/questions to the way you are doing it.
1) Why not just use OUTPUTDIR instead of the two specialized subdirs? That is simpler, more general and future-proof.
2) Why not expand the value of the OUTPUTDIR variable? I.e.  

 DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS -fdebug-prefix-map=$OUTPUTDIR/="
 ```

instead of trying to preserve it as a variable to be expanded in the make execution.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18009#discussion_r1504006780


More information about the build-dev mailing list