Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[S.P.CoreLib]System.Runtime.InteropServices.NFloat._value errors when publish with PublishReadyToRun #79965

Closed
jkotas opened this issue Dec 25, 2022 Discussed in #79947 · 2 comments

Comments

@jkotas
Copy link
Member

jkotas commented Dec 25, 2022

Discussed in #79947

Originally posted by lanyusan December 23, 2022
I am building an Mac desktop app on Mac M1. I got this error as in the title constantly. HELP much appreciated.

I tried to publish with following settings:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <CodesigningKey>3rd Party Mac Developer Application:[xxxx]</CodesigningKey>
    <PackageSigningKey>3rd Party Mac Developer Installer:[xxxx]</PackageSigningKey>   
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <EnableCodeSigning>true</EnableCodeSigning>
    <UseSGen>true</UseSGen>
    <UseRefCounting>true</UseRefCounting>
    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
    <CreatePackage>false</CreatePackage>
    <EnablePackageSigning>false</EnablePackageSigning>
    <AOTMode>None</AOTMode>
	<PublishReadyToRun>true</PublishReadyToRun>
	<RuntimeIdentifier>osx-x64</RuntimeIdentifier>
  </PropertyGroup>

and publish command:

dotnet publish -c release

I got following errors:

/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error : Error: [S.P.CoreLib]System.Runtime.InteropServices.NFloat._value [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error : System.NotImplementedException: [S.P.CoreLib]System.Runtime.InteropServices.NFloat._value [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ModuleTokenResolver.GetModuleTokenForField(FieldDesc field, Boolean throwIfNotFound) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.FieldFixupSignature.GetData(NodeFactory factory, Boolean relocsOnly) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ImportSectionNode.MaterializeSignature(NodeFactory r2rFactory) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ImportSectionsTableNode.MaterializeSignature() [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestMetadataTableNode.ComputeLastSetOfModuleIndices() [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestMetadataTableNode.GetManifestAssemblyMvidTableData() [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRun.ManifestAssemblyMvidHeaderNode.GetData(NodeFactory factory, Boolean relocsOnly) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.DependencyAnalysis.ReadyToRunObjectWriter.EmitPortableExecutable() [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.ReadyToRunCodegenCompilation.Compile(String outputFile) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.Program.RunSingleCompilation(Dictionary`2 inFilePaths, InstructionSetSupport instructionSetSupport, String compositeRootPath, Dictionary`2 unrootedInputFilePaths, HashSet`1 versionBubbleModulesHash, CompilerTypeSystemContext typeSystemContext) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.Program.Run(String[] args) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(465,5): error :    at ILCompiler.Program.Main(String[] args) [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
/usr/local/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(353,5): error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false. [/Users/fqye/projects/layer-mixer-avalonia/LayerMixer.csproj]
```</div>
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Dec 25, 2022
@lanyusan
Copy link

I have created a reproducer.

Clone https://github.com/lanyusan/dotnet-publish-bug.git

Run: dotnet publish -c release -r osx-x64 --self-contained true -p:UseAppHost=true -p:PublishReadyToRun=true

@trylek trylek mentioned this issue May 3, 2023
46 tasks
@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Jul 24, 2023
@mangod9 mangod9 added this to the 8.0.0 milestone Jul 24, 2023
@trylek
Copy link
Member

trylek commented Aug 8, 2023

I believe this should be fixed in .NET 8. I tried the repro locally and it worked for me; @davidwrighton substantially refactored the token resolver in #73663 so I assume the bug was either fixed by his change or by an independent change before that. Please note that @lanyusan's repro uses .NET 6, many things have been fixed since then. Closing for now, please reopen if it still reproes with .NET 8.

@trylek trylek closed this as completed Aug 8, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants