microsoft / BuildXL

Microsoft Build Accelerator
MIT License
902 stars 141 forks source link

Building bxl fails with missing VisualCppTools NuGet package #1288

Closed kjczarne closed 2 years ago

kjczarne commented 3 years ago

Hi,

I've tried building the most recent tag of BuildXL and every single time I get the following error message:

Microsoft (R) Build Accelerator. Build: 0.1.0-20210514.2, Version:
[refs/heads/master:72d7d2d0ac4773e6c674fc7bba035e3b91411162]
Copyright (C) Microsoft Corporation. All rights reserved.

[0:02] -- Telemetry is enabled. SessionId: cae8eac1-0000-0000-bd07-34637fb90a41
[22:41] error DX11331: Nuget failed to download package 'VisualCppTools.Community.VS2017Layout': Package nuget://VisualCppTools.Community.VS2017Layout/14.11.25506 could not be restored: the package is not found.
Build FAILED
    Log Directory: C:\Users\kjczarne\Desktop\BuildXL\Out\Logs\20210521-165538
The BuildXL build failed with exit code 3

The error appears when running a full install as well as with the -minimal flag. Am I missing something configuration-wise? I followed the Developer Guide and used bxl.cmd in Windows Command Line.

pgunasekara commented 3 years ago

Thanks for reporting this to us! Could you please share your BuildXL.log file located under Out/Logs//BuildXL.log? I was able to reproduce this issue once, but a subsequent run seemed to work fine. Could you please also confirm whether this is the case for you?

kjczarne commented 3 years ago

BuildXL.log

Log appended. I'm also having often intermittent file handle locks, perhaps it's related, perhaps not. Let me know if I can provide any extra info apart from that. 😉

pgunasekara commented 3 years ago

Thanks for providing us with the logs! It appears that package has been deprecated and that's why you're hitting this issue. I am working on a fix at the moment, I will update you once it has been released.

Regarding the file handle lock issue you're hitting. I'm not seeing anything specific about that in the log file, could you please describe it in a bit more detail for me?

kjczarne commented 3 years ago

Hey Pasindu, sorry for a late reply I've been on a 2 week vacation. I tried replicating the issue with the file handle but it seems to be intermittent and happens only on occasion. If I catch bxl doing this again, I will make sure to open an issue for that. Thanks again for looking into this!

pgunasekara commented 3 years ago

No worries! Just wanted to update you on this, I almost have a fix ready, I hope to be able to get back to you later this week.

pgunasekara commented 3 years ago

Hey @kjczarne, I'm sorry for getting back to you so late! We had some internal issues with releasing a fix for this, and I was on vacation for a little while so it kept getting delayed. I have released the fix here. Next time you build, please sync the latest changes from our master branch and install the latest version of the visual studio 2019 build tools (please see the third point under the Windows section here). Then try to build buildxl once more using the bxl.cmd -minimal command.

Once again I'm very sorry for making you wait so long for the fix, please let us know if you run into other issues. Thank you for trying BuildXL!

kjczarne commented 2 years ago

Thanks Pasindu, I will try to validate whether this works for me within the next few days 😉

kjczarne commented 2 years ago

So I've:

  1. Pulled from master
  2. Installed the most recent Windows SDK
  3. Added the MSVC (v142) - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.29-16.10) workload in Visual Studio Installer
  4. Ran the bxl.cmd -minimal command

And I am now getting a different kind of an error:

C:\Users\kczarnecki\Desktop\BuildXL\Public\Sdk\Public\Managed\Testing\XUnit\xunitframework.dsc(67,9): error DX9377: Could not find file 'C:\Users\kczarnecki\Desktop\BuildXL\Out\frontend\Nuget\pkgs\xunit.runner.console.2.4.1\tools\netcoreapp2.0\xunit.runner.utility.netcoreapp10.dll' in static directory.
Stack trace:
  C:\Users\kczarnecki\Desktop\BuildXL\Public\Sdk\Public\Managed\Testing\XUnit\xunitframework.dsc(67,9): at additionalRuntimeContent [Debug]
  [ambient call]: at args.merge [?]
  C:\Users\kczarnecki\Desktop\BuildXL\Public\Sdk\Public\Managed\testing.dsc(31,16): at test [Debug]
  C:\Users\kczarnecki\Desktop\BuildXL\Public\Sdk\SelfHost\BuildXL\BuildXLSdk.dsc(407,18): at test [Debug]
  C:\Users\kczarnecki\Desktop\BuildXL\Public\Src\FrontEnd\UnitTests\Sdk\TestBuildXL.FrontEnd.Sdk.dsc(6,24) [?].
Build FAILED
    Log Directory: C:\Users\kczarnecki\Desktop\BuildXL\Out\Logs\20210815-015143

Just to clarify: you mentioned VS BuildTools, do I need to have a separate installation of BuildTools if I'm already using VS 2019 Community?

pgunasekara commented 2 years ago

Hey @kjczarne, unfortunately I did not see your comment as I was out of office last week, sorry for the late reply! You can indeed use VS 2019 community for this without any issues as long as you have the correct version of MSVC installed (which it looks like you do).

This specific error looks unrelated to your original issue. Looks like perhaps the xunit.runner.console package did not sync properly and you're missing a file (xunit.runner.utility.netcoreapp10.dll).

Could you please try deleting the following directories and rerunning the bxl -minimal command?

Out\frontend\Nuget\pkgs\xunit.runner.console.2.4.1
Out\frontend\Nuget\specs\xunit.runner
Out\frontend\Nuget\cfgs\xunit.runner.console.2.4.1
kjczarne commented 2 years ago

Hi @pgunasekara, thanks for the heads-up! I've cleared the Out directory and was able to finally build BXL without problems. I will be testing BXL over the next few months and I'll give you more feedback if I run into issues. Many thanks again for your help!