Skip to content

Add images with both "host" and "target" crossroots in one image.#913

Merged
directhex merged 4 commits intodotnet:mainfrom
directhex:biarch_build_images
Aug 21, 2023
Merged

Add images with both "host" and "target" crossroots in one image.#913
directhex merged 4 commits intodotnet:mainfrom
directhex:biarch_build_images

Conversation

@directhex
Copy link
Contributor

This is required in some cases - e.g. compiling node.js for ARM64/Alpine, and the ever-broken ARM64 runtime perf lane (where we need headers for ARM64 available alongside linkable libraries for AMD64, depending on the build phase).

As is, we've achieved the same result largely by accident in the pre-Mariner build images, where we have enough x64 in the host OS to link successfully, and the ARM64 files in the crossroot.

The precedent on this is #901 which fixed our Android cross-compiler builds, by offering both Android and $HOST in the same system

If at some point in the future we move from building on x64 to building on ARM64, we will need the equivalent images for that.

This is required in some cases - e.g. compiling node.js for ARM64/Alpine,
and the ever-broken ARM64 runtime perf lane (where we need headers for
ARM64 available alongside linkable libraries for AMD64, depending on
the build phase).

As is, we've achieved the same result largely by accident in the
pre-Mariner build images, where we have enough x64 in the host OS to link
successfully, and the ARM64 files in the crossroot.

The precedent on this is dotnet#901
which fixed our Android cross-compiler builds, by offering both Android
and $HOST in the same system

If at some point in the future we move from building on x64 to building
on ARM64, we will need the equivalent images for that.
@directhex
Copy link
Contributor Author

I've validated these images locally in dotnet/node#36 - I was able to cross-compile for Musl for the first time, and arm64 Ubuntu on Mariner without gross accidental functioning via the old Ubuntu images.

@directhex directhex merged commit 3643cf3 into dotnet:main Aug 21, 2023
"osVersion": "cbl-mariner2.0",
"tags": {
"cbl-mariner-2.0-cross-biarch-amd64-amd64-alpine-$(System:TimeStamp)-$(System:DockerfileGitCommitSha)": {},
"cbl-mariner-2.0-cross-biarch-amd64-amd64-alpine$(FloatingTagSuffix)": {}
Copy link
Member

@akoeplinger akoeplinger Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the amd64-amd64 a typo? Or does it mean cross compiling from amd64 to amd64?

@directhex
Copy link
Contributor Author

directhex commented Aug 22, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants