Skip to content

Commit 1a06295

Browse files
authored
Another attempt to fix the SDK insertion issue related to runtime/apphost downloads (#77845)
Use the EnableRuntimePackDownload/EnableAppHostPackDownload flags to indicate whether the restore should download those packages./
1 parent 2437c72 commit 1a06295

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Microsoft.CodeAnalysis.LanguageServer.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@
4444
<PublishDir Condition="'$(RuntimeIdentifier)' != ''">$(ArtifactsDir)/LanguageServer/$(Configuration)/$(TargetFramework)/$(RuntimeIdentifier)</PublishDir>
4545
<PublishDir Condition="'$(RuntimeIdentifier)' == ''">$(ArtifactsDir)/LanguageServer/$(Configuration)/$(TargetFramework)/neutral</PublishDir>
4646

47+
<!-- List of runtime identifiers that we want to publish an executable for. -->
48+
<!-- When building a VMR vertical, we don't need to pack everything. Just pack the passed in TargetRid or BaseOS.
49+
TargetRid and BaseOS are provided to roslyn via the build arguments passed in the VMR orchestrator's repo project.
50+
https://github.com/dotnet/dotnet/blob/main/repo-projects/roslyn.proj. For definitions of the TargetRid
51+
and other common properties, see https://github.com/dotnet/arcade/blob/main/Documentation/UnifiedBuild/Unified-Build-Controls.md -->
52+
<RuntimeIdentifiers Condition="'$(TargetRid)' != ''">$(TargetRid)</RuntimeIdentifiers>
53+
<RuntimeIdentifiers Condition="'$(BaseOS)' != ''">$(BaseOS)</RuntimeIdentifiers>
54+
<RuntimeIdentifiers Condition="'$(TargetRid)' == '' and '$(BaseOS)' == ''">win-x64;win-arm64;linux-x64;linux-arm64;linux-musl-x64;linux-musl-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
55+
56+
<!-- These indicate that the runtime/apphost packages should not be downloaded as part of build/restore -->
57+
<EnableRuntimePackDownload>false</EnableRuntimePackDownload>
58+
<EnableAppHostPackDownload>false</EnableAppHostPackDownload>
59+
4760
<!-- Publish ready to run executables when we're publishing platform specific executables. -->
4861
<PublishReadyToRun Condition="'$(RuntimeIdentifier)' != '' AND '$(Configuration)' == 'Release' ">true</PublishReadyToRun>
4962

src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/PackAllRids.targets

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,6 @@
44
<ImportNuGetBuildTasksPackTargetsFromSdk>false</ImportNuGetBuildTasksPackTargetsFromSdk>
55
<_RoslynPublishReadyToRun>false</_RoslynPublishReadyToRun>
66
<_RoslynPublishReadyToRun Condition="'$(Configuration)' == 'Release'">true</_RoslynPublishReadyToRun>
7-
8-
<!--
9-
List of runtime identifiers that we want to publish an executable for.
10-
This cannot be set in the base project as it will cause issues when roslyn is built
11-
as a test project for SDK insertions. The RuntimeIdentifiers property will cause the build to
12-
attempt to download unpublished packages, which fails (until the packages eventually get published).
13-
14-
The test doesn't actually run pack, so we can instead skip setting the RuntimeIdentifiers property unless
15-
we're actually trying to build packages.
16-
-->
17-
<!--
18-
When building a VMR vertical, we don't need to pack everything. Just pack the passed in TargetRid or BaseOS.
19-
TargetRid and BaseOS are provided to roslyn via the build arguments passed in the VMR orchestrator's repo project.
20-
https://github.com/dotnet/dotnet/blob/main/repo-projects/roslyn.proj. For definitions of the TargetRid
21-
and other common properties, see https://github.com/dotnet/arcade/blob/main/Documentation/UnifiedBuild/Unified-Build-Controls.md
22-
-->
23-
<RuntimeIdentifiers Condition="'$(TargetRid)' != ''">$(TargetRid)</RuntimeIdentifiers>
24-
<RuntimeIdentifiers Condition="'$(BaseOS)' != ''">$(BaseOS)</RuntimeIdentifiers>
25-
<RuntimeIdentifiers Condition="'$(TargetRid)' == '' and '$(BaseOS)' == ''">win-x64;win-arm64;linux-x64;linux-arm64;linux-musl-x64;linux-musl-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
267
</PropertyGroup>
278

289
<Target Name="Pack">
@@ -43,10 +24,13 @@
4324
4425
We also pass the RestoreUseStaticGraphEvaluation=false flag to workaround a long path issue when calling the restore target.
4526
See https://github.com/NuGet/Home/issues/11968
27+
28+
We also pass the EnableRuntimePackDownload/EnableAppHostPackDownload flags to indicate we wish for this restore/pack to download
29+
the required runtime/apphost packages as those will be needed during the pack.
4630
-->
47-
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Restore" Properties="PublishReadyToRun=$(_RoslynPublishReadyToRun);RestoreUseStaticGraphEvaluation=false" />
31+
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Restore" Properties="EnableRuntimePackDownload=true;EnableAppHostPackDownload=true;PublishReadyToRun=$(_RoslynPublishReadyToRun);RestoreUseStaticGraphEvaluation=false" />
4832

49-
<MSBuild Projects="@(ProjectToPublish)" Targets="Pack" BuildInParallel="true" />
33+
<MSBuild Projects="@(ProjectToPublish)" Targets="Pack" Properties="EnableRuntimePackDownload=true;EnableAppHostPackDownload=true" BuildInParallel="true" />
5034
</Target>
5135

5236
<!--

0 commit comments

Comments
 (0)