Skip to content

Commit 3153cc7

Browse files
Skip CreateMSBuildAppHost in offline source-build
CreateMSBuildAppHost requires the microsoft.netcore.app.host NuGet package which is not available in offline source-build. Skip the target and its associated chmod commands when DotNetBuildSourceOnly is set. The apphost can be enabled for source-build once the package is added to the prebuilts cache. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f083f19 commit 3153cc7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/sdk/src/Layout/redist/targets/Crossgen.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
<Exec Command="find $(InstallerOutputDirectory) -type d -exec chmod 755 {} \;" Condition="'$(OSName)' != 'win'" />
199199
<Exec Command="find $(InstallerOutputDirectory) -type f -exec chmod 644 {} \;" Condition="'$(OSName)' != 'win'" />
200200
<Exec Command="chmod 755 $(InstallerOutputDirectory)Roslyn/bincore/%(_RoslynAppHost.Filename)" Condition="'$(OSName)' != 'win'" />
201-
<Exec Command="chmod 755 $(InstallerOutputDirectory)%(_MSBuildAppHost.Filename)" Condition="'$(OSName)' != 'win'" />
201+
<Exec Command="chmod 755 $(InstallerOutputDirectory)%(_MSBuildAppHost.Filename)" Condition="'$(OSName)' != 'win' and '$(DotNetBuildSourceOnly)' != 'true'" />
202202
</Target>
203203

204204
</Project>

src/sdk/src/Layout/redist/targets/GenerateLayout.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
Condition="$(SharedFrameworkRid.StartsWith('osx'))" />
7171
</Target>
7272

73-
<Target Name="CreateMSBuildAppHost">
73+
<Target Name="CreateMSBuildAppHost" Condition="'$(DotNetBuildSourceOnly)' != 'true'">
7474
<CreateAppHost AppHostSourcePath="$(NuGetPackageRoot)\microsoft.netcore.app.host.$(SharedFrameworkRid)\$(MicrosoftNETCoreAppHostPackageVersion)\runtimes\$(SharedFrameworkRid)\native\apphost$(ExeExtension)"
7575
AppHostDestinationPath="%(_MSBuildAppHost.RootDir)%(_MSBuildAppHost.Directory)%(_MSBuildAppHost.Filename)$(ExeExtension)"
7676
AppBinaryName="%(_MSBuildAppHost.Filename)%(_MSBuildAppHost.Extension)"
@@ -521,7 +521,7 @@
521521
<Exec Command="find $(OutputPath) -type d -exec chmod 755 {} \;" />
522522
<Exec Command="find $(OutputPath) -type f -exec chmod 644 {} \;" />
523523
<Exec Command="chmod 755 %(_RoslynAppHost.RootDir)%(_RoslynAppHost.Directory)%(_RoslynAppHost.Filename)" />
524-
<Exec Command="chmod 755 %(_MSBuildAppHost.RootDir)%(_MSBuildAppHost.Directory)%(_MSBuildAppHost.Filename)" />
524+
<Exec Command="chmod 755 %(_MSBuildAppHost.RootDir)%(_MSBuildAppHost.Directory)%(_MSBuildAppHost.Filename)" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
525525
</Target>
526526

527527
<Target Name="DeleteSymbolsFromPublishDir" DependsOnTargets="GenerateCliRuntimeConfigurationFiles">

0 commit comments

Comments
 (0)