Skip to content

Bare repos and hardhat helpers - #80

Open
pothos wants to merge 4 commits into
mainfrom
barerepo-hardhat-helpers-sysupdate-rework
Open

pothos wants to merge 4 commits into
mainfrom
barerepo-hardhat-helpers-sysupdate-rework

Conversation

@pothos

@pothos pothos commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

This introduces support for bare repos as build system outputs that are then imported into proper repositories and function as build system contract binding all files together. They can also be used with an intermediate local repo import for development purposes. A few helper options are added to hardhat to embed the transfer files (with a shorthand for confexts) and custom metadata such as the versions, and quickly create a proper repo from the bare file.

@pothos
pothos force-pushed the barerepo-hardhat-helpers-sysupdate-rework branch 2 times, most recently from e929f89 to 54f64bb Compare October 13, 2026 04:12
@pothos
pothos marked this pull request as ready for review October 13, 2026 04:21
@pothos
pothos requested a review from cyphar October 13, 2026 08:25
quarry-sysupdate takes the sysupdate definitions of a component from
special targets under .quarry/sysupdate[.<component>].d/, but every
producer had to lay out these paths and inline the files itself. That
duplicates the layout detail and can drift from what the client expects.

hardhat targets gains --quarry-transfer-dir <component dir>=<source>,
which publishes the files of a definitions directory as inline targets
in that layout. A source may also be confext:<name>, for which hardhat
generates the transfer installing the confext DDI, and several sources
merge into one directory. A named component without its own component
file gets a generated one, which is enabled like sysupdate's default.
The layout rules live in internal/transferlayout so that quarry-sysupdate
can share them.
A build has to mark its targets for consumers, for example which version
they belong to. hardhat could hash the files but offered no way to
attach such metadata, so a producer would have to post-process the
signed targets file and resign.

Add hardhat targets --custom-from <file>, which merges per-target
"custom" objects from a JSON file and fails on a path that is not a
target, so that a typo cannot drop metadata silently. --custom-version
sets custom.quarry.version on every file target.
@pothos
pothos force-pushed the barerepo-hardhat-helpers-sysupdate-rework branch from 54f64bb to 65798ac Compare October 21, 2026 04:13
When a build system prepares a targets file it had to either have access
to a signing key or use a throaway key, and the result was still only
shortly usable due to expiry. Since a proper refreshed TUF repo is where
this build system's targets file gets imported to, we actually don't
need to produce it signed since the import with --include-from anyway
discards the signature and exiry was not also not checked.

Add --unsigned to write the targets file with no signatures (and no
keystore). Its expiry is the zero time to state that nothing checks it,
unless --expire-after sets one. The option is exclusive with
--from-root and --keyid, so an unsigned file is always asked for
explicitly. Without it, --keystore stays required.
Importing a remote targets file into a local repository needs override
URLs on its entries because otherwise the local repository would have
to mirror all data. This was possible with a custom jq call but required
to know which entries carry inline data.

Add --ext-override-url with --data-root-url to apply to the targets of
--include-from to get an override URL pointing at the remote location.
Entries with inline data or an override URL of their own are left
unchanged, and a path is escaped when it is joined to the data root.
@pothos
pothos force-pushed the barerepo-hardhat-helpers-sysupdate-rework branch from 65798ac to 62f1853 Compare October 21, 2026 05:19
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