subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.28k stars 202 forks source link

Jq is installed on self-hosted runner, but not detected #238

Closed pattersonjack closed 1 year ago

pattersonjack commented 1 year ago

We previously had our runner script working on an Intel iMac. However, now that we have migrated to an M2 Mac Mini, we have begun receiving this error:

Run $GITHUB_ACTION_PATH/setup.sh -p -c '/Users/runner/actions-runner/_work/_tool/flutter/:channel:-:version:-:arch:' -k 'flutter-:os:-:channel:-:version:-:arch:-:hash:' -n '3.10.5' -a 'ARM64' stable
  $GITHUB_ACTION_PATH/setup.sh -p -c '/Users/runner/actions-runner/_work/_tool/flutter/:channel:-:version:-:arch:' -k 'flutter-:os:-:channel:-:version:-:arch:-:hash:' -n '3.10.5' -a 'ARM64' stable
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    JAVA_VERSION: 11.x
    FLUTTER_VERSION: 3.10.5
jq not found, please install it, https://stedolan.github.io/jq/download/
Error: Process completed with exit code 1.

This is all we have in the failing step:

- name: Set up the Flutter environment
  uses: subosito/flutter-action@v2
  with:
    flutter-version: ${{env.FLUTTER_VERSION}}
    channel: 'stable'

Jq is installed on our system (using brew) and it can be found and used normally by the correct user. The shell this action runs in includes both --noprofile and --norc. Does this impact whether homebrew and its installed packages are included in the PATH when the action is executed?

If not, is there anything else needed to ensure jq is correctly detected?

zuffko commented 1 year ago

Same issue for me on self hosted Mac mini M1

Run subosito/flutter-action@v2
  with:
    flutter-version: 3.7.9
    channel: stable
    cache: false
    cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:
    cache-path: /Users/administrator/actions-runner/_work/_tool/flutter/:channel:-:version:-:arch:
    architecture: ARM64
Run $GITHUB_ACTION_PATH/setup.sh -p -c '/Users/administrator/actions-runner/_work/_tool/flutter/:channel:-:version:-:arch:' -k 'flutter-:os:-:channel:-:version:-:arch:-:hash:' -n '3.7.9' -a 'ARM64' stable
jq not found, please install it, https://stedolan.github.io/jq/download/
Error: Process completed with exit code 1.

step

      - name:  Flutter
        uses: subosito/flutter-action@v2
        with:
          flutter-version: 3.7.9
pattersonjack commented 1 year ago

@zuffko I ended up adding to the GitHub path (in a prior step) as a workaround on this machine like so:

echo "/opt/homebrew/bin" >> $GITHUB_PATH

However, we are still unsure why only this runner requires this.

sashkyn commented 8 months ago

Same for me. Any updates?

yurikoles commented 8 months ago

The availability of binaries installed by Homebrew to a self-hosted runner on an Apple Silicon Mac is out of this project's scope.