META_MODE: Fix stage_links not running in the right order without -j.

This fixes staging errors for non-parallel builds that have LINKS.

Creating hardlinks must always happen after the actual files are installed.
The staging code was protected by an .ORDER statement that only affected
parallel -j builds but not non-parallel builds.  Fix this by making the
real stage_links.SET (stage_links.links, stage_links.mlinks, etc) targets
depend on the main targets for all of the other possible staging needs.  For
example, stage_links.links will depend on stage_as and stage_files, which have
their own dependencies to stage_as.prog or stage_files.prog or stage_files.SET,
which is enough to satistfy the ordering.

Also remove the requirement that symlinks be created last, as they can
safely be made without the source being present unlike hardlinks.  This also
fixes symlinks to come before hardlinks as it is possible, in theory, to
hardlink a symlink.  This is not actually supported here though.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2015-10-02 06:24:09 +00:00
parent bf0b7b4527
commit 1b6f33d9ac

View File

@ -237,10 +237,11 @@ stage_as.$s: .dirdep
CLEANFILES += ${STAGE_TARGETS} stage_incs stage_includes
# stage_*links usually needs to follow any others.
.for t in ${STAGE_TARGETS:N*links:O:u}
.ORDER: $t stage_links
.ORDER: $t stage_symlinks
.if !empty(STAGE_SETS) && !empty(STAGE_TARGETS:Nstage_links)
.for s in ${STAGE_SETS:O:u}
stage_links.$s: ${STAGE_TARGETS:Nstage_links:O:u}
.endfor
.endif
# make sure this exists
staging: