[tlbuild] MacOS scripting languages (was: Re: Broken shebangs in TeX Live scripts)
George N. White III
gnwiii at gmail.com
Thu Apr 14 00:47:21 CEST 2022
On Wed, 13 Apr 2022 at 15:19, Siep Kroonenberg <siepo at bitmuis.nl> wrote:
> On Wed, Apr 13, 2022 at 05:19:19PM +0200, Bruno Voisin wrote:
> > Reinhard Kotucha wrote:
> >
> > > Is it difficult to install Bash on the systems you mentioned? Are
> > > there package managers available which allow installation of free
> > > software as easily as on Linux?
> >
> > bash is still part of macOS, and at the expected location. Here on
> > the very latest beta (macOS Monterey 12.4 Beta):
> >
> > % which bash /bin/bash
> >
> > But it is no longer the default shell (zsh is). I have read that
> > bash might be removed at some point, but could not found any
> > official Apple statement about this.
> >
> > Apparently, it all comes down to a license issue.
> > <https://dev.to/bphogan/use-modern-bash-shell-on-macos-22a6>
> > writes
> >
> > "macOS ships with an older version of the Bash shell, because
> > newer versions use a license that makes it more difficult for
> > Apple to integrate into their OS. In macOS Catalina, Apple changed
> > the default shell to ZSH for this reason."
> >
> > and mention the older version as 3.2.57(1)-release. Indeed, on
> > macOS 12.4 Beta,
> >
> > % bash --version GNU bash, version 3.2.57(1)-release
> > (arm64-apple-darwin21) Copyright (C) 2007 Free Software
> > Foundation, Inc.
>
Around 2014, IT required my group to replace Apple bash with a
version that had current security patches for the shellshock bug.
I think many organizations replace Apple's bash with a current
version.
> >
> > More worrying for the future is the planned removal of scripting
> > languages. Python was removed in macOS 12.3, which forced TeX Live
> > Utility (the Mac GUI to tlmgr, and more), largely written in
> > Python, to embed a Python framework.
>
> > Next in line are Perl and Tcl. Right now you get:
> >
> > % tclsh >
> > WARNING: This version of tcl is included in macOS for
> > compatibility with legacy software. In future versions of macOS
> > the tcl runtime will not be available by default, and may require
> > you to install an additional package.
> >
> > and
> >
> > % perl -de1
> >
> > WARNING: This version of perl is included in macOS for
> > compatibility with legacy software. In future versions of macOS
> > the perl runtime will not be available by default, and may
> > require you to install an additional package.
> >
> > So the countdown has started already for those two!
> >
> > There is a nice pre-built macOS Python package at
> > <https://www.python.org>, but no such thing for Tcl at
> > <https://www.tcl.tk> nor Perl at <https://www.perl.org>.
> >
I think Apple wants to keep ordinary users away from the command
line altogether. They had a nice Developer document for
command-line usage, but last time I looked it was marked
"deprecated". In it. Apple says 3rd party python should be invoked
using the full pathname to avoid issues with the PATH setting and
potential conflicts with system scripts that use Python.
Should TeX Live install Python with a locked-down configuration or
allow users to add packages (some TeX uses may require packages
beyond what you get with a basic install).?
With 3rd party tools there will be issues with users who
have some failed or corrupt installation, so you you need
some basic tests to ensure that the required tools are
available and in working order.
Linux has the unique advantage that widely used tools
(Python, ghostscript, Perl, tcl, fontconfig, etc. are available
as distro packages, can generally be assumed to work and
have lots of optional extras). For the other OS's you need
to figure out where to get tools and how to verify that they
actually work. You don't have conventions on where things
get installed and how to deal with multiple installations.
Windows systems often end up with multiple Python
programs. On my work laptop Python.org's Python is
installed using Software Center and AppStore is disabled.
Python is added to the System PATH so has priority over the
User PATH setting.
Users outside enterprise environments get the same Python
from the AppStore configured with an amazing web of links,
most of which can't be used to run python scripts from a command-line.
Maybe you are supposed to use the 'py -N.N' mechanism.
> > The approach used in TeX Live for Windows
> > <https://tug.org/texlive/windows.html>, namely provide minimal
> > Perl and Tcl setups inside TeX Live, in a way that does not affect
> > PATH, seems promising.
> >
These minimal packages cause confusion when a TL user needs
more than the minimal configuration. There can also be issues on
corporate/enterprise systems where IT requires removal of tool versions
with known security problems. I think it better for TL to focus on
sanity check for the available tools at install time, and a list of
recommended
sources for packages that get timely security updates.
> > Being part of the MacTeX team, I looked rapidly through the TeX
> > Live source, to find info on how these setups are created (ie
> > which perl and tcl packages are selected -- for example are
> > LWP::UserAgent and Mozilla::CA included for Perl --, how they are
> > built, how they are installed), to prepare for the future, see
> > whether/how the approach could be adapted to macOS. But I couldn't
> > find anything. Does anybody here know about this?
>
> Windows versions of perl, of required perl modules and of Tcl/Tk are
> built separately. This is explained in
> <TLroot>/source/tlperl/tlperl.README and
> <TLroot>/source/tlgui/tltcl/tltcl.README.
>
Anaconda.org provides python in miniconda3 for macOS, Windows, and linux
Tcl :: Anaconda.org <https://anaconda.org/intel/tcl> supports macOS,
Windows, and linux. A drawback to
Anaconda is that it requires the user to activate the environment, but this
does get around the problem of a Python directory in the System PATH, so
may be the best option to minimize confusion for users who have other
versions
of the tools installed.
For windows, Msys64 provides a fairly robust set of tools (including
Python, tcl, and
perl) managed using pacman. The R-Project is using a customized version of
MXE (M cross environment) <https://mxe.cc/>, and also provides Windows
"packages" Rtools40 and
RTools42).
--
George N. White III
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tlbuild/attachments/20220413/78a56c74/attachment.html>
More information about the tlbuild
mailing list.