Goreleaser: .deb generated with `--snapshot` is broken when the git tag starts with a `v`

Created on 28 Feb 2018  Â·  5Comments  Â·  Source: goreleaser/goreleaser

Prerequisites

  • [x] Are you running the latest version?
  • [x] Did you perform a search to see if this problem was already reported?

For more information, see the CONTRIBUTING guide.

Description

When you create a git tag starting with a v the generated .deb is invalid

Environment

Please paste the output of:

  • go version
go version go1.10 linux/amd64
  • uname -a
Linux kodi 4.10.0-42-generic #46-Ubuntu SMP Mon Dec 4 14:38:01 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • goreleaser --debug
yml@kodi$ goreleaser --debug

   • releasing...
   • loading config file       file=.goreleaser.yml
   • loaded config file        config={gobby { %!s(bool=false) %!s(bool=false) } { { }     []  []   %!s(bool=false) } { { }   } [{[darwin linux windows] [] [] [] [] ./main.go   gobby {go generate } [CGO_ENABLED=0] }] { map[darwin:Darwin linux:Linux windows:Windows 386:i386 amd64:x86_64]  [{windows zip}] %!s(bool=true) []} { map[] [] [] [] [] []       map[] map[]} {{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }} map[darwin:macOS linux:linux amd64:64-bit 386:32-bit] [deb] [] [] [] [] Gwadeloop. https://github.com/lincolnloop/Gobby Yann Malet <[email protected]> Web server for Jobby-wrap in GO TBD /usr/local/bin map[] map[]} { map[]      map[]} {{{ .Tag }}_{{ .Commit}}} {{{ .ProjectName }}_{{ .Version }}_checksums.txt} [] [] {{[^docs: ^test:]} asc} ./dist { []  } {} {[] [] [] [] []     { } [] } {  }}
   • parallelism: 4
   • SETTING DEFAULTS FOR:
      • loading environment variables
      • snapshoting
      • releasing to GitHub
      • running git               args=[rev-parse --is-inside-work-tree]
      • git result                output=true

      • running git               args=[config --get remote.origin.url]
   ⨯ release failed after 0.01s error=repository doesn't have an `origin` remote

Steps to Reproduce

  1. Create a git tag starting with a v
$ git tag -a v0.0.3 -m "0.0.3: bug in goreleaser snapshot if the tag starts with a v"
$ git tag
0.1.0
v0.0.3
  1. Generate the .deb using goreleaser --snapshot --rm-dist
  2. Install this .deb
root@test-gobby:~# dpkg -i /tmp/gobby_v0.0.3_b10d29d694fbf3ec3452df21e819ea91f6d90b6a_linux_64-bit.deb 
dpkg: error processing archive /tmp/gobby_v0.0.3_b10d29d694fbf3ec3452df21e819ea91f6d90b6a_linux_64-bit.deb (--install):
 parsing file '/var/lib/dpkg/tmp.ci/control' near line 2 package 'gobby':
 error in 'Version' field string 'v0.0.3': version number does not start with digit
Errors were encountered while processing:
 /tmp/gobby_v0.0.3_b10d29d694fbf3ec3452df21e819ea91f6d90b6a_linux_64-bit.deb

Expected behavior:

I expected to be able to install the .deb without error.

Actual behavior:

I received an error related to the version not starting with a digit.

error in 'Version' field string 'v0.0.3': version number does not start with digit
bug

All 5 comments

Possibly related to this https://github.com/goreleaser/nfpm/issues/9 ?

Also the go releaser packages have this problem on my ubuntu artful laptop

$ sudo dpkg -i /tmp/goreleaser_amd64.deb
dpkg: error processing archive /tmp/goreleaser_amd64.deb (--install):
 parsing file '/var/lib/dpkg/tmp.ci/control' near line 2 package 'goreleaser':
 error in 'Version' field string 'v0.57.0': version number does not start with digit
Errors were encountered while processing:
 /tmp/goreleaser_amd64.deb

fixed in nfpm, testing on goreleaser...

should be fixed in v0.57.1
thanks for reporting, was totally my bad!

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fheidenreich picture fheidenreich  Â·  4Comments

jonfriesen picture jonfriesen  Â·  4Comments

zet4 picture zet4  Â·  4Comments

tj picture tj  Â·  5Comments

tisba picture tisba  Â·  4Comments