All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Martinez <Thierry.Martinez@inria.fr>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: cocci@inria.fr
Subject: Re: [cocci] Cannot infer Python version: when no /usr/bin/python symlink is found (resend)
Date: Fri, 05 Nov 2021 20:21:37 +0100	[thread overview]
Message-ID: <ow4bl2ys91a.fsf@inria.fr> (raw)
In-Reply-To: <YXxGHEuS0zi+sbft@bombadil.infradead.org>

Luis Chamberlain:
> Cannot infer Python version

I was not able to reproduce this error: are you sure that it is due to a
missing /usr/bin/python symlink? This error message should appear when
libpython3-dev is missing (and I have to admit we should change for a
better error message!).

For instance, the following Dockerfile succeeds 

$ cat >Dockerfile <<EOF
FROM debian:latest
RUN apt-get update
RUN apt-get install --yes ocaml ocaml-findlib libpython3-dev curl autoconf \
    automake make
RUN curl --remote-name --location \
    https://gitlab.inria.fr/coccinelle/coccinelle/-/archive/1.1.1/coccinelle-1.1.1.tar.bz2
RUN tar --extract --file coccinelle-1.1.1.tar.bz2
WORKDIR coccinelle-1.1.1
RUN autoreconf
RUN ./configure
RUN make
RUN cd tests && \
    ../spatch.opt --sp-file countcalls_python.cocci countcalls_python.c
RUN test ! -f /usr/bin/python
EOF

Cheers.
-- 
Thierry.

Luis Chamberlain :
> Debian and OpenSUSE Tumblweed no longer have the /usr/bin/python
> symlink, at least this is explained and spelled out on the Debian
> Python Policy [0]. This guideline specifically requests that scripts
> do not use `/usr/bin/env`, do not use `/usr/bin/python` and instead
> use the exact version desired.
>
> When running coccinelle on a system without this /usr/bin/python
> symlink Coccinelle will complain when using a python script on a cocci
> file:
>
> Cannot infer Python version
>
> Fixing this is just to create the symlink, but I *really* don't want
> to do that. And so I think we may need to support:
>
> script:python3
> initialize:python3
>
> Maybe it makes sense then to always look for python2 if a version is
> not specified, and if that does not exist look for python3 as new
> systems may not have python2.
>
> [0] https://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html#s-interpreter
>
>   Luis


  parent reply	other threads:[~2021-11-05 19:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 19:06 [cocci] Cannot infer Python version: when no /usr/bin/python symlink is found (resend) Luis Chamberlain
2021-10-29 20:16 ` Julia Lawall
2021-11-05 19:21 ` Thierry Martinez [this message]
2021-11-05 21:54   ` Luis Chamberlain

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=ow4bl2ys91a.fsf@inria.fr \
    --to=thierry.martinez@inria.fr \
    --cc=cocci@inria.fr \
    --cc=mcgrof@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.