Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRomu-009XDI-V8 for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 07:32:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rRomt-002Gce-1u for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 07:32:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRoms-002GcW-N6 for pgsql-hackers@lists.postgresql.org; Mon, 22 Jan 2024 07:32:06 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRomp-0035Hy-Hq for pgsql-hackers@postgresql.org; Mon, 22 Jan 2024 07:32:05 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 39B185C0110 for ; Mon, 22 Jan 2024 02:32:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 22 Jan 2024 02:32:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1705908721; x=1705995121; bh=9wZKoQ+sR5V0TYxtLj9Etq89EkXhg1p+ ar4zMh9INn8=; b=c1MrhRXI6GEWmevig2dyvQQI+Xp+OzZBxHdELyMMtMTiTApA PGvqnwhywhfk5fKOOfXgoSrXVf5xvC/WonF0LadALh87QBowq+UpRyDNpH1WTNtC gSjsBjX+vIBgc26KW8bLVKfZ/fc+X1c6WQUOJMi5obv+xPypNOW7c4jih9w39So6 F4l+AwH9K8NeA1aop9kvqPbO9O8m82gw8ZzgXEbEnwTZYhhbiAcySZ7gdYrmUHXH E3z12N74+1yknMnVTW9CGR0EdBmMsAFh7hMigFIiS317Ocd5Dg5IwAbbVH9PttmQ uUb3sDzQ2TjHTBHKpMLVOOJyITMnXAz1IWnaPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1705908721; x=1705995121; bh=9wZKoQ+sR5V0TYxtLj9Etq89EkXhg1p+ar4 zMh9INn8=; b=OhokmhWehNjRV1p5SNvz4Q0l5ecMtorP9Hm6mOBmNMQEyZJmjjv L3yftL+g8kSAathgmHFVeeWBlTu4dpEtWmdI1apzVnm3a1vUIE7Y0hqFXExc3ZUu EpAROi5Eh0aj27g6SkJw7PT/mAbEtMIDMvCoeezhQsiutymiqtsuB/kVCTqRTg92 Uj7e8j5AHaNKfy5VY3YuLye8metmj5QctoPCAVgkKe4lZjEx8ims2uxs0oTqUGiJ CNHxJx1QVmfdk8xeuYWRHWNk6GQAMAoAHZXywUG8/97Sdrw43pJr2lSr9OQ4L+Pv 3IEDA0nluVwBjckzPXPnCRBwJYhKM/AIpzQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdekhedguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfhuffvsehmtderre dtvdejnecuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegv ihhsvghnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepheetkedugedtheettd ethfdukeejgfduieehieetffeutdetffekkefgledvffelnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruh htrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 22 Jan 2024 02:32:00 -0500 (EST) Content-Type: multipart/mixed; boundary="------------Wm7y0tm0iuuMmZEm8M2KSX0y" Message-ID: <40e80f77-a294-4f29-a16f-e21bc7bc75fc@eisentraut.org> Date: Mon, 22 Jan 2024 08:31:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Peter Eisentraut Subject: make dist using git archive To: pgsql-hackers List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------Wm7y0tm0iuuMmZEm8M2KSX0y Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit One of the goals is to make the creation of the distribution tarball more directly traceable to the git repository. That is why we removed the "make distprep" step. Here I want to take another step in that direction, by changing "make dist" to directly use "git archive", rather than the custom shell script it currently runs. The simple summary is that it would run git archive --format tar.gz --prefix postgresql-17devel/ HEAD -o postgresql-17devel.tar.gz (with appropriate version numbers, of course), and that's the tarball we would ship. There are analogous commands for other compression formats. The actual command gets subtly more complicated if you need to run this in a separate build directory. In my attached patch, the make version doesn't support vpath at the moment, just so that it's easier to understand for now. The meson version is a bit hairy. I have studied and tested this quite a bit, and I have found that the archives produced this way are deterministic and reproducible, meaning for a given commit the result file should always be bit-for-bit identical. The exception is that if you use a git version older than 2.38.0, gzip records the platform in the archive, so you'd get a different output on Windows vs. macOS vs. "UNIX" (everything else). In git 2.38.0, this was changed so that everything is recorded as "UNIX" now. This is just something to keep in mind. This issue is specific to the gzip format, it does not affect other compression formats. Meson has its own distribution building command (meson dist), but opted against using that. The main problem is that the way they have implemented it, it is not deterministic in the above sense. (Another point is of course that we probably want a "make" version for the time being.) But the target name "dist" in meson is reserved for that reason, so I needed to call the custom target "pgdist". I did take one idea from meson: It runs a check before git archive that the checkout is clean. That way, you avoid mistakes because of uncommitted changes. This works well in my "make" implementation. In the meson implementation, I had to find a workaround, because a custom_target cannot have a dependency on a run_target. As also mentioned above, the whole meson implementation is a bit ugly. Anyway, with the attached patch you can do make dist or meson compile -C build pgdist and it produces the same set of tarballs as before, except it's done differently. The actual build scripts need some fine-tuning, but the general idea is correct, I think. --------------Wm7y0tm0iuuMmZEm8M2KSX0y Content-Type: text/plain; charset=UTF-8; name="v0-0001-make-dist-uses-git-archive.patch" Content-Disposition: attachment; filename="v0-0001-make-dist-uses-git-archive.patch" Content-Transfer-Encoding: base64 RnJvbSA0YjEyOGZhY2E5MDIzOGQwYTBiYjY5NDlhODA1MGMyNTAxZDFiZDY3IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQZXRlciBFaXNlbnRyYXV0IDxwZXRlckBlaXNlbnRy YXV0Lm9yZz4KRGF0ZTogU2F0LCAyMCBKYW4gMjAyNCAyMTo1NDozNiArMDEwMApTdWJqZWN0 OiBbUEFUQ0ggdjBdIG1ha2UgZGlzdCB1c2VzIGdpdCBhcmNoaXZlCgotLS0KIEdOVW1ha2Vm aWxlLmluIHwgMzQgKysrKysrKysrKysrLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogbWVzb24u YnVpbGQgICAgfCAzOCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKwog MiBmaWxlcyBjaGFuZ2VkLCA1MCBpbnNlcnRpb25zKCspLCAyMiBkZWxldGlvbnMoLSkKCmRp ZmYgLS1naXQgYS9HTlVtYWtlZmlsZS5pbiBiL0dOVW1ha2VmaWxlLmluCmluZGV4IGViYTU2 OWU5MzBlLi4zZTA0Nzg1YWRhMiAxMDA2NDQKLS0tIGEv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gICAgICctLWZvcm1hdCcsICd0YXIuYnoyJywKKyAgICAgICAg ICAgICctLXByZWZpeCcsIGRpc3RkaXIgKyAnLycsCisgICAgICAgICAgICAnLW8nLCAnQEJV SUxEX1JPT1RAL0BPVVRQVVRAJywKKyAgICAgICAgICAgICdIRUFEJywgJy4nXSwKKyAgaW5z dGFsbDogZmFsc2UsCisgIG91dHB1dDogZGlzdGRpciArICcudGFyLmJ6MicsCispCisKK2Fs aWFzX3RhcmdldCgncGdkaXN0JywgW2NoZWNrX2RpcnR5X2luZGV4LCB0YXJfZ3osIHRhcl9i ejJdKQorCisKKwogIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjCiAjIFRoZSBFbmQsIFRoZSBFbmQsIE15IEZyaWVuZAog IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjCi0tIAoyLjQzLjAKCg== --------------Wm7y0tm0iuuMmZEm8M2KSX0y--