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

single-target cannot find build #4437

Closed
till opened this issue Nov 21, 2023 · 5 comments · Fixed by #4442
Closed

single-target cannot find build #4437

till opened this issue Nov 21, 2023 · 5 comments · Fixed by #4442
Assignees
Labels
bug Something isn't working
Milestone

Comments

@till
Copy link
Contributor

till commented Nov 21, 2023

We got this error with 1.22.1:

 /opt/hostedtoolcache/goreleaser-action/1.22.1/x64/goreleaser build --snapshot --rm-dist --single-target
  • starting build...
  • loading                                          path=.goreleaser.yaml
  • DEPRECATED: --rm-dist was deprecated in favor of --clean, check https://goreleaser.com/deprecations#-rm-dist for more details
  • building only for linux/amd64                    reason=single target is enabled
  ⨯ build failed after 0s                    error=no builds matching --single-target linux/amd64
Error: The process '/opt/hostedtoolcache/goreleaser-action/1.22.1/x64/goreleaser' failed with exit code 1

Originally posted by @till in #4411 (comment)

My goreleaser config is very simple:

before:
  hooks:
    - go mod tidy
builds:
  - env:
      - CGO_ENABLED=0
    ldflags:
      -  -s -w -X main.Version={{.Version}}
    main: ./cmd/foo
    goos:
      - linux
      - windows
      - darwin
archives:
  - name_template: >-
      {{ .ProjectName }}_
      {{- title .Os }}_
      {{- if eq .Arch "darwin" }}Darwin
      {{- else if eq .Arch "linux" }}Linux
      {{- else if eq .Arch "386" }}i386
      {{- else if eq .Arch "amd64" }}x86_64
      {{- else }}{{ .Arch }}{{ end }}
    wrap_in_directory: true
    format_overrides:
      - goos: windows
        format: zip
    files: # don't add README/LICENSE files
      - none*

There's more, but it's docker and docker manifests.

My guess is, that the --single-target cannot match because we are not explicitly defining amd64, arm64 (aka goarch), etc. in the builds:?

At least, that's my guess. We downgraded the build on that one project for the time being. We usually just build amd64 and --single-target works there, but this project needs everything.

@caarlos0 caarlos0 self-assigned this Nov 22, 2023
@caarlos0 caarlos0 added the bug Something isn't working label Nov 22, 2023
@caarlos0
Copy link
Member

My guess is, that the --single-target cannot match because we are not explicitly defining amd64, arm64 (aka goarch), etc. in the builds:?

yep, that's likely it.

I'll backport this from goreleaser pro to oss, as it works differently there (and better)

thanks for reporting 🙏

@caarlos0
Copy link
Member

if you wanna give it a try, per my testing this should do the trick: #4442

caarlos0 added a commit that referenced this issue Nov 27, 2023
closes #4437 
closes #4426

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@till
Copy link
Contributor Author

till commented Dec 6, 2023

@caarlos0 cheers, I haven't had the chance to test it. Is there a simple way to use the nightlies via homebrew?

@till
Copy link
Contributor Author

till commented Dec 6, 2023

I downloaded it and I had to do a weird dance where I control-click on it and select "open" to override the "un-identified developer" mess on OSX. :D

@caarlos0 Long story short: this works, can we get a bugfix release?

@caarlos0
Copy link
Member

caarlos0 commented Dec 6, 2023

nice to hear it works!

I'll probably release the (hopefully) last release of the year in a couple of days/weeks.

Thanks for the issue and feedback 🙏

@caarlos0 caarlos0 added this to the v1.23.0 milestone Dec 6, 2023
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

Successfully merging a pull request may close this issue.

2 participants