go/tools/gopackagesdriver/pkgjson: Construct pkg json from file input#4371
Merged
fmeum merged 2 commits intobazel-contrib:masterfrom Jun 10, 2025
Merged
go/tools/gopackagesdriver/pkgjson: Construct pkg json from file input#4371fmeum merged 2 commits intobazel-contrib:masterfrom
fmeum merged 2 commits intobazel-contrib:masterfrom
Conversation
Member
|
@tyler-french Is this a reason for a 0.55.1? |
cffd2b7 to
c73e9cf
Compare
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.
c73e9cf to
44d4447
Compare
JamyDev
approved these changes
Jun 10, 2025
fmeum
approved these changes
Jun 10, 2025
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When testing the bazel driver, we ran into an error that flaged that the argument list as too long.
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.