Skip to content

Conversation

r-hang
Copy link
Contributor

@r-hang r-hang commented Jun 4, 2025

When testing the bazel driver, we ran into an error that flaged that the argument list as too long.

ERROR: ...json failed: (Exit -1): pkgjson failed: error executing Action command (from target //...) bazel-out/k8-opt-exec-ST-a828a81199fe/bin/external/io_bazel_rules_go/go/tools/gopackagesdriver/pkgjson/reset_pkgjson/pkgjson --id @//src/... --pkg_path ... (remaining 15 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Action failed to execute: java.io.IOException: Cannot run program "/home/user/.cache/bazel/_bazel_rhang/install/7e4ce7b0d69e79cb6bd84c7f9dfefe6b/process-wrapper" (in directory "/home/user/.cache/pkgdrv/0ddf1c72b811bee41d29991c732306ef72553747/sandbox/processwrapper-sandbox/29913/execroot/__main__"): error=7, Argument list too long
ERROR: Build did NOT complete successfully

Digging into this issue, the cause is that the pkgjson command takes in all of the fields of package archive data as arguments.

To work around this, we should preserve the original approach of writing a pkg json, before #4338, which used Skylark builtins to write the package content directly to disk.

The pkgjson command is updated to parse ths json file directly and write out a transformed pkg json with the cgo related corrections in order to avoid limits regarding argument size.

Note:

This diff also makes changes to undo a breaking change (i.e. changing
the signature of the make_pkg_json function) that was made in
#4338.

I revert changes to the functionalty of make_pkg_json and add a new
replacement function make_pkg_json_with_archive.

@fmeum
Copy link
Member

fmeum commented Jun 5, 2025

@tyler-french Is this a reason for a 0.55.1?

@r-hang r-hang force-pushed the rhang/pkg-driver-fix branch from cffd2b7 to c73e9cf Compare June 6, 2025 19:32
When testing the bazel driver, we ran into an error that flaged that
the argument list as too long.

```
ERROR: ...json failed: (Exit -1): pkgjson failed: error executing Action command (from target //...) bazel-out/k8-opt-exec-ST-a828a81199fe/bin/external/io_bazel_rules_go/go/tools/gopackagesdriver/pkgjson/reset_pkgjson/pkgjson --id @//src/... --pkg_path ... (remaining 15 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Action failed to execute: java.io.IOException: Cannot run program "/home/user/.cache/bazel/_bazel_rhang/install/7e4ce7b0d69e79cb6bd84c7f9dfefe6b/process-wrapper" (in directory "/home/user/.cache/pkgdrv/0ddf1c72b811bee41d29991c732306ef72553747/sandbox/processwrapper-sandbox/29913/execroot/__main__"): error=7, Argument list too long
ERROR: Build did NOT complete successfully
```

Digging into this issue, the cause is that the pkgjson command takes
in all of the fields of package archive data as arguments.

To work around this, we should preserve the original approach of writing
a pkg json, before  bazel-contrib#4338,
which used Skylark builtins to write the package content directly to disk.

The pkgjson command is updated to parse ths json file directly and
write out a transformed pkg json with the cgo related corrections in
order to avoid limits regarding argument size.

Note:

This diff also makes changes to undo a breaking change (i.e. changing
the signature of the make_pkg_json function) that was made in
bazel-contrib#4338.

I revert changes to the functionalty of make_pkg_json and add a new
replacement function make_pkg_json_with_archive.
@r-hang r-hang force-pushed the rhang/pkg-driver-fix branch from c73e9cf to 44d4447 Compare June 6, 2025 23:29
@fmeum fmeum merged commit 050ff83 into bazel-contrib:master Jun 10, 2025
1 check passed
linzhp pushed a commit that referenced this pull request Jun 10, 2025
…#4371)

When testing the bazel driver, we ran into an error that flaged that the
argument list as too long.

```
ERROR: ...json failed: (Exit -1): pkgjson failed: error executing Action command (from target //...) bazel-out/k8-opt-exec-ST-a828a81199fe/bin/external/io_bazel_rules_go/go/tools/gopackagesdriver/pkgjson/reset_pkgjson/pkgjson --id @//src/... --pkg_path ... (remaining 15 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Action failed to execute: java.io.IOException: Cannot run program "/home/user/.cache/bazel/_bazel_rhang/install/7e4ce7b0d69e79cb6bd84c7f9dfefe6b/process-wrapper" (in directory "/home/user/.cache/pkgdrv/0ddf1c72b811bee41d29991c732306ef72553747/sandbox/processwrapper-sandbox/29913/execroot/__main__"): error=7, Argument list too long
ERROR: Build did NOT complete successfully
```

Digging into this issue, the cause is that the pkgjson command takes in
all of the fields of package archive data as arguments.

To work around this, we should preserve the original approach of writing
a pkg json, before #4338,
which used Skylark builtins to write the package content directly to
disk.

The pkgjson command is updated to parse ths json file directly and write
out a transformed pkg json with the cgo related corrections in order to
avoid limits regarding argument size.

Note:
    
This diff also makes changes to undo a breaking change (i.e. changing
the signature of the make_pkg_json function) that was made in
#4338.

I revert changes to the functionalty of make_pkg_json and add a new
replacement function make_pkg_json_with_archive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants