Repository navigation
Build: let a parent make control the wxWidgets build jobs - #1903
Merged
Merged
Conversation
flatstik
force-pushed
the
wxbuild-jobserver
branch
from
October 4, 2026 09:50
7ba3237 to
65c6dc3
Compare
The wxbuild target always runs the wxWidgets sub-make with -j 4. When VeraCrypt is built from a parent "make -jN" (for example by a distribution or embedded build system), the explicit -j 4 overrides the parent's job count and jobserver: the wx build ignores -j1 and the configured parallelism and can oversubscribe the machine. Keep -j 4 as the default for a standalone build, but leave the job count to the parent make when it was started with -j: MFLAGS then contains -j, -jN or the jobserver option (-j1 since GNU make 4.2; older makes treat a -j1 parent like a serial one without -j). MFLAGS is used rather than MAKEFLAGS because it holds only options, not command-line variable definitions, so a variable value containing "-j" cannot match. See also veracrypt#717, which proposed dropping -j 4 for the same reason. Signed-off-by: Ville Takio <ville+git@takio.fi>
flatstik
force-pushed
the
wxbuild-jobserver
branch
from
October 4, 2026 10:09
65c6dc3 to
4f559f5
Compare
4 tasks done
Contributor
Author
|
@idrassi any comments on this? The OpenWrt build is still waiting for your decision for this |
idrassi
requested changes
Oct 9, 2026
Address review: - GNU make 3.81 can group single-letter options in MFLAGS, e.g. "-sj" for the -s this Makefile adds plus a bare -j, which the previous pattern missed. Look for "j" in every single-dash option word instead, skipping the options that take an argument (-C, -E, -I, -O, -W, -f, -o). An option argument containing a space followed by "-j" can still be mistaken for a job option; this is documented next to the variable. - The OpenWrt recipe built wxWidgets without the package's job settings, so it still ran 4 jobs. Pass $(PKG_JOBS) and an empty WX_MAKE_JOBS, so the wxWidgets build follows OpenWrt's settings, including serial builds. Signed-off-by: Ville Takio <ville+git@takio.fi>
idrassi
approved these changes
Oct 10, 2026
idrassi
left a comment
Member
There was a problem hiding this comment.
Thanks for the update. Looks good to me now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
wxbuildtarget always runs the wxWidgets sub-make with-j 4. When VeraCrypt is built from a parentmake -jN, as distribution or embedded build systems (e.g. OpenWrt) do, the explicit-j 4overrides the parent's job count and jobserver: the wx build ignores-j1or the configured parallelism and can oversubscribe the machine.This keeps
-j 4as the default for a standalonemake, but leaves the job count to the parent when it was started with-j. The parent'sMFLAGSthen contains-j,-jNor the jobserver option, so the sub-make joins the parent's jobserver.MFLAGSis used rather thanMAKEFLAGSbecause it holds only options, so a command-line variable whose value contains-j(e.g.make 'FOO=a -j3') can't match.Single-letter options can be grouped in one
MFLAGSword (GNU make 3.81 gives-sjfor the-sthis Makefile adds plus a bare-j), so the check looks forjin every single-dash option word, skipping the options that take an argument (-C,-E,-I,-O,-W,-f,-o). Known limitation, documented next to the variable: an option argument containing a space followed by-j(e.g.-I '/tmp/ordinary -j3') still looks like a job option, so that build inherits the parent's (serial) setting instead of using 4 jobs;WX_MAKE_JOBScan be set explicitly in that case.The OpenWrt recipe in
src/Build/Packaging/openwrtnow passes$(PKG_JOBS)and an emptyWX_MAKE_JOBStowxbuild: OpenWrt clearsMAKEFLAGSand passes the job count inPKG_JOBS, which can be empty for a serial build, so the emptyWX_MAKE_JOBSmakes the wxWidgets build follow OpenWrt's settings in every case.Checked with GNU make 4.4.1:
make-j 4(as before)make -j8-j8and--jobserver-auth=...make -j-jmake -j1-j1(serial; GNU make 4.2+, older makes do not record-j1and give-j 4)make -k,make -ks-j 4make 'FOO=a -j3'-j 4MFLAGS=-sj(GNU make 3.81, bare-j)-jmake -I/jail,-C/proj,-Otarget-j 4The grouped
MFLAGSforms were checked by evaluating the same expression with theMFLAGSvalues make 3.81 produces.See also #717, which proposed dropping
-j 4for the same reason (closed by its author, not rejected). This version keeps the standalone default, so plainmakebuilds aren't slowed down.