From 8e15f69709f70fce745bcd281a1a2bc04468f95d Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Mon, 9 Oct 2023 12:26:21 -0700 Subject: Remove ?= assignements to product variables In make, all product variables are assigned to an empty string before including the product config makefiles. In starlark, we don't do that just so the memory usage is smaller. This means that in make, using ?= to assign a product config variable has no effect. Replicate this behavior in starlark by not emitting any code for ?= assignments of product variables. Fixes: 304324003 Test: go test Change-Id: Id31531506ac9e372a1bea92ce9ae8e17ae0ca70c --- mk2rbc/variable.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'mk2rbc/variable.go') diff --git a/mk2rbc/variable.go b/mk2rbc/variable.go index 0a26ed8b2..95e1f8ec7 100644 --- a/mk2rbc/variable.go +++ b/mk2rbc/variable.go @@ -109,14 +109,11 @@ func (pcv productConfigVariable) emitSet(gctx *generationContext, asgn *assignme } emitAppend() case asgnMaybeSet: - gctx.writef("if cfg.get(%q) == None:", pcv.nam) - gctx.indentLevel++ - gctx.newLine() - if needsSetDefault { - emitSetDefault() - } - emitAssignment() - gctx.indentLevel-- + // In mk2rbc.go we never emit a maybeSet assignment for product config variables, because + // they are set to empty strings before running product config. + panic("Should never get here") + default: + panic("Unknown assignment flavor") } gctx.setHasBeenAssigned(&pcv) -- cgit v1.2.3-59-g8ed1b