Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@RossComputerGuy
Copy link
Contributor

@RossComputerGuy RossComputerGuy commented Oct 31, 2024

Fixes running x64 binaries on arm64 hosts, this fixes systems like Raspberry Pi's, Apple Silicon, and Ampere.

Before, I would get something like:

Checking GN formatting...
Completed checking 0 GN files with no formatting problems.
Checking Java formatting...
No Java files with changes, skipping Java format check.
Checking Python formatting...
All python files formatted correctly.
Checking for trailing whitespace on 1 source file...
No trailing whitespace found.
No header files with changes, skipping header guard check.
Checking C++/ObjC/Shader formatting...
ERROR: Formatter command '/home/ross/flutter-engine/src/flutter/buildtools/linux-x64/clang/bin/clang-format --style=file shell/platform/linux/fl_application_test.cc' failed with exit code 255. Command output follows:

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

Completed checking 0 C++/ObjC/Shader files with no formatting problems

Now it just works, I also changed the shell script to use env since /bin/bash doesn't exist on NixOS so using env is a more portable solution.

List which issues are fixed by this PR. You must list at least one issue.

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@RossComputerGuy
Copy link
Contributor Author

Unsure of how to do testing, do we need additional testing to ensure the new logic is working or would we just need to run it on ARM64 systems?

@chinmaygarde
Copy link
Member

cc @jonahwilliams

Comment on lines 318 to 322
clangOs = Abi.current().toString().replaceFirst('_', '-');
} else if (Platform.isMacOS) {
clangOs = 'mac-x64';
clangOs = 'mac-${Abi.current().toString().split('_')[1]}';
} else if (Platform.isWindows) {
clangOs = 'windows-x64';
clangOs = Abi.current().toString().replaceFirst('_', '-');
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer if we had specified strings for each binary rather than processing the ABI string.

if (ABI.current() == Abi.macosx64) {
  clangOs = 'mac-amd64'; //
} else {
 //
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, I've switched over to using that.

@RossComputerGuy RossComputerGuy force-pushed the fix/githooks-linux-arm64 branch from ae95170 to 2c747ca Compare November 14, 2024 04:30
@chinmaygarde
Copy link
Member

Is progress being made on this? The linked CI failures may be related to analysis.

@RossComputerGuy
Copy link
Contributor Author

Is progress being made on this?

I've been busy + waiting for reviews.

The linked CI failures may be related to analysis.

Didn't see that until now, didn't know CI failed. I'll try updating it tonight to fix it.

@RossComputerGuy RossComputerGuy force-pushed the fix/githooks-linux-arm64 branch from 2c747ca to 4cce5bd Compare November 26, 2024 04:43
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 2, 2024
@auto-submit auto-submit bot merged commit 4a7daa5 into flutter:main Dec 2, 2024
31 checks passed
@RossComputerGuy RossComputerGuy deleted the fix/githooks-linux-arm64 branch December 2, 2024 19:05
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 2, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 2, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 2, 2024
…159694)

flutter/engine@e0900f8...05fdaa6

2024-12-02 [email protected] Roll Skia from d7751d3d6ff4 to
2c4ce1d953ba (5 revisions) (flutter/engine#56901)
2024-12-02 [email protected] [ci] use env for format and support
arm64 hosts (flutter/engine#56268)
2024-12-02 [email protected] Replace outdated wiki URLs in pull
request template (flutter/engine#56824)
2024-12-02 [email protected] [impeller] makes
UniformBindData 15% faster and adds unit test (flutter/engine#56844)
2024-12-02 [email protected] Roll Skia from dd70c8e1c38f to
d7751d3d6ff4 (36 revisions) (flutter/engine#56898)
2024-12-02 [email protected] Roll Dart SDK from
5785058c9bb1 to 46630dbefbbd (12 revisions) (flutter/engine#56897)
2024-12-02 [email protected] switched reactor
to absl::flat_hash_map (flutter/engine#56845)
2024-12-02 [email protected] Sped up
SubpixelGlyph::Equal (flutter/engine#56851)
2024-12-02 [email protected] [Impeller] dont cache glyph layout
if atlas is invalid. (flutter/engine#56879)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
Fixes running x64 binaries on arm64 hosts, this fixes systems like Raspberry Pi's, Apple Silicon, and Ampere.

Before, I would get something like:
```
Checking GN formatting...
Completed checking 0 GN files with no formatting problems.
Checking Java formatting...
No Java files with changes, skipping Java format check.
Checking Python formatting...
All python files formatted correctly.
Checking for trailing whitespace on 1 source file...
No trailing whitespace found.
No header files with changes, skipping header guard check.
Checking C++/ObjC/Shader formatting...
ERROR: Formatter command '/home/ross/flutter-engine/src/flutter/buildtools/linux-x64/clang/bin/clang-format --style=file shell/platform/linux/fl_application_test.cc' failed with exit code 255. Command output follows:

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

Completed checking 0 C++/ObjC/Shader files with no formatting problems
```

Now it just works, I also changed the shell script to use env since `/bin/bash` doesn't exist on NixOS so using env is a more portable solution.

*List which issues are fixed by this PR. You must list at least one issue.*

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants