Giter Site home page Giter Site logo

goreleaser-cross's Introduction

GoReleaser Logo

GoReleaser

Deliver Go binaries as fast and easily as possible.


GoReleaser builds Go binaries for several platforms, creates a GitHub release and then pushes a Homebrew formula to a tap repository. All that wrapped in your favorite CI.


Get GoReleaser

Documentation

Documentation is hosted live at https://goreleaser.com

Community

You have questions, need support and or just want to talk about GoReleaser?

Here are ways to get in touch with the GoReleaser community:

Join Discord Follow Twitter GitHub Discussions

You can find the links above and all others here.

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. We appreciate your contribution. Please refer to our contributing guidelines for further information.

Badges

Release Software License Build status Codecov branch Artifact Hub Go Doc Powered By: GoReleaser Backers on Open Collective Sponsors on Open Collective Conventional Commits CII Best Practices

GitHub Sponsors

High-tier sponsors of @caarlos0 on GitHub:

OpenCollective

Sponsors

Does your company use goreleaser? Help keep the project bug-free and feature rich by sponsoring the project.

Backers

Love our work and community? Become a backer.

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Stargazers over time

Stargazers over time

goreleaser-cross's People

Contributors

caarlos0 avatar climech avatar dbussink avatar dependabot[bot] avatar gythialy avatar henrynguyen5 avatar hslatman avatar maoueh avatar maraino avatar mfat7y avatar orirawlings avatar qwqcode avatar shibme avatar troian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

goreleaser-cross's Issues

signing failed: No secret key

Hi there,

First of all, thanks to you all for creating such an amazing project!

I've been trying to update my project to use https://github.com/goreleaser/goreleaser-cross instead of https://github.com/goreleaser/goreleaser.

More specifically, I've updated this line to be make release-dry-run to match this.

However, I've been getting an error during make release step (more specifically, during signing artifacts step):

...
    • signing                                        artifact=terraform-provider-confluent-internal_1.34.4_SHA256SUMS cmd=gpg signature=dist/terraform-provider-confluent-internal_1.34.4_SHA256SUMS.sig02:34
  ⨯ release failed after 36s                 error=sign: gpg failed: exit status 2: gpg: directory '/root/.gnupg' created02:34
gpg: keybox '/root/.gnupg/pubring.kbx' created02:34
gpg: skipped "766DB83696A47670296E603FD4A2B1EDB0EC0C8E": No secret key # where 766... is my GPG_FINGERPRINT
gpg: signing failed: No secret key
make: *** [Makefile:125: release-dry-run] Error 1

I double checked the README but it only references 3 env vars and Goreleaser variables (that I didn't manage to find a full list of):
image.

Here's a list of env vars I do provide:

          - 'echo "GOPATH=${GOPATH}" >> .release-env'
          - 'echo "GPG_FINGERPRINT=${GPG_FINGERPRINT}" >> .release-env'
          - 'echo "GPG_PASSWORD=${GPG_PASSWORD}" >> .release-env'
          - 'echo "GPG_KEY=${GPG_PRIVATE_KEY}" >> .release-env'

If that helps, here's a project that seems to be related that shares:

        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
          GORELEASER_KEY: ${{ secrets.GORELEASER_PRO_KEY }}

Use Debian Bookworm as base

Hi!

Due to a third-party dependency, a software I work on needs at least Debian Bookworm to compile correctly (C++ stdlib fails to link otherwise).

Is there a way I could run goreleaser-cross on Bookworm?

Thanks!

Do the sysroots need to be regenerated every time dependencies change?

This looks like a great project, but I'm still trying to wrap my head around sysroots.

We have a complicated ci / build process that includes a rust project that generates C bindings, and then a go / CGO project that references those bindings. That rust project changes somewhat frequently, as do many of our other dependencies. If I understand the sysroot approach correctly, each sysroot is a slimmed down copy of the target filesystem that includes all headers and dependencies necessary for the main project to compile. Doesn't that mean that the sysroots would have to be updated every time the dependencies change?

An alternative approach, which seems to only be available with Goreleaser Pro, would be to run goreleaser in single target mode and prebuild binaries on each target architecture, and then inject those prebuilt binaries later in the pipeline and have Goreleaser handle the rest of the release process from there. That sounds complicated, but potentially still simpler than needing to manage CI jobs that regenerate the sysroots every time things change.

X11/Xlib.h: No such file or directory

This is a request to add libx11-dev as part of goreleaser-cross image

You can add Xlib.h to image by adding following dependency

apt install libx11-dev

Windows 386 support

Hi Guys,
I am trying to build for windows and i see we don't support 386 arch. However, Goreleaser main module does support windows 386. I am confused and need some assistant on the same.

release failed when running in a container

Hello, I intended to experiment with cross-compilation using goreleaser-cross within a container. However, I encountered an issue where goreleaser detected that the cwd is "not a git repository." I'm looking for any suggestions on why this might occur and if there's a possible workaround.

Below is the GitHub workflow snippet that only has two steps.

# SNIPPED
jobs:
  release:
    name: goreleaser-cross
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/goreleaser/goreleaser-cross:latest
    if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && (inputs.job == 'release' || inputs.job == 'both')) }}
    steps:
      - uses: actions/checkout@master
        with:
          ref: "${{ inputs.tag }}"
          fetch-depth: 0

      - run: goreleaser release
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
        working-directory: "${{ github.workspace }}"

Error occurred:

  goreleaser release
# shell: sh -e {0}
# env:
#   GITHUB_TOKEN: ***
  • starting release...
  • loading config file                              file=.goreleaser.yaml
  • loading environment variables
    • using token from "$GITHUB_TOKEN"
  • getting and validating git state
  ⨯ release failed after 0s                  error=current folder is not a git repository
Error: Process completed with exit code 1.

Thanks!

"oa64-clang": executable file not found in $PATH

HI @troian,

I'm trying to use goreleaser to release my project. With reference to this issue I have followed the akash .goreleaser.yaml to update my yaml file.

Tha action fails with message

cgo: C compiler "oa64-clang" not found: exec: "oa64-clang": executable file not found in $PATH

.github/workflows/release.yaml

name: Release

on:
  push:
    branches-ignore:
      - '**'
    tags:
      - 'v*.*.*'


jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - name: GCC multilib
        run: |
            sudo apt-get -y install gcc-aarch64-linux-gnu gcc-x86-64-linux-gnu
      - name: Setup Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.18
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Fetch all tags
        run: git fetch --force --tags
      - name: Docker Hub Login
        run: |
          printf ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: Run GoReleaser
        uses: goreleaser/goreleaser-action@v2
        with:
          version: latest
          args: release --rm-dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

project_name: dfs

release:
  prerelease: auto
env:
  - GO111MODULE=on
  - CGO_ENABLED=1
builds:
  - id: dfs-darwin-amd64
    main: ./cmd/dfs
    binary: dfs
    goos:
      - darwin
    goarch:
      - amd64
    env:
      - CC=o64-clang
      - CXX=o64-clang++
    flags:
      - -v
      - -trimpath
    ldflags:
      - -s -w
      - -X github.com/fairdatasociety/fairOS-dfs.commit={{ .ShortCommit }}
      - -X github.com/fairdatasociety/fairOS-dfs.version={{ .Version }}
  - id: dfs-darwin-arm64
    main: ./cmd/dfs
    binary: dfs
    goos:
      - darwin
    goarch:
      - arm64
    env:
      - CC=oa64-clang
      - CXX=oa64-clang++
    flags:
      - -v
      - -trimpath
    ldflags:
      - -s -w
      - -X github.com/fairdatasociety/fairOS-dfs.commit={{ .ShortCommit }}
      - -X github.com/fairdatasociety/fairOS-dfs.version={{ .Version }}
  - id: dfs-linux-amd64
    main: ./cmd/dfs
    binary: dfs
    goos:
      - linux
    goarch:
      - amd64
    env:
      - CC=x86_64-linux-gnu-gcc
      - CXX=x86_64-linux-gnu-g++
    flags:
      - -v
      - -trimpath
    ldflags:
      - -s -w
      - -X github.com/fairdatasociety/fairOS-dfs.commit={{ .ShortCommit }}
      - -X github.com/fairdatasociety/fairOS-dfs.version={{ .Version }}
      - -extldflags "-lc -lrt -lpthread --static"
  - id: dfs-linux-arm64
    main: ./cmd/dfs
    binary: dfs
    goos:
      - linux
    goarch:
      - arm64
    env:
      - CC=aarch64-linux-gnu-gcc
      - CXX=aarch64-linux-gnu-g++
    flags:
      - -v
      - -trimpath
    ldflags:
      - -s -w
      - -X github.com/fairdatasociety/fairOS-dfs.commit={{ .ShortCommit }}
      - -X github.com/fairdatasociety/fairOS-dfs.version={{ .Version }}
      - -extldflags "-lc -lrt -lpthread --static"
  - id: dfs-windows-amd64
    main: ./cmd/dfs
    binary: dfs
    goos:
      - windows
    goarch:
      - amd64
    env:
      - CC=x86_64-w64-mingw32-gcc
      - CXX=x86_64-w64-mingw32-g++
    flags:
      - -v
      - -trimpath
      - -buildmode=exe
    ldflags:
      - -s -w
      - -X github.com/fairdatasociety/fairOS-dfs.commit={{ .ShortCommit }}
      - -X github.com/fairdatasociety/fairOS-dfs.version={{ .Version }}

archives:
  - id: binary
    name_template: '{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
    format: binary
  - id: zip
    name_template: '{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
    format: zip
checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: "{{ incpatch .Version }}-snapshot"
dockers:
  - dockerfile: Dockerfile.goreleaser
    ids:
      - dfs-linux-amd64
    image_templates:
      - "asabya/fairos-dfs:v{{ .Version }}-amd64"
    use: buildx
    goos: linux
    goarch: amd64
    build_flag_templates:
      - "--platform=linux/amd64"
      - "--pull"
      - "--label=org.opencontainers.image.created={{.Date}}"
      - "--label=org.opencontainers.image.title={{.ProjectName}}"
      - "--label=org.opencontainers.image.revision={{.FullCommit}}"
      - "--label=org.opencontainers.image.version={{.Version}}"
  - dockerfile: Dockerfile.goreleaser
    ids:
      - dfs-linux-arm64
    image_templates:
      - "asabya/fairos-dfs:v{{ .Version }}-arm64"
    use: buildx
    goos: linux
    goarch: arm64
    build_flag_templates:
      - "--platform=linux/arm64"
      - "--pull"
      - "--label=org.opencontainers.image.created={{.Date}}"
      - "--label=org.opencontainers.image.title={{.ProjectName}}"
      - "--label=org.opencontainers.image.revision={{.FullCommit}}"
      - "--label=org.opencontainers.image.version={{.Version}}"
docker_manifests:
  - name_template: asabya/fairos-dfs:v{{ .Major }}
    image_templates:
      - asabya/fairos-dfs:v{{ .Version }}-amd64
      - asabya/fairos-dfs:v{{ .Version }}-arm64
    skip_push: auto
  - name_template: asabya/fairos-dfs:v{{ .Major }}.{{ .Minor }}
    image_templates:
      - asabya/fairos-dfs:v{{ .Version }}-amd64
      - asabya/fairos-dfs:v{{ .Version }}-arm64
    skip_push: auto
  - name_template: asabya/fairos-dfs:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}{{ with .Prerelease }}-{{ . }}{{ end }}
    image_templates:
      - asabya/fairos-dfs:v{{ .Version }}-amd64
      - asabya/fairos-dfs:v{{ .Version }}-arm64
  - name_template: asabya/fairos-dfs:latest
    image_templates:
      - asabya/fairos-dfs:v{{ .Version }}-amd64
      - asabya/fairos-dfs:v{{ .Version }}-arm64

Dockerfile.goreleaser

FROM debian:bullseye

EXPOSE 9090

COPY dfs /usr/local/bin/dfs
RUN /usr/local/bin/dfs version
ENTRYPOINT ["dfs"]

Question: recommended way to add c libraries in the image

I use a libmp3lame binding in my project, and I am not sure how to have those available in the docker image. Do I need to recreate an image including those ? Should I just have them in my repo and point the compiler to them ? Can I apt-get them from the container ?

Compiler for Windows ARM64

Hi, first of all thanks for this great work which reduces a lot the burden of cross-compilation with CGO :)

The list of supported platforms in the README.md include Windows on ARM64, but it seems that MinGW's clang is not present (/llvm-mingw/llvm-mingw/bin/aarch64-w64-mingw32-gcc) in the published container image.

Am I missing something?

Thank you

Control over what version of `glibc` is used

I currently use this to cross compile to a few platforms, and it works great! One issue I'm having is the resulting binary is always built with a recent (ish) version of glibc and some of our servers are running an older version of glibc, meaning they can't be run in the native environment.

I understand this package is already doing a lot and this might be out of scope, I'm not entirely sure what needs to change but I'd imagine it has something to do with the Dockerfile using bullseye and not an older environment like stretch? It would be awesome if you were able to choose which environment to use!

Image no longer works in GitHub Actions

Due to a bug in actions/checkout, this action cannot be used as a container without an additional step:

- run: git config --system --add safe.directory <path>

This is not unique to goreleaser-cross and will affect all versions until actions/checkout is fixed.

But, in the meantime, there is a method we can apply to the image that will allow it work without that extra step in the workflows. We could bake the command into the image itself with something like:

RUN git config --system --add safe.directory '*'

This would effectively disable the safe directory functionality within the goreleaser-cross container.

Docker platform discrepancies

Today, if you run docker run --platform linux/arm64 ... and docker run --platform linux/amd64 ... the set of system include paths is not consistent on disk:

docker run --platform=linux/amd64 --rm -it --entrypoint bash goreleaser/goreleaser-cross:v1.20.5 -c "ls /usr | grep -E '(aarch64-linux-gnu|x86_64-linux-gnu)'"
aarch64-linux-gnu

docker run --platform=linux/arm64 --rm -it --entrypoint bash goreleaser/goreleaser-cross:v1.20.5 -c "ls /usr | grep -E '(aarch64-linux-gnu|x86_64-linux-gnu)'"
x86_64-linux-gnu

This means that if you run the --platform=linux/arm64 version, path /usr/aarch64-linux-gnu does not exist as it's directly /usr and the opposite for --platform=linux/amd64 (path /usr/x86_64-linux-gnu does not exist).

I think we can make image consistent across platform by having 3 symlinks to /usr/{include,lib,bin}. If you agree, I would like to propose a PR for this.

How to Build Snaps?

When I try and build a snap with this image I get the following error:

error=snapcraft not present in $PATH

I looked into installing snapcraft and found the following instructions:

sudo apt update
sudo apt install snapd
sudo snap install core

I tried to add this to a Dockerfile:

FROM goreleaser/goreleaser-cross:v1.21

RUN apt-get update \
 && apt-get install --no-install-recommends -y -q \
    snapd
RUN snap install core
RUN snap install snapcraft --classic

But that fails with:

error: cannot communicate with server: Post "http://localhost/v2/snaps/core": dial unix /run/snapd.socket: connect: no such file or directory

Any ideas on how build snaps with this Docker image?

fatal error: bits/libc-header-start.h: No such file or directory

Hello, i'm trying to run goreleaser-cross:v1.20.5 to build a linux amd64 binary with CGO_ENABLED=1 on my Macbook and it consistnelty fails with - I'm out of ideas.

# runtime/cgo
In file included from _cgo_export.c:3:
/usr/include/stdlib.h:25:10: fatal error: bits/libc-header-start.h: No such file or directory
   25 | #include <bits/libc-header-start.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
release-dry-run:
	@docker run \
		--rm \
		-e CGO_ENABLED=1 \
		-v /var/run/docker.sock:/var/run/docker.sock \
		-v /Users/matt/go-workspace/src/rufus:/go/src/rufus \
		-v /Users/matt/go-workspace/src/rufus/sysroot:/rufus \
		-w /go/src/nginxZ/core \
		ghcr.io/goreleaser/goreleaser-cross:v1.20.5 \
		--clean --skip-validate --skip-publish --skip-docker --skip-sign --snapshot --debug

before:
  hooks:
    - sh -c "cd ./core && go mod tidy"
builds:
  - id: linux-amd64
    main: ./core/main.go
    binary: core-linux
    goos:
      - linux
    goarch:
      - amd64
    env:
      - CGO_ENABLED=1
      - CC=x86_64-linux-gnu-gcc
      - CXX=x86_64-linux-gnu-g++
    ldflags:
      - -s -w -X main.version={{.Version}}
  - id: darwin-amd64
    main: ./core/main.go
    binary: core-darwin
    goos:
      - darwin
    goarch:
      - amd64
    env:
      - CGO_ENABLED=1
      - CC=o64-clang
      - CXX=o64-clang++
    ldflags:
      - -s -w -X main.version={{.Version}}

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 }}

checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: "{{ incpatch .Version }}-next"
changelog:
  sort: asc
  filters:
    exclude:
      - '^docs:'
      - '^test:'

Add clang and clang++ for Linux

I don't know if there's something blocking using clang as CC or if it's already possible.

I would love to contribute if you can show me the ropes.

Docker images version separator changed from - to .

Currently our automation that uses the goreleaser-cross docker images is broken because of this change:

903176d#diff-324dcb1f6809c46621bb617852fa831a1b2f98aaa137bb65db03c065c04e1776L29-L30

Which changed the separator between versions from - to . in the published docker images starting from goreleaser-cross v1.20.0.

I could find no communication regarding this change but I wanted to check if it was in fact an intended change going forward and we should change our automation to match the new format or simply a bug to be fixed (so we should hold off or offer our own MR to fix the issue instead of changing the automation).

Error: /Headers/NSBundle.h:91:143: error: function does not return NSString

I am recieving this error when building a wails app with -tags=desktop,production

In file included from /root/go/pkg/mod/github.com/wailsapp/wails/[email protected]/pkg/assetserver/webview/request_darwin.go:9:
In file included from /usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
                                                         ~~~~~~~~~~~~~~                                                                       ^                  ~
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
In file included from /root/go/pkg/mod/github.com/wailsapp/wails/[email protected]/pkg/assetserver/webview/request_darwin.go:9:
In file included from /usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:130:
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:500:168: error: expected ')'
- (void)readDataOfMinLength:(NSUInteger)minBytes maxLength:(NSUInteger)maxBytes timeout:(NSTimeInterval)timeout completionHandler:(void (^) (NSData * _Nullable_result data, BOOL atEOF, NSError * _Nullable error))completionHandler;
                                                                                                                                                                       ^
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:500:141: note: to match this '('
- (void)readDataOfMinLength:(NSUInteger)minBytes maxLength:(NSUInteger)maxBytes timeout:(NSTimeInterval)timeout completionHandler:(void (^) (NSData * _Nullable_result data, BOOL atEOF, NSError * _Nullable error))completionHandler;
                                                                                                                                            ^
In file included from /root/go/pkg/mod/github.com/wailsapp/wails/[email protected]/pkg/assetserver/webview/request_darwin.go:10:
In file included from /usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.h:39:
In file included from /usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKFrameInfo.h:30:
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h:337:237: error: unknown type name '_Nullable_result'
- (void)callAsyncJavaScript:(NSString *)functionBody arguments:(nullable NSDictionary<NSString *, id> *)arguments inFrame:(nullable WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^ _Nullable)(_Nullable_result id, NSError * _Nullable error))completionHandler NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(11.0), ios(14.0));

When solutions I found is this:-
tpoechtrager/osxcross#345

Which requires me to set
CXXFLAGS=-DNS_FORMAT_ARGUMENT(A)=

But how to set this flag?

No docker login in entry point

Description

My CI was refusing to push Docker images to GitLab registry until I found the instructions provided by the documentation (https://goreleaser.com/ci/gitlab/) did not apply to goreleaser-cross. The issue is related to the entrypoint of this image that is not the same as the official goreleaser image.
Having the same entrypoint in both images would make it easier to switch from one to the other.

Do you think it would be possible?

Note: I fixed the problem by creating my own image from goreleaser/goreleaser-cross and replacing the entrypoint by the one from goreleaser/goreleaser.

FROM goreleaser/goreleaser-cross:v1.20.5

COPY goreleaser-entrypoint.sh /entrypoint.sh

How to reproduce?

Follow the documentation https://goreleaser.com/ci/gitlab/ but replace the image goreleaser/goreleaser by goreleaser/goreleaser-cross in the docker run command.
The CI will fail with "docker images: failed to publish artifacts: failed to push registry.gitlab.com/...:latest: exit status 1: denied: access forbidden"

Producing a .dll.exe where I was expecting a .dll

Help needed please:

I have the following configuration, and when a do a build, the output binary has the .exe.dll extension.

Also when try to use the .exe.dll renamed to.dll in Visual Studio, it's reported that it's not a valid .dll file. (I presume the binary format for .exe and .dll is somewhat different. If found this on StackOverflow:IMAGE_NT_HEADERS. For a DLL, it has the IMAGE_FILE_DLL (0x2000) flag turned on. For a EXE it's the IMAGE_FILE_EXECUTABLE_IMAGE (0x2) flag.

Here is my configuration that is producing a .exe.dll

I am setting the flags as follows: -buildmode=c-shared

builds:
  - id: windows-amd64
    main: ./
    binary: cal-lib.dll
    goos:
      - windows
    goarch:
      - amd64
    env:
      - CGO_ENABLED=1
      - CC=x86_64-w64-mingw32-gcc
      - CXX=x86_64-w64-mingw32-g++
    flags:
      - -buildmode=c-shared
    ldflags:
      - -s -w -X main.version={{.Version}}
  - id: windows-arm64
    main: ./
    binary: cal-lib.dll
    goos:
      - windows
    goarch:
      - arm64
    env:
      - CGO_ENABLED=1
      - CC=/llvm-mingw/bin/aarch64-w64-mingw32-gcc
      - CXX=/llvm-mingw/bin/aarch64-w64-mingw32-g++
    flags:
      - -buildmode=c-shared
    ldflags:
      - -s -w -X main.version={{.Version}}
archives:
  - id: golang-cross
    builds:
      - windows-amd64
      - windows-arm64
    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
    format: zip
    wrap_in_directory: true
checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: "{{ .Tag }}"
changelog:
  sort: asc
  filters:
    exclude:
      - '^docs:'
      - '^test:'

release:
  github:
    owner: goreleaser
    name: cal-lib.dll
  prerelease: auto
  draft: false

Pro version?

I just subscribed to Pro, and I'd like to use this repo's Docker image to make Pro cross-compiles. But it looks like it only includes goreleaser not goreleaser-pro.

libxar.so not found

Version: 1.19.5

failed to build for darwin_arm64

/usr/local/go/pkg/tool/linux_amd64/link: running oa64-clang++ failed: exit status 255
[263](https://github.com/ledgerwatch/erigon/actions/runs/4120944114/jobs/7116173623#step:6:264)
/osxcross/bin/arm64-apple-darwin21.1-ld: error while loading shared libraries: libxar.so.1: cannot open shared object file: No such file or directory
[264](https://github.com/ledgerwatch/erigon/actions/runs/4120944114/jobs/7116173623#step:6:265)
clang: error: unable to execute command: No such file or directory

https://github.com/ledgerwatch/erigon/actions/runs/4121190447/jobs/7116640008#step:6:75
https://github.com/ledgerwatch/erigon/blob/devel/.goreleaser.yml

Passphrase environment variable

Context

Thanks for this awesome project! I'm successfully using goreleaser-cross to build binaries for multiple platforms with CGO support. Tangent: our project needs this because it uses hardware wallets (i.e. Ledger) that depend on CGO.

Problem

I'm encountering an issue with signing here. Copy + pasted below for convenience

  ⨯ release failed after 5m16s                       error=sign: gpg failed: exit status 2: gpg: signing failed: Inappropriate ioctl for device
gpg: signing failed: Inappropriate ioctl for device

make: *** [Makefile:183: prebuilt-binary] Error 1
Error: Process completed with exit code 2.

A quick ChatGPT search leads me to believe this is happening because the passphrase hasn't been plumbed through and the process is opening an interactive prompt to ask for the passphrase.

Proposal

Add an environment variable to plumb the passphrase through and provide it during the signing step in Goreleaser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.