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] Use native arm runner instead of cross compiling #509

Merged
merged 3 commits into from
Feb 8, 2025

Conversation

mcbarton
Copy link
Contributor

@mcbarton mcbarton commented Feb 2, 2025

With Ubuntu arm Github runners now available for general availability (see Github blogpost here https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/ ) there is no longer a need to use the Ubuntu x86 runner and cross compile in the ci. This means you no longer need to skip building the sysroot on the ci for this platform.

@mcbarton mcbarton changed the title Do not require cross compilation for Ubuntu arm target ci Do not build for Ubuntu arm from Ubuntu x86 runner. Change to using Ubuntu arm runner. Feb 2, 2025
@mcbarton
Copy link
Contributor Author

mcbarton commented Feb 2, 2025

@alexcrichton can you review this PR, and if happy approve the ci to run? I'm not entirely sure I've named the PR well. Basically as far as I can tell from the ci your running a job which cross compiles for the arm architecture from the an x86 one (in this case Ubuntu). This feels unnecessary with Github recently making their Ubuntu arm runners generally available.

@alexcrichton
Copy link
Collaborator

CI I think should be running now (there's a failure to debug). I think it's reasonable to do a native build, yeah. Although I also don't personally think it's much of a problem to do a cross-build either, it's nice to exercise the infrastructure to ensure it's working. Basically I have no preference either way myself.

Copy link
Member

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

lgtm if the tests pass!

@mcbarton
Copy link
Contributor Author

mcbarton commented Feb 4, 2025

@alexcrichton @sbc100 I thought it was the rust_target in the ci matrix that was causing this error https://github.com/WebAssembly/wasi-sdk/actions/runs/13142634365/job/36673180959?pr=509#step:10:741 . I was wrong, and unsure where to look to debug this. I've set the PR to be editable by maintainers if you have any ideas.

@mcbarton
Copy link
Contributor Author

mcbarton commented Feb 5, 2025

Not sure what is happening with the ninja error at the moment. Trying reinstalling ninja to fix error like I did with rust without success. Will try and think of another solution.

@mcbarton mcbarton force-pushed the main branch 3 times, most recently from 9e8f478 to d5f3fd6 Compare February 5, 2025 21:02
@mcbarton
Copy link
Contributor Author

mcbarton commented Feb 5, 2025

@sbc100 This PR is ready for another review. I tried removing the --file and --tags from the docker build/run commands, but hit an issue (Removed both together so don't know if I can run one without the other). It feels that there must be an elegant alternative to the if statement I added in the Dockerfile, but just couldn't seem to see it.

if: matrix.os == 'ubuntu-24.04-arm'

- uses: actions-rust-lang/setup-rust-toolchain@v1
if: matrix.os == 'ubuntu-24.04-arm'
Copy link
Member

Choose a reason for hiding this comment

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

My only remaining question is why this is needed? Where was the rust toolchain previously coming from before the use of actions-rust-lang/setup-rust-toolchain here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm note entirely sure where in the repo the previous rust install was coming from, but any attempt by the ci at using it resulted in an error.

Copy link
Member

Choose a reason for hiding this comment

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

It looks like maybe if you retore the rust_target then the rustup command below will run:

          if [ "${{ matrix.rust_target }}" != "" ]; then                             
            rustup target add ${{ matrix.rust_target }}                              
            cmake_args="$cmake_args -DRUST_TARGET=${{ matrix.rust_target }}"         
          fi    

Perhaps removing the rust_target was why this extra run was needed?

Copy link
Member

Choose a reason for hiding this comment

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

If that doesn't work perhaps @alexcrichton has some clue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know this doesn't work, since its something I've already tried.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you have a CI log for when the changes here weren't present?

Where was the rust toolchain previously coming from before the use of actions-rust-lang/setup-rust-toolchain here?

GHA runners have rustup/rustc/cargo installed by default which is where the toolchain came from.


In the abstract though there are known crashes in rustc on the new GHA runners for arm64. I'm not sure if that would affect this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reverted the change expecting to see the same error I saw previously, and the workflow ran without issue. Not sure what change I made since the error which fixed it.

Copy link

Choose a reason for hiding this comment

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

The crashes in question are random and seem to be an interaction between these CPUs and a kernel version that starts somewhere between Ubuntu 22 and Ubuntu 24. Use Ubuntu 22 if you want stable CI on these runners.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds reasonable, can we switch to Ubuntu 22 @mcbarton?

Copy link
Member

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

Looks like it worked! lgtm

@alexcrichton
Copy link
Collaborator

I'm not sure why, but why the latest commit downgrading from ubuntu 24 to 22? I agree with @sbc100 that prior to that this looks reasonable to me

@saethlin
Copy link

saethlin commented Feb 7, 2025

@alexcrichton #509 (comment)

I also updated the issue description of the pinned rust-lang/rust issue with similar text

@mcbarton
Copy link
Contributor Author

mcbarton commented Feb 7, 2025

Not sure whether I should revert back to Ubuntu 24.04 arm. Until I get confirmation either way i'll leave this PR as is with Ubuntu 22.04 arm.

@sbc100 sbc100 changed the title Do not build for Ubuntu arm from Ubuntu x86 runner. Change to using Ubuntu arm runner. [ci] Use native arm runner instead of cross compiling Feb 7, 2025
@sbc100
Copy link
Member

sbc100 commented Feb 7, 2025

Leaving the arm runner on 22.04 makes sense. I think this change is good to land now, but I'll wait for @alexcrichton to confirm

@alexcrichton
Copy link
Collaborator

Oh sorry I missed the reply from @saethlin in my emails, apologies!

@alexcrichton alexcrichton merged commit 10214e1 into WebAssembly:main Feb 8, 2025
8 checks passed
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.

4 participants