invoke-mf2pt1.sh: 7: python: not found

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

invoke-mf2pt1.sh: 7: python: not found

Dan Eble
I'm trying to upgrade the LilyDev Dockerfile to use Ubuntu 20.04 and I get this error when I try to build.  It's coming from here:

    # realpath doesn't exist on OSX
    realpath() {
      python -c "import os; print(os.path.realpath('$1'))"
    }

Is there a Right Way to resolve this?  Should this call python3?  Should I change the Docker image, say by creating a symlink?  TIA.

Dan


Reply | Threaded
Open this post in threaded view
|

Re: invoke-mf2pt1.sh: 7: python: not found

Han-Wen Nienhuys-3
symlink sounds like the fastest solution.

On Sun, May 10, 2020 at 8:42 PM Dan Eble <[hidden email]> wrote:

>
> I'm trying to upgrade the LilyDev Dockerfile to use Ubuntu 20.04 and I get this error when I try to build.  It's coming from here:
>
>     # realpath doesn't exist on OSX
>     realpath() {
>       python -c "import os; print(os.path.realpath('$1'))"
>     }
>
> Is there a Right Way to resolve this?  Should this call python3?  Should I change the Docker image, say by creating a symlink?  TIA.
> —
> Dan
>
>


--
Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

Reply | Threaded
Open this post in threaded view
|

Re: invoke-mf2pt1.sh: 7: python: not found

Jonas Hahnfeld
In reply to this post by Dan Eble
Am Sonntag, den 10.05.2020, 14:41 -0400 schrieb Dan Eble:
> I'm trying to upgrade the LilyDev Dockerfile to use Ubuntu 20.04 and I get this error when I try to build.  It's coming from here:
>
>     # realpath doesn't exist on OSX
>     realpath() {
>       python -c "import os; print(os.path.realpath('$1'))"
>     }
>
> Is there a Right Way to resolve this?  Should this call python3?  Should I change the Docker image, say by creating a symlink?  TIA.

The short-term solution is to install python-is-python3 which will take
care of the symlink. Longer term, maybe the script can be made to work
without python? I know realpath is horrible in sh, but it could be we
can get around it...

Jonas

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: invoke-mf2pt1.sh: 7: python: not found

Han-Wen Nienhuys-3
On Sun, May 10, 2020 at 9:29 PM Jonas Hahnfeld <[hidden email]> wrote:

>
> Am Sonntag, den 10.05.2020, 14:41 -0400 schrieb Dan Eble:
> > I'm trying to upgrade the LilyDev Dockerfile to use Ubuntu 20.04 and I get this error when I try to build.  It's coming from here:
> >
> >     # realpath doesn't exist on OSX
> >     realpath() {
> >       python -c "import os; print(os.path.realpath('$1'))"
> >     }
> >
> > Is there a Right Way to resolve this?  Should this call python3?  Should I change the Docker image, say by creating a symlink?  TIA.
>
> The short-term solution is to install python-is-python3 which will take
> care of the symlink. Longer term, maybe the script can be made to work
> without python? I know realpath is horrible in sh, but it could be we
> can get around it...


We need python for a host of other things, so dropping it here doesn't
do much good. Now that we've moved to python 3, is it guaranteed that
python3 exists?

--
Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

Reply | Threaded
Open this post in threaded view
|

Re: invoke-mf2pt1.sh: 7: python: not found

Jonas Hahnfeld
Am Sonntag, den 10.05.2020, 22:03 +0200 schrieb Han-Wen Nienhuys:

> On Sun, May 10, 2020 at 9:29 PM Jonas Hahnfeld <[hidden email]> wrote:
> > Am Sonntag, den 10.05.2020, 14:41 -0400 schrieb Dan Eble:
> > > I'm trying to upgrade the LilyDev Dockerfile to use Ubuntu 20.04 and I get this error when I try to build.  It's coming from here:
> > >
> > >     # realpath doesn't exist on OSX
> > >     realpath() {
> > >       python -c "import os; print(os.path.realpath('$1'))"
> > >     }
> > >
> > > Is there a Right Way to resolve this?  Should this call python3?  Should I change the Docker image, say by creating a symlink?  TIA.
> >
> > The short-term solution is to install python-is-python3 which will take
> > care of the symlink. Longer term, maybe the script can be made to work
> > without python? I know realpath is horrible in sh, but it could be we
> > can get around it...
>
> We need python for a host of other things, so dropping it here doesn't
> do much good. Now that we've moved to python 3, is it guaranteed that
> python3 exists?
No, we are only guaranteed that configure found a suitable binary. This
may be in any location, with any name, if the user sets $PYTHON. So if
we really need it, we should use the found interpreter.

But if we can get rid of Python in invoke-mf2pt1.sh, that would be
better IMHO. As far as I understand, we just need an absolute path of
some arguments. We can do this in make already. Alternatively realpath
can be implemented "portably" by (cd $dir && pwd).

Jonas

signature.asc (499 bytes) Download Attachment