Warn about generated Python Windows output path lengths - #210
Open
leileizhang (lei9444) wants to merge 3 commits into
Open
leileizhang (lei9444) wants to merge 3 commits into
leileizhang (lei9444) wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Accept optional trailing commas and format the two existing macro calls required by hosted Rust 1.99. Generated native signatures and behavior are unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Exercise eight generated types in two namespaces with one warning and no output writes. Document the existing global dry-run aggregation without changing generation behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mixed-language test coverageWorkflow status: ✅ Passed
|
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.
Problem
Rust can emit generated Python files that ordinary Windows Python imports, mypy, or pip cannot open. The existing 120-character module-component budget cannot constrain an arbitrary output root.
Fix
Emit one actionable stderr warning before transactional publication, using the actual final generated
.py/.pyiinventory, including namespace facades. Report the longest representative path, its UTF-16 length, and the shorter-output budget at the legacy 260-unit boundary. Resolve the caller's logical absolute path without counting extended prefixes, staging directories, or a junction's longer target. Dry runs aggregate all selected namespaces into one warning without writing;--no-pyiexcludes stubs.Document preferred short output/checkouts and validated same-path junction/
substrecipes, with primary Windows/Python references. Generation still succeeds; generated names, imports, layout, bytes, manifests, runtime ABI, versions, and machine configuration are unchanged.A separate additive CI-only prerequisite carries the exact authorized patch from
49c7e6e2e7042b527f1fee9d6655a8df8f537099: accept trailing commas in the existing test-hookstub!macro and format two calls for hosted Rust 1.99. Native signatures and behavior are unchanged; no functional feature prerequisite is imported.Verification
cargo fmt --all -- --checkand the original 57 focused Rust checks passed. Follow-up passed 4 CLI regressions, 7 path/classifier tests and 6 snapshots, including eight types across two namespaces yielding exactly one dry-run warning and no filesystem writes.cargo check -p jswinrt_rs --features test-hooks --libpassed for both ARM64 and x64. One additional JS-dependent naming check was unavailable without the builtbindings\js\dist\winrt.jsruntime.Native Windows ARM64 / CPython 3.13.15 /
LongPathsEnabled=0, using an isolated runtime wheel built from this main-based checkout:.py/.pyisubstAll 303 generated files are byte-identical to unchanged main and across these paths. The documented relative-output junction recipe also passed generation/import/mypy/install.
Limitations
Diagnostic only, not an automatic long-path guarantee. Pip build staging and deep venv/install destinations cannot all be predicted from codegen output. A short-built identical wheel still fails in a deep venv. The existing
test_generated_python_long_paths.ps1package build also fails identically on unchanged main in this long-path-disabled environment; this PR does not claim to fix it. No registry/TLS changes, module-layout redesign, or functional unmerged-branch dependencies.