dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.15k stars 4.71k forks source link

[Build] BuildTools issue #26342

Closed BredPet closed 4 years ago

BredPet commented 6 years ago

CoreFX/CoreRT build doesn't work. CoreCLR buildtools works only. I checked x86 and x64. Behavior doesn't change. I don't understand - how can this work in CI?) At the moment I use CoreCLR BuildTools and DotnetCLI versions in CoreFX/CoreRT.

CoreFX logs:

Installing dotnet cli...
Restoring BuildTools version 2.2.0-preview1-02830-02...
ERROR: Could not restore build tools correctly.
Please check the detailed log that follows.
Running: corefx/init-tools.sh
Installing 'https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-rc1-008673/dotnet-sdk-2.1.300-rc1-008673-linux-x64.tar.gz' to 'corefx/Tools/dotnetcli/dotnet.tar'
Running: corefx/Tools/dotnetcli/dotnet restore "corefx/init-tools.msbuild" --no-cache --packages corefx/packages --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json /p:BuildToolsPackageVersion=2.2.0-preview1-02830-02 /p:ToolsDir=corefx/Tools
corefx/Tools/dotnetcli/sdk/2.1.300-rc1-008673/Microsoft.Common.CurrentVersion.targets(5955,3): error MSB4019: The imported project "corefx/Tools/dotnetcli/sdk/2.1.300-rc1-008673/15.0/Microsoft.Common.targets/ImportAfter" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [corefx/init-tools.msbuild]
Using RID linux-x64 for BuildTools native tools
Initializing BuildTools...
chmod: cannot access 'corefx/packages/microsoft.dotnet.buildtools/2.2.0-preview1-02830-02/lib/init-tools.sh': No such file or directory
corefx/init-tools.sh: line 173: corefx/packages/microsoft.dotnet.buildtools/2.2.0-preview1-02830-02/lib/init-tools.sh: No such file or directory
ERROR: An error occurred when trying to initialize the tools.
Please check the detailed log that follows.
Running: corefx/init-tools.sh
Installing 'https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-rc1-008673/dotnet-sdk-2.1.300-rc1-008673-linux-x64.tar.gz' to 'corefx/Tools/dotnetcli/dotnet.tar'
Running: corefx/Tools/dotnetcli/dotnet restore "corefx/init-tools.msbuild" --no-cache --packages corefx/packages --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json /p:BuildToolsPackageVersion=2.2.0-preview1-02830-02 /p:ToolsDir=corefx/Tools
corefx/Tools/dotnetcli/sdk/2.1.300-rc1-008673/Microsoft.Common.CurrentVersion.targets(5955,3): error MSB4019: The imported project "corefx/Tools/dotnetcli/sdk/2.1.300-rc1-008673/15.0/Microsoft.Common.targets/ImportAfter" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [corefx/init-tools.msbuild]
Running: corefx/packages/microsoft.dotnet.buildtools/2.2.0-preview1-02830-02/lib/init-tools.sh corefx corefx/Tools/dotnetcli/dotnet corefx/Tools corefx/packages

CoreRT logs:

Installing dotnet cli...
Restoring BuildTools version 2.1.0-preview3-02711-02...
ERROR: Could not restore build tools correctly.
Please check the detailed log that follows.
Running: corert/init-tools.sh
Installing 'https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-rc1-008673/dotnet-sdk-2.1.300-rc1-008673-linux-x64.tar.gz' to 'corert/Tools/dotnetcli/dotnet.tar'
Running: corert/Tools/dotnetcli/dotnet restore "corert/init-tools.msbuild" --no-cache --packages corert/packages --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json /p:BuildToolsPackageVersion=2.1.0-preview3-02711-02
corert/Tools/dotnetcli/sdk/2.1.300-rc1-008673/Microsoft.Common.CurrentVersion.targets(5955,3): error MSB4019: The imported project "corert/Tools/dotnetcli/sdk/2.1.300-rc1-008673/15.0/Microsoft.Common.targets/ImportAfter" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [corert/init-tools.msbuild]
Initializing BuildTools...
chmod: cannot access 'corert/packages/microsoft.dotnet.buildtools/2.1.0-preview3-02711-02/lib/init-tools.sh': No such file or directory
corert/buildscripts/../init-tools.sh: line 135: corert/packages/microsoft.dotnet.buildtools/2.1.0-preview3-02711-02/lib/init-tools.sh: No such file or directory
ERROR: An error occurred when trying to initialize the tools.
Please check the detailed log that follows.
Running: corert/init-tools.sh
Installing 'https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-rc1-008673/dotnet-sdk-2.1.300-rc1-008673-linux-x64.tar.gz' to 'corert/Tools/dotnetcli/dotnet.tar'
Running: corert/Tools/dotnetcli/dotnet restore "corert/init-tools.msbuild" --no-cache --packages corert/packages --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json /p:BuildToolsPackageVersion=2.1.0-preview3-02711-02
corert/Tools/dotnetcli/sdk/2.1.300-rc1-008673/Microsoft.Common.CurrentVersion.targets(5955,3): error MSB4019: The imported project "corert/Tools/dotnetcli/sdk/2.1.300-rc1-008673/15.0/Microsoft.Common.targets/ImportAfter" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [corert/init-tools.msbuild]
Running: corert/packages/microsoft.dotnet.buildtools/2.1.0-preview3-02711-02/lib/init-tools.sh corert corert/Tools/dotnetcli/dotnet corert/Tools corert/packages
Using CLI tools version:
2.1.300-rc1-008673  NuGetFallbackFolder
corert/build.proj(20,3): error MSB4019: The imported project "corert/Tools/clean.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.37
Build Exit Code = 1

But CoreCLR:

Installing dotnet cli...
Restoring BuildTools version 2.2.0-preview1-02829-01...
Using RID linux-x64 for BuildTools native tools
Initializing BuildTools...
Making all .sh files executable under Tools.
  Restoring packages for coreclr/Tools/crossgen/crossgen.csproj...
  Installing runtime.linux-x64.Microsoft.NETCore.App 2.1.0-rtm-26507-03.
  Generating MSBuild file coreclr/Tools/crossgen/obj/crossgen.csproj.nuget.g.props.
  Generating MSBuild file coreclr/Tools/crossgen/obj/crossgen.csproj.nuget.g.targets.
  Restore completed in 2.1 min for coreclr/Tools/crossgen/crossgen.csproj.
Running crossgen on all assemblies in coreclr/Tools.
coreclr/Tools/Desktop.Analyzers.dll -> coreclr/Tools/Desktop.Analyzers.ni.dll
...

https://github.com/dotnet/corert/issues/5875

karelz commented 6 years ago

@BredPet does it happen for fresh clone of the repo? Does the file in question truly exist on the disk? cc @wtgodbe

BredPet commented 6 years ago

@BredPet does it happen for fresh clone of the repo?

yes

Does the file in question truly exist on the disk?

No, with this path - no.

jkotas commented 6 years ago

"corert/Tools/dotnetcli/sdk/2.1.300-rc1-008673/15.0/Microsoft.Common.targets/ImportAfter" was not found.

This directory should be created by tar -xf $__DOTNET_PATH/dotnet.tar command in the init-tools.sh script. Could you please try to run this command directly and see why it does not create it?

ViktorHofer commented 6 years ago

I assume this doesn't happen anymore as it works fine in CI. Closing. Feel free to comment on the issue if the issue still exists.