From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 1FD42385840C for ; Mon, 13 Dec 2021 11:47:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FD42385840C Received: by mail-wr1-x435.google.com with SMTP id t18so26495192wrg.11 for ; Mon, 13 Dec 2021 03:47:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=m7958eSihlHe5gOC84kDEurSSLYaZl1WzVEMdK4HI/I=; b=a9JqgirMg+gDweSYjeOHW3HNMz9T/pUUj6AYZ3e7HmfMkFVl4XnhP2tuRC2tWYxRCD x2f1YXja5dW2TXt6xCfxDCrQgahFFPQMXLuDVSauwqpyIPZk8FoMKiaHW4FnqCth6YHy Y63AHJHNcoOB1nEqhgX7w9GVSSS+kCS9ipmrqKVE1JzBEmgucmnefXIJilfVEUeyAwna dWzmECE63hNXnhuEDkaJtd+qV/uRh2MmemkhIsFpqKUzcCNHWDI6iy0H/Nf6HHfER/JW WkfoO0ZFSj3BEMpoyWI/nViCQyMe3D3bExZCz4AN+SjlsJLbV2JhWuq2IF1Rna6Q7jp3 CwOA== X-Gm-Message-State: AOAM530j86Yn2iBWuqonE8/JxGR8NU8s3qSumLIBvNal0w37PCi1zjIK hQwKTmR5ITMRBn5ELDlg3s7paEiAeeEh X-Google-Smtp-Source: ABdhPJz/gjRbiahzgY/F68Hnye+RvVtURtWsuzDIEt5N9pDk28nWXcAGaam/zqru9gaDgk8GOidKrg== X-Received: by 2002:a5d:424c:: with SMTP id s12mr31325981wrr.370.1639396040154; Mon, 13 Dec 2021 03:47:20 -0800 (PST) Received: from takamaka.home (lfbn-reu-1-483-157.w92-130.abo.wanadoo.fr. [92.130.72.157]) by smtp.gmail.com with ESMTPSA id d1sm10194888wrz.92.2021.12.13.03.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 03:47:19 -0800 (PST) Received: by takamaka.home (Postfix, from userid 1000) id 5B03AA49EE; Mon, 13 Dec 2021 15:47:17 +0400 (+04) Date: Mon, 13 Dec 2021 15:47:17 +0400 From: Joel Brobecker To: overseers@sourceware.org, Joel Brobecker , Carlos O'Donell , Joseph Myers , Ivo Raisr Subject: Re: transition git-hooks on sourceware.org to Python 3.x Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: overseers@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Overseers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2021 11:47:23 -0000 > > The current version of the git-hooks being used on sourceware > > is a version which uses Python 2.7. I have since then migrated > > to Python 3, where the minimum version is currently Python 3.8. > > That version has been running on AdaCore's server for a few weeks, > > now, so I think it's time to think about transitioning our repos > > on sourceware. > > > > The main improvement, besides the transition away from Python 2.x, > > comes from Python 3.x itself and the handling of strings vs bytes, > > so charsets are handled a bit better. > > > > The one small difficulty comes from making sure a recent version > > of Python 3.x gets used. Ideally, we should use the same Python > > I'm using on sourceware to run the git-hooks testsuite to make sure > > there aren't any compatibility issues. > > Not sure I understand this... wouldn't it make sense to run the > hooks and the testsuite using the default python3 release 3.6.8 > installed on sware in the first place? This version of Python is too old. The testing needs e3-core, which only supports 3.8. > > For this, what I'd like to propose is that we use a set of wrapper > > scripts which provide the same hooks as the git-hooks, and which > > only do the following: add the correct Python to the PATH, and > > then call the real hook script in git-hooks. > > > > I've created a small prototype and did some testing with it, > > it seems to work well. In a nutshell, we have: > > > > / > > - hooks/ <-- directory to use as hooks in Git bare repos > > - git-hooks/ <-- clone of https://github.com/adacore/git-hooks > > - python3-for-git-hooks/ <-- Python 3.x venv to be used by the git-hooks > > That would also avoid this wrapper stuff, which seems fragile. > > > [...] > > In terms of the projects themselves, I've identified the following > > repositories as using the git-hooks: > > > > - binutils-gdb.git/hooks > > - gcc.git/hooks > > - glibc.git/hooks > > - newlib-cygwin.git/hooks > > - valgrind.git/hooks > > > > This is based on searching for repositories on sourcware.org > > whose hooks dir is a symlink to the git-hooks. Not sure if there are > > others. > > > > I've Cc'ed people I know have asked me about the git-hooks for > > GCC, glibc and newlib. Not sure about valgrind. > > > > What we could do is give the binutils & GDB maintainers a quick > > heads up and then transition the binutils-gdb repository. If all > > goes well, I think we can transition the remaining ones. > > Given the hooks are shared anyway, I don't see much of a problem, > except for the non-shared local scripts in hooks-bin. These are > mostly shell scripts and shouldn't be affected. > > Only email_to.py is a python2 script. 2to3(*) only requests 2 simple > changes. Is there more to it than that? Does it even matter? Good point. We'll need to look at this script. I believe we can do that prior to the transition. -- Joel