release/reproducible-build/release-files
Release builds are reproducible
Implements release/reproducible-build for the release-files artifact: it runs when the release publishes one (see artifacts).
| Severity | info |
| Tiers | 1 |
| Artifact | release-files |
| Scope | root |
| Kind | outcome |
| Source | library v0.8.0 |
| Selected by | fleetlint-recommended@v0.8.0 |
Requirement
The binaries and archives are built without local paths or build-time stamps: Go with -trimpath (in .goreleaser.yaml together with mod_timestamp, or in the go build of the task runner or the publishing workflow); Rust with cargo build --release --locked and --remap-path-prefix; .NET with ContinuousIntegrationBuild; or SOURCE_DATE_EPOCH is set for the release build, in the workflow that publishes the files or the task runner.
Why
When anyone can rebuild a release bit for bit from the tag, a tampered artifact or a compromised build machine shows up as a mismatch.
Capability applies when
release.exists || repo.artifacts.size() > 0Parameters
skip:^\s*[@+-]*\s*(\{\{[^}]*\}\}\s*|\$[({][A-Za-z_]+[)}]\s*)?(#|//|echo\b|printf\b|(sudo\s+)?(go (install|get)|cargo b?install|pipx? install|pip3 install|python3? -m pip install|uv (tool |pip )?(install|add)|(npm|pnpm|yarn|bun) (i|install|add|global add)|gem install|bundle add|brew install|dotnet tool (install|update)|composer (global )?require|apt(-get)? install|curl|wget)\b[^;&]*$)
Fix
Go: add flags: [-trimpath] and mod_timestamp: "{{ .CommitTimestamp }}" to the goreleaser builds. Rust: build with --locked and RUSTFLAGS="--remap-path-prefix=$PWD=.". .NET: set ContinuousIntegrationBuild in Directory.Build.props. Else export SOURCE_DATE_EPOCH from the commit time.
Agent instruction (from release/reproducible-build): Add the stack’s reproducibility settings to the release build and derive SOURCE_DATE_EPOCH from git log -1 --format=%ct; do not change what is built.
Sources
- https://reproducible-builds.org/docs/ (standard, Achieve deterministic builds)
- https://reproducible-builds.org/docs/source-date-epoch/ (spec)
- https://fleetlint.org/baseline/#releases
- https://goreleaser.com/customization/builds/go/ (spec, Reproducible Builds)
- https://pkg.go.dev/cmd/go (spec)
- https://doc.rust-lang.org/rustc/command-line-arguments.html (spec, –remap-path-prefix: remap source paths in output)
- https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props (spec, ContinuousIntegrationBuild)
Generated by fleetlint docs from catalog v0.8.0.