public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: overseers@sourceware.org, Joel Brobecker <brobecker@adacore.com>,
	Carlos O'Donell <carlos@systemhalted.org>,
	Joseph Myers <joseph@codesourcery.com>,
	Ivo Raisr <ivosh@ivosh.net>
Subject: Re: transition git-hooks on sourceware.org to Python 3.x
Date: Mon, 13 Dec 2021 15:47:17 +0400	[thread overview]
Message-ID: <YbcyxUZS/O6/aiTF@adacore.com> (raw)
In-Reply-To: <YbcwFLCcjVwL2C1s@calimero.vinschen.de>

> > 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:
> > 
> >   <wrappers root>/
> >       - 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

  reply	other threads:[~2021-12-13 11:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12 11:32 Joel Brobecker
2021-12-13  9:23 ` Mark Wielaard
2021-12-15  9:30   ` Ivo Raisr
2021-12-16  2:16     ` Joel Brobecker
2021-12-13 11:35 ` Corinna Vinschen
2021-12-13 11:47   ` Joel Brobecker [this message]
2021-12-13 22:20 ` Joseph Myers
2021-12-14  3:39   ` Joel Brobecker
2021-12-17  2:46 ` Joel Brobecker
2021-12-19  4:45   ` Joel Brobecker
2021-12-20  5:10     ` Joel Brobecker
2022-01-16 10:06     ` Joel Brobecker
2022-01-17 10:02       ` Corinna Vinschen
2022-01-20  5:27         ` Joel Brobecker
2022-01-20 10:04           ` Corinna Vinschen
2022-01-20 13:54             ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YbcyxUZS/O6/aiTF@adacore.com \
    --to=brobecker@adacore.com \
    --cc=carlos@systemhalted.org \
    --cc=ivosh@ivosh.net \
    --cc=joseph@codesourcery.com \
    --cc=overseers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).