Skip to content

Refuse plugins on Windows spores, up front and with the reason (#1001) - #1041

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1001
Oct 16, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1001

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1001

Decision: Windows spores do not support plugins

Evidence from the plugin spec and registry (spore-host/spore-plugins, read-only):

  • All 12 registry plugins declare conditions.remote: [{type: platform, os: linux}]. Their steps are POSIX shell (systemctl, apt/dnf, curl | sh).
  • AUTHORING.md documents run as "Execute a shell command", and extract is tar.
  • CONCEPTS.md says: "Windows: there is no per-user account … The local-matching-user model is Linux-only". as_user depends on that model.

A PowerShell runner wouldn't make any existing plugin work, because each one would have to be rewritten for Windows. So we refuse, and say why:

path before now
spawn plugin install --instance <windows spore> ran local provision steps, then the remote install failed at the first sh -c refused before the plugin is resolved or any local step runs, based on the spawn:os=windows tag
spawn launch --os windows --plugin X (also sweeps) the Windows bootstrap carries no plugins, so the flag was silently dropped refused at preflight, naming the plugins
spored push API POST /v1/plugins/install on Windows 202, then fail at the first step 501 with the reason in the body (an older spawn prints the body), and no state recorded
spored launch-time declarations on Windows resolved, then failed skipped with one log line, no registry fetch

All four use one check and one message: plugin.CheckSporeOS / plugin.ErrWindowsSporeUnsupported. The decision is also documented in docs/windows-beta-guide.md (new "Not available on Windows: plugins" section) and in the spawn plugin install help text (docs-gen/plugin.md regenerated).

An instance spawn can't resolve (a raw user@host, or no AWS access) gets past the CLI guard. spored's own refusal covers that case.

Tests

  • cmd/plugin_windows_spore_test.go: runPluginInstall with a Windows-tagged instance (lookup injected via pluginInstanceLookup, no AWS) must return ErrWindowsSporeUnsupported, and must do so before resolving: the ref is a nonexistent ./ file, so a late or missing guard returns the resolve error instead. Linux, untagged and unresolvable instances pass the guard. windowsPluginGuard is covered too.
  • pkg/pluginruntime/windows_spore_test.go (runs on every OS by overriding hostGOOS): Install refused, no step ran (marker file absent), no state saved. The push API returns 501 with the reason. LoadFromDeclarations doesn't call the resolver.
  • pkg/plugin/spore_os_test.go: covers CheckSporeOS.
  • The pluginruntime tests that execute sh steps now skip on a Windows host via posixSporeOnly(t), because there's nothing to execute there.

Checked against reverts that compile (each guard changed to false && err != nil): all five refusal tests fail, with messages like = resolve plugin "./absent-plugin.yaml": … no such file, = <nil>, HTTP 202, want 501, a declaration was resolved on a Windows spore.

Caveats

  • CI: run the unit tests on Windows (#971) #973 is not merged, so scripts/windows-test-skips.txt isn't on main and pkg/pluginruntime can't come off it in this PR. The package now refuses on Windows and its sh-based tests skip there. But the Windows-tagged runs have only been compiled and vetted (GOOS=windows go vet), never executed, so remove the skip entry only once a Windows CI run shows the package green.
  • The call sites in launch_single.go / launch_sweep.go are one line each. The guard is tested where it lives, not through a full launch.
  • Filed plugin: conditions.remote is validated but never evaluated #1040: conditions.remote is validated but never evaluated anywhere, so a plugin's type: command remote pre-flight is silently ignored.

make check: everything passes except the known Docker-only TestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker. make check-nested: all 9 modules pass. GOOS=windows go vet ./... is clean except the pre-existing pkg/service / pkg/taskproto test-compile errors (#925, fixed by #941), which fail on main too.

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/launch_single.go 0.00% 1 Missing and 1 partial ⚠️
cmd/launch_sweep.go 0.00% 2 Missing ⚠️
pkg/pluginruntime/runtime.go 71.42% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Plugins are Linux-only. Steps run through sh -c, su - <user> -c, nohup
and tar. Every registry plugin in spore-host/spore-plugins declares
conditions.remote platform os: linux. The as_user "local matching user"
model is documented in spore-plugins CONCEPTS.md as Linux-only (a
Windows spore has only Administrator). A PowerShell runner would need
every plugin rewritten for Windows, so refuse instead:

- plugin.CheckSporeOS / ErrWindowsSporeUnsupported: one shared check
  and message.
- spawn plugin install: refuse a spawn:os=windows instance before the
  plugin is resolved or any local provision step runs.
- spawn launch --plugin with a Windows target: refuse. The Windows
  bootstrap carries no plugin declarations, so the flag was silently
  dropped.
- spored: Runtime.InstallWithProvenance refuses before recording state.
  The push API's install endpoint answers 501 with the reason, so an
  older spawn reports it. LoadFromDeclarations skips resolution.

Step-executing pluginruntime tests skip on a Windows host. The refusal
is tested on every OS by overriding hostGOOS. Documented in
docs/windows-beta-guide.md and in spawn plugin install's help.

(#1001)
@scttfrdmn
scttfrdmn merged commit 92502b7 into main Oct 16, 2026
8 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1001 branch October 16, 2026 23:14
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.

pluginruntime: plugin remote steps run via sh/su/tar, so a Windows spore cannot run them

1 participant