2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-18 01:52:17 +00:00
Files
build/historic/jam/test/parallel_multifile_actions_2.jam
Jurko Gospodnetić 74eb969e43 Fixed a Boost Jam bug causing it to sometimes trigger actions depending on targets that have not been built yet. Test case included. Updated related code comments.
Bug was happening when we had a multifile action that got triggered to build its non-initial target. Then while that action was being executed all the other targets were reporting as 'already built' and were getting used by other actions prematurely. Quick-fixed by making all targets built by a single action list each other as 'included' causing anything else depending on any of these targets to automatically depend on all the others in the group as well.

The solution is not perfect as it might have some unexpected interactions with other uses of 'included' targets and now if any target in a group is not up to date then all of them will be rebuilt even if actually did not need the target that was up to date. On the other hand this should be a really rare use case as it would require the one target in a group to be up to date and be needed while another in the same group (i.e. built by the same action) to not be up to date.

[SVN r48426]
2008-08-28 19:20:27 +00:00

50 lines
1.4 KiB
Plaintext

# Copyright 2008 Jurko Gospodnetic, Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Added to guard against a bug causing targets to be used before they
# themselves have finished building. This used to happen for targets built by a
# multi-file action that got triggered by another target, except when the target
# triggering the action was the first one in the list of targets produced by
# that action.
#
# Example:
# When target A and target B were declared as created by a single action with
# A being the first one listed, and target B triggered running that action then
# while the action was still running, target A was already reporting as being
# built causing other targets depending on target A to be built prematurely.
if ! $(BJAM_SUBTEST)
{
ECHO --- Testing -jN parallel execution of multi-file actions - 2... ;
assert "...found 4 targets...
...updating 3 targets...
link dll
001 - linked
install installed_dll
002 - installed
...updated 3 targets...
" : (==) : [ SHELL "\"$(ARGV[1])\" -f parallel_multifile_actions_2.jam -sBJAM_SUBTEST=1 -j2" ] ;
}
else
{
actions link
{
sleep 1
echo 001 - linked
}
link dll lib ;
actions install
{
echo 002 - installed
}
install installed_dll : dll ;
DEPENDS installed_dll : dll ;
DEPENDS all : lib installed_dll ;
}