From 578925bcbcaef470c75aea9e463ca6a44ac10c17 Mon Sep 17 00:00:00 2001 From: Laura Peskin Date: Tue, 19 Nov 2024 16:10:36 -0800 Subject: pkg/build: avoid relying on environment file for ffx --- pkg/build/starnix.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pkg/build') diff --git a/pkg/build/starnix.go b/pkg/build/starnix.go index e629c004e..1ab542929 100644 --- a/pkg/build/starnix.go +++ b/pkg/build/starnix.go @@ -17,6 +17,11 @@ import ( type starnix struct{} +// The location of the default ffx build config (a Fuchsia implementation detail), +// relative to the kernel build dir. Contains default relative paths of build +// artifacts. +const ffxBuildConfig = "ffx-config.json" + // The name of the Fuchsia assembly override defined in `overrideRule`. const overrideName = "syzkaller_starnix" @@ -54,10 +59,11 @@ func (st starnix) build(params Params) (ImageDetails, error) { if err := osutil.SandboxChown(localDir); err != nil { return ImageDetails{}, err } + buildDir := filepath.Join(params.KernelDir, "out/"+arch) if _, err := runSandboxed( time.Hour, params.KernelDir, - "scripts/fx", "--dir", "out/"+arch, + "scripts/fx", "--dir", buildDir, "set", product, "--assembly-override", fmt.Sprintf("//products/workbench/*=//local:%s", overrideName), ); err != nil { @@ -75,6 +81,8 @@ func (st starnix) build(params Params) (ImageDetails, error) { 30*time.Second, params.KernelDir, ffxBinary, + "--no-environment", + "-c", filepath.Join(buildDir, ffxBuildConfig), "-c", "log.enabled=false,ffx.analytics.disabled=true,daemon.autostart=false", "config", "get", "product.path", ) @@ -86,6 +94,7 @@ func (st starnix) build(params Params) (ImageDetails, error) { 30*time.Second, params.KernelDir, ffxBinary, + "--no-environment", "-c", "log.enabled=false,ffx.analytics.disabled=true,daemon.autostart=false", "product", "get-image-path", productBundlePath, "--slot", "a", -- cgit mrf-deployment