From nobody Thu Dec 19 15:03:05 2024 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 4YDYhC00P1z5hKSV; Thu, 19 Dec 2024 15:03:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YDYhB68Ynz4jdC; Thu, 19 Dec 2024 15:03:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734620586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yofb/PkEJ1Rk8tc1Fr+s2IGTRptS8/zdesTY+pj6YQ8=; b=JH3aTxwKMdOiGuenaO7Ijwdc7mKatBLgm5Nm48veVRicZd3ygj3y0Mg6yWX8YjxjojfrGI jSSHiHMFPHSpK+i1L89r2hxovFt4urr3PHA8rS5PkjzwtcMZl4aXHPYz72CU9ae24SvIyN wgBlZXPz6awJrBEvtu1apzb5AWfRxNqEOvE3BWju9a74eS5Cy58AYvyO6nAiOdLqHOBuLw zLr7dtTz92BWRYI6wiRGJ3TCQtR15uPl7LVG27Uv7M+NGxnvpFAMCTUkFu4lMWaH0d/FOS 9rycxWUl+CPIvwI0H05dewjBu1+f/QqCCBkQDlHYxdFZCYTnb/cGVsyCWsMj8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734620586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yofb/PkEJ1Rk8tc1Fr+s2IGTRptS8/zdesTY+pj6YQ8=; b=ikNWxmL+ZgheA41jK5GMkkCHeYsKeSsiKPDZ6oaKKNWSFqkm6OWpuZKCjn8x1ggZGhbD31 a5Z7nBkaLARjUhxKwZbX3sM+NuQfRP7aE3nzdLdeGiIXnLxAfUpH7H9kxdpL2DgmfhQoUU PJPgI5/3FMgMx3SyDMaMf1ctJPM4AR3xdrFbc7KJWyVPFhA2fekntlI5YsUm1cVFJ3+RHP Mh9/z2H3IeFP1pgFRPGLxoEDUmoOD1hWQGBC0HOs6kLwLATtptiuWjwsy4G7ZvwDfHdpxe 1CdokZS9n9ld5WIzSEAhC5Vc7h5BEug8D336/+yfMPxssQyfQfgCmQ7zG6qLEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734620586; a=rsa-sha256; cv=none; b=edCxxchZepBpm4sIrjTWp9nmVx6b5bSjkO6ps7q8ID0De0tGBhWg1h4H22iPIYVR5CHkfe nAyi/zXRWBpNwv/ieAvjoGrv/N4+Q5oCmk6auI8qYb6M7I/NVeldMw3lQSI5PyOeXhief3 8dafqSSn7VfrAC5tWpkX9QLpymiGdI1VKkabDLEJunqUuCA9n8reiaBONzWcpliz4dtxTc t4fTb45Awu5xBynj+bnMk4K8jbyWxr5kikDu5061qPzdZKKOfBs/QxEdssC+MUPy/Jxb+g 4V29N2TpQVfIY13jY5vs1lVZPP3guITu07eip76GUy7tE6neNAR99fPuxPS9aw== Received: from [IPV6:2601:5c0:4200:b830:f819:cd88:aeb3:e21d] (unknown [IPv6:2601:5c0:4200:b830:f819:cd88:aeb3:e21d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YDYhB47WJzXDh; Thu, 19 Dec 2024 15:03:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <9afbf270-0cc0-4fd0-8975-6b88aadd3903@FreeBSD.org> Date: Thu, 19 Dec 2024 10:03:05 -0500 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 User-Agent: Mozilla Thunderbird Subject: Re: git: a1097094c4c5 - main - newvers: Set explicit git revision length Content-Language: en-US To: Gleb Smirnoff , Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202412131306.4BDD6bxu011253@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/18/24 12:12, Gleb Smirnoff wrote: > On Wed, Dec 18, 2024 at 10:22:24AM -0500, Ed Maste wrote: > E> That said, it doesn't matter what Git's algorithm chooses as the short > E> hash length; specifying --short bypasses that algorithm. `git > E> rev-parse --verify --short=12 HEAD` will give us a 12-character short > E> hash as long as that hash is unique. The reproducibility concern is > E> thus: what is the probability that the 12-character short hash is > E> unique at the time and in a repo from which an image is built, but is > E> not unique for the attempt to reproduce it, or vice-versa. This > E> probability is rather small. > E> > E> If you look at arbitrary commits 6 or 7 characters are usually > E> sufficient for a unique hash today. For instance, some latest -pX from > E> recent releng/ branches: > E> > E> 13.3: 72aa3d > E> 13.4: 3f40d5 > E> 14.0: f10e32 > E> 14.1: 74b6c98 > E> 14.2: c8918d6 > E> > E> The status quo of --short=12 should be fine for quite some time. > > AFAIU John's concern is that you can't guarantee a reproducible build from a > "dirty" repository. A repository that has more branches than just the official > ones. I just make a quick check on Netflix repo, that has both the current > FreeBSD history and the before-the-official-git history together, as well as > splitted ports subdirectories and of course our own stuff. For short hashes > there are roughly 2x more ambiguities than for a "clean" repo. Apparently > chance of collision on a long hash is also doubled. > > We can of course say that we don't provide reproducible builds from a "dirty" > repo. But would be a real limitation. That would cancel a legitimate > scenario: > > git subtree add FreeBSD && cd FreeBSD && make a reproducible build In particular, the dirty repository scenario I imagine is FreeBSD's official repository at some point in the future. A question though is how far in the future would it have to be to matter. If we would need 100+ years at our current commit rate to matter, then this is probably moot. The other point I guess is that how many other user git settings can affect the build? Should we not require an empty global git config as a prereq for someone who wants a reproducible build (and use the same setup for our official builds) and say that if you adjust your user config to impact the build that's kind of your problem? -- John Baldwin