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

[Bug] CGO_ENABLED on macos amd64 is not correct #477

Open
2 of 5 tasks
timandy opened this issue May 6, 2024 · 2 comments
Open
2 of 5 tasks

[Bug] CGO_ENABLED on macos amd64 is not correct #477

timandy opened this issue May 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@timandy
Copy link

timandy commented May 6, 2024

Description:
A clear and concise description of what the bug is.

Action version:
actions/setup-go@v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
go 1.18
go 1.19

Repro steps:

      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: ${{ matrix.go }}

      # darwin
      - name: 'Test on [darwin] arch [amd64]'
        if: ${{ matrix.os == 'darwin' && contains(fromJson('["amd64"]'), matrix.arch) }}
        env:
          GOOS: ${{ matrix.os }}
          GOARCH: ${{ matrix.arch }}
        run: |
          echo ${CGO_ENABLED}   //print empty
          go env CGO_ENABLED //print 0 - should be 1

Expected behavior:
go env CGO_ENABLED //should be 1

Actual behavior:
printed 0, On windows and linux print 1

mac
https://github.com/timandy/routine/actions/runs/8965563348/job/24619393933#step:4:11

linux
https://github.com/timandy/routine/actions/runs/8965563348/job/24619398442#step:6:11

@timandy timandy added bug Something isn't working needs triage labels May 6, 2024
@timandy timandy changed the title [Bug] CGO_ENABLED on macos amd64 is [Bug] CGO_ENABLED on macos amd64 is not correct May 6, 2024
@aparnajyothi-y
Copy link

Hello @timandy, zthank you for creating this issue and we will look into it :)

@gowridurgad gowridurgad self-assigned this Jun 4, 2024
@matthewhughes934
Copy link

matthewhughes934 commented Jun 4, 2024

I suspect this might be something to do with those versions of Go being built differently/in such a way that they don't support cross compilation. Possibly related to #181

EDIT: digging a bit more I see

$ tar -tzf go-1.20.14-darwin-arm64.tar.gz | grep 'src/runtime/.*syso'
./src/runtime/race/internal/amd64v1/race_windows.syso
./src/runtime/race/internal/amd64v1/race_darwin.syso
./src/runtime/race/internal/amd64v1/race_linux.syso
./src/runtime/race/internal/amd64v1/race_freebsd.syso
./src/runtime/race/internal/amd64v1/race_netbsd.syso
./src/runtime/race/internal/amd64v1/race_openbsd.syso
./src/runtime/race/internal/amd64v3/race_linux.syso
./src/runtime/race/race_darwin_arm64.syso
./src/runtime/race/syso_test.go
$ tar -tzf go1.18.10.darwin-arm64.tar.gz | grep 'src/runtime/.*syso'
go/src/runtime/race/race_darwin_arm64.syso
go/src/runtime/race/syso_test.go

files take from:

Indeed I see the same output in the upstream download from https://go.dev/dl/#go1.20.14 🤔 I wonder if those are meant to be there (via tar -tzf go1.20.14.darwin-arm64.tar.gz | grep 'src/runtime/.*syso') ... indeed it looks like the build process has involved quite a bit over time and I guess those are expected now

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

No branches or pull requests

4 participants