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

RUNNER_OS should return macOS instead of darwin and wrong RUNNER_ARCH on MacOS M1 #1509

Closed
x-yurii-uvarov opened this issue Dec 14, 2022 · 3 comments · Fixed by #1510
Closed
Labels
kind/bug Something isn't working

Comments

@x-yurii-uvarov
Copy link

Bug report info

act --bug-report                                    
act version:            0.2.34
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
	/Users/yuriiuvarov/.docker/run/docker.sock
Config files:           
	/Users/yuriiuvarov/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
	.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.19.3
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -X main.version=0.2.34
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               amd64
		GOOS:                 darwin
		GOAMD64:              v1
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:                4
	OS memory:             3933 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act -j build --platform macos-latest=-self-hosted

Describe issue

Some Github actions depend on the RUNNER_OS and expect one of the defined values according to the https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables.

The operating system of the runner executing the job. Possible values are Linux, Windows, or macOS

For example, flutter-action uses RUNNER_OS to build a link to the flutter binary.

expected result: macOS,
actual result: darwin

Also, RUNNER_ARCH should be arm64(or x64 using rosetta at least) but it provides amd64, which is definitely wrong.

Link to GitHub repository

No response

Workflow content

name: Linter & Tests

on:
  push:
    branches: [ main, redesign-master ]
  pull_request:
    branches: [ main, redesign-master ]

jobs:
  build:
    runs-on: macos-latest
    env:
      REPO_DIR: ${{ github.workspace }}
    steps:
      - uses: actions/checkout@v3
      - name: 'Test os'
        run: echo $RUNNER_OS
      - name: 'Set Flutter 3.3.9'
        uses: subosito/flutter-action@v2
        with:
          architecture: arm64
          flutter-version: 3.3.9

Relevant log output

This exceeds the GitHub character limit, please find it here:
https://drive.google.com/file/d/1UYD4cZqcdBm2jMyOISvDMpJ6XJ44LGZq/view?usp=sharing

Additional information

uname -a
Darwin Yuriis-MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 arm64
@x-yurii-uvarov x-yurii-uvarov added the kind/bug Something isn't working label Dec 14, 2022
@ChristopherHX
Copy link
Contributor

@x-yurii-uvarov Could you please check if the arm64 version of act https://github.com/nektos/act/releases/download/v0.2.34/act_Darwin_arm64.tar.gz has the correct RUNNER_ARCH ?

You are right, the RUNNER_OS needs a remapping for macOS.

@ChristopherHX
Copy link
Contributor

ChristopherHX commented Dec 14, 2022

FYI Possible values for RUNNER_OS of act are also freebsd, openbsd, plan9, dragonfly, solaris and android.

If you run RUNNER_OS=macOS act ... you have the correct RUNNER_OS without a patch

@x-yurii-uvarov
Copy link
Author

I have uninstalled the brew version of the act and tried yours, and RUNNER_ARCH changed from amd64 to arm64.
Also, RUNNER_OS=macOS act ... helped to change RUNNER_OS, and I can use it as a workaround for now.

Thank you @ChristopherHX! Both of your suggestions work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants