Skip to content

Commit

Permalink
fix(compile): add missing GOAMD64 and GOARM env values in goctx.env_f…
Browse files Browse the repository at this point in the history
…or_path_mapping
  • Loading branch information
lbcjbb committed Sep 26, 2024
1 parent 6c1154a commit 3e5573d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions go/private/context.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,6 @@ def go_context(
"GODEBUG": "winsymlink=0",
}

# Path mapping can't map the values of environment variables, so we pass GOROOT to the action
# via an argument instead in builder_args. We need to drop it from the environment to get cache
# hits across different configurations since the stdlib path typically contains a Bazel
# configuration segment.
env_for_path_mapping = {k: v for k, v in env.items() if k != "GOROOT"}

# The level of support is determined by the platform constraints in
# //go/constraints/amd64.
# See https://go.dev/wiki/MinimumRequirements#amd64
Expand Down Expand Up @@ -587,7 +581,11 @@ def go_context(
coverage_enabled = ctx.configuration.coverage_enabled,
coverage_instrumented = ctx.coverage_instrumented(),
env = env,
env_for_path_mapping = env_for_path_mapping,
# Path mapping can't map the values of environment variables, so we pass GOROOT to the action
# via an argument instead in builder_args. We need to drop it from the environment to get cache
# hits across different configurations since the stdlib path typically contains a Bazel
# configuration segment.
env_for_path_mapping = {k: v for k, v in env.items() if k != "GOROOT"},
label = ctx.label,

# Action generators
Expand Down

0 comments on commit 3e5573d

Please sign in to comment.