fix(slsa): replace deprecated jq --argfile with --rawfile + fromjson - #209
Open
imlk0 wants to merge 1 commit into
Open
fix(slsa): replace deprecated jq --argfile with --rawfile + fromjson#209imlk0 wants to merge 1 commit into
imlk0 wants to merge 1 commit into
Conversation
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
jq 1.7+ deprecates --argfile. Replace it with the semantically equivalent --rawfile (reads the file as a raw string) combined with fromjson, which parses the string back into a JSON value. Verified the produced bundle is byte-identical to the previous --argfile output. Co-Authored-By: Claude <noreply@anthropic.com>
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
|
@imlk0 ,您好,您的请求已接收,请耐心等待结果。 |
|
@imlk0 ,您好,未检测到有镜像需要构建,如需重新检测请评论 /start 。 |
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.
Summary
tools/slsa/slsa-generatorused jq's--argfileoption, which is deprecated as of jq 1.7, makes it failed to run on Alinux4. This replaces it with the non-deprecated, semantically equivalent--rawfile+fromjson.Why
--argfilereads a file and parses it as JSON, storing the value in a variable. jq 1.7+ emits a deprecation warning for it and recommends moving off it. The drop-in replacement is--rawfile(reads the file contents as a raw string) combined withfromjson(parses that string back into a JSON value), producing an identical result.Changes
tools/slsa/slsa-generator: the twojq -ninvocations that built the trustee bundle now use--rawfile ... ($var|fromjson)instead of--argfile ... $var.Verification
Confirmed the produced bundle is byte-identical between the old and new invocations using sample JSON inputs:
🤖 Generated with Claude Code