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

Building Terminal from the main branch says it can't find nugget.exe #16379

Open
nivowski opened this issue Nov 26, 2023 · 9 comments
Open

Building Terminal from the main branch says it can't find nugget.exe #16379

nivowski opened this issue Nov 26, 2023 · 9 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. Product-Meta The product is the management of the products.
Milestone

Comments

@nivowski
Copy link

Windows Terminal version

1.18.3181.0

Windows build number

10.0.19045.0

Other Software

No response

Steps to reproduce

PS C:\Users\vinny\Documents\programming\projet_tutoré\terminal> Import-Module .\tools\OpenConsole.psm1 PS C:\Users\vinny\Documents\programming\projet_tutoré\terminal> Set-MsBuildDevEnvironment Dev environment variables set PS C:\Users\vinny\Documents\programming\projet_tutoré\terminal> Invoke-OpenConsoleBuild &: The term 'C:/Users/vinny/Documents/programming/projet_tutor├⌐/terminal\dep\nuget\nuget.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. &: The term 'C:/Users/vinny/Documents/programming/projet_tutor├⌐/terminal\dep\nuget\nuget.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. MSBuild version 17.8.3+195e7f5a3 for .NET Framework MSBUILD : error MSB1009: Project file does not exist. Switch: C:/Users/vinny/Documents/programming/projet_tutor├⌐/terminal\OpenConsole.sln

Expected Behavior

No response

Actual Behavior

The build process as described in the developer documentation is not working as it says the nugget.exe package is missing

@nivowski nivowski added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 26, 2023
@zadjii-msft
Copy link
Member

Very curious error message there - does it work if you put the Terminal source in a directory that doesn't have an accented character like the é it's currently in?

The build script probably should be resilient to that sorta scenario, but that's my theory

@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. Area-Build Issues pertaining to the build system, CI, infrastructure, meta Product-Meta The product is the management of the products. labels Nov 27, 2023
@zadjii-msft zadjii-msft added this to the Backlog milestone Nov 27, 2023
@nivowski
Copy link
Author

Very curious error message there - does it work if you put the Terminal source in a directory that doesn't have an accented character like the é it's currently in?

The build script probably should be resilient to that sorta scenario, but that's my theory

You were right, the build script doesn't include accented character to work. I replaced with a simple "e" without accent and it's actually building but is it normal that it takes a lot of time to build? I've been waiting for like 20+ minutes.

@nivowski
Copy link
Author

Edit: It finally finished building however the building failed with 5 errors:

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targe ts(5198,5): error MSB3030: Could not copy the file "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\too ls\TerminalStress\obj\Debug\net6.0\apphost.exe" because it was not found. [C:\Users\vinny\Documents\programming\projet_ tutore\terminal\src\tools\TerminalStress\TerminalStress.csproj] Done Building Project "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\tools\TerminalStress\TerminalStr ess.csproj" (default targets) -- FAILED. Done Building Project "C:\Users\vinny\Documents\programming\projet_tutore\terminal\OpenConsole.sln" (default targets) - - FAILED. Build FAILED. "C:\Users\vinny\Documents\programming\projet_tutore\terminal\OpenConsole.sln" (default target) (1) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\CascadiaPackage\CascadiaPackage.wapproj.metap roj" (default target) (2) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\ShellExtension\WindowsTerminalShellExt.vcxpro j" (default target) (3) -> (ClCompile target) -> C:\Users\vinny\Documents\programming\projet_tutore\terminal\packages\Microsoft.Windows.ImplementationLibrary.1.0.2308 24.2\include\wil\cppwinrt.h(91,1): error C1083: Cannot open include file: 'winrt/base.h': No such file or directory [C: \Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\ShellExtension\WindowsTerminalShellExt.vcxproj] "C:\Users\vinny\Documents\programming\projet_tutore\terminal\OpenConsole.sln" (default target) (1) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\host\exe\Host.EXE.vcxproj.metaproj" (default target) ( 8) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\host\exe\Host.EXE.vcxproj" (default target) (14) -> (ManifestResourceCompile target) -> C:\Users\vinny\Documents\programming\projet_tutore\terminal\obj\x64\Debug\Host.EXE\OpenConsole_manifest.rc(1): error RC2135: file not found: C:\Users\vinny\Documents\programming\projet_tutorΘ\terminal\obj\x64\Debug\Host.EXE\OpenConsole. exe.embed.manifest [C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\host\exe\Host.EXE.vcxproj] "C:\Users\vinny\Documents\programming\projet_tutore\terminal\OpenConsole.sln" (default target) (1) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\WpfTerminalControl\WpfTerminalControl.csproj" (default target) (84) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\WpfTerminalControl\WpfTerminalControl.csproj" (Build target) (84:2) -> (ResolvePackageAssets target) -> C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266, 5): error NETSDK1064: Package StyleCop.Analyzers, version 1.1.118 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path lengt h restrictions. [C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\WpfTerminalControl\WpfTermina lControl.csproj::TargetFramework=net472] "C:\Users\vinny\Documents\programming\projet_tutore\terminal\OpenConsole.sln" (default target) (1) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\WpfTerminalControl\WpfTerminalControl.csproj" (default target) (84) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\WpfTerminalControl\WpfTerminalControl.csproj" (Build target) (84:3) -> C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266, 5): error NETSDK1064: Package StyleCop.Analyzers, version 1.1.118 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path lengt h restrictions. [C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\cascadia\WpfTerminalControl\WpfTermina lControl.csproj::TargetFramework=net6.0-windows] "C:\Users\vinny\Documents\programming\projet_tutore\terminal\OpenConsole.sln" (default target) (1) -> "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\tools\TerminalStress\TerminalStress.csproj" (default t arget) (114) -> (_CopyOutOfDateSourceItemsToOutputDirectory target) -> C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.tar gets(5198,5): error MSB3030: Could not copy the file "C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\t ools\TerminalStress\obj\Debug\net6.0\apphost.exe" because it was not found. [C:\Users\vinny\Documents\programming\proje t_tutore\terminal\src\tools\TerminalStress\TerminalStress.csproj] 6 Warning(s) 5 Error(s) Time Elapsed 00:22:38.29

@lhecker
Copy link
Member

lhecker commented Nov 27, 2023

[...] but is it normal that it takes a lot of time to build? I've been waiting for like 20+ minutes.

Yes, unfortunately cppwinrt is very slow to compile. There are ways to speed it up (by sharing the PCH file), but we haven't had time yet to figure out how to make it work.

C:\Users\vinny\Documents\programming\projet_tutore\terminal\obj\x64\Debug\Host.EXE\OpenConsole_manifest.rc(1): error  RC2135: file not found:
C:\Users\vinny\Documents\programming\projet_tutorΘ\terminal\obj\x64\Debug\Host.EXE\OpenConsole.exe.embed.manifest [C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\host\exe\Host.EXE.vcxproj]    

While I'm not entirely sure why your build failed, the difference between tutore and tutorΘ worries me. I think your build cache is broken. I usually resolve that by rebuilding everything from scratch, but it also doesn't take 20min for me...

@nivowski
Copy link
Author

[...] but is it normal that it takes a lot of time to build? I've been waiting for like 20+ minutes.

Yes, unfortunately cppwinrt is very slow to compile. There are ways to speed it up (by sharing the PCH file), but we haven't had time yet to figure out how to make it work.

C:\Users\vinny\Documents\programming\projet_tutore\terminal\obj\x64\Debug\Host.EXE\OpenConsole_manifest.rc(1): error  RC2135: file not found:
C:\Users\vinny\Documents\programming\projet_tutorΘ\terminal\obj\x64\Debug\Host.EXE\OpenConsole.exe.embed.manifest [C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\host\exe\Host.EXE.vcxproj]    

While I'm not entirely sure why your build failed, the difference between tutore and tutorΘ worries me. I think your build cache is broken. I usually resolve that by rebuilding everything from scratch, but it also doesn't take 20min for me...

How to clean building cache before doing again the build process? Is there an argument to pass to the "Invoke-OpenConsoleBuild" command?

@nivowski
Copy link
Author

nivowski commented Nov 27, 2023

[...] but is it normal that it takes a lot of time to build? I've been waiting for like 20+ minutes.

Yes, unfortunately cppwinrt is very slow to compile. There are ways to speed it up (by sharing the PCH file), but we haven't had time yet to figure out how to make it work.

C:\Users\vinny\Documents\programming\projet_tutore\terminal\obj\x64\Debug\Host.EXE\OpenConsole_manifest.rc(1): error  RC2135: file not found:
C:\Users\vinny\Documents\programming\projet_tutorΘ\terminal\obj\x64\Debug\Host.EXE\OpenConsole.exe.embed.manifest [C:\Users\vinny\Documents\programming\projet_tutore\terminal\src\host\exe\Host.EXE.vcxproj]    

While I'm not entirely sure why your build failed, the difference between tutore and tutorΘ worries me. I think your build cache is broken. I usually resolve that by rebuilding everything from scratch, but it also doesn't take 20min for me...

How to clean building cache before doing again the build process? Is there an argument to pass to the "Invoke-OpenConsoleBuild" command?

I solved my build issue as suggested in https://learn.microsoft.com/en-us/nuget/consume-packages/package-restore by doing msbuild t:restore .\OpenConsole.sln and then Invoke-OpenConsoleBuild (msbuild .\OpenConsole.sln should work aswell).

@zadjii-msft
Copy link
Member

This is almost certainly the root cause:

function Find-OpenConsoleRoot
{
$root = (git rev-parse --show-toplevel 2>$null)
If ($?) {
return $root
}
return $script:OpenConsoleFallbackRoot
}

PowerShell parses it in the ACP, which explodes here

@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Nov 29, 2023
@nivowski
Copy link
Author

This is almost certainly the root cause:

function Find-OpenConsoleRoot
{
$root = (git rev-parse --show-toplevel 2>$null)
If ($?) {
return $root
}
return $script:OpenConsoleFallbackRoot
}

PowerShell parses it in the ACP, which explodes here

I don't really understand what's wrong in the code you showed as I debugged the script by printing different output to ensure everything is fine. My supposition tells me that it's certainly the nuget cause when invoking the Invoke-OpenConsoleBuild() as with running msbuild t:restore, the build appears to be success(packages missing and not retrieved with nuget?):

function Invoke-OpenConsoleBuild()
{
$root = Find-OpenConsoleRoot
& "$root\dep\nuget\nuget.exe" restore "$root\OpenConsole.sln"
& "$root\dep\nuget\nuget.exe" restore "$root\dep\nuget\packages.config"
msbuild.exe "$root\OpenConsole.sln" @args
}

@nivowski
Copy link
Author

This is almost certainly the root cause:

function Find-OpenConsoleRoot
{
$root = (git rev-parse --show-toplevel 2>$null)
If ($?) {
return $root
}
return $script:OpenConsoleFallbackRoot
}

PowerShell parses it in the ACP, which explodes here

I don't really understand what's wrong in the code you showed as I debugged the script by printing different output to ensure everything is fine. My supposition tells me that it's certainly the nuget cause when invoking the Invoke-OpenConsoleBuild() as with running msbuild t:restore, the build appears to be success(packages missing and not retrieved with nuget?):

function Invoke-OpenConsoleBuild()
{
$root = Find-OpenConsoleRoot
& "$root\dep\nuget\nuget.exe" restore "$root\OpenConsole.sln"
& "$root\dep\nuget\nuget.exe" restore "$root\dep\nuget\packages.config"
msbuild.exe "$root\OpenConsole.sln" @args
}

Update:

I actually downloaded the latest nuget executable from the official website and replaced the one used on this project and the error about "Exception thrown" disappeared. Can I have my hands on this issue to fix this bug? Thank you in advance.

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. Product-Meta The product is the management of the products.
Projects
None yet
Development

No branches or pull requests

3 participants