Skip to content

Commit

Permalink
Remove unneeded packages from stdlib (#4093)
Browse files Browse the repository at this point in the history
**What type of PR is this?**
perf improvement

**What does this PR do? Why is it needed?**
This cuts down the time to build the stdlib from 8.1 to 7.4s in my
testing and it also reduces the size of the `sdk.libs` depset and the
resulting linkcfg files.

I wasn't sure if it's ok to exclude all of `cmd/`; I suspect it should
be ok since the toolchain has prebuilt tools anyway, in which case we
can simplify the glob pattern.

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**
  • Loading branch information
dzbarsky authored Sep 14, 2024
1 parent 0433213 commit 7eba57f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion go/private/BUILD.sdk.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,21 @@ filegroup(

filegroup(
name = "srcs",
srcs = glob(["src/**"]),
srcs = glob(
["src/**/*"],
exclude = [
"src/**/*_test.go",
"src/**/testdata/**",
"src/cmd/**",
"src/log/slog/internal/benchmarks/**",
"src/log/slog/internal/slogtest/**",
"src/internal/obscuretestdata/**",
"src/internal/testpty/**",
"src/net/internal/socktest/**",
"src/reflect/internal/example*/**",
"src/runtime/internal/startlinetest/**",
],
),
)

filegroup(
Expand Down

0 comments on commit 7eba57f

Please sign in to comment.