Skip to content

feat(shim): Read .shim fields and body features - #6827

Merged
niheaven merged 7 commits into
developfrom
feat/shim-fields
Nov 9, 2026
Merged

niheaven merged 7 commits into
developfrom
feat/shim-fields

Conversation

@niheaven

@niheaven niheaven commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Description

Read .shim files field by field instead of assuming path is on the first line, and expose what the paired shim body supports. scoop shim info -v shows 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, and scoop 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 supports cwd, 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) and Features: cwd env env-force expand dp0 elevate.
  • Bundled shim.exe files match the cs/v0.5.1 release archives byte for byte on x86, x64 and arm64.
  • scoop shim info <name> -v against a hand-written .shim in a temporary Scoop root: expanded target, arguments, cwd and environment, plus the body feature list and diagnostics.

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; all three previous findings are fixed.

Summary

The PR reads .shim fields independently and shows body features and resolved values through scoop shim info -v.

  • Scoop reads shim fields wherever they appear in a .shim file.
  • Detailed shim info shows the body features and launch values.
  • New shims keep arguments from an existing shim.
  • Shim refreshes compare bodies without counting console or GUI mode.

Reviews (2) · Last reviewed commit: "fix(shim): Keep shim values as the body ..." · Reviewed by Greptile

Comment thread lib/shim.ps1 Resolved
Comment thread lib/shim.ps1 Resolved
Comment thread libexec/scoop-shim.ps1 Resolved
@niheaven
niheaven merged commit 3d06929 into develop Nov 9, 2026
4 checks passed
@niheaven
niheaven deleted the feat/shim-fields branch November 9, 2026 17:21
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.

1 participant