[tlbuild] Support for musl

Henri henrimenke at gmail.com
Tue Jan 23 02:24:57 CET 2018


On Tue, 2018-01-23 at 10:03 +0900, Norbert Preining wrote:
> Hi Henri,
> 
> > 
> > https://git.alpinelinux.org/cgit/aports/tree/testing/texlive/APKBUILD
> ...
> > 
> > The ./Build script does not work out-of-the-box because headers are located in different
> > directories
> > than expected.  I'll see whether I can fix this somehow but I'm not an autotools wizard.
> That is surprising - checking the abovce APKBUILD it contains nothing
> but configure/make invocation, no patching and now magic to adjust the
> search paths. 
> 
> What is the actual error you get using ./Build?

The error is from the build of icu which requires xlocale.h which is not included in Alpine Linux
because it is only part of the glibc version of libstdc++.  Alpine gets around this by monkey
patching icu:
https://git.alpinelinux.org/cgit/aports/tree/main/icu/APKBUILD

There might be more errors after that.  This was just the one where I last stopped.

> 
> > 
> > Unfortunately, this does not meet the requirements of official TeX live because it is
> > dynamically
> > linked against system libraries rather than statically linked.
> Do you mean you want to provide new sets of binaries for TeX Live to be
> distributed?
> 
> I guess the problem is that the binaries provided by us for x86_64-linux
> are linked against libc and thus not work on your system.
> 
> > 
> > by sarcastic responses.  My question is not how to build TeX live for musl in general but how to
> > add
> > official support for upcoming releases (hence the question "Do I have to provide build
> Ok, this is a different question. From your side there is in principle
> nothing to do but provide the binaries.
> 
> But our TL internal scripts will probably not work, because I guess we
> cannot easily distinguish between the version of libc.
> 
> Furthermore, all our installer/tlmgr scripts do only distinguish between
> arch/os, but do not take libc into account. What you are proposing is
> extending the architectures
>   i386-linux
>   x86_64-linux
> to
>   i386-linux-libc
>   i386-linux-musl
>   x86_64-linux-libc
>   x86_64-linux-musl
> For that to work out we need LOTS of time, and that will surely not work
> out for TL2018 which is going to start to put together rather soon.

That is basically what I propose and what some other toolchains already do, most notably the Rust
compiler:
https://forge.rust-lang.org/platform-support.html

(Irrelevant note: I think it should be linux-gnu instead of linux-libc)

> 
> There is much more to do in the deep guts of TeX Live than just
> building.
> 
> What we *CAN* do is
> - you provide us a set of binaries, which we make available on our pages
> - users of musl-based dists can use the -custom-bin option of the
>   installer (see docs) to install the system using the provided
>   binaries.

This sounds reasonable.  I'll try to get it compile without problems on Alpine and submit binaries
and patches.

> 
> This is not the best, but it is a feasible option, see
>   https://www.tug.org/texlive/custom-bin.html
> 
> 
> > 
> > I could envision that future releases of TeX live also provide a container-based version which
> > can
> > then be used easily in continuous integration services.
> Can you be more specific? Do you want a container/docker script that
> installs TL? Or a ready made container image?

Right now I am building my own Docker image which I host on Docker Hub.  My image is based on Debian
and just installs the full TeX live (without the doc tree I think).  The Docker file looks somewhat
like this:

FROM debian
ENV DEBIAN_FRONTEND noninteractive
COPY texlive.profile /
RUN apt-get update \
  && apt-get install --no-install-recommends -y \
    wget perl fontconfig libwww-perl \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/* \
  && wget ftp://tug.org/historic/systems/texlive/2017/install-tl-unx.tar.gz \
  && tar xzvf install-tl-unx.tar.gz \
  && ./install-tl-*/install-tl -profile texlive.profile \
  -repository ftp://tug.org/historic/systems/texlive/2017/tlnet-final \
  && rm -rf install-tl-*

This could of course be minimised as most users do not need the full scheme.  It is really easy to
provide images with more minimal schemes as well.  That is where Alpine Linux comes in.  The base
image has only 5.5 MB and if it only bundles tl-infra it should be perfect for people who want to
install packages by hand on top of a minimal container for their continuous integration.

> 
> Best
> 
> Norbert
> 
> --
> PREINING Norbert                               http://www.preining.info
> Accelia Inc.     +    JAIST     +    TeX Live     +    Debian Developer
> GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


More information about the tlbuild mailing list