Build fails with spaces in user directory #653

Closed
opened 2026-01-30 21:58:06 +00:00 by claunia · 12 comments
Owner

Originally created by @fridtjof on GitHub (May 6, 2019).

  • Your Windows build number: 10.0.17763.437

  • What you're doing and what's happening:
    Trying to build using VS 2017 Enterprise, the build fails like this:

24>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: Der Befehl "
24>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073:         if not exist C:\Users\Fridtjof Mund\git\Terminal\x64\Debug\WindowsTerminal mkdir C:\Users\Fridtjof Mund\git\Terminal\x64\Debug\WindowsTerminal
24>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073:       
24>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: :VCEnd" wurde mit dem Code 3 beendet.

I suspect this is because of the space in my user folder. This also breaks razzle.cmd

Originally created by @fridtjof on GitHub (May 6, 2019). * Your Windows build number: 10.0.17763.437 * What you're doing and what's happening: Trying to build using VS 2017 Enterprise, the build fails like this: ``` 24>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: Der Befehl " 24>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: if not exist C:\Users\Fridtjof Mund\git\Terminal\x64\Debug\WindowsTerminal mkdir C:\Users\Fridtjof Mund\git\Terminal\x64\Debug\WindowsTerminal 24>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: 24>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: :VCEnd" wurde mit dem Code 3 beendet. ``` I suspect this is because of the space in my user folder. This also breaks razzle.cmd
claunia added the Help WantedIssue-BugArea-Build labels 2026-01-30 21:58:06 +00:00
Author
Owner

@ourway commented on GitHub (May 7, 2019):

IMHO, It's so fascinating to see Windows people got interested by a new Terminal. Looks like 25 years ago with a fedora 2.

@ourway commented on GitHub (May 7, 2019): IMHO, It's so fascinating to see Windows people got interested by a new Terminal. Looks like 25 years ago with a fedora 2.
Author
Owner

@wvdvegt commented on GitHub (May 7, 2019):

Same here (really annoying this kind of issues still exists).

@wvdvegt commented on GitHub (May 7, 2019): Same here (really annoying this kind of issues still exists).
Author
Owner

@zadjii-msft commented on GitHub (May 7, 2019):

Yep, this is a real bug. Should've escaped that commandline with quotes. I believe the bug is in one of the .props files, but I can't be sure which one.

@zadjii-msft commented on GitHub (May 7, 2019): Yep, this is a real bug. Should've escaped that commandline with quotes. I believe the bug is in one of the `.props` files, but I can't be sure which one.
Author
Owner

@zadjii-msft commented on GitHub (May 8, 2019):

If someone wanted to dig into this and properly escape the commands in question, I'd happily review the PR :)

@zadjii-msft commented on GitHub (May 8, 2019): If someone wanted to dig into this and properly escape the commands in question, I'd happily review the PR :)
Author
Owner

@DHowett-MSFT commented on GitHub (May 8, 2019):

Or, replace the commands with real MSBuild rules!


From: Mike Griese notifications@github.com
Sent: Wednesday, May 8, 2019 12:29:06 PM
To: microsoft/Terminal
Cc: Subscribed
Subject: Re: [microsoft/Terminal] Build fails with spaces in user directory (#438)

If someone wanted to dig into this and properly escape the commands in question, I'd happily review the PR :)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTerminal%2Fissues%2F438%23issuecomment-490618915&data=01%7C01%7Cduhowett%40microsoft.com%7C5b0d4d0a981240f8773e08d6d3eb6fd6%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=vSCHR9xkU%2FscVbvNh7vhpGF%2BBHRL5b1T9IoBFECTNFM%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADNHLGR3C4NPDNUIKXVGUB3PUMSYFANCNFSM4HLD5M2A&data=01%7C01%7Cduhowett%40microsoft.com%7C5b0d4d0a981240f8773e08d6d3eb6fd6%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=KvSG%2FW8ibHUDXdhVdC5u8mohLWbrpQ0cl6p1Ts8i%2BQc%3D&reserved=0.

@DHowett-MSFT commented on GitHub (May 8, 2019): Or, replace the commands with real MSBuild rules! ________________________________ From: Mike Griese <notifications@github.com> Sent: Wednesday, May 8, 2019 12:29:06 PM To: microsoft/Terminal Cc: Subscribed Subject: Re: [microsoft/Terminal] Build fails with spaces in user directory (#438) If someone wanted to dig into this and properly escape the commands in question, I'd happily review the PR :) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTerminal%2Fissues%2F438%23issuecomment-490618915&data=01%7C01%7Cduhowett%40microsoft.com%7C5b0d4d0a981240f8773e08d6d3eb6fd6%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=vSCHR9xkU%2FscVbvNh7vhpGF%2BBHRL5b1T9IoBFECTNFM%3D&reserved=0>, or mute the thread<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADNHLGR3C4NPDNUIKXVGUB3PUMSYFANCNFSM4HLD5M2A&data=01%7C01%7Cduhowett%40microsoft.com%7C5b0d4d0a981240f8773e08d6d3eb6fd6%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=KvSG%2FW8ibHUDXdhVdC5u8mohLWbrpQ0cl6p1Ts8i%2BQc%3D&reserved=0>.
Author
Owner

@jpandersen87 commented on GitHub (May 8, 2019):

Files of note in regards to fixing directories not being quoted in commands (either by quotation marks or &quot; as necessary):

  • src\host\ft_uia\Host.Tests.UIA.csproj
  • src\cppwinrt.build.post.props
  • src\propsheet\propsheet.vcxproj (I inserted a period character after the output path variables to force a period before the ending slash so that mc.exe was happy)

I am able to successfully build the CascadiaPackage project on x64 release after these changes.

@jpandersen87 commented on GitHub (May 8, 2019): Files of note in regards to fixing directories not being quoted in commands (either by quotation marks or `&quot;` as necessary): - src\host\ft_uia\Host.Tests.UIA.csproj - src\cppwinrt.build.post.props - src\propsheet\propsheet.vcxproj (I inserted a period character after the output path variables to force a period before the ending slash so that mc.exe was happy) I am able to successfully build the CascadiaPackage project on x64 release after these changes.
Author
Owner

@wvdvegt commented on GitHub (May 9, 2019):

  1. src\host\ft_uia\Host.Tests.UIA.csproj (added " entities):
  <PropertyGroup>
    <PostBuildEvent>copy &quot;$(SolutionDir)\dep\WinAppDriver\*&quot; &quot;$(OutDir)&quot;\</PostBuildEvent>
  </PropertyGroup>
  1. src\propsheet\propsheet.vcxproj (added " entities to mc.exe arguments AND added a . to $(IntermediateOutputPath) because the project uses a .dll suffix):
  <Target Name="MessageCompile" Inputs="@(MessageCompile)" Outputs="$(IntermediateOutputPath)\%(MessageCompile.Filename).h" BeforeTargets="ClCompile">
    <Exec Command="mc.exe /h &quot;$(IntermediateOutputPath).&quot; /r &quot;$(IntermediateOutputPath).&quot; @(MessageCompile)" />
  </Target>
  1. src\cppwinrt.build.post.props (added " entities to xcopy arguments):
  <ItemDefinitionGroup Condition="'$(NoOutputRedirection)'=='true' And '$(ConfigurationType)'=='DynamicLibrary' And '$(DontCopyOutput)'!='true'">
    <PostBuildEvent Condition="'$(Platform)'!='Win32'">
      <Command>
        echo OutDir=$(OutDir)
        (echo f | xcopy /y &quot;$(OutDir)$(ProjectName).dll&quot; &quot;$(OpenConsoleDir)$(Platform)\$(Configuration)\$(ProjectName).dll&quot; )
        (echo f | xcopy /y &quot;$(OutDir)$(ProjectName).pdb&quot; &quot;$(OpenConsoleDir)$(Platform)\$(Configuration)\$(ProjectName).pdb&quot; )
      </Command>
    </PostBuildEvent>
    <PostBuildEvent Condition="'$(Platform)'=='Win32'">
      <Command>
        echo OutDir=$(OutDir)
        (echo f | xcopy /y &quot;$(OutDir)$(ProjectName).dll&quot; &quot;$(OpenConsoleDir)$(Configuration)\$(ProjectName).dll&quot; )
        (echo f | xcopy /y &quot;$(OutDir)$(ProjectName).pdb&quot; &quot;$(OpenConsoleDir)$(Configuration)\$(ProjectName).pdb&quot; )
      </Command>
    </PostBuildEvent>
  </ItemDefinitionGroup>
  1. tools\razzle.cmd (added "):
rem call .razzlerc - for your generic razzle environment stuff
if exist "%OPENCON_TOOLS%\.razzlerc.cmd" (
    call "%OPENCON_TOOLS%\.razzlerc.cmd"
)   else (
    (
        echo @echo off
        echo.
        echo rem This is your razzlerc file. It can be used for default dev environment setup.
    ) > "%OPENCON_TOOLS%\.razzlerc.cmd"
)
  1. tools\opencon.cmd (added plain quotes):
if not exist "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\OpenConsole.exe" (
    echo Could not locate the OpenConsole.exe in "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%". Double check that it has been built and try again.
    goto :eof
)

and

(echo f | xcopy /Y "%_last_build%\OpenConsole.exe" %TEMP%\%copy_dir%\OpenConsole.exe) > nul
(echo f | xcopy /Y "%_last_build%\OpenConsole.exe" %TEMP%\%copy_dir%\conhost.exe) > nul
(echo f | xcopy /Y "%_last_build%\VtPipeTerm.exe" %TEMP%\%copy_dir%\VtPipeTerm.exe) > nul
(echo f | xcopy /Y "%_last_build%\Nihilist.exe" %TEMP%\%copy_dir%\Nihilist.exe) > nul
(echo f | xcopy /Y "%_last_build%\console.dll" %TEMP%\%copy_dir%\console.dll) > nul

and counting...

@wvdvegt commented on GitHub (May 9, 2019): 1) src\host\ft_uia\Host.Tests.UIA.csproj (added &quot; entities): ``` <PropertyGroup> <PostBuildEvent>copy &quot;$(SolutionDir)\dep\WinAppDriver\*&quot; &quot;$(OutDir)&quot;\</PostBuildEvent> </PropertyGroup> ``` 2) src\propsheet\propsheet.vcxproj (added &quot; entities to mc.exe arguments AND added a . to $(IntermediateOutputPath) because the project uses a .dll suffix): ``` <Target Name="MessageCompile" Inputs="@(MessageCompile)" Outputs="$(IntermediateOutputPath)\%(MessageCompile.Filename).h" BeforeTargets="ClCompile"> <Exec Command="mc.exe /h &quot;$(IntermediateOutputPath).&quot; /r &quot;$(IntermediateOutputPath).&quot; @(MessageCompile)" /> </Target> ``` 3) src\cppwinrt.build.post.props (added &quot; entities to xcopy arguments): ``` <ItemDefinitionGroup Condition="'$(NoOutputRedirection)'=='true' And '$(ConfigurationType)'=='DynamicLibrary' And '$(DontCopyOutput)'!='true'"> <PostBuildEvent Condition="'$(Platform)'!='Win32'"> <Command> echo OutDir=$(OutDir) (echo f | xcopy /y &quot;$(OutDir)$(ProjectName).dll&quot; &quot;$(OpenConsoleDir)$(Platform)\$(Configuration)\$(ProjectName).dll&quot; ) (echo f | xcopy /y &quot;$(OutDir)$(ProjectName).pdb&quot; &quot;$(OpenConsoleDir)$(Platform)\$(Configuration)\$(ProjectName).pdb&quot; ) </Command> </PostBuildEvent> <PostBuildEvent Condition="'$(Platform)'=='Win32'"> <Command> echo OutDir=$(OutDir) (echo f | xcopy /y &quot;$(OutDir)$(ProjectName).dll&quot; &quot;$(OpenConsoleDir)$(Configuration)\$(ProjectName).dll&quot; ) (echo f | xcopy /y &quot;$(OutDir)$(ProjectName).pdb&quot; &quot;$(OpenConsoleDir)$(Configuration)\$(ProjectName).pdb&quot; ) </Command> </PostBuildEvent> </ItemDefinitionGroup> ``` 4) tools\razzle.cmd (added "): ``` rem call .razzlerc - for your generic razzle environment stuff if exist "%OPENCON_TOOLS%\.razzlerc.cmd" ( call "%OPENCON_TOOLS%\.razzlerc.cmd" ) else ( ( echo @echo off echo. echo rem This is your razzlerc file. It can be used for default dev environment setup. ) > "%OPENCON_TOOLS%\.razzlerc.cmd" ) ``` 5) tools\opencon.cmd (added plain quotes): ``` if not exist "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%\OpenConsole.exe" ( echo Could not locate the OpenConsole.exe in "%OPENCON%\bin\%ARCH%\%_LAST_BUILD_CONF%". Double check that it has been built and try again. goto :eof ) ``` and ``` (echo f | xcopy /Y "%_last_build%\OpenConsole.exe" %TEMP%\%copy_dir%\OpenConsole.exe) > nul (echo f | xcopy /Y "%_last_build%\OpenConsole.exe" %TEMP%\%copy_dir%\conhost.exe) > nul (echo f | xcopy /Y "%_last_build%\VtPipeTerm.exe" %TEMP%\%copy_dir%\VtPipeTerm.exe) > nul (echo f | xcopy /Y "%_last_build%\Nihilist.exe" %TEMP%\%copy_dir%\Nihilist.exe) > nul (echo f | xcopy /Y "%_last_build%\console.dll" %TEMP%\%copy_dir%\console.dll) > nul ``` and counting...
Author
Owner

@RefundGarbage commented on GitHub (May 10, 2019):

One possible solution:
DON'T put the files under your user folder, or any sub directories from your user folder such as Documents, Downloads.
Even USB drives work fine.

@RefundGarbage commented on GitHub (May 10, 2019): One possible solution: **DON'T** put the files under your user folder, or any sub directories from your user folder such as Documents, Downloads. Even USB drives work fine.
Author
Owner

@fridtjof commented on GitHub (May 10, 2019):

To be fair, that's a workaround, not a solution.

@fridtjof commented on GitHub (May 10, 2019): To be fair, that's a workaround, not a solution.
Author
Owner

@PikaFan123 commented on GitHub (May 12, 2019):

One possible solution:
DON'T put the files under your user folder, or any sub directories from your user folder such as Documents, Downloads.
Even USB drives work fine.

I tried doing this but still get the same Error

Edit:
Turns out the Language was the Problem for me because XCopy on german machines wants 'd' instead of 'f' as you can see in #507

@PikaFan123 commented on GitHub (May 12, 2019): > > > One possible solution: > **DON'T** put the files under your user folder, or any sub directories from your user folder such as Documents, Downloads. > Even USB drives work fine. I tried doing this but still get the same Error Edit: Turns out the Language was the Problem for me because XCopy on german machines wants 'd' instead of 'f' as you can see in #507
Author
Owner

@zugazagoitia commented on GitHub (May 21, 2019):

There's still a problem in the post-compile commands.

Some paths are unquoted, i was able to fix it like this.

image
image

@zugazagoitia commented on GitHub (May 21, 2019): There's still a problem in the post-compile commands. Some paths are unquoted, i was able to fix it like this. ![image](https://user-images.githubusercontent.com/23284823/58079867-4b588b80-7bb2-11e9-8331-f737a42f9178.png) ![image](https://user-images.githubusercontent.com/23284823/58079882-54495d00-7bb2-11e9-8a37-b2f82d7d5761.png)
Author
Owner

@tejaswivykuntam commented on GitHub (May 22, 2019):

20>mc : error : 0x3 trying to open file <Uchiha\Documents\Terminal\\obj\x64\Release\Propsheet.DLL\>. 20>C:\Users\Itachi Uchiha\Documents\Terminal\src\propsheet\propsheet.vcxproj(81,5): error MSB3073: The command "mc.exe /h C:\Users\Itachi Uchiha\Documents\Terminal\\obj\x64\Release\Propsheet.DLL\ /r C:\Users\Itachi Uchiha\Documents\Terminal\\obj\x64\Release\Propsheet.DLL\ strid.mc" exited with code 1.

@tejaswivykuntam commented on GitHub (May 22, 2019): `20>mc : error : 0x3 trying to open file <Uchiha\Documents\Terminal\\obj\x64\Release\Propsheet.DLL\>. 20>C:\Users\Itachi Uchiha\Documents\Terminal\src\propsheet\propsheet.vcxproj(81,5): error MSB3073: The command "mc.exe /h C:\Users\Itachi Uchiha\Documents\Terminal\\obj\x64\Release\Propsheet.DLL\ /r C:\Users\Itachi Uchiha\Documents\Terminal\\obj\x64\Release\Propsheet.DLL\ strid.mc" exited with code 1.`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#653