Skip to content

Conversation

@Oblomov
Copy link

@Oblomov Oblomov commented Oct 21, 2025

This patchset contains some minor and less minor bug fixes in the makefiles. The biggest one in particular solves some issues that arise with parallel builds (triggered e.g. when running scripts/first.sh on a clean, fresh checkout when the MAKEFLAGS environment variable includes the -j flag).

There are several other parallel build improvements possible, but they are not included here and before diving into it I would prefer to know if there is an interest for such improvements or not.

The rule to generate Tangled/Syntax.preform was invalid.
When tangling inter directly, the inform7_clib.{c,h} files end up in the
inter directory rather than under the inform7 directory. Copy them to
the expected place after tangling.

While we're at it, make the inter subset tangling its own target,
to ensure that it's only run once during parallel builds.
When the environment variable MAKEFLAGS contains -j or similar parallel
building flag, a clean build (scripts/first.sh from a fresh checkout)
will lead to errors such as

    (Step 3 of 4: building the tools)
    make -f inblorb/inblorb.mk force
    inbuild/Tangled/inbuild -rebuild -contents-of
    inform7/Internal/Extensions/Graham\ Nelson/Standard\
    Rules.i7xd/Materials/Inter
    make: inbuild/Tangled/inbuild: No such file or directory
    make: *** No rule to make target 'inform7/Tangled/Syntax.preform',
    needed by 'inform7/Internal/Extensions/Graham Nelson/English
    Language.i7xd/Materials/Languages/English/Syntax.preform'.  Stop.
    make: *** Waiting for unfinished jobs....
    make: *** [makefile:331: forcekits] Error 127

and others. This is due to the 'force' build trying to build forcetools,
forcekits and localintegration in parallel, even though there is
actually a strict dependency between them that is not fully described by
the makefile rules.

This patch introduces two changes to avoid this issue.

First of all, we introduce the .WAIT dependency before localintegration
in the 'all' and 'force' targets. This implicitly-defined phony
dependency is used by GNU Make to indicate that the dependencies on the
right must wait for the dependencies on the left to finish.

Secondly, the kits and forcekits targets now depend on the tools used to
build the kits (i.e. Inbuild and inter). For the forcekits target, this
requires the introduction of force_* variants for the tools, that were
previously built using a single target.

As a bonus, this allows the tools themselves to now be built in parallel
even during a force build.

Similar changes can be implemented for other targets that currently
build multiple files serially, but this will be left to later commits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant