Skip to content

Commit

Permalink
Fix build.cmd -s clr.aot+libs (#82019)
Browse files Browse the repository at this point in the history
The instructions to build NativeAOT suggest this invocation:


```
build.cmd -s clr.aot+libs
```

However I get this error while building:

```
C:\runtime\src\libraries\externals.csproj(90,5): error : Could not locate CoreCLR IL files.
```

Here is the target that generates the error:

https://github.com/dotnet/runtime/blob/main/src/libraries/externals.csproj#L72-L91

It looks like it is only supposed to run when compiling against vanillia
CoreCLR.
  • Loading branch information
AustinWise committed Feb 14, 2023
1 parent 9060368 commit 6823bc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<NativeAotSupported Condition="('$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'freebsd') and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')">true</NativeAotSupported>

<!-- If we're building clr.nativeaotlibs and not building the CLR runtime, compile libraries against NativeAOT CoreLib -->
<UseNativeAotCoreLib Condition="$(_subset.Contains('+clr.nativeaotlibs+')) and !$(_subset.Contains('+clr.native+')) and !$(_subset.Contains('+clr.runtime+'))">true</UseNativeAotCoreLib>
<UseNativeAotCoreLib Condition="'$(TestNativeAot)' == 'true' or ($(_subset.Contains('+clr.nativeaotlibs+')) and !$(_subset.Contains('+clr.native+')) and !$(_subset.Contains('+clr.runtime+')))">true</UseNativeAotCoreLib>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/externals.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<Target Name="OverrideRuntimeCoreCLR"
DependsOnTargets="ResolveRuntimeFilesFromLocalBuild"
AfterTargets="AfterResolveReferences"
Condition="'$(RuntimeFlavor)' != 'Mono' and '$(TestNativeAot)' != 'true'">
Condition="'$(RuntimeFlavor)' != 'Mono' and '$(UseNativeAotCoreLib)' != 'true'">
<ItemGroup>
<RuntimeFiles Include="@(HostFxrFile)" Condition="Exists('@(HostFxrFile)')" />
<RuntimeFiles Include="@(HostPolicyFile)" Condition="Exists('@(HostPolicyFile)')" />
Expand Down

0 comments on commit 6823bc2

Please sign in to comment.