Official documentation for cross-compiling .NET SDK
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Is your feature request related to a problem? Please describe.
I am trying to cross-compile the .NET SDK from Linux x64 (e.g. from GitHub Actions CI images) to another OS.
Since the .NET 8 era, I have been using this command:
```sh
./build.sh --ci --pack /p:OSName=haiku /p:Architecture=x64
```
And recently, after https://github.com/dotnet/sdk/commit/0a74d579fde092d52266b88d262736068f419dcc, I have replaced it with this command:
```sh
./build.sh --ci --pack -os haiku -arch x64
```
If combined with a way to disable Crossgen (e.g. #54094 for .NET 11, `/p:SkipUsingCrossgen=true` for .NET 10, or `export DISABLE_CROSSGEN=true` for .NET 9), we can produce a somewhat working SDK build.
However, the SDK in `artifacts/bin/redist/$Configuration/dotnet/sdk` still seems to be compiled for the host. If Crossgen is on, one could [clearly see](https://github.com/dotnet/runtime/issues/55803#issuecomment-4326718517) that the assemblies are for Linux.
The same issue applies when we use the packages in `artifacts/packages/Debug/Shipping`. Apparently, there is now a package for Haiku: `dotnet-sdk-11.0.100-ci-haiku-x64.tar.gz`, but when extracted, Linux Crossgen assemblies can still be found.
### Describe the solution you'd like
Official support and documentation for this process.
### Additional context
Related issue: dotnet/runtime#55803
Opened as requested on [Discord](https://discord.com/channels/732297728826277939/1267023991428612199/1498597728853168179).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.