Skip to content

Starlark extension loading fails on Windows: paths interpolated into source break escape parsing #376

Open

Description

@David-Noble-at-work

Loading a Starlark extension fails on Windows because a Windows filesystem path is interpolated into Starlark source, where backslashes are escape sequences.

Evidence

From the first three-platform CI run (PR #375, commit f8b28c82, job test (windows-latest)):

sourcefile_integration_test.go: LoadExtensionsFrom: load extension com.test.SourceFile:
load command test.source-file:
exec C:\Users\RUNNER~1\AppData\Local\Temp\TestSourceFile_StarlarkIntegration1\1\star\extensions\com.test.SourceFile\commands\test-source-file.star:
...test-source-file.star:N:N: invalid escape sequence \Users\RUN

\U is not a valid Starlark escape, so the path C:\Users\... fails to parse the moment it lands inside a string literal.

Why it matters

This is not a test artifact. Any Windows path reaching Starlark source through the same route breaks — the failure is in the product's extension loading, not in the test's expectations. It cannot occur on Linux or macOS, and CI never ran this package on Windows until #373 phase 1 landed the platform matrix.

Likely shape of the fix

A path embedded in generated or templated Starlark must be escaped for Starlark string syntax, or converted to forward-slash form (which Go accepts for filesystem calls on Windows), or passed as a value rather than interpolated into source text. Which of those is correct depends on where the interpolation happens; that is the first thing to establish.

Found by the platform test matrix (#373) on its first run. Classified bucket 1 — a genuine platform defect — under that plan's phase 2 triage.


Epic: #430 · Feature: #373

Metadata

Metadata

Labels

Epic:WindowsCampaignThe Windows campaign epicPriority:P1This cycleSeverity:HighA supported path is broken with no workaroundbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions