From nobody Fri Feb 28 15:16:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z4Bck5Jhbz5m4kr; Fri, 28 Feb 2025 15:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z4Bck4Mfzz3kMN; Fri, 28 Feb 2025 15:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740755782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZENnwvlp8HKMqTpNRRo6sFVq52hidLjDcTkOjXVm96I=; b=POFGxXpt5HTK3lvQwq27ZFZk7w/QrZzPjVTfm56/8eKj6WvCFbAtuVqe+DTPpk8mATsJDw hSjFrFRhUGIKdAfrTN5BXAJoAdV18Izt9TpusY2plExL3lQcz+g6tsCO2NWWPm84xwE8t3 pgqjHlkboJUHWJEcFULW+/52H1xAe3FWv1i8tOhhMGKOz/IfD+FcpvfHIK14JtwmGGhVO8 4rGkIln8DDRBH68yALElOZLmm7GU9nUPW2DZz5y0n4qlbbwRkmGNf/SpJ6yN+j4p71fBBK vZMKoTitKYHlQIu+vlKhJDAspGjn8gzS6jo6utllLHsRlGqC4t8bPp98k28q2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740755782; a=rsa-sha256; cv=none; b=hGRKJnG87c4cmtUMihaoSqZ2rdKSczmBo0dDmv/alPrOEnpeAcL4B3HlmH0o3PC8ZrmXTY UResiOGBJxdKJqM6iaw7YVHmnnHV5jCKDJwEtb8UZPGGVfQUWhJnUswbVxcxh0DJRoTgQv 1ejO8im5rnLW27ppUQgE895PQ9N0itqAsAFVRH+KCO/sHEx5u3L6lK4gwa9RTl+uZ+XSvy 9iXaA8TDjJaiyc+HcuSp/jcuY09+6LkBckd/axCtZNGY/Bh7uXBYh5JCD7u+EbRE/+sY08 xQ81dWXElgV1mZyXrePjtYIj4lHEYQzk49OdArTxUyI9l6zLY6QAvLLkIGr6BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740755782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZENnwvlp8HKMqTpNRRo6sFVq52hidLjDcTkOjXVm96I=; b=CBSqBUcST8SrVTXo1slMH20LgbcYv2FJPllA5nN6FXs5it9cDWY6woOF7/dMV9VZI+F351 HUPfSYybzfYIEz/rD8G8XcsUCTCYgdSJAfWrDRxjR0kE+ibJu+enmhw/J1T/dueMTjfdZC QGgS2EzKG3h/CCZKt3Qg/mdU1XDGh3oHqE8UCtdZ5sctHYyecIN2aeu/f+iVEacghv6Fw9 coYCM8NNecvyc6J53JoAdRzVbYfbLG8D5kPnZ4L5eR/zEjwklDZZK6wtnKhpUf+1l68kwO KieZjt4UxW+BH03T/BwjEkOX+TiscWLk7MjnDfOYHM+51eE7e+CrmIgQfciLzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z4Bck3c3Szb5b; Fri, 28 Feb 2025 15:16:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51SFGMeg025563; Fri, 28 Feb 2025 15:16:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51SFGMT5025560; Fri, 28 Feb 2025 15:16:22 GMT (envelope-from git) Date: Fri, 28 Feb 2025 15:16:22 GMT Message-Id: <202502281516.51SFGMT5025560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 8a3537aaf7c1 - main - Makefile.inc1: Make package timestamps reproducible by default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a3537aaf7c19f7331fcc160ab42e36fc79e408a Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8a3537aaf7c19f7331fcc160ab42e36fc79e408a commit 8a3537aaf7c19f7331fcc160ab42e36fc79e408a Author: Ed Maste AuthorDate: 2025-02-27 13:17:11 +0000 Commit: Ed Maste CommitDate: 2025-02-28 15:11:52 +0000 Makefile.inc1: Make package timestamps reproducible by default Set package archive timestamps based on most recent source commit timestamp (approach suggested by bapt). I'd like to include git metadata in a file included in src tarballs, so that the build is reproducible (including the hash shown in uname etc.) outside of a git checkout. There are still details to be sorted out to do that, so this is an interim step to improve reproducibility. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49165 --- Makefile.inc1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index c9a4fee236aa..f51fe7d3b119 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -597,8 +597,12 @@ PKG_VERSION:= ${_PKG_REVISION}${EXTRA_REVISION:C/[[:space:]]//g} .endif # !defined(PKG_VERSION) .if !defined(PKG_TIMESTAMP) +.if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) +SOURCE_DATE_EPOCH!= ${GIT_CMD} -C ${SRCDIR} show -s --format=%ct HEAD +.else TIMEEPOCHNOW= %s SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime} +.endif .else SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP} .endif