Description
Found in #992 (#987). After #992, the property expansion applies MSBuild's Unix path fixup (MaybeAdjustFilePath) exactly wherever its probe is absolute, and declines a seed's backslash that meets a relative probe. One known gap remains.
A relative probe of project text is assumed to miss. When the document's own text has a backslash whose rewritten first segment is relative (obj\x), MSBuild probes Directory.Exists("obj") under its working directory, which a served evaluation does not know. The walk assumes the probe misses, so the backslash is kept. That matches MSBuild started from a directory holding none of the segments, but not one started from a directory holding obj/.
Declining instead would decline the SDK's own obj\ and take the NuGet chain with it, so #992 did not. This is the remaining provenance work in docs/msbuild-unix-path-fixup-plan.md.
path_fixup_expansion_diff already runs MSBuild from two working directories. It allows a move between them only where the document's own text holds the \, so this boundary is measured, not hidden.
Options
- On the A₁ path, where the startup directory is supplied (msbuild: take MSBuildStartupDirectory as an input to the restore cone's evaluation (#674) #971), decide the probe exactly.
- For served evaluations, find out which relative first segments real projects and the SDK spell. If the SDK's are all under paths MSBuild would resolve the same way from any plausible working directory, a narrower decline may be affordable. Measure with the corpus differentials first.
🤖 Generated with Claude Code
Activity
Smaug123 commentedon Nov 19, 2026
This gap now produces a wrong answer that a consumer reads. Codex found it reviewing the fsc assembly-name derivation (#1007).
Minimal repro (dotnet 10.0.401, macOS). Run MSBuild from the project's directory, which is where
dotnet buildand every build request run it:obj/beside the projectobj/in MSBuild's working directoryP/Robj\/FALSEobj//TRUEobj//TRUEThe evaluator answers
obj\/FALSEin every row. The rewrite follows the process's working directory, not the project's directory, and it changes the stored property value, not just the comparison.The SDK reaches the same state. A restored SDK project has
obj/, sodotnet msbuild -getProperty:BaseIntermediateOutputPath, run from the project's directory, printsobj/once restore has createdobj/andobj\before.<AssemblyName Condition="'$(BaseIntermediateOutputPath)'=='obj/'">Moved</AssemblyName>buildsMoved.dll, but the evaluation trustsAssemblyNameas the project name.MSBuild code (dotnet/msbuild
mainat 6d52671ffe4c):src/Build/Evaluation/Expander.cs,ExpandIntoStringLeaveEscaped:result = FileUtilities.MaybeAdjustFilePath(result);(line 260). It passes no base directory.src/Framework/FileUtilities.cs,MaybeAdjustFilePath(line 716) converts\to/and keeps the result whenLooksLikeUnixFilePathholds.LooksLikeUnixFilePath(line 822) defaults an emptybaseDirectorytoCurrentThreadWorkingDirectory ?? "", which is the process's working directory outside multi-threaded mode. It then checksDirectoryExists(Path.Combine(baseDirectory, firstSegment)).Why no differential catches it:
fsproj_property_table_diff's generator writes no backslash at all.msbuild-condition-oracle) inherits the test process's working directory,crates/msbuild, which has noobj/. So the SDK chain'sobj\is only ever graded from a working directory where MSBuild agrees with "the probe misses".path_fixup_expansion_diffdoes vary the working directory, but it allows exactly this movement for project text. That is correct for its own purpose, but nothing downstream treats the value as uncertain.#1007 works around it locally: it declines whenever a write from outside the install to
AssemblyName,TargetName,TargetExtorOutputTypeis conditional. The fix belongs here.fsc: decline foreign conditions (#993), escaped file names and unlist…
Smaug123 commentedon Nov 19, 2026
Blocking count for #1007's derivation: it declines any document outside the install that holds a condition (
NameDecline::Conditional), as a stopgap for this issue. That rule blocks 6/6 pinned project-corpus projects and 97/97.fsprojfiles overall: the 24 in the corpus checkouts plus fsharp-src's 73. The count comes fromfsc_name_census, an ignored report test inborzoi-msbuild. With this fixed, conditions whose operands are trusted-exact can be admitted again. The sibling rules are tracked in #1061–#1067.Smaug123 commentedon Nov 19, 2026
Correction to the count above: fsharp-src's 73 projects sit under a
global.jsonthat selects an SDK the census does not reproduce, so they are now reported as unevaluated rather than counted. The conditions rule blocks 6/6 pinned projects and 24/24.fsprojfiles in the corpus checkouts.fsc_args oracle and the compiled assembly name, held certain-implies-…
fsc_args oracle and the compiled assembly name, held certain-implies-…
msbuild, lsp: decide MSBuild's Unix path fixup across startup directo…
msbuild: close codex round 24's findings on the #993 walk
msbuild: close codex round 25's findings on the #993 walk
msbuild: close codex round 26's findings on the #993 walk
msbuild: weigh each startup world's throw apart (codex round 27, #993)
msbuild: close codex round 28's findings on the #993 walk
msbuild: close codex round 29's findings on the #993 walk
27 remaining items
msbuild: close codex round 8 (xhigh) on the batch of Updates (#993, P…
msbuild: close codex round 9 (xhigh) on the batch of Updates (#993, P…
msbuild: close codex round 10 (xhigh) on the batch of Updates (#993, …
msbuild: close codex round 11 (high) on the batch of Updates (#993, P…
msbuild: close codex round 12 (high) on the batch of Updates (#993, P…
msbuild: a file's own path seeds may splice an item reference (#993, …
msbuild: close codex round 13 (high) on the batch of Updates (#993, P…
msbuild: close codex round 14 (high) on the batch of Updates (#993, P…
msbuild: close codex round 15 (high) on the batch of Updates (#993, P…
msbuild: close codex round 16 (high) on the batch of Updates (#993, P…
msbuild: close codex round 17 (high) on the batch of Updates (#993, P…
msbuild: close codex round 18 (high) on the batch of Updates (#993, P…
msbuild: close codex round 19 (high) on the batch of Updates (#993, P…
msbuild: close codex round 20 (high) on the batch of Updates (#993, P…
msbuild: close codex round 21 (high) on the batch of Updates (#993, P…