OXYGENHUB

Build image recipe: only crates patched in from vendor/ go in whole 9c8820a50d7f

A pinned subrepo's crates under deps/ are stubbed like the members,
since only stubbed code depends on them, and their workspace roots are
copied as before; the last change copied them whole, without their
roots, and the hub's and runner's warm builds failed.

refs andymccall/oxygen#63
Author
Andy McCall @andymccall <[email protected]>
When
· 2026-10-04 00:50 UTC
Signature
✔ signed by Andy McCall
Hash
9c8820a50d7f863a4856b1372891ba2a1f16f0b5b11f045da9dda25db7922c08
Depends on
87eb0f97c52d eba589f87e4f
Depended on by
fad6152112b1
In bookmarks
main newer-pipeline push-uses-login
In tags
v0.2.0 v0.3.0 v0.3.1 v0.4.0 v0.5.0 v0.5.1 v0.5.2 v0.5.3
Edits
3 atoms, 0 tree operations, 1 file

Browse the tree at this change

modified images/rust/recipe.py +9 −9
…
3 unchanged lines
4 4
The recipe is the workspace with its sources stubbed out: every member's
5 5
Cargo.toml (and the workspace roots its path dependencies inherit from),
6 6
the lock file, real build scripts, and an empty file for each other
7 -
target. A path dependency that is not a member (a patched third-party
8 -
crate under vendor/) is copied whole: it is built as a dependency. Building it compiles exactly the dependencies the real
7 +
target. A third-party crate patched in from vendor/ is copied whole:
8 +
registry crates with real code depend on it. Building it compiles exactly the dependencies the real
9 9
workspace uses, with the same features, so the build image can hold them
10 10
prebuilt: jobs copy that target directory in and compile only their own
11 11
crates.
…
40 unchanged lines
52 52
        if p["source"] is not None:
53 53
            continue
54 54
        manifest = p["manifest_path"]
55 -
        if p["id"] not in members:
56 -
            # A path dependency that is not a member: a patched third-party
57 -
            # crate under vendor/. It is a dependency, so it goes in whole.
58 -
            src_dir = os.path.dirname(manifest)
59 -
            rel = os.path.relpath(src_dir, root)
60 -
            if rel.startswith(".."):
61 -
                sys.exit(f"{src_dir} is outside the workspace; a recipe holds only paths under it")
55 +
        src_dir = os.path.dirname(manifest)
56 +
        rel = os.path.relpath(src_dir, root)
57 +
        if p["id"] not in members and (rel == "vendor" or rel.startswith("vendor/")):
58 +
            # A third-party crate patched in from vendor/: registry crates
59 +
            # with real code depend on it, so it goes in whole. (A pinned
60 +
            # subrepo's crates under deps/ are stubbed like the members:
61 +
            # only stubbed code depends on them.)
62 62
            shutil.copytree(src_dir, os.path.join(out, rel), dirs_exist_ok=True)
63 63
            continue
64 64
        put(manifest)
…
20 unchanged lines