Skip to content

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

Description

@Tyrrrz

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.

Activity

  1. danmoseley commented on Nov 6, 2019

    @danmoseley
    Contributor

    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, ' ')">

  2. transferred this issue fromdotnet/corefxon Nov 6, 2019
  3. Tyrrrz commented on Nov 6, 2019

    @Tyrrrz
    ContributorAuthor

    Thanks for the insight, I will take a look at that file and see how I can substitute the targets to test it out.

  4. Tyrrrz commented on Nov 6, 2019

    @Tyrrrz
    ContributorAuthor

    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.

  5. stephentoub commented on Nov 9, 2019

    @stephentoub
    Member

    Fix reverted in dotnet/coreclr#27793

  6. transferred this issue fromdotnet/coreclron Jan 31, 2020
  7. added this to the 5.0 milestone on May 11, 2020
  8. removed
    untriagedNew issue has not been triaged by the area owner
    on May 11, 2020
  9. logiclrd commented on Jun 12, 2020

    @logiclrd
    Contributor

    Can confirm this is still happening.

  10. danmoseley commented on Jun 12, 2020

    @danmoseley
    Contributor

    @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?

  11. logiclrd commented on Jun 12, 2020

    @logiclrd
    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.

  12. logiclrd commented on Jun 15, 2020

    @logiclrd
    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.

  13. modified the milestones: 5.0.0, 6.0.0 on Jul 6, 2020
  14. modified the milestones: 6.0.0, Future on Aug 13, 2021
  15. added
    Priority:2Work that is important, but not critical for the release
    on Apr 24, 2023
  16. added
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions