Repository navigation
Configure remote repositories per architecture and boxes for the host - #300
Merged
daandemeyer merged 4 commits intoOct 12, 2026
Merged
Conversation
A content-based output path contains no configuration. The x86_64 and arm64 configurations of one repository therefore download an identical file, such as a noarch package, to the same path. A build for arm64 on an x86_64 host needs both configurations, and two parallel downloads into one path corrupt the file. Put the architecture into the path of every download. Signed-off-by: Daan De Meyer <daan@amutable.com>
A box lock and an image reach a remote repository in configurations that also differ in other constraints, such as the image's distribution. Each of those configurations downloads every file of the repository again. Give the repository rule an incoming transition to the target platform of its architecture, so that callers of one architecture share one repository. Callers in the execution configuration still get a repository of their own. Signed-off-by: Daan De Meyer <daan@amutable.com>
Buck keeps the exec mark through transitions, so a remote repository is configured once for the box that installs from it and once more for the box lock and the image. The two configured repositories download the same files at the same time, and the parallel downloads corrupt Arch's core.db in refresh-catalog. Register no exec marker, so that the execution configuration is the host platform's. Configure a box for the host with an incoming transition instead of the exec-only compatibility check. Signed-off-by: Daan De Meyer <daan@amutable.com>
The box rule's transition configures every box for the host, so the alias no longer prevents a second build. The alias still resolves a parent's packages for a lock of another architecture, because packages can select() on the architecture. Let a child box's lock read the parent's packages from the parent's lock for the same architecture instead. A child box can then only keep a lock for an architecture that its parent keeps one for. Signed-off-by: Daan De Meyer <daan@amutable.com>
daandemeyer
force-pushed
the
push-sutullnlkmoq
branch
from
October 12, 2026 10:29
fcbe684 to
dde2d26
Compare
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.
This is an alternative to #295 for #292.
The problem
Buck builds every target for a configuration: a set of facts such as "cpu is x86_64, os is linux". The
same target in two configurations is two builds, even when its output depends on only one of those facts.
Arch's core repository is reached in three configurations:
A repository's content only depends on the cpu, so these three are the same build. Buck still runs all
three, and the three downloads of each file write to the same path at the same time. That corrupts
core.dbin refresh-catalog.What Buck offers
An
exec_depconfigures a tool for the execution platform, whoever depends on it. An execution platformcan also register an exec marker constraint. Buck then marks the execution configuration, so it never
equals a target configuration, even with the same cpu and os. tine copied that marker from the prelude's
example platform, and only the box's exec-only compatibility check uses it.
A rule can declare an incoming transition with
rule(cfg = ...). The transition rewrites theconfiguration of every caller before Buck configures the target. Callers that end up in the same
configuration share one build, and the other configurations only get a forward node that points at it.
Buck copies the exec mark through every transition. A transition can merge "x86_64, linux" with "x86_64,
linux, distribution=arch", but never with "x86_64, linux, exec".
What this changes
repository therefore download an identical file, such as a noarch package, to the same path. Every
download now has the architecture in its path.
tine//platforms:<cpu>. The box lock and the imagethen reach one repository. The box still gets its own, because of the exec mark.
as the default target configuration. The box rule gets an incoming transition to the host platform,
which replaces the exec-only compatibility check. Both transitions fail with an error if an execution
platform registers the marker again, so a consumer project cannot bring the duplicate downloads back
without noticing.
a lock of another architecture, because a package list can
select()on the architecture. A childbox's lock now reads the parent's packages from the parent's lock for the same architecture. A child
box can therefore only keep a lock for an architecture its parent keeps one for.
Compared with #295, there are no hidden per-architecture targets and no aliases, and tools/catalog.py does
not change. A repository or box named on the command line reaches the same build as every other caller.
Testing
tools:checkon each commitexamples/image:reproducibility-testfedora.rawhide.box.lock.arm64resolved on an x86_64 hosttine//catalog:fedora.rawhide.boxin another package, with lockstine//catalog:arch.rolling.box.lock.x86_64andtine//examples/image:base.archFixes #292