Github messages for voidlinux
 help / color / mirror / Atom feed
From: Vaelatern <Vaelatern@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Closed]: Drop default python_version in xbps-src
Date: Wed, 22 Apr 2020 00:45:54 +0200	[thread overview]
Message-ID: <20200421224554.3PVWIN_IDYyGXChJeHuJ2MsuyFpXU5FMv-iMnpkodnQ@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-21209@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2666 bytes --]

There's a closed pull request on the void-packages repository

Drop default python_version in xbps-src
https://github.com/void-linux/void-packages/pull/21209

Description:
This is a second attempt at #21132 following the recommendation of @q66. With the help of @Duncaen, I've identified (almost) all of the packages that currently rewrite python shebangs to the current default, `python2`. Those packages that do **not** create a `/usr/lib/pythonX.Y` directory have had `python_version=2` explicitly added to their templates. Note that I did not bump the revisions, becasuse there is no need to rebuild the packges for this change. I've also cleaned up a few `xlint` failures in some packages.

All packages that have `python3` shebangs are assumed to satisfy one of two conditions:
1. Any python scripts in the package explicitly use a `python3` shebang, which is never modified by the `xbps-src` rewrite hook. (The hook only modifies `python` or `pythonX.Y` shebangs.)
2. The package explicitly sets `python_version=3` to instruct the hook to use the correct version.
In either case, there is no need to alter these packages.

In addition, I have removed the default `python_version=2` in `common/environment/setup/python.sh` and modified `common/hooks/pre-pkg/03-rewrite-python-shebang.sh` to do the "right" thing with `python_version`:
1. As before, iff the package installs something to exactly one `usr/lib/pythonX.Y` python libdir, a default `python_version` will be inferred from the directory name. (Note: if the package creates more than one python libdir, the test in the hook will fail, so no default `python_version` will be derived in this case.)
2. A manual declaration of `python_version` in a template will override this default (or lack of a default).
3. Iff a default or explicit `python_version` has been specified, an approriate "target" shebang will be created.
4. If any python scripts are detected in the package, their shebangs will be replaced iff the appropriate target shebang was created; otherwise, if no target shebang was determined but at least one python script is found, package building will fail with a hard error.

These changes minimize the chance for package breakage because of the disappearing default `python_version` and, if I've missed anything, it should be detected the next time one of these packages is rebuilt.

Note that some packages may have already installed broken scripts from relying on the default `python_version=2` if the scripts actually target `python3`. This PR does not attempt to detect or fix those, but instead seeks to preserve existing behavior without adding additional breakage.

  parent reply	other threads:[~2020-04-21 22:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 17:11 [PR PATCH] " ahesford
2020-04-21 17:12 ` [PR PATCH] [Updated] " ahesford
2020-04-21 17:24 ` ahesford
2020-04-21 18:08 ` Vaelatern
2020-04-21 18:08 ` Chocimier
2020-04-21 18:15 ` q66
2020-04-21 18:40 ` [PR PATCH] [Updated] " ahesford
2020-04-21 18:40 ` ahesford
2020-04-21 18:43 ` ahesford
2020-04-21 18:55 ` [PR PATCH] [Updated] " ahesford
2020-04-21 20:52 ` ahesford
2020-04-21 20:53 ` ahesford
2020-04-21 22:45 ` Vaelatern [this message]
2020-04-21 22:46 ` Vaelatern

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=20200421224554.3PVWIN_IDYyGXChJeHuJ2MsuyFpXU5FMv-iMnpkodnQ@z \
    --to=vaelatern@users.noreply.github.com \
    --cc=ml@inbox.vuxu.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 NNTP newsgroup(s).