Clarify local runtime bundle bootstrap
Stop presenting make runtime-bundle as a turnkey fresh-checkout bootstrap\nwhen the checked-in manifest is intentionally empty. The manifest comments,\nruntimebundle error messages, Make help, README, and AGENTS docs now all\ndescribe the same local-first flow: stage an archive, use a separate local\nmanifest copy with url/sha256, then bootstrap ./runtime from that manifest.\n\nKeep the existing package/fetch commands intact, and add a small runtimebundle\nregression test so the local-manifest guidance does not drift again.\n\nValidated with make help and GOCACHE=/tmp/banger-gocache go test\n./internal/runtimebundle.
This commit is contained in:
parent
ccba07ec68
commit
617f677c9b
6 changed files with 66 additions and 17 deletions
|
|
@ -69,10 +69,10 @@ func LoadManifest(path string) (Manifest, error) {
|
|||
|
||||
func Bootstrap(ctx context.Context, manifest Manifest, manifestPath, outDir string) error {
|
||||
if manifest.URL == "" {
|
||||
return fmt.Errorf("runtime bundle manifest %s has no url; publish a runtime bundle and update the manifest", manifestPath)
|
||||
return fmt.Errorf("runtime bundle manifest %s has no url; point a local manifest copy at a staged or published runtime bundle archive", manifestPath)
|
||||
}
|
||||
if manifest.SHA256 == "" {
|
||||
return fmt.Errorf("runtime bundle manifest %s has no sha256", manifestPath)
|
||||
return fmt.Errorf("runtime bundle manifest %s has no sha256; add the checksum for the staged or published runtime bundle archive", manifestPath)
|
||||
}
|
||||
manifestDir := filepath.Dir(manifestPath)
|
||||
parentDir := filepath.Dir(outDir)
|
||||
|
|
|
|||
|
|
@ -71,6 +71,30 @@ func TestBootstrapRejectsChecksumMismatch(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestBootstrapRejectsMissingURLWithLocalManifestGuidance(t *testing.T) {
|
||||
manifest := Manifest{
|
||||
SHA256: strings.Repeat("0", 64),
|
||||
BundleRoot: "runtime",
|
||||
RequiredPaths: []string{"firecracker"},
|
||||
}
|
||||
err := Bootstrap(context.Background(), manifest, filepath.Join(t.TempDir(), "runtime-bundle.toml"), filepath.Join(t.TempDir(), "runtime"))
|
||||
if err == nil || !strings.Contains(err.Error(), "local manifest copy") {
|
||||
t.Fatalf("Bootstrap() error = %v, want local manifest guidance", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBootstrapRejectsMissingSHAWithArchiveGuidance(t *testing.T) {
|
||||
manifest := Manifest{
|
||||
URL: "./bundle.tar.gz",
|
||||
BundleRoot: "runtime",
|
||||
RequiredPaths: []string{"firecracker"},
|
||||
}
|
||||
err := Bootstrap(context.Background(), manifest, filepath.Join(t.TempDir(), "runtime-bundle.toml"), filepath.Join(t.TempDir(), "runtime"))
|
||||
if err == nil || !strings.Contains(err.Error(), "staged or published runtime bundle archive") {
|
||||
t.Fatalf("Bootstrap() error = %v, want archive guidance", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPackageWritesArchive(t *testing.T) {
|
||||
runtimeDir := t.TempDir()
|
||||
for _, rel := range []string{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue