Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with MSB3073 if there are spaces in the path #13740

Open
Tyrrrz opened this issue Nov 5, 2019 · 8 comments · Fixed by dotnet/coreclr#27704
Open

Build fails with MSB3073 if there are spaces in the path #13740

Tyrrrz opened this issue Nov 5, 2019 · 8 comments · Fixed by dotnet/coreclr#27704
Labels
area-ILTools-coreclr help wanted [up-for-grabs] Good issue for external contributors in-pr There is an active PR which will close this issue when it is merged Priority:2 Work that is important, but not critical for the release
Milestone

Comments

@Tyrrrz
Copy link
Contributor

Tyrrrz commented Nov 5, 2019

OS: Windows 10
Head: 46bc2ab4d

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.

@danmoseley
Copy link
Member

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://github.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=&quot;@(IntermediateAssembly)&quot; $(_KeyFileArgument) @(Compile, ' ')">
should probably be
<Exec Command="&quot;$(_IlasmDir)ilasm&quot; $(_IlasmSwitches) $(_OutputTypeArgument) $(IlasmFlags) -OUTPUT=&quot;@(IntermediateAssembly)&quot; $(_KeyFileArgument) @(Compile, ' ')">

@danmoseley danmoseley transferred this issue from dotnet/corefx Nov 6, 2019
@Tyrrrz
Copy link
Contributor Author

Tyrrrz commented 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
Copy link
Contributor Author

Tyrrrz commented 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.

jkotas referenced this issue in dotnet/coreclr Nov 7, 2019
This fixes issues when running build.cmd in dotnet/corefx when there are spaces on the path.
Fixes #27699
@stephentoub
Copy link
Member

Fix reverted in dotnet/coreclr#27793

@stephentoub stephentoub reopened this Nov 9, 2019
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@BruceForstall BruceForstall added this to the 5.0 milestone May 11, 2020
@BruceForstall BruceForstall removed the untriaged New issue has not been triaged by the area owner label May 11, 2020
@BruceForstall BruceForstall added the help wanted [up-for-grabs] Good issue for external contributors label Jun 3, 2020
@logiclrd
Copy link
Contributor

Can confirm this is still happening.

@danmoseley
Copy link
Member

@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
Copy link
Contributor

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.

@logiclrd
Copy link
Contributor

Confirmed that with a user profile in C:\Users\Jonathan instead of C:\Users\Jonathan Gilbert, build runs through to completion with no errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ILTools-coreclr help wanted [up-for-grabs] Good issue for external contributors in-pr There is an active PR which will close this issue when it is merged Priority:2 Work that is important, but not critical for the release
Projects
None yet
8 participants