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

ci: x86_64 build failed on macos-latest image #1472

Open
Chiichen opened this issue Apr 24, 2024 · 2 comments
Open

ci: x86_64 build failed on macos-latest image #1472

Chiichen opened this issue Apr 24, 2024 · 2 comments

Comments

@Chiichen
Copy link
Contributor

Chiichen commented Apr 24, 2024

          > LGTM, waiting on a build pass.

@Chiichen It appears that 4e30365 seems to have caused the apple builds to fail.

Thanks for your reply. It reports in workflow's log at line 135

135 error[E0463]: can't find crate for `core`

This looks like a classic error that can occur when we cross-compile without the corresponding tool chain installed. and I found it at line 7

6 Runner Image
7   Image: macos-14-arm64
8   Version: 20240415.6
9   Included Software: https://github.com/actions/runner-images/blob/macos-14-arm64/20240415.6/images/macos/macos-14-arm64-Readme.md
10  Image Release: https://github.com/actions/runner-images/releases/tag/macos-14-arm64%2F20240415.6

It seems that we are trying to build a x86_64 target on aarch64 platform. I think this may be caused by us not properly installing the Rust toolchain for x86_64-macos on the aarch64-macos device

Actually, I found that the existing workflow does not handle cross-compilation on macos devices. One method is to force it to use x86_64 machines by specifying an older macos version(macos11 or macos12), and the other method is to amend the workflow to support cross-compilation on the macos platform.

Originally posted by @Chiichen in #1458 (comment)

@Chiichen
Copy link
Contributor Author

here defines the image to be used in ci workflow

      matrix:
        config:
          - os: macOS-latest
            target: x86_64-apple-darwin
            variant: debug
            cargo: cargo

          - os: macOS-latest
            target: x86_64-apple-darwin
            variant: release
            cargo: cargo

However, Macos-latest was added as a mirror in the PR 4 years ago #266. At that time, all github actions used the x86_64 architecture macos as the build mirror. However, today, 4 years later, the macos-latest mirror (that is, macos14) has It may be arm64. The specific image information is given here runner images

@Chiichen
Copy link
Contributor Author

It's time to rewrite the workflow for both x86_64 and arm64 macos, since we can not specify the arch of the macos iamge we use in github action. We must assume that every build on the macos image is a possible cross-compile

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

No branches or pull requests

1 participant