Skip to content

Conversation

@crazywhalecc
Copy link
Owner

What does this PR do?

Fix alpine-docker build in different arch issue.

For spc-gnu-docker, I need more time to implement. It's so weird that when I switch the arch (between host arch and emulated arch), docker will get segment fault (on mac) or /bin/sh not found(on linux) issue, unless removing all the docker things and re-install it. (prune not work)

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php or *.json, run them locally to ensure your changes are valid:
    • PHP_CS_FIXER_IGNORE_ENV=1 composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:sort-config
  • If it's an extension or dependency update, please ensure the following:
    • Add your test combination to src/globals/test-extensions.php.
    • If adding new or fixing bugs, add commit message containing extension test or test extensions to trigger full test suite.

@crazywhalecc crazywhalecc marked this pull request as draft June 20, 2025 05:24
@crazywhalecc
Copy link
Owner Author

Seems we cannot use qemu-user-static for centos docker. Its hosted multiarch/centos does not have arm64 architecture.

But when I pull the x86_64 centos in host x86_64, and build arm64 centos, it will get /bin/bash no such file or directory.

After I switch back to host arch, it still shows /bin/bash no such file or directory.

@henderkes
Copy link
Collaborator

Using this I can successfully run all the commands of the docker and get a working compilation environment.

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && docker run --rm -it --platform=linux/arm64 centos:7 bash

@crazywhalecc
Copy link
Owner Author

Using this I can successfully run all the commands of the docker and get a working compilation environment.

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes && docker run --rm -it --platform=linux/arm64 centos:7 bash

Oh, I forgot -p yes. Looks good to me now. But it's really too slow 🥱

@henderkes
Copy link
Collaborator

Err I think we have a much bigger problem...
https://vault.centos.org/centos/7/sclo/

There's no aarch64...

@crazywhalecc
Copy link
Owner Author

Err I think we have a much bigger problem... https://vault.centos.org/centos/7/sclo/

There's no aarch64...

It's in /altarch/, not in /centos/.

@crazywhalecc crazywhalecc marked this pull request as ready for review June 20, 2025 08:22
@crazywhalecc crazywhalecc requested a review from henderkes June 20, 2025 08:41
@crazywhalecc
Copy link
Owner Author

Test suite:

  • Host x86_64:
    • SPC_USE_ARCH=aarch64 bin/spc-alpine-docker
    • bin/spc-alpine-docker
    • SPC_USE_ARCH=aarch64 bin/spc-gnu-docker
    • bin/spc-gnu-docker
  • Host aarch64:
    • SPC_USE_ARCH=x86_64 bin/spc-alpine-docker
    • bin/spc-alpine-docker
    • SPC_USE_ARCH=aarch64 bin/spc-gnu-docker
    • bin/spc-gnu-docker

@crazywhalecc crazywhalecc merged commit a0f9985 into main Jun 20, 2025
13 checks passed
@crazywhalecc crazywhalecc deleted the fix/docker-arch branch June 20, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants