Adds an optional "source" Docker target that collects all upstream
source tarballs for producing a source.tar release artifact. BuildKit
skips it unless explicitly requested via --target source.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In DepsLog::Load(), the file offset used for truncation-based recovery
was advanced past each record immediately after reading its bytes from
disk, but before validating the record's semantic correctness (e.g. the
path checksum or node-id range checks). When a record was structurally
complete but semantically invalid, recovery truncated the file to an
offset that included the bad record, so it was never removed.
This created an infinite cycle: every build would load the deps log, hit
the corrupt record, "recover" by truncating everything after it (but not
the record itself), then append new dependency records that would be
destroyed by the next build's recovery. The result was spurious rebuilds
on every invocation.
Move the offset update to the end of the loop body, after all validation
has passed. Now when a record fails validation, the offset still points
before it, and truncation correctly removes it.
(This patch has been submitted upstream.)
I wrote this new tool yesterday after reading about "cmake --debugger"
the night before, and it's already been powerful and useful. In the past
this would be a month-long project, but in 2026 it only takes a day.
Aliases remain small because size is important and they are already
maximum speed. The distribution is ~10MB (~22%) larger, but C++ builds
with this toolchain are ~25% faster.
By breaking independent parts of the build into stages breaks implied
dependencies between those parts. A tool built later will not require
rebuilding when earlier unrelated tools are changed. That includes
upgrades to require new downloads. Most tools can be upgraded without
requiring unnecessary rebuilds.
The official Vim project no longer hosts older versions of Vim, and the
original Vim host is now gone. Due to the hashes, we can safely download
from anywhere stable, so let's try this mirror.
Also switch to GitHub releases because it apparently not subject to
naive Expat security policies, making it more reliable. Expat only
parses trusted inputs in w64dk, and so is unaffected by security issues.
Updates are generally unnecessary. Unfortunately Expat's repository has
an unconventiontional tagging convention, and tags do not exactly match
the version, so the ARG will no longer work on its own, which is why I
had avoided its GitHub releases for so long.
The widl configure script is broken and does not support out-of-source
builds, so unlike gendef just above, it's built in the source tree. The
--prefix and --with-widl-includedir options must be congruent despite
their artificiality. These two paths are combined to construct the real
sysroot path at run time via tools.h:build_relative_path.
This patch also creates arch-prefixed aliases for both gendef and widl.
llvm-mingw switched to using it in this commit:
https://github.com/mstorsjo/llvm-mingw/commit/a96bbc0c
And I figured we should do the same. Especially since we download more
than just GNU make.
GNU themselves write (https://www.gnu.org/server/mirror.en.html):
> We recommend using this generic ftpmirror.gnu.org address wherever
> possible in links, documentation, etc., to reduce load on the main GNU
> server.
One of my goals is that the distribution can be re-built in place using
only Docker or Podman, and so the unpacked distribution mirrors the
repository layout. That hasn't been true for w64devkit.ini, which is the
only file interfering with this trick, so fix it.