Repository navigation
feat(shim): Read .shim fields and body features - #6827
Merged
Merged
Conversation
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.
Description
Read
.shimfiles field by field instead of assumingpathis on the first line, and expose what the paired shim body supports.scoop shim info -vshows the body version, the features it advertises and the values the shim will use at launch. The bundled bodies move to cs v0.5.1, andscoop shim add <new> <existing>keeps the source shim's arguments.Motivation and Context
This prepares Scoop for the shim system it already moved to.
The official shim accepts fields in any order, appends repeated
args, and supportscwd, environment values and elevation, none of which Scoop could read or display. Its 0.5.1 build embeds the version and the features it implements in the executable's version resource.This is the read side of those features. A producer must only emit syntax the target body advertises, so the write side (environment, working directory, elevation) can build on it without re-reading the specification.
How Has This Been Tested?
Windows 11 x64, PowerShell 7.6.9:
./test/bin/test.ps1: 322 passed, 0 failed../supporting/shims/x64/shim.exe --version:shim 0.5.1 (cs)andFeatures: cwd env env-force expand dp0 elevate.shim.exefiles match thecs/v0.5.1release archives byte for byte on x86, x64 and arm64.scoop shim info <name> -vagainst a hand-written.shimin a temporary Scoop root: expanded target, arguments, cwd and environment, plus the body feature list and diagnostics.Checklist:
developbranch.

Confidence Score: 5/5
The PR appears safe to merge; all three previous findings are fixed.Summary
The PR reads
.shimfields independently and shows body features and resolved values throughscoop shim info -v..shimfile.Reviews (2) · Last reviewed commit: "fix(shim): Keep shim values as the body ..." · Reviewed by Greptile