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

Description not being used for deb nfpm #2861

Closed
3 tasks done
staticdev opened this issue Jan 30, 2022 · 11 comments
Closed
3 tasks done

Description not being used for deb nfpm #2861

staticdev opened this issue Jan 30, 2022 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@staticdev
Copy link
Contributor

What happened?

I created a .goreleaser.yaml configuration with:

nfpms:
  - maintainer: staticdev <staticdev-support@protonmail.com>
    license: "MIT"
    description: Cleanup your phone contacts to prevent apps for having access to all details of your contacts.
    formats:
    - deb
    - rpm

Then I use lintian to validade Debian compatibility of the deb packages I get:

E: cleancontacts: extended-description-is-empty
E: cleancontacts: no-copyright-file

The parameters description and license could be used to have a compatible package.

How can we reproduce this?

Repo: https://github.com/staticdev/cleancontacts/releases

goreleaser version

goreleaser version 1.4.1
commit: a1447a363579365f489458ad7636fd088a5b66ab
built at: 2022-01-27T03:23:37Z
built by: goreleaser
goos: linux
goarch: amd64
module version: v1.4.1, checksum: h1:gW8sdjDEo2H2ZgcJmWsNZUcaJSD4MLvA/bw7+GYQ8kU=

https://goreleaser.com

GoReleaser Check

  • goreleaser check shows no errors

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

No response

@staticdev staticdev added bug Something isn't working triage Issue pending triage by one of the maintainers labels Jan 30, 2022
@caarlos0
Copy link
Member

caarlos0 commented Jan 31, 2022

That seems odd, goreleaser itself has everything set as expected:

carlos@darkstar in ~ 2s
❯ dpkg-deb -I goreleaser_1.4.1_amd64.deb
 new Debian package, version 2.0.
 size 11385942 bytes: control archive=576 bytes.
       1 bytes,     0 lines      conffiles
     314 bytes,    12 lines      control
     363 bytes,     5 lines      md5sums
 Package: goreleaser
 Version: 1.4.1
 Section:
 Priority: optional
 Architecture: amd64
 Maintainer: Carlos Alexandro Becker <root@carlosbecker.com>
 Vendor: GoReleaser
 Installed-Size: 37360
 Depends: git
 Recommends: golang
 Homepage: https://goreleaser.com
 Description: Deliver Go binaries as fast and easily as possible

I also cloned your repo and tested it, and it seems to work just fine:

carlos@darkstar in /tmp
❯ git clone  https://github.com/staticdev/cleancontacts
Cloning into 'cleancontacts'...
remote: Enumerating objects: 174, done.
remote: Counting objects: 100% (174/174), done.
remote: Compressing objects: 100% (124/124), done.
remote: Total 174 (delta 80), reused 117 (delta 44), pack-reused 0
Receiving objects: 100% (174/174), 59.11 KiB | 2.11 MiB/s, done.
Resolving deltas: 100% (80/80), done.

carlos@darkstar in /tmp 670ms
❯ cd cleancontacts/

carlos@darkstar in /tmp/cleancontacts on  main
❯ goreleaser release --rm-dist --skip-validate --skip-sign --skip-sbom --skip-publish
   • releasing...
   • loading config file       file=.goreleaser.yaml
   • loading environment variables
   • getting and validating git state
      • building...               commit=aa107290196d8185c96087d955d8430e73c8cb28 latest tag=v0.2.1
      • pipe skipped              error=validation is disabled
   • parsing tag
   • setting defaults
   • checking distribution directory
      • --rm-dist is set, cleaning it up
   • loading go mod information
   • build prerequisites
   • writing effective config file
      • writing                   config=dist/config.yaml
   • generating changelog
      • writing                   changelog=dist/CHANGELOG.md
   • building binaries
      • building                  binary=/tmp/cleancontacts/dist/cleancontacts_darwin_arm64/cleancontacts
      • building                  binary=/tmp/cleancontacts/dist/cleancontacts_linux_amd64/cleancontacts
      • building                  binary=/tmp/cleancontacts/dist/cleancontacts_linux_386/cleancontacts
      • building                  binary=/tmp/cleancontacts/dist/cleancontacts_windows_amd64/cleancontacts.exe
      • building                  binary=/tmp/cleancontacts/dist/cleancontacts_windows_arm64/cleancontacts.exe
      • building                  binary=/tmp/cleancontacts/dist/cleancontacts_linux_arm64/cleancontacts
      • building                  binary=/tmp/cleancontacts/dist/cleancontacts_darwin_amd64/cleancontacts
      • building                  binary=/tmp/cleancontacts/dist/cleancontacts_windows_386/cleancontacts.exe
   • archives
      • creating                  archive=dist/cleancontacts_0.2.1_Linux_arm64.zip
      • creating                  archive=dist/cleancontacts_0.2.1_Windows_32.zip
      • creating                  archive=dist/cleancontacts_0.2.1_Windows_x86_64.zip
      • creating                  archive=dist/cleancontacts_0.2.1_Windows_arm64.zip
      • creating                  archive=dist/cleancontacts_0.2.1_Mac_x86_64.zip
      • creating                  archive=dist/cleancontacts_0.2.1_Mac_arm64.zip
      • creating                  archive=dist/cleancontacts_0.2.1_Linux_32.zip
      • creating                  archive=dist/cleancontacts_0.2.1_Linux_x86_64.zip
   • linux packages
      • creating                  arch=arm64 file=dist/cleancontacts_0.2.1_linux_arm64.rpm format=rpm package=cleancontacts
      • creating                  arch=arm64 file=dist/cleancontacts_0.2.1_linux_arm64.deb format=deb package=cleancontacts
      • creating                  arch=386 file=dist/cleancontacts_0.2.1_linux_386.rpm format=rpm package=cleancontacts
      • creating                  arch=amd64 file=dist/cleancontacts_0.2.1_linux_amd64.deb format=deb package=cleancontacts
      • creating                  arch=386 file=dist/cleancontacts_0.2.1_linux_386.deb format=deb package=cleancontacts
      • creating                  arch=amd64 file=dist/cleancontacts_0.2.1_linux_amd64.rpm format=rpm package=cleancontacts
   • calculating checksums
   • storing release metadata
      • writing                   file=dist/artifacts.json
      • writing                   file=dist/metadata.json
   • release succeeded after 1.46s

carlos@darkstar in /tmp/cleancontacts on  main  1s
❯ dpkg -I dist/cleancontacts_0.2.1_linux_amd64.deb
 new Debian package, version 2.0.
 size 1619442 bytes: control archive=391 bytes.
       1 bytes,     0 lines      conffiles
     273 bytes,     8 lines      control
      64 bytes,     1 lines      md5sums
 Package: cleancontacts
 Version: 0.2.1
 Section:
 Priority: optional
 Architecture: amd64
 Maintainer: staticdev <staticdev-support@protonmail.com>
 Installed-Size: 3984
 Description: Cleanup your phone contacts to prevent apps for having access to all details of your contacts.

carlos@darkstar in /tmp/cleancontacts on  main
❯ goreleaser --version
goreleaser version 1.4.1
commit: a1447a363579365f489458ad7636fd088a5b66ab
built at: 2022-01-27T03:23:37Z
built by: goreleaser
goos: linux
goarch: amd64
module version: v1.4.1, checksum: h1:gW8sdjDEo2H2ZgcJmWsNZUcaJSD4MLvA/bw7+GYQ8kU=

https://goreleaser.com

I have no idea why deb is complaining... maybe new fields we need to fill now?

@caarlos0 caarlos0 removed the triage Issue pending triage by one of the maintainers label Jan 31, 2022
@staticdev
Copy link
Contributor Author

staticdev commented Jan 31, 2022

Olá @caarlos0 vi aqui que é br, então vou continuar em pt.

Sobre os erros descobri que o primeiro erro é porque o Debian espera que o campo description tenha no mínimo 2 linhas: https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-description

Consegui resolver no goreleaser com:

nfpms:
  - maintainer: staticdev <staticdev-support@protonmail.com>
    license: "MIT"
    description: |
      This is a test.
      Cleanup your phone contacts to prevent apps for having access to all details of your contacts.
    formats:
    - deb
    - rpm

Tentei colocar \n e outras formas de colocar multilinha mas só o pipe funcionou.

Talvez seja uma boa colocar um warning no goreleaser check e/ou um exemplo com duas linhas na documentação (criei uma PR pra isso #2864).

Sobre o segundo erro, vou dar uma olhada agora.

@staticdev
Copy link
Contributor Author

staticdev commented Jan 31, 2022

@caarlos0 update: dps de resolver o problema da extended description agora aparece um warning description-starts-with-leading-spaces

isso acontece pq antes de cada frase na description o goreleaser adiciona dois espaços e o padrão é 1 espaço =(

Se vc der dpkg -I nesse exemplo vai aparecer:

 Description: This is a test.
   Cleanup your phone contacts to prevent apps for having access to all details of your contacts.

Exemplo do nmap do repositório do Debian

 Description: The Network Mapper
  Nmap is a utility for network exploration or security auditing. It
  supports ping scanning (determine which hosts are up), many port
  scanning techniques, version detection (determine service protocols
  and application versions listening behind ports), and TCP/IP
  fingerprinting (remote host OS or device identification). Nmap also
  offers flexible target and port specification, decoy/stealth scanning,
  sunRPC scanning, and more. Most Unix and Windows platforms are
  supported in both GUI and commandline modes. Several popular handheld
  devices are also supported, including the Sharp Zaurus and the iPAQ.

Se preferir posso criar um issue separado para o problema da licença.

@caarlos0
Copy link
Member

pretty sure this needs to be:

description: |- 
      This is a test.
      Cleanup your phone contacts to prevent apps for having access to all details of your contacts.
    formats:

https://yaml-multiline.info

caarlos0 added a commit that referenced this issue Jan 31, 2022
refs  #2861

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@staticdev
Copy link
Contributor Author

@caarlos0 it didn't make any difference for me having |- instead of |. I tried many things to get around the error. Still puts two spaces before every line. Probably the packaging code needs to be changed.

@caarlos0
Copy link
Member

caarlos0 commented Jan 31, 2022

seems like we indeed prefix with 2 spaces on deb.go

image

what's the output of your dpkg --version? I can't reproduce these errors here...

@staticdev
Copy link
Contributor Author

dpkg --version
Debian 'dpkg' package management program version 1.20.9 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.

@caarlos0
Copy link
Member

same version here... no idea why it doesn't complain here...

@staticdev
Copy link
Contributor Author

staticdev commented Jan 31, 2022

@caarlos0 I get the error using lintian not dpkg. Lintian is the official checker for Debian format. dpkg -I only shows that the description has two spaces instead of one.

@staticdev staticdev changed the title Description and license not being used for deb nfpm Description not being used for deb nfpm Jan 31, 2022
@caarlos0
Copy link
Member

caarlos0 commented Feb 5, 2022

fixed on nfpm v2.12, and also merged in here.

next version of goreleaser will have this fixed as well.

to fix other lintian issues, you can refer to #2883

thanks again for the report!

@caarlos0 caarlos0 closed this as completed Feb 5, 2022
@staticdev
Copy link
Contributor Author

Thanks a lot @caarlos0, this tool is very good. I will spread it around!

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

2 participants