Skip to content

Commit

Permalink
Reduce number of declared files in emit_stdlib
Browse files Browse the repository at this point in the history
* The `src` directory is declared, but not passed to downstream rules.
  It has been declared since cfc58d9,
  but hasn't been exposed since 3680494
* Instead of writing a new root file, use the existing `pkg` directory.
  • Loading branch information
fmeum committed Nov 27, 2022
1 parent b3ebe1f commit 8e832cb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions go/private/actions/stdlib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,11 @@ def _sdk_stdlib(go):

def _build_stdlib(go):
pkg = go.declare_directory(go, path = "pkg")
src = go.declare_directory(go, path = "src")
root_file = go.declare_file(go, path = "ROOT")
args = go.builder_args(go, "stdlib")
args.add("-out", root_file.dirname)
args.add("-out", pkg.dirname)
if go.mode.race:
args.add("-race")
args.add_all(link_mode_args(go.mode))
go.actions.write(root_file, "")
env = go.env
if go.mode.pure:
env.update({"CGO_ENABLED": "0"})
Expand All @@ -105,7 +102,7 @@ def _build_stdlib(go):
go.sdk.tools +
[go.sdk.go, go.sdk.package_list, go.sdk.root_file] +
go.crosstool)
outputs = [pkg, src]
outputs = [pkg]
go.actions.run(
inputs = inputs,
outputs = outputs,
Expand All @@ -117,5 +114,5 @@ def _build_stdlib(go):
return GoStdLib(
_list_json = _build_stdlib_list_json(go),
libs = [pkg],
root_file = root_file,
root_file = pkg,
)

0 comments on commit 8e832cb

Please sign in to comment.