Repository navigation
Open
Description
My username is abc def and I get an error running build.cmd.
PS> .\build.cmd
Determining projects to restore...
Tool 'coverlet.console' (version '1.7.2') was restored. Available commands: coverlet
Tool 'dotnet-reportgenerator-globaltool' (version '4.5.8') was restored. Available commands: reportgenerator
Tool 'microsoft.dotnet.xharness.cli' (version '1.0.0-prerelease.20403.2') was restored. Available commands: xharness
Restore was successful.
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
Restored C:\Users\abc def\Documents\dotnet-runtime\src\installer\pkg\projects\netcoreapp\pkg\legacy\Microsoft.NETCore.App.pkgproj (in 162 ms).
1 of 2 projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
Restored C:\Users\abc def\Documents\dotnet-runtime\src\installer\pkg\projects\netcoreapp\pkg\workaround\Microsoft.NETCore.App.pkgproj (in 43 ms).
Determining projects to restore...
All projects are up-to-date for restore.
Determining projects to restore...
All projects are up-to-date for restore.
System.Private.CoreLib -> C:\Users\abc def\Documents\dotnet-runtime\artifacts\bin\coreclr\Windows_NT.x64.Debug\IL\System.Private.CoreLib.dll
BUILD: Starting Build at 20:07:06.52
'""C:\Users\abc' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\abc def\Documents\dotnet-runtime\src\coreclr\runtime.proj(37,5): error MSB3073: The command ""C:\Users\abc def\Documents\dotnet-runtime\src\coreclr\build-runtime.cmd" -x64 -debug" exited with code 1.
Build FAILED.
C:\Users\abc def\Documents\dotnet-runtime\src\coreclr\runtime.proj(37,5): error MSB3073: The command ""C:\Users\abc def\Documents\dotnet-runtime\src\coreclr\build-runtime.cmd" -x64 -debug" exited with code 1.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:50.88
Build failed.
Some builds failed:
Configuration: Debug, Architecture: x64
After removing the line @if not defined _echo @echo off in build-runtime.cmd and running the file I get the same error but with more details.
PS C:\Users\abc def\Documents\dotnet-runtime2> .\src\coreclr\build-runtime.cmd -x64 -release -enforcegpo
C:\Users\abc def\Documents\dotnet-runtime2>setlocal EnableDelayedExpansion EnableExtensions
C:\Users\abc def\Documents\dotnet-runtime2>set "__MsgPrefix=BUILD: "
C:\Users\abc def\Documents\dotnet-runtime2>echo BUILD: Starting Build at 20:11:03.01
BUILD: Starting Build at 20:11:03.01
C:\Users\abc def\Documents\dotnet-runtime2>set __ThisScriptFull="C:\Users\abc def\Documents\dotnet-runtime2\src\coreclr\build-runtime.cmd"
C:\Users\abc def\Documents\dotnet-runtime2>set __ThisScriptDir="C:\Users\abc def\Documents\dotnet-runtime2\src\coreclr\"
C:\Users\abc def\Documents\dotnet-runtime2>call ""C:\Users\abc def\Documents\dotnet-runtime2\src\coreclr\""\setup_vs_tools.cmd
'""C:\Users\abc' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\abc def\Documents\dotnet-runtime2>if NOT '1' == '0' goto ExitWithError
C:\Users\abc def\Documents\dotnet-runtime2>exit /b 1
It seems like there is an issue with quotes at the line call ""C:\Users\abc def\Documents\dotnet-runtime2\src\coreclr\""\setup_vs_tools.cmd.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
danmoseley commentedon Sep 17, 2020
I think these
runtime/src/coreclr/build-runtime.cmd
Lines 10 to 11 in c87e75e
should probably not add quotes and instead the quotes should be applied where they are used
runtime/src/coreclr/build-runtime.cmd
Line 13 in c87e75e
runtime/src/coreclr/build-runtime.cmd
Line 724 in c87e75e
Same in crossgen-corelib.cmd.
Can you try that and see how it works?
Building the repo when there's a space in the path breaks periodically because we dont have a test to protect it and apparently nobody that works on the repo day to day has this configuration.
verdie-g commentedon Sep 17, 2020
Adding some quotes at the right place allowed to execute few more lines without errors until the same issue happened again. I think quotes are missing at many places in the scripts and I don't feel comfortable doing the PR. It should be easy to reproduce by adding a space in the project folder though.
danmoseley commentedon Sep 17, 2020
Too bad thanks for trying. Realistically this is going to keep breaking regularly and probably not a high priority. Can you place the repo another location?
verdie-g commentedon Sep 17, 2020
Is having a test with a space in the path not possible?
I have the student version of Windows 10 which forces $"{firstName} {lastName}" as a username so I'll move the folder to C: or maybe it's time to get a real license 👍
danmoseley commentedon Sep 17, 2020
We could modify one of our CI legs potentially (cc @safern) but it's probably not a priority because the workaround is pretty easy. I put my repo for example in C:\git\runtime
verdie-g commentedon Sep 18, 2020
After putting the repository in
C:\dev\dotnet-runtimeI get the same error. It seems like it's searching for files under my user folder.safern commentedon Sep 22, 2020
It seems like we need to add quotes to usages of
_ILasmDir:runtime/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets
Line 138 in 9d1ec34
and also to usages of
_ILdasmDir:runtime/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets
Line 82 in 9d1ec34
trylek commentedon Sep 22, 2020
I suspect this will blow up in multiple places in the scripts as we're generally not too consistent about quoting everything. I'm adding this to the infra backlog project as it definitely merits fixing, it's just likely to have quite a bit of a bug tail.
mangod9 commentedon Sep 24, 2020
I have a partial fix I am validating here: #42671.
C:\With Space\runtime>build -subset clr+libsshould now work if the targets fix is manually applied.danmoseley commentedon Sep 24, 2020
This has come up and been fixed again a number of times. I suggest to either protect the next fix with CI or just document it doesn't work.
16 remaining items
mangod9 commentedon Sep 28, 2020
keeping this open so we can track the CI changes to ensure this doesnt regress, but that will have to wait for the
il.targetsto propagate to sdk and back.lkempf commentedon Nov 11, 2020
I have found a regression of this issue. Executing
./build.cmd -subset clr -ninjafails when the build path contains spaces as of commit e8bba0b. This is caused by missing quotes inbuild-runtime.cmdaround%__IntermediatesDir%.There also is a problem with generating timestamps which I have not been able to pinpoint yet.
mangod9 commentedon Nov 11, 2020
Hey @lkempf, thanks for reporting the issue. Would you like to submit a PR, assuming its a simple fix? Else will take a look later this week, we also plan to add verification for this within the CI.
trylek commentedon Nov 11, 2020
FYI @jkoritzinsky
lkempf commentedon Nov 11, 2020
I've created #44540 to fix the issue I could pinpoint.
ViktorHofer commentedon May 5, 2021
@mangod9 as you are assigned to the issue, do you know what's remaining here? CI protection or an infra fix?
mangod9 commentedon May 5, 2021
primarily CI protection, I had a fix made a few months ago, but there is a good possibility things have since regressed.
ivdiazsa commentedon Aug 24, 2022
This is still a thing in as noted in #73327. I wrote a deeper explanation here #73327 (comment).
dotnet-policy-service commentedon Apr 13, 2026
Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.