Skip to content

Conversation

@radical
Copy link
Member

@radical radical commented Nov 2, 2022

This manifested in a case where a non-mono project was passed a mono specific property RunAOTCompilation=true, but instead of it getting ignored, the build failed with:

/usr/local/share/dotnet/sdk/7.0.200-preview.22521.7/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5):

error NETSDK1147: To build this project, the following workloads must be installed: macos [/private/tmp/c/c.csproj]
error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/private/tmp/c/c.csproj]

And this is because the MonoAOTCompiler.Task is imported with:

<Import Condition="'$(TargetsCurrent)' == 'true' and '$(RunAOTCompilation)' == 'true' and '$(_BrowserWorkloadNotSupportedForTFM)' != 'true'" Project="Sdk.props" Sdk="Microsoft.NET.Runtime.MonoAOTCompiler.Task" />

  • This happens for net6, and net8 projects.

Fixes #77707 .

cc @steveisok @lewing

- with, and without workload
- with net6/7/8
- and with various mono specific properties set like
`RunAOTCompilation`, and `WasmBuildNative`.
.. when `RunAOTCompilation=true` is passed.
@radical radical requested a review from lewing as a code owner November 2, 2022 02:00
@ghost ghost assigned radical Nov 2, 2022
@radical radical added this to the 8.0.0 milestone Nov 2, 2022
@radical radical merged commit 8e45d5f into dotnet:main Nov 3, 2022
@radical radical deleted the fix-non-workload-builds branch November 3, 2022 15:41
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting RunAOTCompilation=true on non-wasm/non-mobile projects fails to build

2 participants