From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Generated patches change over time Date: Sun, 02 Dec 2018 11:38:53 +0100 Message-ID: <87zhtop60y.fsf@gnu.org> References: <20181124183051.23027.37347@vcs0.savannah.gnu.org> <20181124183052.9A76B209A2@vcs0.savannah.gnu.org> <87h8g5unug.fsf@gnu.org> <87pnuskfmg.fsf@netris.org> <87h8g15uqb.fsf_-_@gnu.org> <87r2f1q671.fsf@gnu.org> <87zhto3mnz.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTP9M-0004Cz-8a for guix-devel@gnu.org; Sun, 02 Dec 2018 05:38:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTP9L-0000Zc-HH for guix-devel@gnu.org; Sun, 02 Dec 2018 05:38:56 -0500 In-Reply-To: <87zhto3mnz.fsf@netris.org> (Mark H. Weaver's message of "Sat, 01 Dec 2018 17:29:57 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mark H Weaver Cc: guix-devel@gnu.org, Maxim Cournoyer Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Maxim Cournoyer skribis: >> >>>>> ludo@gnu.org (Ludovic Court=C3=A8s) writes: >>> >>>>Lesson learned: we should not rely at all on generated patches because >>>>they are bound to change frequently (version string at the end, length >>>>of commit hash prefixes, etc.) It=E2=80=99s probably worse than tarbal= ls >>>>generated by Git hosting services. >>>> >>>>So we should probably work towards using local copies of patches, >>>>unless >>>>we find that the generated patches do not include any variable bits. >>>> >>> >>> Maybe we could pass the patches through some sanitizer to strip any met= adata? I guess the content itself shouldn't change? >> >> We can=E2=80=99t really do that, or the downloads would no longer be >> fixed-output derivations and thus we wouldn=E2=80=99t be solving the pro= blem. > > Can you elaborate on why it cannot be done? If I understand correctly, > our 'git-fetch' origin type deletes the .git subdirectory after fetching > it, and yet it still creates fixed-output derivations, no? I don't see > why stripping metadata from a patch is fundamentally any different. You=E2=80=99re right, along the same lines, it could be a fixed-output derivation. The problem is rather that the workflow would be a bit awkward: =E2=80=98gu= ix download=E2=80=99 would download the raw, unprocessed patch, and thus it wo= uld give you the =E2=80=9Cwrong=E2=80=9D hash. In essence you=E2=80=99d have to put a random hash in your package definiti= on, run =E2=80=9Cguix build -S=E2=80=9D, copy the correct hash from the error m= essage, manually look at the patch, etc. It=E2=80=99s possible, but it=E2=80=99s a bit awkward IMO. Or we would need to add a =E2=80=98--strip-patch-metadata=E2=80=99 option t= o =E2=80=98guix download=E2=80=99 so that it applies the exact same transformation when downloading. Thoughts? Ludo=E2=80=99.