[GH-ISSUE #1549] {runner.arch} is not respects --container-architecture parameter #783

Closed
opened 2026-03-01 21:46:18 +03:00 by kerem · 4 comments
Owner

Originally created by @westito on GitHub (Jan 7, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1549

Bug report info

act version:            0.2.35
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
	/Users/westito/.docker/run/docker.sock
Config files:           
	/Users/westito/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:full-latest
		-P ubuntu-latest=catthehacker/ubuntu:full-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:full-18.04
Build info:
	Go version:            go1.19.4
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -X main.version=0.2.35
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               arm64
		GOOS:                 darwin
Docker Engine:
	Engine version:        20.10.21
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Docker Desktop
	OS type:               linux
	OS version:            
	OS arch:               aarch64
	OS kernel:             5.15.49-linuxkit
	OS CPU:                10
	OS memory:             7950 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

`act -P ubuntu-latest=catthehacker/ubuntu:act-latest --container-architecture linux/amd64`
I also added `max-parallel: 1` to `jobs/build/strategy` to prevent parallel job running

Describe issue

runner.arch environment variable in action.yml returns arm64 even I set the --container-architecture to linux/amd64

https://github.com/rrousselGit/riverpod

Workflow content

name: Build

on:
  pull_request:
    paths-ignore:
      - "**.md"
  push:
    branches:
      - master
    paths-ignore:
      - "**.md"
  schedule:
    # runs the CI everyday at 10AM
    - cron: "0 10 * * *"

jobs:
  build:
    runs-on: ubuntu-latest

    defaults:
      run:
        working-directory: ${{ matrix.package_path }}

    strategy:
      matrix:
        channel:
          - stable
        package_path:
          - examples/counter
          - examples/marvel
          - examples/pub
          - examples/random_number
          - examples/stackoverflow
          - examples/todos
          - packages/riverpod
          - packages/riverpod/example
          - packages/flutter_riverpod
          - packages/flutter_riverpod/example
          - packages/hooks_riverpod
          - packages/hooks_riverpod/example
          - packages/riverpod_annotation
          # TODO(rrousselGit) update riverpod_cli test setup to be supported by the CI
          # - packages/riverpod_cli
          - packages/riverpod_generator
          - packages/riverpod_generator/integration/build_yaml
          # TODO(rrousselGit) update riverpod_graph test setup to be supported by the CI
          # - packages/riverpod_graph
          - packages/riverpod_lint
          # TODO(rousselGit) blocked by https://github.com/invertase/dart_custom_lint/issues/16
          # - packages/riverpod_lint_flutter_test
          - website

    steps:
      - uses: actions/checkout@v3.1.0
        with:
          fetch-depth: 2
      - uses: subosito/flutter-action@v2.7.1
        with:
          channel: ${{ matrix.channel }}
      - name: Add pub cache bin to PATH
        run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
      - name: Add pub cache to PATH
        run: echo "PUB_CACHE="$HOME/.pub-cache"" >> $GITHUB_ENV
      - name: Install dependencies
        run: flutter pub get
      - name: Install dependencies (integration/buid.yaml)
        run: |
          if test -d "integration/build_yaml"; then
            flutter pub get integration/build_yaml
          fi

      - name: Check format
        run: flutter format --set-exit-if-changed .
        if: matrix.package_path != 'website'

      - name: Analyze
        run: flutter analyze

      - name: Run tests
        run: |
          if test -d "test"; then
            if grep -q flutter "pubspec.yaml"; then
              flutter test --coverage
            else
              ${{github.workspace}}/scripts/coverage.sh
            fi
          fi

      - name: Upload coverage to codecov
        run: |
          if test -d "test"; then
            curl -s https://codecov.io/bash | bash
          fi

Relevant log output

[Build/build-1 ] 🚀  Start image=catthehacker/ubuntu:act-latest
[Build/build-1 ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform=linux/amd64 username= forcePull=false
[Build/build-1 ]   🐳  docker create image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Build/build-1 ]   🐳  docker run image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Build/build-1 ]   ☁  git clone 'https://github.com/subosito/flutter-action' # ref=v2.7.1
[Build/build-1 ] ⭐ Run Pre subosito/flutter-action@v2.7.1
[Build/build-1 ]   ☁  git clone 'https://github.com/actions/cache' # ref=v3
[Build/build-1 ]   ✅  Success - Pre subosito/flutter-action@v2.7.1
[Build/build-1 ] 🧪  Matrix: map[channel:stable package_path:examples/counter]
[Build/build-1 ] ⭐ Run Main actions/checkout@v3.1.0
[Build/build-1 ]   🐳  docker cp src=/Users/westito/Projects/Dart/riverpod/. dst=/Users/westito/Projects/Dart/riverpod
[Build/build-1 ]   ✅  Success - Main actions/checkout@v3.1.0
[Build/build-1 ] ⭐ Run Main subosito/flutter-action@v2.7.1
[Build/build-1 ]   🐳  docker cp src=/Users/westito/.cache/act/subosito-flutter-action@v2.7.1/ dst=/var/run/act/actions/subosito-flutter-action@v2.7.1/
[Build/build-1 ] ⭐ Run Main $GITHUB_ACTION_PATH/setup.sh -p -c '/opt/hostedtoolcache/flutter/:channel:-:version:-:arch:' -k 'flutter-:os:-:channel:-:version:-:arch:-:hash:' -n 'any' -a 'arm64' stable
[Build/build-1 ]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-flutter-action.sh] user= workdir=
| Unable to determine Flutter version for channel: stable version: any architecture: arm64
[Build/build-1 ]   ❌  Failure - Main $GITHUB_ACTION_PATH/setup.sh -p -c '/opt/hostedtoolcache/flutter/:channel:-:version:-:arch:' -k 'flutter-:os:-:channel:-:version:-:arch:-:hash:' -n 'any' -a 'arm64' stable
[Build/build-1 ] exitcode '1': failure
[Build/build-1 ]   ⚙  ::set-output:: cache-path=
[Build/build-1 ]   ⚙  ::set-output:: cache-key=
[Build/build-1 ]   ⚙  ::set-output:: channel=
[Build/build-1 ]   ⚙  ::set-output:: version=
[Build/build-1 ]   ⚙  ::set-output:: architecture=
[Build/build-1 ]   ❌  Failure - Main subosito/flutter-action@v2.7.1
[Build/build-1 ] exitcode '1': failure
[Build/build-1 ] ⭐ Run Post subosito/flutter-action@v2.7.1
[Build/build-1 ]   🐳  docker cp src=/Users/westito/.cache/act/subosito-flutter-action@v2.7.1/ dst=/var/run/act/actions/subosito-flutter-action@v2.7.1/
[Build/build-1 ]   ✅  Success - Post subosito/flutter-action@v2.7.1
[Build/build-1 ] 🏁  Job failed

Additional information

If I add architecture: x64 parameter to subosito/flutter-action@v2.7.1 step the problem goes away. flutter-action uses ${{ runner.arch }} in action.yml to get architecture.

Originally created by @westito on GitHub (Jan 7, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1549 ### Bug report info ```plain text act version: 0.2.35 GOOS: darwin GOARCH: arm64 NumCPU: 10 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock /Users/westito/.docker/run/docker.sock Config files: /Users/westito/.actrc: -P ubuntu-latest=catthehacker/ubuntu:full-latest -P ubuntu-latest=catthehacker/ubuntu:full-20.04 -P ubuntu-18.04=catthehacker/ubuntu:full-18.04 Build info: Go version: go1.19.4 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -compiler: gc -ldflags: -X main.version=0.2.35 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: arm64 GOOS: darwin Docker Engine: Engine version: 20.10.21 Engine runtime: runc Cgroup version: 2 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: aarch64 OS kernel: 5.15.49-linuxkit OS CPU: 10 OS memory: 7950 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh `act -P ubuntu-latest=catthehacker/ubuntu:act-latest --container-architecture linux/amd64` I also added `max-parallel: 1` to `jobs/build/strategy` to prevent parallel job running ``` ### Describe issue `runner.arch` environment variable in `action.yml` returns `arm64` even I set the `--container-architecture` to `linux/amd64` ### Link to GitHub repository https://github.com/rrousselGit/riverpod ### Workflow content ```yml name: Build on: pull_request: paths-ignore: - "**.md" push: branches: - master paths-ignore: - "**.md" schedule: # runs the CI everyday at 10AM - cron: "0 10 * * *" jobs: build: runs-on: ubuntu-latest defaults: run: working-directory: ${{ matrix.package_path }} strategy: matrix: channel: - stable package_path: - examples/counter - examples/marvel - examples/pub - examples/random_number - examples/stackoverflow - examples/todos - packages/riverpod - packages/riverpod/example - packages/flutter_riverpod - packages/flutter_riverpod/example - packages/hooks_riverpod - packages/hooks_riverpod/example - packages/riverpod_annotation # TODO(rrousselGit) update riverpod_cli test setup to be supported by the CI # - packages/riverpod_cli - packages/riverpod_generator - packages/riverpod_generator/integration/build_yaml # TODO(rrousselGit) update riverpod_graph test setup to be supported by the CI # - packages/riverpod_graph - packages/riverpod_lint # TODO(rousselGit) blocked by https://github.com/invertase/dart_custom_lint/issues/16 # - packages/riverpod_lint_flutter_test - website steps: - uses: actions/checkout@v3.1.0 with: fetch-depth: 2 - uses: subosito/flutter-action@v2.7.1 with: channel: ${{ matrix.channel }} - name: Add pub cache bin to PATH run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH - name: Add pub cache to PATH run: echo "PUB_CACHE="$HOME/.pub-cache"" >> $GITHUB_ENV - name: Install dependencies run: flutter pub get - name: Install dependencies (integration/buid.yaml) run: | if test -d "integration/build_yaml"; then flutter pub get integration/build_yaml fi - name: Check format run: flutter format --set-exit-if-changed . if: matrix.package_path != 'website' - name: Analyze run: flutter analyze - name: Run tests run: | if test -d "test"; then if grep -q flutter "pubspec.yaml"; then flutter test --coverage else ${{github.workspace}}/scripts/coverage.sh fi fi - name: Upload coverage to codecov run: | if test -d "test"; then curl -s https://codecov.io/bash | bash fi ``` ### Relevant log output ```sh [Build/build-1 ] 🚀 Start image=catthehacker/ubuntu:act-latest [Build/build-1 ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform=linux/amd64 username= forcePull=false [Build/build-1 ] 🐳 docker create image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Build/build-1 ] 🐳 docker run image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Build/build-1 ] ☁ git clone 'https://github.com/subosito/flutter-action' # ref=v2.7.1 [Build/build-1 ] ⭐ Run Pre subosito/flutter-action@v2.7.1 [Build/build-1 ] ☁ git clone 'https://github.com/actions/cache' # ref=v3 [Build/build-1 ] ✅ Success - Pre subosito/flutter-action@v2.7.1 [Build/build-1 ] 🧪 Matrix: map[channel:stable package_path:examples/counter] [Build/build-1 ] ⭐ Run Main actions/checkout@v3.1.0 [Build/build-1 ] 🐳 docker cp src=/Users/westito/Projects/Dart/riverpod/. dst=/Users/westito/Projects/Dart/riverpod [Build/build-1 ] ✅ Success - Main actions/checkout@v3.1.0 [Build/build-1 ] ⭐ Run Main subosito/flutter-action@v2.7.1 [Build/build-1 ] 🐳 docker cp src=/Users/westito/.cache/act/subosito-flutter-action@v2.7.1/ dst=/var/run/act/actions/subosito-flutter-action@v2.7.1/ [Build/build-1 ] ⭐ Run Main $GITHUB_ACTION_PATH/setup.sh -p -c '/opt/hostedtoolcache/flutter/:channel:-:version:-:arch:' -k 'flutter-:os:-:channel:-:version:-:arch:-:hash:' -n 'any' -a 'arm64' stable [Build/build-1 ] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-flutter-action.sh] user= workdir= | Unable to determine Flutter version for channel: stable version: any architecture: arm64 [Build/build-1 ] ❌ Failure - Main $GITHUB_ACTION_PATH/setup.sh -p -c '/opt/hostedtoolcache/flutter/:channel:-:version:-:arch:' -k 'flutter-:os:-:channel:-:version:-:arch:-:hash:' -n 'any' -a 'arm64' stable [Build/build-1 ] exitcode '1': failure [Build/build-1 ] ⚙ ::set-output:: cache-path= [Build/build-1 ] ⚙ ::set-output:: cache-key= [Build/build-1 ] ⚙ ::set-output:: channel= [Build/build-1 ] ⚙ ::set-output:: version= [Build/build-1 ] ⚙ ::set-output:: architecture= [Build/build-1 ] ❌ Failure - Main subosito/flutter-action@v2.7.1 [Build/build-1 ] exitcode '1': failure [Build/build-1 ] ⭐ Run Post subosito/flutter-action@v2.7.1 [Build/build-1 ] 🐳 docker cp src=/Users/westito/.cache/act/subosito-flutter-action@v2.7.1/ dst=/var/run/act/actions/subosito-flutter-action@v2.7.1/ [Build/build-1 ] ✅ Success - Post subosito/flutter-action@v2.7.1 [Build/build-1 ] 🏁 Job failed ``` ### Additional information If I add `architecture: x64` parameter to `subosito/flutter-action@v2.7.1` step the problem goes away. `flutter-action` uses `${{ runner.arch }}` in `action.yml` to get architecture.
kerem 2026-03-01 21:46:18 +03:00
Author
Owner

@westito commented on GitHub (Jan 7, 2023):

Update: I tried with Docker Desktop first where this happened. With Colima there is no issue with the same command: [DEBUG] expression 'format('{0}', runner.arch)' evaluated to '%!t(string=X64)'

<!-- gh-comment-id:1374610045 --> @westito commented on GitHub (Jan 7, 2023): Update: I tried with `Docker Desktop` first where this happened. With `Colima` there is no issue with the same command: `[DEBUG] expression 'format('{0}', runner.arch)' evaluated to '%!t(string=X64)'`
Author
Owner

@github-actions[bot] commented on GitHub (Jul 7, 2023):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1624459817 --> @github-actions[bot] commented on GitHub (Jul 7, 2023): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@andrey-parkhomets commented on GitHub (Aug 1, 2024):

please re-open as it's a definitely a logical bug of "func RunnerArch" in docker_run.go ,arch shouldn't be sourced from func GetHostInfo, rather other/new functiion similar to tryReadID (i.e. try-read-Arch)

<!-- gh-comment-id:2263389365 --> @andrey-parkhomets commented on GitHub (Aug 1, 2024): please re-open as it's a definitely a logical bug of "func RunnerArch" in docker_run.go ,arch shouldn't be sourced from func GetHostInfo, rather other/new functiion similar to tryReadID (i.e. try-read-Arch)
Author
Owner

@MiniSuperDev commented on GitHub (Apr 7, 2025):

Please reopen i have the same error in Mac (darwin 24.3.0)

<!-- gh-comment-id:2781969810 --> @MiniSuperDev commented on GitHub (Apr 7, 2025): Please reopen i have the same error in Mac (darwin 24.3.0)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#783
No description provided.