Skip to content

Fix Windows mdoc framework-root path - #12808

Merged
jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-fix-windows-mdoc-path
Sep 16, 2026
Merged

jonathanpeppers merged 2 commits into
mainfrom
jonathanpeppers-fix-windows-mdoc-path

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Summary

  • build the mdoc framework-root path with System.IO.Path.DirectorySeparatorChar
  • keep the quoted mdoc update path valid on Windows by addressing the same directory as docs-gen-temp\.

Root cause

_RunMdoc passed $(BaseIntermediateOutputPath)docs-gen-temp/ to mdoc.exe fx-bootstrap. On Windows, mdoc enumerates framework child directories with backslashes while retaining the root's trailing /. Its substring calculation then drops the first character of the framework moniker (net-android-* becomes et-android-*) and fails with a missing-path error.

Independent Android 37.1 and Android 37.2 documentation-generation runs reproduced the same failure. Using a native trailing backslash fixes fx-bootstrap. The full target also requires avoiding a quoted argument that ends immediately in \, so mdoc update receives the equivalent docs-gen-temp\. path.

Base: origin/main at 261d2ce4894cb33942179f113f723eb6ec22f011.

Validation

  • .\dotnet-local.cmd build src\Mono.Android\Mono.Android.csproj -c Debug -p:AndroidApiLevel=37.2 -p:AndroidPlatformId=37.2 -p:AndroidFrameworkVersion=v17.2 -p:IsUnstableVersion=false -bl:bin\BuildDebug\mdoc-framework-37.2-build.binlog -nodeReuse:false
  • .\dotnet-local.cmd msbuild src\Mono.Android\Mono.Android.csproj -t:_RunMdoc -p:Configuration=Debug -p:TargetFramework=net11.0 -p:DocsApiLevel=37.2 -p:DocsPlatformId=37.2 -p:AndroidApiLevel=37.2 -p:AndroidPlatformId=37.2 -p:AndroidFrameworkVersion=v17.2 -p:IsUnstableVersion=false -bl:bin\BuildDebug\mdoc-run-37.2-fixed.binlog -nodeReuse:false -v:normal
    • fx-bootstrap exited successfully with -fx obj\docs-gen-temp\
    • src\Mono.Android\obj\docs-gen-temp\frameworks.xml was generated
    • mdoc update exited successfully with -fx "obj\docs-gen-temp\."
    • binlogtool found no docs-gen-temp\et-android-, missing-path, illegal-path, or MSB3073 entries
  • parsed Mono.Android.targets as XML and ran git diff --check
  • Unix behavior remains / through the documented platform contract of Path.DirectorySeparatorChar; no Unix runtime validation was run locally

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a3ce160e-e16a-4c88-b777-9fd23a3caa0a
Copilot AI lite review requested due to automatic review settings September 16, 2026 13:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The fix was validated successfully; only a minor documentation nit remains.

Pull request overview

This pull request fixes Windows mdoc framework-root path handling during Android documentation generation.

Changes:

  • Uses Path.DirectorySeparatorChar.
  • Appends . to preserve valid quoted Windows paths.
File summaries
File Summary
src/Mono.Android/Mono.Android.targets Corrects framework-root and mdoc path construction.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/Mono.Android/Mono.Android.targets Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a3ce160e-e16a-4c88-b777-9fd23a3caa0a
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Sep 16, 2026
@jonathanpeppers
jonathanpeppers merged commit b24d1a8 into main Sep 16, 2026
40 of 44 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-fix-windows-mdoc-path branch September 16, 2026 15:47
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants