Closed
Description
Environment
- OS: macOS Montgomery - 12.2.1
- Processor: 2.6 GHz Dual-Core Intel Core i5
- Flutter version: 3.0.2
Steps to Reproduce
- Clone flutter v3.0.2
- Navigate to the hello world sample:
cd examples/hello_world
- Build for iOS:
flutter build ios --release --no-codesign
- Notice the error: bin/internal/shared.sh: line 225: bin/cache/dart-sdk/bin/dart: Bad CPU type in executable
I think this may have something to do with the change:
bb4a5fa#diff-fecfc9dccd8a04f4936b4fa1bf09db14f099197ead58e7633009ac282443c4d0R225
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
ebjorklund01 commentedon Jun 15, 2022
I am seeing this error building the app in our github actions, but I am not seeing this when I build locally on my intel mac.
/Users/runner/hostedtoolcache/flutter/3.0.2-stable/x64/bin/internal/shared.sh: line 225: /Users/runner/hostedtoolcache/flutter/3.0.2-stable/x64/bin/cache/dart-sdk/bin/dart: Bad CPU type in executable
Still builds fine if I specify flutter 3.0.1.
mikegogovapps commentedon Jun 15, 2022
Yup. I'm working around this by reverting to an older version as well (v3.0.0). Just wanted to get this one folks' radar in case I wasn't the only one.
And I also first discovered this when my daily github action build broke last Friday after having made no updates to it or my app.
Macacoazul01 commentedon Jun 16, 2022
Maybe it's similar to what happened on my project #105862
Downgrading to 3.0.1 and upgrading again to 3.0.2 was the only working solution.
philiparpin commentedon Jun 16, 2022
We are also experiencing this bug with 3.0.2
jmagman commentedon Jun 16, 2022
@christopherfujino did something change with the packaging in 3.0.2 that could cause the arm version of dart to be served up on x64, if that's what's happening?
I'll investigate more tomorrow.
Is this happening to anyone outside of GitHub actions? Could those scripts be running on an M1 but without Rosetta installed?
What's the output of
file bin/cache/dart-sdk/bin/dart
?maheshj01 commentedon Jun 16, 2022
Hi @mikegogovapps, Thanks for filing the issue. I tried to build the hello world app and it seems to build successfully on a m1 mac. Please share the complete output of
flutter doctor -v
.Can you please share the output of this command as requested above?
logs
flutter doctor -v (mac)
huycozy commentedon Jun 16, 2022
Providing tests on my local Mac Intel. It can build normally.
It seems that it only happened on Github Actions.
Logs
3.0.2
3.1.0-0.0.pre.1265
flutter doctor -v
ghost commentedon Jun 16, 2022
Running into the same issue in GitHub action and it's definitely trying to use an ARM executable on Intel:
ghost commentedon Jun 16, 2022
Looking a bit more in the matter I don't think this is a flutter issue, rather a https://github.com/flutter-actions/setup-flutter one. I've been checking what the script does and it doesn't consider the architecture for macos. For 3.0.0 and 3.0.1 the first entry in the releases manifest is the intel one so the intel version is downloaded. For 3.0.2 the first version listed in the manifest is the M1 one therefore the script downloads that.
ghost commentedon Jun 16, 2022
Actually, correction, we use https://github.com/subosito/flutter-action instead of the one I linked before. Sorry for the mixup!
philiparpin commentedon Jun 16, 2022
@robertof-wolt hahah all good probably still an issue with https://github.com/flutter-actions/setup-flutter anyways, right?
ghost commentedon Jun 16, 2022
@philiparpin Cannot say for sure without trying, but by looking at its code it should work if the runner is intel, if for some reason the runner would happen to be M1 probably it would fail.
The one we are using https://github.com/subosito/flutter-action has a newer version that properly supports different architectures, that should at least solve @ebjorklund01's issue.
mikegogovapps commentedon Jun 16, 2022
@maheshmnj I just tried to recreate this outside of the context of github actions on another Intel Mac and the sample built just fine.
I think @robertof-wolt is right with this really being an issue with how flutter is set up for my github action build.
We are also using https://github.com/subosito/flutter-action so I'll close this issue and continue my troubleshooting with this in mind.
Thanks!
ebjorklund01 commentedon Jun 16, 2022
I followed the advice @robertof-wolt to upgrade https://github.com/subosito/flutter-action to v2 and that fixed the issue for me.
github-actions commentedon Jul 1, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -v
and a minimal reproduction of the issue.