Github messages for voidlinux
 help / color / mirror / Atom feed
From: ericonr <ericonr@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [RFC] option to skip 03-rewrite-python-shebang
Date: Sun, 14 Nov 2021 19:31:09 +0100	[thread overview]
Message-ID: <20211114183109.C47QUyi9LStSqwJ4n8x_Vufv8qe5UNlaNuZoB2kUzHY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-34053@inbox.vuxu.org>

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/34053#issuecomment-968341587

Comment:
> Doesn't scanning and replacing all python shebangs cause issues in any other situations?

There used to be a bug with replacing it without taking into account the flags passed to the interpreter in the shebang, but that's been fixed.

> In particular this is NOT about hardcoding paths to the python interpreter but allowing it to run through env.

That is the exact purpose of the hook. It means system packages aren't affected by alternative `python` executables in `PATH`, and that the `xbps-alternatives` selected python doesn't change what's used for a given script. Since an alternative python will usually look for modules in a different place from `/usr/lib/python${py3_ver}` as well, this means that programs which depend on packaged modules continue working. (way back when, installing conda provided Python on ubuntu completely hosed a bunch of GUI programs for me, since they could no longer import `gi`, for example)

> It might be argued that rewriting "#! /usr/bin/env sage-python" is incorrect.

How does this break? Where is `sage-python` located?

> Also: for packages with lots of files (and/or huge text files?) this hook takes its time... AFAICT it's not only checking in /usr/bin or +x files but every single non-binary file is scanned.

Yup, there are packages with scripts under `/usr/share`, for example.

> A similar situation is 11-pkglint-elf-in-usrshare, but for that case we have "ignore_elf_dirs=".

`ignore_elf_dirs` is about policy: that directory can have ELF files because they aren't arch specific or because they *have* to go there. It's not about speedup, and it bothers me slightly that `pari-galpol` is using it for that purpose. The purpose of hooks is to always be there to catch things that we may miss; manually adding a bunch of skips for speed rather than policy feels wrong to me.

>  a. fix the pattern in 03-rewrite-python-shebang so it doesn't match "#!/usr/bin/env sage-python".

I can kinda see the case for that, since it isn't one of the two "official" python interpreters.

>  b. add an option "ignore_python_shebang_dirs" similar to "ignore_elf_dirs"

I don't think this is a valid option.


  parent reply	other threads:[~2021-11-14 18:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13 11:20 [PR PATCH] " tornaria
2021-11-13 14:03 ` ericonr
2021-11-14 10:18 ` dkwo
2021-11-14 14:27 ` leahneukirchen
2021-11-14 14:48 ` tornaria
2021-11-14 18:31 ` ericonr [this message]
2021-11-15  1:45 ` [PR PATCH] [Closed]: " tornaria
2021-11-15  1:45 ` tornaria

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=20211114183109.C47QUyi9LStSqwJ4n8x_Vufv8qe5UNlaNuZoB2kUzHY@z \
    --to=ericonr@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).