Skip to content

Executable from dotnet publish for Apple Silicon is not working. .net 6 preview 1. #49091

@iamphi

Description

@iamphi

The executable from dotnet publish --self-contained -r osx-arm64 does not run as expected. It fails with a kill signal like: zsh: killed

Test script:

mkdir helloworld
cd helloworld 
dotnet new console

echo "### Testing dotnet run"
dotnet run

echo "### Testing intel publish"
dotnet publish --self-contained -r osx-x64 -o intel
lipo -info intel/helloworld
./intel/helloworld                                                     

echo "### Testing arm64 publish"
dotnet publish --self-contained -r osx-arm64 -o arm64
lipo -info arm64/helloworld
./arm64/helloworld 

My output:

The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /Users/phi/ws/helloworld/helloworld.csproj...
  Determining projects to restore...
  Restored /Users/phi/ws/helloworld/helloworld.csproj (in 138 ms).
Restore succeeded.

### Testing dotnet run
Hello World!
### Testing intel publish
Microsoft (R) Build Engine version 16.9.0-preview-21103-02+198f3f262 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /Users/phi/ws/helloworld/helloworld.csproj (in 207 ms).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  helloworld -> /Users/phi/ws/helloworld/bin/Debug/net6.0/osx-x64/helloworld.dll
  helloworld -> /Users/phi/ws/helloworld/intel/
Non-fat file: intel/helloworld is architecture: x86_64
Hello World!
### Testing arm64 publish
Microsoft (R) Build Engine version 16.9.0-preview-21103-02+198f3f262 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /Users/phi/ws/helloworld/helloworld.csproj (in 216 ms).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  helloworld -> /Users/phi/ws/helloworld/bin/Debug/net6.0/osx-arm64/helloworld.dll
  helloworld -> /Users/phi/ws/helloworld/arm64/
Non-fat file: arm64/helloworld is architecture: arm64
zsh: killed     ./arm64/helloworld

Machine information:

% sw_vers 
ProductName:	macOS
ProductVersion:	11.1
BuildVersion:	20C69
% system_profiler -detailLevel mini SPHardwareDataType
Hardware:

    Hardware Overview:

      Model Name: Mac mini
      Model Identifier: Macmini9,1
      Chip: Apple M1
      Total Number of Cores: 8 (4 performance and 4 efficiency)
      Memory: 8 GB
      System Firmware Version: 6723.61.3
% dotnet --version
6.0.100-preview.1.21103.13
% dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.0-preview.1.21103.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.1.21102.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
% dotnet --list-sdks    
6.0.100-preview.1.21103.13 [/usr/local/share/dotnet/sdk]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions