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 spaces in user directory #438

Closed
fridtjof opened this issue May 6, 2019 · 12 comments
Closed

Build fails with spaces in user directory #438

fridtjof opened this issue May 6, 2019 · 12 comments
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@fridtjof
Copy link

fridtjof commented 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

@ourway
Copy link

ourway commented May 6, 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.

@wvdvegt
Copy link

wvdvegt commented May 7, 2019

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

@zadjii-msft
Copy link
Member

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 zadjii-msft added the Issue-Bug It either shouldn't be doing this or needs an investigation. label May 7, 2019
@zadjii-msft zadjii-msft added this to the Windows Terminal v1.0 milestone May 7, 2019
@zadjii-msft zadjii-msft added the Help Wanted We encourage anyone to jump in on these. label May 8, 2019
@zadjii-msft
Copy link
Member

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

@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented May 8, 2019 via email

@Ahava Ahava mentioned this issue May 8, 2019
@jpandersen87
Copy link

Files of note in regards to fixing directories not being quoted in commands (either by quotation marks or " 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.

@DHowett-MSFT DHowett-MSFT added the Area-Build Issues pertaining to the build system, CI, infrastructure, meta label May 9, 2019
@wvdvegt
Copy link

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

@RefundGarbage
Copy link

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.

@fridtjof
Copy link
Author

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

@PikaFan123
Copy link

PikaFan123 commented 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

@zugazagoitia
Copy link

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

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

image
image

@tejaswivykuntam
Copy link

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests