From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C598E385840C for ; Mon, 13 Dec 2021 11:35:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C598E385840C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-479-acH7nytJOMaCEOwH6w7aHg-1; Mon, 13 Dec 2021 06:35:52 -0500 X-MC-Unique: acH7nytJOMaCEOwH6w7aHg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 87A9D1006AA1; Mon, 13 Dec 2021 11:35:50 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-112-6.ams2.redhat.com [10.36.112.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DE367AB73; Mon, 13 Dec 2021 11:35:49 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 79CEFA8095C; Mon, 13 Dec 2021 12:35:48 +0100 (CET) Date: Mon, 13 Dec 2021 12:35:48 +0100 From: Corinna Vinschen To: overseers@sourceware.org Cc: Joel Brobecker , Carlos O'Donell , Joseph Myers , Ivo Raisr Subject: Re: transition git-hooks on sourceware.org to Python 3.x Message-ID: Reply-To: overseers@sourceware.org Mail-Followup-To: overseers@sourceware.org, Joel Brobecker , Carlos O'Donell , Joseph Myers , Ivo Raisr References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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:35:58 -0000 On Dec 12 15:32, Joel Brobecker via Overseers wrote: > Hello, > > 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? > 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? Corinna (*) Would it make sense to install 2to3 on sware?