Skip to content

Commit 3c6262e

Browse files
Add package version mismatch error
1 parent 08ad165 commit 3c6262e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/coreclr/nativeaot/BuildIntegration/OverrideImportRuntimeIlcPackageTarget.targets

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<!-- NativeAOT-LLVM: override ImportRuntimeIlcPackageTarget to not depend on the SDK-provided ResolvedILCompilerPack item -->
33
<Target Name="ImportRuntimeIlcPackageTarget" Condition="'$(BuildingFrameworkLibrary)' != 'true' and '$(_targetArchitecture)' == 'wasm'" DependsOnTargets="$(ImportRuntimeIlcPackageTargetDependsOn)" BeforeTargets="Publish">
4-
<Error Condition="'@(PackageDefinitions)' == ''" Text="The PackageDefinitions ItemGroup is required for target ImportRuntimeIlcPackageTarget" />
4+
<Error Condition="'@(PackageDefinitions)' == ''"
5+
Text="The PackageDefinitions ItemGroup is required for target ImportRuntimeIlcPackageTarget" />
6+
7+
<PropertyGroup>
8+
<_IlcHostPackageVersion Condition="'%(PackageDefinitions.Name)' == '$(_hostPackageName)'">%(PackageDefinitions.Version)</_IlcHostPackageVersion>
9+
<_IlcRuntimePackageVersion Condition="'%(PackageDefinitions.Name)' == '$(_targetPackageName)'">%(PackageDefinitions.Version)</_IlcRuntimePackageVersion>
10+
</PropertyGroup>
11+
12+
<Warning Condition="'$(_IlcHostPackageVersion)' != '$(_IlcRuntimePackageVersion)'"
13+
Text="$(_hostPackageName) version ($(_IlcHostPackageVersion)) differs from the Microsoft.DotNet.ILCompiler.LLVM version ($(_IlcRuntimePackageVersion)). This will likely result in build or runtime failures." />
514

615
<PropertyGroup>
716
<IlcHostPackagePath Condition="'%(PackageDefinitions.Name)' == '$(_hostPackageName)'">%(PackageDefinitions.ResolvedPath)</IlcHostPackagePath>

0 commit comments

Comments
 (0)