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

compilation error for linux_386 #76

Open
Yakiyo opened this issue Mar 5, 2024 · 3 comments
Open

compilation error for linux_386 #76

Yakiyo opened this issue Mar 5, 2024 · 3 comments

Comments

@Yakiyo
Copy link

Yakiyo commented Mar 5, 2024

I'm trying to cross compile a systray app using goreleaser via github workflows in ci. But it fails during compilation with the following error:
image

@andydotxyz
Copy link
Member

I don't know why but your command triggered the arm64 C compiler instead of x86. There isn't enough context here to suggest why.

@Yakiyo
Copy link
Author

Yakiyo commented Mar 6, 2024

well, if it helps, the goreleaser config file i used was

# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
project_name: gorp

before:
  hooks:
    # You may remove this if you don't use go modules.
    - go mod tidy
    # you may remove this if you don't need go generate
    - go generate ./...
builds:
  - env:
      - CGO_ENABLED=1
    goos:
      - linux
      - windows
      - darwin
    ldflags:
      - >- 
        {{- if eq .Os "windows" }}-H=windowsgui{{- end }}
    #ignore:
     # - goos: "linux"
      #  goarch: "386"
      #- goos: "linux"
      #  goarch: "amd64"
      #- goos: "windows"
      #  goarch: "arm64"

archives:
  - format: tar.gz
    # this name template makes the OS and Arch compatible with the results of uname.
    name_template: >-
      {{ .ProjectName }}_
      {{- title .Os }}_
      {{- if eq .Arch "amd64" }}x86_64
      {{- else if eq .Arch "386" }}i386
      {{- else }}{{ .Arch }}{{ end }}
      {{- if .Arm }}v{{ .Arm }}{{ end }}
    # use zip for windows archives
    format_overrides:
    - goos: windows
      format: zip
checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: "{{ incpatch .Version }}-next"
changelog:
  sort: asc
  filters:
    exclude:
      - '^docs:'
      - '^test:'

scoops:
  - folder: "share/scoop"
    commit_author:
      name: goreleaserbot
      email: bot@goreleaser.com
    commit_msg_template: "Update scoop manifest to {{ .ProjectName }} version {{ .Tag }}"
    homepage: "https://github.com/Yakiyo/gorp"
    license: "MIT"
    description: "{{ .ProjectName }} version {{ .Tag }}"
    repository:
      owner: "Yakiyo"
      name: "{{ .ProjectName }}"
      branch: "main"

brews:
  - name: "{{ .ProjectName }}"
    # available in goreleaser pro
    # alternative_names:
    #   - "{{ .ProjectName }}@{{ .Version }}"
    #   - "{{ .ProjectName }}@{{ .Major }}"
    commit_author:
      name: goreleaserbot
      email: bot@goreleaser.com
    commit_msg_template: "Update brew formula to {{ .ProjectName }} version {{ .Tag }}"
    folder: "share/brew"
    homepage: "https://github.com/Yakiyo/gorp"
    license: "MIT"
    repository:
      owner: "Yakiyo"
      name: "{{ .ProjectName }}"
      branch: "main"

@andydotxyz
Copy link
Member

I've no familiarity with that and it doesn't seem that the script is setting i386.

I'd consider asking the goreleaser community as there isn't much we can do if your scripts are calling arm64 gcc for 32bit intel target...

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

2 participants