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: Error: Failed to generate version headers . And System.TimeoutException #27987

Open
Kevin920920 opened this issue Jan 11, 2020 · 4 comments
Open

Comments

@Kevin920920
Copy link

@Kevin920920 Kevin920920 commented Jan 11, 2020

E:\Downloads\coreclr-3.1.0>build.cmd
BUILD: Starting Build at 15:58:14.03
BUILD: Searching for Visual Studio 2017 or later installation
BUILD: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"


** Visual Studio 2019 Developer Command Prompt v16.4.1
** Copyright (c) 2019 Microsoft Corporation


BUILD: Commencing CoreCLR product build
BUILD: Checking prerequisites
BUILD: Number of processor cores 4
未能从“https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/microsoft.net.compilers.toolset/3.3.0-beta2-19367-02/microsoft.net.compilers.toolset.3.3.0-beta2-19367-02.nupkg”下载包“Microsoft.Net.Compilers.Toolset.3.3.0-beta2-19367-02”。
由于在 60000 毫秒内未接收到数据,“https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/microsoft.net.compilers.toolset/3.3.0-beta2-19367-02/microsoft.net.compilers.toolset.3.3.0-beta2-19367-02.nupkg”的下载超时。
Exception of type 'System.TimeoutException' was thrown.
未能从“https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/microsoft.net.compilers.toolset/3.3.0-beta2-19367-02/microsoft.net.compilers.toolset.3.3.0-beta2-19367-02.nupkg”下载包“Microsoft.Net.Compilers.Toolset.3.3.0-beta2-19367-02”。
The SSL connection could not be established, see inner exception.
Unable to read data from the transport connection: 远程主机强迫关闭了一个现有的连接。.
远程主机强迫关闭了一个现有的连接。
E:\Downloads\coreclr-3.1.0\eng\empty.csproj 的还原在 17.91 min 内完成。
E:\Downloads\coreclr-3.1.0.packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): error : 无法定位包含目录 'E:\Downloads\coreclr-3.1.0\eng' 的存储库。 [E:\Downloads\coreclr-3.1.0\eng\empty.csproj]
E:\Downloads\coreclr-3.1.0.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19461.7\tools\Version.targets(53,5): error : SourceRevisionId is not set, which means the SourceLink targets are not included in the build. Those are needed to produce a correct sha for our build outputs. [E:\Downloads\coreclr-3.1.0\eng\empty.csproj]

生成失败。

E:\Downloads\coreclr-3.1.0.packages\microsoft.build.tasks.git\1.0.0-beta2-19367-01\build\Microsoft.Build.Tasks.Git.targets(24,5): error : 无法定位包含目录 'E:\Downloads\coreclr-3.1.0\eng' 的存储库。 [E:\Downloads\coreclr-3.1.0\eng\empty.csproj]
E:\Downloads\coreclr-3.1.0.packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.19461.7\tools\Version.targets(53,5): error : SourceRevisionId is not set, which means the SourceLink targets are not included in the build. Those are needed to produce a correct sha for our build outputs. [E:\Downloads\coreclr-3.1.0\eng\empty.csproj]
0 个警告
2 个错误

已用时间 00:17:55.82
Build failed.
BUILD: Error: Failed to generate version headers.

@jeffschwMSFT

This comment has been minimized.

Copy link
Member

@jeffschwMSFT jeffschwMSFT commented Jan 16, 2020

@hoyosjs

This comment has been minimized.

Copy link
Member

@hoyosjs hoyosjs commented Jan 16, 2020

A quick question would be how did you clone the repo? The name of the directory makes it sound like you downloaded a ZIP of the repository from the releases tab. Sadly I don't think this will work as it doesn't contain a .git folder. We use sourcelink, which uses the target InitializeSourceControlInformationFromSourceControlManager from Microsoft.Build.Tasks.Git to get repository metadata to embed into the images produced, including setting SourceRevisionId. There's no good way to work around this AFAIK. If you downloaded the source in that manner, can you please try by cloning the repo? Also, @tmat would it be a good idea to make sourcelink optional for cases like these?

As for the timeout, that's an unlucky incident. Those feeds are quite expensive to traverse and that particular one has vast amounts of data in it, making it a bit slower. Right now we are moving to other types of feeds with less problems in the master branch of the runtime repo.

@hoyosjs hoyosjs self-assigned this Jan 16, 2020
@hoyosjs hoyosjs added the question label Jan 16, 2020
@tmat

This comment has been minimized.

Copy link
Member

@tmat tmat commented Jan 20, 2020

@hoyosjs It is already possible to build w/o Source Link (at least C# projects) if you set /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false.

Two possible improvements:

  1. Update GenerateNativeVersionFile target to not include commit sha in the version if none is available, rather then error.
  2. Set EnableSourceControlManagerQueries and EnableSourceLink to false in https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryInfo.targets if $(RepoRoot).git directory does not exist.
@hoyosjs

This comment has been minimized.

Copy link
Member

@hoyosjs hoyosjs commented Jan 22, 2020

@Kevin920920 does this solve your question?

@hoyosjs hoyosjs added this to the Future milestone Jan 22, 2020
@hoyosjs hoyosjs removed their assignment Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.