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

Cross compilation on Ubuntu 22.04 to ARM from AMD #45208

Open
saariniemi opened this issue Nov 28, 2024 · 2 comments
Open

Cross compilation on Ubuntu 22.04 to ARM from AMD #45208

saariniemi opened this issue Nov 28, 2024 · 2 comments
Assignees
Labels
Area-Linux untriaged Request triage from a team member
Milestone

Comments

@saariniemi
Copy link

saariniemi commented Nov 28, 2024

In dotnet9 is cross compilation still supported on Ubuntu? What is required?

Steps to reproduce

  1. I have installed dotnet9
  2. I have run script from documentation:
    https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/cross-compile#linux
  3. Created new webapiaot
    dotnet new webapiaot
  4. Run publish
    dotnet publish -f net9.0 -r linux-arm64 -c Release

Exception:
error : The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative

Real scenario

In our production we have used a docker container for cross compiling.

Following script is incompatible with latest docker images (9.0-noble) and there is no documentation provided how to enable cross compilation on that image.

I have also tried directly to use the 9.0-noble-arm container ... but I get an exception wheb executing dotnet publish.

sudo dpkg --add-architecture arm64 sudo bash -c 'cat > /etc/apt/sources.list.d/arm64.list <<EOF deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse EOF' sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list sudo sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list sudo apt update sudo apt install -y clang llvm binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu zlib1g-dev:arm64

Environment

.NET SDK:
Version: 9.0.100
Commit: a2bc464e40
Workload version: 9.0.100-manifests.6bf02610
MSBuild version: 17.12.7+a2bc464e4

Runtime Environment:
OS Name: ubuntu
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Linux untriaged Request triage from a team member labels Nov 28, 2024
@marcpopMSFT marcpopMSFT self-assigned this Dec 10, 2024
@marcpopMSFT
Copy link
Member

@richlander I think you're the expert here for container compilation. Any ideas?

@marcpopMSFT marcpopMSFT added this to the Discussion milestone Dec 17, 2024
@richlander
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Linux untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants