go/tools/gopackagesdriver/pkgjson: Construct pkg json from file input #4371
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.