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

Arm64 runners support #345

Open
ferraridamiano opened this issue Jan 19, 2025 · 5 comments
Open

Arm64 runners support #345

ferraridamiano opened this issue Jan 19, 2025 · 5 comments

Comments

@ferraridamiano
Copy link

ferraridamiano commented Jan 19, 2025

Github just released arm64 actions for linux. I tried to setup flutter with flutter-action on ubuntu-24.04-arm but it failed. Will you add support also for arm runners?

Here is the error:

Run subosito/flutter-action@v2
  with:
    channel: stable
    cache: true
    architecture: ARM6[4](https://github.com/ferraridamiano/prova/actions/runs/12855298558/job/35840677162#step:4:4)
    pub-cache-path: default
    dry-run: false
Run chmod +x "$GITHUB_ACTION_PATH/setup.sh"
  chmod +x "$GITHUB_ACTION_PATH/setup.sh"
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
Run $GITHUB_ACTION_PATH/setup.sh -p \
  $GITHUB_ACTION_PATH/setup.sh -p \
    -n '' \
    -f '' \
    -a 'ARM[6](https://github.com/ferraridamiano/prova/actions/runs/12855298558/job/35840677162#step:4:6)4' \
    -k '' \
    -c '' \
    -l '' \
    -d 'default' \
    stable
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
Unable to determine Flutter version for channel: stable version: any architecture: arm64
Error: Process completed with exit code 1.
@Npepperlinux
Copy link

Npepperlinux commented Jan 22, 2025

The official does not provide linux arm64 build, you can use snap instead

The official support deployment on linux-arm64 and provide dart-sdk-linux-arm64(3.24.5 SDK example). It should be possible if you don't reference release_linux.json.

@ferraridamiano
Copy link
Author

So It should be possible to include it in this action?

@josh-audio
Copy link

josh-audio commented Feb 5, 2025

Here's an alternative way to install Flutter for Linux that works on ARM. I've tested this on ubuntu-24.04-arm and it's working as expected.

3.27.3 is the latest Flutter version as of writing this. You can replace 3.27.3 in the clone command below with your preferred Flutter version.

jobs:
  build-linux:
    # If you want to run the same action on x86 and ARM, you can use a matrix strategy
    strategy:
      matrix:
        os: [ubuntu-latest, ubuntu-24.04-arm]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Install dependencies from Apt
        run: |
          sudo apt-get update -y && sudo apt-get upgrade -y;

          # These packages are listed in the setup instructions for Linux desktop. They may not all be necessary.
          # For reference: https://docs.flutter.dev/get-started/install/linux/desktop
          sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev

      - name: Clone Flutter
        run: |
          # Shallow-clone Flutter to reduce download size
          git clone --depth 1 --branch 3.27.3 https://github.com/flutter/flutter.git $RUNNER_TEMP/flutter

          # Add Flutter to PATH
          echo "$RUNNER_TEMP/flutter/bin" >> $GITHUB_PATH

      - name: Install Flutter
        # Running "flutter doctor" will download Flutter's dependencies
        run: flutter doctor
      
      # More steps here...

If you want to use the same clone strategy on Windows, the code is similar:

jobs:
  build-windows:
    runs-on: [windows-latest]
    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Clone Flutter
        run: |
          # Shallow-clone Flutter to reduce download size
          git clone --depth 1 --branch 3.27.3 https://github.com/flutter/flutter.git $env:RUNNER_TEMP\flutter

          # Add Flutter to PATH
          Add-Content $env:GITHUB_PATH "$env:RUNNER_TEMP\flutter\bin"
      
      - name: Install Flutter
        # Running "flutter doctor" will download Flutter's dependencies
        run: flutter doctor

      # More steps here...

coolymike added a commit to coolymike/interstellar that referenced this issue Feb 11, 2025
Can be removed when subosito/flutter-action#345 is closed
Also renamed aarch64 to arm64
@pugaizai
Copy link

you don't need to manually git clone, u just

steps:
  - name: Clone repository
    uses: actions/checkout@v4
  - name: Set up Flutter
    uses: subosito/flutter-action@v2
    with:
      channel: master
      flutter-version: 3.24.0
  - run: flutter --version

then linux arm works

@ferraridamiano
Copy link
Author

Thanks for your solution @pugaizai. It works!

The issue with this action occurs when it's configured to use a flutter channel other than master.

alexVinarskis added a commit to alexVinarskis/dell-powermanager that referenced this issue Feb 16, 2025
Drop manual clonning workaround, as flutter-action
can work on arm64 as well if master channel with
explicit version declartion also works [1].

[1] subosito/flutter-action#345 (comment)
alexVinarskis added a commit to alexVinarskis/dell-powermanager that referenced this issue Feb 16, 2025
Drop manual clonning workaround, as flutter-action
can work on arm64 as well if master channel with
explicit version declartion also works [1].

[1] subosito/flutter-action#345 (comment)
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

4 participants