bazel-contrib / bazel-contrib/rules_go

Argument list too long on macOS

Open
#2,002 8 comments 2 reactions 0 assignees View on GitHub
bug darwin
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

- rules_go v2.30
- gazelle 0.17.0
- bazel 0.23.1

I put up a simple repro project that anyone can clone:

```
~/src/github.com/jarreds $ git clone git@github.com:jarreds/toomanyfiles.git
Cloning into 'toomanyfiles'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (5/5), done.
~/src/github.com/jarreds $ cd toomanyfiles/
~/src/github.com/jarreds/toomanyfiles $ bazel build //:toomanyfiles
Loading:
Loading: 0 packages loaded
Analyzing: target //:toomanyfiles (1 packages loaded, 0 targets configured)
INFO: Analysed target //:toomanyfiles (3 packages loaded, 30 targets configured).
INFO: Found 1 target...
bazel: Entering directory `/private/var/tmp/_bazel_jward/f47a410108a7b6bad68cd01a437e2533/execroot/__main__/'
[0 / 7] [-----] BazelWorkspaceStatusAction stable-status.txt
ERROR: /private/var/tmp/_bazel_jward/f47a410108a7b6bad68cd01a437e2533/external/com_github_awslabs_goformation/cloudformation/resources/BUILD.bazel:3:1: GoCompile external/com_github_awslabs_goformation/cloudformation/resources/darwin_amd64_stripped/go_default_library%/github.com/awslabs/goformation/cloudformation/resources.a failed (Exit 1) builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder ... (remaining 4 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
compile: error starting compiler: fork/exec external/go_sdk/pkg/tool/darwin_amd64/compile: argument list too long
bazel: Leaving directory `/private/var/tmp/_bazel_jward/f47a410108a7b6bad68cd01a437e2533/execroot/__main__/'
Target //:toomanyfiles failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.137s, Critical Path: 0.40s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
```

Contributor guide

Open the contributing guide

Research direction

Clone the linked toomanyfiles repro and run `bazel build //:toomanyfiles` on macOS, using `--sandbox_debug` or `--verbose_failures` to inspect the failing Go compile action. The issue is resolved when the repro builds without the compiler's argument-list-too-long error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.