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-runtime.cmd fails when the latest version in C:\Program Files (x86)\Windows Kits\10\Lib does not contain ucrt #42774

Open
Maoni0 opened this issue Sep 26, 2020 · 4 comments
Labels
area-Infrastructure-coreclr help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@Maoni0
Copy link
Member

Maoni0 commented Sep 26, 2020

Initial cost estimate: 1 week
Initial contacts: @trylek, @hoyosjs, @ViktorHofer

so I just freshly cloned the repo and failed to build. this was what I got when trying to build clr -

  CSC : warning CS1668: Invalid search path 'C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64' specified in 'LIB environment variable' -- 'directory does not exist' [C:\runtime-doubly-fl\artifacts\obj\coreclr\Windows_NT.x64.Release\src\ToolBox\SOS\DacTableGen\dactablegen.csproj]
  CSC : warning CS1668: Invalid search path 'C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86' specified in 'LIB environment variable' -- 'directory does not exist' [C:\runtime-doubly-fl\artifacts\obj\coreclr\Windows_NT.x64.Release\src\ToolBox\SOS\DacTableGen\dactablegen.csproj]
      4 Warning(s)
      0 Error(s)

  Time Elapsed 00:01:17.78
  File not found - *.dll
  0 File(s) copied
  BUILD: Error: Failed to copy the Universal CRT to the artifacts directory.
C:\runtime-doubly-fl\src\coreclr\runtime.proj(37,5): error MSB3073: The command ""C:\runtime-doubly-fl\src\coreclr\build-runtime.cmd" -x64 -release -enforcepgo" exited with code 4.

my latest version in C:\Program Files (x86)\Windows Kits\10\Lib is 10.0.19041.0 but it does not have a ucrt dir in it -

 Directory of C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0

08/19/2020  11:16 PM    <DIR>          .
08/19/2020  11:16 PM    <DIR>          ..
07/27/2020  01:23 AM    <DIR>          km
04/18/2019  06:46 PM               512 stub512.com
07/27/2020  12:44 AM    <DIR>          um

this is because I installed "Windows Driver Kit - Windows 10.0.19041.1" which created this 10.0.19041.0 dir but it did not install ucrt in it.

when I uninstalled the Windows Driver Kit the build succeeded. now the last ver in this dir does have ucrt:

C:\WINDOWS\system32>dir "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0"
Volume in drive C is OSDisk
Volume Serial Number is EA9A-AF54

 Directory of C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0

07/27/2020  12:56 AM    <DIR>          .
07/27/2020  12:56 AM    <DIR>          ..
07/27/2020  12:56 AM    <DIR>          ucrt
07/27/2020  12:56 AM    <DIR>          ucrt_enclave
07/27/2020  12:56 AM    <DIR>          um
               0 File(s)              0 bytes

so this says we have problems searching for the right dir for ucrt.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-coreclr untriaged New issue has not been triaged by the area owner labels Sep 26, 2020
@trylek trylek added this to the 6.0.0 milestone Sep 28, 2020
@trylek trylek added this to Reliability in Infrastructure Backlog CoreClr Sep 28, 2020
@trylek trylek removed the untriaged New issue has not been triaged by the area owner label Sep 28, 2020
@trylek trylek moved this from Reliability to TE: Dev Inner loop productivity in Infrastructure Backlog CoreClr Nov 8, 2020
@yew
Copy link
Member

yew commented Dec 10, 2020

@Maoni0
Solution: Simply create "ucrt\x64", "ucrt\x86" sub folders and rerun MSbuild. MSbuild doesn't actually need anything from this folder but it's set as input variable anyways during Visual Studio setup.

@trylek trylek added the help wanted [up-for-grabs] Good issue for external contributors label Mar 2, 2021
@hoyosjs
Copy link
Member

hoyosjs commented Jul 22, 2021

Haven't seen any other repro of this.

@hoyosjs hoyosjs moved this from 6.0.0 to 7.0.0 in Infrastructure Backlog Jul 22, 2021
@hoyosjs hoyosjs moved this from 7.0.0 to Future in Infrastructure Backlog Jul 22, 2021
@hoyosjs hoyosjs modified the milestones: 6.0.0, Future Jul 22, 2021
@drewnoakes
Copy link
Member

CS1668: Invalid search path 'C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64' specified in 'LIB environment variable' -- 'directory does not exist'

I hit this in VS after uninstalling that version (and several others) of the Windows SDK. Restarting VS seems to have made it go away.

@vatsan-madhavan
Copy link
Member

vatsan-madhavan commented Mar 25, 2024

FYI - I've done something like this to work around this warning in my builds.

  <PropertyGroup>
    <SetBuildDefaultEnvironmentVariablesDependsOn>
      _SanitizeLibraryPathComponents;
      $(SetBuildDefaultEnvironmentVariablesDependsOn);
    </SetBuildDefaultEnvironmentVariablesDependsOn>
  </PropertyGroup>

  <!--    
    Ensure that components of $(LibraryPath) that are actually not
    present on disk are removed.
    
    This target will run before 'SetBuildDefaultEnvironmentVariables'
    is called within Microsoft.Cpp.Current.targets,
    which sets the environment variable 'LIB' based on $(LibraryPath).
  -->
  <Target Name="_SanitizeLibraryPathComponents">
    <ItemGroup>
      <_LibraryPathComponents Include="$(LibraryPath)" />
    </ItemGroup>
    
    <PropertyGroup>
      <LibraryPath>@(_LibraryPathComponents->Exists())</LibraryPath>     
    </PropertyGroup>
  </Target>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure-coreclr help wanted [up-for-grabs] Good issue for external contributors
Projects
Status: No status
Infrastructure Backlog CoreClr
  
TE: Dev Inner loop productivity
Development

No branches or pull requests

7 participants