From cfc402b4e65a6aab3a2555765bda8dc12c99a348 Mon Sep 17 00:00:00 2001 From: Laura Peskin Date: Wed, 4 Dec 2024 14:42:03 -0800 Subject: pkg/vcs: work around bug in jiri prebuilt_versions hook Invoke `jiri update` twice (once from the fuchsia bootstrap script, then as a standalone command) when initializing a new fuchsia checkout. --- pkg/vcs/fuchsia.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/vcs/fuchsia.go b/pkg/vcs/fuchsia.go index a50076147..3f6983f3b 100644 --- a/pkg/vcs/fuchsia.go +++ b/pkg/vcs/fuchsia.go @@ -59,7 +59,11 @@ func (ctx *fuchsia) initRepo() error { } cmd := "curl -s 'https://fuchsia.googlesource.com/fuchsia/+/main/scripts/bootstrap?format=TEXT' |" + "base64 --decode | bash" - if _, err := runSandboxed(tmpDir, "bash", "-c", cmd); err != nil { + // TODO: Remove the second `jiri update` once the `prebuilt_versions` hook is fixed. + // Expect and ignore an error from the bootstrap script's invocation of `jiri update`. + _, _ = runSandboxed(tmpDir, "bash", "-c", cmd) + // Run `jiri update` a second time; it should succeed. + if _, err := runSandboxed(filepath.Join(tmpDir, "fuchsia"), "./.jiri_root/bin/jiri", "update"); err != nil { return err } return osutil.Rename(filepath.Join(tmpDir, "fuchsia"), ctx.dir) -- cgit mrf-deployment