goreleaser / nfpm

nFPM is Not FPM - a simple deb, rpm, apk, ipk, and arch linux packager written in Go
https://nfpm.goreleaser.com/
MIT License
2.13k stars 157 forks source link

Introduction of reproducible builds causes Lintian to throw `package-contains-ancient-file` errors for directories #757

Closed christian-stephen closed 8 months ago

christian-stephen commented 8 months ago

What happened?

In v2.35.0, the introduction of reproducible builds appears to cause Lintian to throw package-contains-ancient-file errors for directories created by nfpm, due to it defaulting to zero (epoch).

I thought I could get around this by specifying the mtime in the nfpm configuration, but this doesn't seem to work. I see that the mtime appears hardcoded in some places that may be related to this.

I could ignore this error in .lintian-overrides, but this wasn't an issue before.

How can we reproduce this?

Define an nfpm config with something along the following:

mtime: 2023-12-21
contents:
  - src: ./config.yml
    dst: /etc/my-app/config.yml
    type: "config|noreplace"

Install Lintian per the nfpm docs' recommendation (I'm on Lintian v2.114.0ubuntu1.3), and run:

lintian --fail-on error --no-tag-display-limit /path/to/deb

Observe package-contains-ancient-file errors, like this:

E: my-app: package-contains-ancient-file etc/ 1970-01-01

nfpm version

_____ ____  __  __
 _ __ |  ___|  _ \|  \/  |
| '_ \| |_  | |_) | |\/| |
| | | |  _| |  __/| |  | |
|_| |_|_|   |_|   |_|  |_|
nfpm: a simple and 0-dependencies deb, rpm, apk and arch linux packager written in Go
https://nfpm.goreleaser.com

GitVersion:    dev
GitCommit:     unknown
GitTreeState:  unknown
BuildDate:     unknown
BuiltBy:       unknown
GoVersion:     go1.21.5
Compiler:      gc
ModuleSum:     h1:rUUc2TdsJ1rSAy09X25ilBqDfAp7/MzUQIKsAfYbqWs=
Platform:      linux/amd64

Search

Code of Conduct

Additional context

This issue seems related: https://github.com/goreleaser/nfpm/issues/750

caarlos0 commented 8 months ago

ah, good catch, will fix that, thanks

caarlos0 commented 8 months ago

can you try with #758?

christian-stephen commented 8 months ago

can you try with #758?

Thanks! I'll give it a try and report back.