From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74413: [PATCH] Allow to store and read repository information of VCS builds Date: Mon, 18 Nov 2024 23:48:38 +0200 Message-ID: <39049.546960608$1731966635@news.gmane.org> References: <86frnovhg8.fsf@gnu.org> <867c90vbfk.fsf@gnu.org> <861pz8uzyo.fsf@gnu.org> <86zflwtjlz.fsf@gnu.org> Reply-To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24277"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, 74413@debbugs.gnu.org, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 18 22:50:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tD9da-00068I-Ip for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Nov 2024 22:50:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tD9dF-0007sI-Dx; Mon, 18 Nov 2024 16:50:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tD9dD-0007qu-3Z for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 16:50:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tD9dC-0002YJ-QP for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 16:50:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=N5oLXX+KCol/9iiSJa16xyDyDb5PkahfQ3dhIEErOp8=; b=HZKDdMnDRuEDwvjY1Evjgs4XtHzSEjBxOpKLXb0fJYb9JKEyjfAZ/iWeMbjZkF58NSnKioVK5yArgOHnXwoI9SoPFs1+yqzI16sagktYtmpFIwY68qu2aYImKmJDfFFQLZusjjsM8ud/QWr7jJXKVFy9KEpG2HcHdh6Ytf9Meic2m3I9de8Y6J6jZHUqeLeVjggrUnBrd1h5/XA0oXGfmk0psUT8X8Uvcai7VpiA9yHmJW4qcfW9HsFOrap8g7JcSuMcQZrcj/U6K3Rgl0kXNQ/mdfo7RQNemPUgJUH67WGb4Y1vmR48ItuRdP/iu+4qPoBvG0djKympL063oa+W2w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tD9dC-0004XK-G1 for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2024 16:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Nov 2024 21:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74413 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74413-submit@debbugs.gnu.org id=B74413.173196655417361 (code B ref 74413); Mon, 18 Nov 2024 21:50:02 +0000 Original-Received: (at 74413) by debbugs.gnu.org; 18 Nov 2024 21:49:14 +0000 Original-Received: from localhost ([127.0.0.1]:39458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tD9cP-0004Vw-OL for submit@debbugs.gnu.org; Mon, 18 Nov 2024 16:49:14 -0500 Original-Received: from thaodan.de ([185.216.177.71]:33638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tD9cM-0004Vi-Pp for 74413@debbugs.gnu.org; Mon, 18 Nov 2024 16:49:12 -0500 Original-Received: from odin (dsl-trebng12-50dc7b-49.dhcp.inet.fi [80.220.123.49]) by thaodan.de (Postfix) with ESMTPSA id 64F10D00071; Mon, 18 Nov 2024 23:48:39 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1731966519; bh=rCXiUEqBgfJ/S0nDf13BTJnHtwucxruaGkBr1TRZvvk=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=bPZDucgrheRYbFEntKKgoTNrOIl0Ae+3t9URfbSpzj96V/FPJjQZ37LP3q1d2ALNL +coHDVJCe4JDS/CR9/oQiH3sg8A+96svvOULyzTJ4GfHlk+Wq3+1Ds5heEz50Ar1Nn tBTxA2oKvhUrixL9HdL1zKIaKH/eT6mfdJsP6deNdi1TO112SVjv2dNvW2CLVArwuB MpirkbF7xR9wdJVBlholQ3zEmO+tHKtFEa+SN0bF6FpmOIrsDpyWuK/5cEwq4CNuzK CqG8JxAtcgFF55QFVqY4m85Tlo2QVADntdwfPLR2B+JQONauvc6zCdzN5a1APfRyhN qTuhggdLCuFz8XETHIMrRBD5kxPKuZ9nYbPxmYtwClWQGTEA/JLfJNZ+FhhkWkXlvr TVLV9wqI9Bwg5DBz5TWA0OSoYtnIqmrmmkMbFzylYqlXeXSJLKQgbiAz3dAPyHzSSG SLqFqxEtOXth9b4Ypg0jKDxoZ1K/MzfG2S71yW7VWPt72UcRpCw5ZgSQHByCSTW7FE r3aVPep4VhSr7Wj3TyCmF1MRUDC84vyuaS0YZnjjhDNh5AJeig8a7fNx3GP6x6yNDD BJTbAFhsM6NThWUj6rHHkNsemiolbLv3lF2SotESFixpyEiVMMBLotg+XuLPPGVihm q413h+haIrp+wFdbY4EHoqVE= In-Reply-To: <86zflwtjlz.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 18 Nov 2024 21:41:44 +0200") Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295612 Archived-At: Eli Zaretskii writes: >> From: Bj=C3=B6rn Bidar >> Cc: stefankangas@gmail.com, luangruo@yahoo.com, 74413@debbugs.gnu.org >> Date: Mon, 18 Nov 2024 21:31:43 +0200 >>=20 >> Eli Zaretskii writes: >>=20 >> >> From: Bj=C3=B6rn Bidar >> >> Cc: Stefan Kangas , luangruo@yahoo.com, >> >> 74413@debbugs.gnu.org >> >> Date: Mon, 18 Nov 2024 18:54:26 +0200 >> >>=20 >> >> Eli Zaretskii writes: >> >>=20 >> >> > This is already available if Emacs is built in a Git repository, and >> >> > the information is stored in the dumped Emacs. So what is gained by >> >> > also recording the repository version on a disk file external to >> >> > Emacs? >> >>=20 >> >> The information is only stored if the worker already had git installed >> >> and checked out the sources with git inside the worker. >> >> Also the function currently fails unless the system the user uses als= o happens to >> >> have git installed and the sources if the are installed also contain = the >> >> VCS metadata. >> >> Storing the VCS metadata in the sources doesn't happen usually as it >> >> increases the size of a good chunk. In my case e.g. from 188MB to 788= MB. >> >> Why not have the same feature for other platforms too? >> > >> > Sorry, I don't understand this explanation; I'm probably missing >> > something. >> > >> > The feature you propose requires to build Emacs inside a Git >> > repository, is that correct? Because otherwise "git rev-parse" will >> > not work, right? If that is correct, then building Emacs inside a Git >> > repository already calls this Git command and records the result in 2 >> > Emacs Lisp variables. >> > >> > So why do you also want to record the same >> > information on a file? What kind of scenario do you have in mind in >> > which building Emacs with its current code will not record the branch >> > and the revision, but your additions to Makefile will record that? >>=20 >> The additions to the make file are so that if the worker contains git >> the file can be generated so that the related functions will still work >> after the built or to generate them prior the built. The latter probably >> makes less sense except to maybe avoid having autotools in the built >> dependency chain. >>=20 >> If the Make recipe isn't used to generate the version file it can be >> generated by the CI, e.g. in my case I take the information from the >> open build source service. For others such as Fedora the sources can be >> retrieved in a similar manner. >>=20 >> The file can be added before the built starts and package so that the p= dump >> will contain the repository information and the VCS function will also >> work afterwards.=20 > > I still don't think I understand, sorry. Do you mean the file is > generated from a Git repository, but then Emacs is somehow built from > a directory that is not under Git? The file can be generated from the git repository outside of the Emacs builder. E.g. in my case the obs source service store's the git revision used in the service=20 In my case the file looks like this: name: emacs version: 31.0.50.9794.eee0ed8442a mtime: 1731883844 commit: eee0ed8442aa78320a3e578ab290df145fb49624 sed -n -e 's/^commit: \(.*\)/\1/p' emacs.obsinfo > etc/version > But if this is the scenario, how can you be sure the produced Emacs binar= y was made from that revision > on that branch? This is only guaranteed if you actually build from > Git when you record this information. > > What am I missing? If the source is generated by the CI it can also store this information in the build source which then can be extracted from the ci metadata to the Emacs sources on the builder. I can be sure that Emacs was built from that revision as much as I can trust the CI to use the sources I told it to use. If I can't trust one, I can't trust the other.