-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support to build armhf/arm64 platforms on arm based system #7731
Conversation
Makefile.work
Outdated
COMPILE_HOST_ARCH := armhf | ||
else | ||
COMPILE_HOST_ARCH := amd64 | ||
endif | ||
|
||
COMPILE_HOST_ARCHS := $(COMPILE_HOST_ARCH) $(HOST_ARCHS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I search the repo and could not found HOST_ARCHS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is not defined, normally, we are not necessary to define it, the default value is empty.
If we want to support build armhf on arm64, we can set HOST_ARCHS=armhf, it means that the architecture armhf is supported on arm64, although it does not match with "uname -m".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this paragraph is good code comment, could you add it? Otherwise user could not easily figure out this hidden feature.
Makefile.work
Outdated
@@ -111,18 +113,13 @@ ifeq ($(ENABLE_DOCKER_BASE_PULL),) | |||
override ENABLE_DOCKER_BASE_PULL = n | |||
endif | |||
|
|||
ifeq ($(CONFIGURED_ARCH),amd64) | |||
ifneq (,$(filter $(CONFIGURED_ARCH),amd64 $(COMPILE_HOST_ARCHS))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some comment for complex condition check? #Closed
dockers/docker-base/Dockerfile.j2
Outdated
@@ -1,6 +1,6 @@ | |||
{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For armhf, we can always use multiarch/debian-debootstrap:armhf-jessie, it should not be relative to MULTIARCH_QEMU_ENVIRON yes or not.
Maybe we can simply use multiarch/debian-debootstrap:{% CONFIGURED_ARCH %}-jessie
Example:
docker run -it --rm multiarch/debian-debootstrap:amd64-buster uname -m
x86_64
what about building arm64 on armhf? that is probably not supported, correct? |
It is not supported, it needs to use only qemu vm to support. |
@qiluo-msft , I do an improvement to detect the docker environment in the build time to decide whether the qemu simulator needed. When the docker arch of the build environment is the same as the build target, then no simulator required. |
…#7731) Why I did it Support to build armhf/arm64 platforms on arm based system without qemu simulator. When building the armhf/arm64 on arm based system, it is not necessary to use qemu simulator. How I did it Build armhf on armhf system, or build arm64 on arm64 system, by default, qemu simulator will not be used. When building armhf on arm64, and you have enabled armhf docker, then it will build images without simulator automatically. It is based how the docker service is run. Docker base image change: For amd64, change from debian:to amd64/debian: For arm64, change from multiarch/debian-debootstrap:arm64- to arm64v8/debian: For armhf, change from multiarch/debian-debootstrap:armhf- to arm32v7/debian: See https://github.com/docker-library/official-images#architectures-other-than-amd64 The mapping relations: arm32v6 --- armel arm32v7 --- armhf arm64v8 --- arm64 Docker image armhf deprecated info: https://hub.docker.com/r/armhf/debian, using arm32v7 instead.
…#7731) Why I did it Support to build armhf/arm64 platforms on arm based system without qemu simulator. When building the armhf/arm64 on arm based system, it is not necessary to use qemu simulator. How I did it Build armhf on armhf system, or build arm64 on arm64 system, by default, qemu simulator will not be used. When building armhf on arm64, and you have enabled armhf docker, then it will build images without simulator automatically. It is based how the docker service is run. Docker base image change: For amd64, change from debian:to amd64/debian: For arm64, change from multiarch/debian-debootstrap:arm64- to arm64v8/debian: For armhf, change from multiarch/debian-debootstrap:armhf- to arm32v7/debian: See https://github.com/docker-library/official-images#architectures-other-than-amd64 The mapping relations: arm32v6 --- armel arm32v7 --- armhf arm64v8 --- arm64 Docker image armhf deprecated info: https://hub.docker.com/r/armhf/debian, using arm32v7 instead.
…8458) Why I did it Support to build armhf/arm64 platforms on arm based system without qemu simulator. When building the armhf/arm64 on arm based system, it is not necessary to use qemu simulator. How I did it Build armhf on armhf system, or build arm64 on arm64 system, by default, qemu simulator will not be used. When building armhf on arm64, and you have enabled armhf docker, then it will build images without simulator automatically. It is based how the docker service is run. Docker base image change: For amd64, change from debian:to amd64/debian: For arm64, change from multiarch/debian-debootstrap:arm64- to arm64v8/debian: For armhf, change from multiarch/debian-debootstrap:armhf- to arm32v7/debian: See https://github.com/docker-library/official-images#architectures-other-than-amd64 The mapping relations: arm32v6 --- armel arm32v7 --- armhf arm64v8 --- arm64 Docker image armhf deprecated info: https://hub.docker.com/r/armhf/debian, using arm32v7 instead.
…#7731) Why I did it Support to build armhf/arm64 platforms on arm based system without qemu simulator. When building the armhf/arm64 on arm based system, it is not necessary to use qemu simulator. How I did it Build armhf on armhf system, or build arm64 on arm64 system, by default, qemu simulator will not be used. When building armhf on arm64, and you have enabled armhf docker, then it will build images without simulator automatically. It is based how the docker service is run. Docker base image change: For amd64, change from debian:to amd64/debian: For arm64, change from multiarch/debian-debootstrap:arm64- to arm64v8/debian: For armhf, change from multiarch/debian-debootstrap:armhf- to arm32v7/debian: See https://github.com/docker-library/official-images#architectures-other-than-amd64 The mapping relations: arm32v6 --- armel arm32v7 --- armhf arm64v8 --- arm64 Docker image armhf deprecated info: https://hub.docker.com/r/armhf/debian, using arm32v7 instead.
…10577) Why I did it Support to build armhf/arm64 platforms on arm based system without qemu simulator. When building the armhf/arm64 on arm based system, it is not necessary to use qemu simulator. How I did it Build armhf on armhf system, or build arm64 on arm64 system, by default, qemu simulator will not be used. When building armhf on arm64, and you have enabled armhf docker, then it will build images without simulator automatically. It is based how the docker service is run. Docker base image change: For amd64, change from debian:to amd64/debian: For arm64, change from multiarch/debian-debootstrap:arm64- to arm64v8/debian: For armhf, change from multiarch/debian-debootstrap:armhf- to arm32v7/debian: See https://github.com/docker-library/official-images#architectures-other-than-amd64 The mapping relations: arm32v6 --- armel arm32v7 --- armhf arm64v8 --- arm64 Docker image armhf deprecated info: https://hub.docker.com/r/armhf/debian, using arm32v7 instead.
Why I did it
Support to build armhf/arm64 platforms on arm based system without qemu simulator.
When building the armhf/arm64 on arm based system, it is not necessary to use qemu simulator.
How I did it
Build armhf on armhf system, or build arm64 on arm64 system, by default, qemu simulator will not be used.
When building armhf on arm64, and you have enabled armhf docker, then it will build images without simulator automatically. It is based how the docker service is run.
Docker base image change:
For amd64, change from debian:to amd64/debian:
For arm64, change from multiarch/debian-debootstrap:arm64- to arm64v8/debian:
For armhf, change from multiarch/debian-debootstrap:armhf- to arm32v7/debian:
See https://github.com/docker-library/official-images#architectures-other-than-amd64
The mapping relations:
arm32v6 --- armel
arm32v7 --- armhf
arm64v8 --- arm64
Docker image armhf deprecated info: https://hub.docker.com/r/armhf/debian, using arm32v7 instead.
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)