[recipe_bootstrap] Fix recipe bundle invocation
Fix CIPD ensure call, and fix relative path to
recipe bundle's luciexe to an absolute path.
Bug: 10404
Change-Id: I16d672b94cf531f74040f4b36def33e0e3352b48
diff --git a/cmd/recipe_bootstrap/cipd.go b/cmd/recipe_bootstrap/cipd.go
index b8b2b79..be10c0b 100644
--- a/cmd/recipe_bootstrap/cipd.go
+++ b/cmd/recipe_bootstrap/cipd.go
@@ -26,7 +26,7 @@
// Return a string slice representation of ensure args.
func (ea *ensureArgs) ToArgs() []string {
- return []string{"-root", ea.installDir, "-ensure-file", "-"}
+ return []string{"ensure", "-root", ea.installDir, "-ensure-file", "-"}
}
// Ensure recipe bundle from CIPD at a specified dir for a specified version.
diff --git a/cmd/recipe_bootstrap/cipd_test.go b/cmd/recipe_bootstrap/cipd_test.go
index 9567b5c..9e7dbdf 100644
--- a/cmd/recipe_bootstrap/cipd_test.go
+++ b/cmd/recipe_bootstrap/cipd_test.go
@@ -45,6 +45,7 @@
{
"install_here",
[]string{
+ "ensure",
"-root",
"install_here",
"-ensure-file",
diff --git a/cmd/recipe_bootstrap/main.go b/cmd/recipe_bootstrap/main.go
index a1e8680..2b45196 100644
--- a/cmd/recipe_bootstrap/main.go
+++ b/cmd/recipe_bootstrap/main.go
@@ -150,8 +150,13 @@
return err
}
invokeOpts := invoke.Options{Namespace: namespace}
+ cwd, err := os.Getwd()
+ if err != nil {
+ return err
+ }
+ luciexePath := filepath.Join(cwd, cipdRoot, "luciexe")
// Invoke recipe bundle luciexe.
- if err := sr.invoke(ctx, filepath.Join(cipdRoot, "luciexe"), &invokeOpts); err != nil {
+ if err := sr.invoke(ctx, luciexePath, &invokeOpts); err != nil {
return err
}
return nil