portage icon indicating copy to clipboard operation
portage copied to clipboard

Reproducible Build

Open timkenhan opened this issue 8 months ago • 0 comments

Added a couple environment variables that alters BUILD_TIME & BUILD_ID to have deterministic values.

BUILD_TIME: can be "pkg" for the current time of the package build (default) or "ebuild" for the ebuild file's timestamp.

BUILD_ID_TYPE: can be "int" for autoincrement (default) or "hash" for the hash of the environment.

Currently tested to work with sys-apps/baselayout package with the command:

PKGDIR="/tmp/pkg" FEATURES="-getbinpkg" BUILD_TIME="ebuild" BUILD_ID_TYPE="hash" bin/emerge --ignore-default-opts -B sys-apps/baselayout

Known issues:

  • some warning on mtime data type (should be string, but data is int)
  • while image.tar.zst is in the clear, the other part of the files still has present mtime
  • some more complex compilation process may still insert non-deterministic values on its own

timkenhan avatar Jun 12 '24 10:06 timkenhan