From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100518 Path: news.gmane.org!.POSTED!not-for-mail From: Brian Hunt Newsgroups: gmane.comp.tex.context Subject: Re: Build for Alpine Linux Date: Mon, 09 Apr 2018 18:59:06 +0000 Message-ID: References: <026e5b07-3364-2011-50bf-29a249fb41b7@xs4all.nl> <6a1d4148-1bb5-2633-d9e1-9859c05bb665@gmx.es> <1523235042.18581.29.camel@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6984618871270387684==" X-Trace: blaine.gmane.org 1523300273 28383 195.159.176.226 (9 Apr 2018 18:57:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Apr 2018 18:57:53 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 09 20:57:49 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f5bz9-0007EO-Ho for gctc-ntg-context-518@m.gmane.org; Mon, 09 Apr 2018 20:57:47 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id ADC95625607; Mon, 9 Apr 2018 20:59:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QWTyw8w3q25F; Mon, 9 Apr 2018 20:59:30 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id BD8AF625609; Mon, 9 Apr 2018 20:59:30 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 52A3B625609 for ; Mon, 9 Apr 2018 20:59:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L8U9yB2a-VnZ for ; Mon, 9 Apr 2018 20:59:28 +0200 (CEST) Original-Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 48E7F625607 for ; Mon, 9 Apr 2018 20:59:18 +0200 (CEST) Original-Received: by mail-wm0-f48.google.com with SMTP id x82so18716756wmg.1 for ; Mon, 09 Apr 2018 11:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=076WoYdThDIwE0vxVoLfCrZn0gcfGijK9UqyiiNDl7s=; b=D8SJY02Qm10XfgmG4T3VvT6zUGvln7Xtq2TLIkpRRw+RFDIb+hvyA+3G1Xvlh9bDGk btMUl64uxw7o7X8CKziGjEonxAD/7mClVkRkIpQLtcqyuOxhL2K2NP5/VMvZy6ZAA/M/ 4UXQ328khkn1d6rkzhNVmu95UQoogvzbHPIw0ArxBTOj1zSmoUice7737GOE9YdA2fQ8 kOw1ZlTf3zIgbeZRBXYTA2Q9B65Rymz05BZYwb1hGInCc/V9oILkuHdZpYuN90UEshic VYLY/tDR13pqTBhyvwHyTb/4i8p8dbkMKmaDeGD0YB7qkWrnBp9s4TIlDCX7FzGMMsRp s2Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=076WoYdThDIwE0vxVoLfCrZn0gcfGijK9UqyiiNDl7s=; b=CaYdXmJJXcy+t2CrjEwFBNtALLLl/VRtVRi2APD0BDZM4z+VfCvivEt5h8MHsMTycM maaZE7y6W3fjEp+VfwQmx9QgZrayMoY7AshWdDzu8bvaaKgmvW3DsaX0mg4tBhyRSOwz 3PbzN9RXsN+5rY/hLPx2+zh0KTOoJfB3cKNGip+x4d6WGoqpH2Us5Tw0YZrYaYA8Nleu xmmYxJCiH0D4QxQggoIR9wYnPsicNeBI/e/lakCrCahNdHPaGFYp9Ynk4B9DQO2xlLni FECG9S724LJvsOxlYewUOGH55e3l3m9Mev6kUgXr28a5jh/xImy/vDHIrSIE7HOhtneD pFiA== X-Gm-Message-State: ALQs6tAcN37RBtAK1isOXFAZMa4zoeC+d/SlWhi51xubNIfrlmNhc28M FtEBarTGt+MkF8KCm5HP0Wg0Dzs8MWP6PCCMAbHExw== X-Google-Smtp-Source: AIpwx4+C2G46QHgPk516zAbK+cXK2JvfT6jVmbOjXM/RBozhvd3GPpn6mrgs0g/pa5YTzlR3tH0q29tSBuYouEhsNuo= X-Received: by 10.80.214.201 with SMTP id l9mr3107564edj.67.1523300357577; Mon, 09 Apr 2018 11:59:17 -0700 (PDT) In-Reply-To: <1523235042.18581.29.camel@gmail.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:100518 Archived-At: --===============6984618871270387684== Content-Type: multipart/alternative; boundary="f403045dbb74b3204205696f001e" --f403045dbb74b3204205696f001e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Here are a couple experimental observations. 1. Detecting musl. -- Alpine Linux/sh -- $ ldd --version 2>&1 | grep -F musl musl libc (x86_64) $? =3D 0 -- Debian/bash -- $ ldd --version 2>&1 | grep -F musl (nothing; $? =3D 1) -- Debian/zsh -- $ ldd --version 2>&1 | grep -F musl (nothing; $? =3D 1) A few notes: a.) On some platforms fgrep has been deprecated (in favour of `grep -F`) so it's not future-proof b.) The caret (^) passed to `grep -F` will not be interpreted as a regex, since -F forces non-regexp, meaning the '^' will be interpreted literally (and the string "^musl" is not in the ldd output). c.) It's likely safe to assume that the string 'musl' will only occur in `ldd --version` where musl is installed d.) I did not test a case Arthur described here https://mailman.ntg.nl/pipermail/ntg-context/2018/091123.html, but the use of -F ought to avoid the zsh EXTENDED_GLOB problem Based on this, a reasonably portable detection of musl in first-setup.sh and tex/setuptex might be: if command -v ldd >/dev/null && ldd --version 2>&1 | grep -Fq 'musl' > /dev/null 2. Running /context/first-setup.sh the link /context/bin/texlua did not exist and first-setup.sh fails. Once symlinked to `luatex` in the same directory, first-setup.sh will run rsync. 3. Similarly /context/tex/texmf-linuxmusl-64/bin/texlua does not exist, so setuptex fails. Once symlinked `luatex -> texlua` then setuptex can be executed (bearing in mind `setuptex` needs to be updated with the same musl detection test as first-setup.sh) 4. setuptex needs to be called with an explicit directory otherwise it complains with ""/bin" is not a valid TEXROOT path. (There is no file "/bin/texmf/tex/plain/base/plain.tex") provide a proper tex root (like '. setuptex /something/tex')" Running this will run setuptex variables: $ . /context/tex/setuptex /context/tex Setting "/context/tex" as ConTeXt root. 5. Running context exits with: mtxrun | unknown script 'context.lua' or 'mtx-context.lua' That's as far as I have gotten for now, but I thought this enough to report= . 6. I am happy to take direction and report, but it is also straightforward to reproduce with Docker via the Dockerfile: FROM python:3.6-alpine3.7 RUN apk --no-cache add rsyncWORKDIR /context Then running docker: $ docker build -t context . $ docker run -ti context /bin/sh Then in the docker container shell, run: $ cd /context $ wget http://minimals.contextgarden.net/setup/first-setup.sh \$ sh ./first-setup.sh --modules=3Dall --engine=3Dluatex (please pardon the formatting - some copying and pasting here). I hope this is helpful. Cheers, Brian On Sun, 8 Apr 2018 at 20:52 Henri Menke wrote: > On Sun, 2018-04-08 at 22:50 +0200, Mojca Miklavec wrote: > > Dear Brian, > > > > On 8 April 2018 at 16:56, Brian Hunt wrote: > > > > > > Hello everyone, > > > > > > Per this question on tex.StackOverflow, I am having trouble getting > ConTeXt > > > (LuaTeX specifically) to run on Alpine Linux: > > > > > > https://tex.stackexchange.com/questions/425463 > > > > > > Specifically, the build from ConTeXt standalone has a LuaTeX that > seems not > > > to run against the musl libc6 library. > > We have a "nearly working" one. At least all the binaries should be > > there, see for example: > > http://distribution.contextgarden.net/setup/linuxmusl-64/ > > > > There are two to three remaining problems: > > > > 1.) I disabled automatic musl recognition (short after enabling it) > > after this bug report: > > https://mailman.ntg.nl/pipermail/ntg-context/2018/091094.html > > I need to finish "parsing" > > https://mailman.ntg.nl/pipermail/ntg-context/2018/091123.html > > and a few other posts in that thread and maybe make some additional > > testing. There was some "oh no, it has to be the other way around" > > discussion where I no longer followed and I need some more time to > > read everything more carefully (no time for that right now). > > > > 2.) Most likely a patch in mtxrun is still needed (but I admit that I > > didn't check) for proper platform recognition. The fact that we are > > struggling in shell doesn't really help doing this part either :) > > > > 3.) Ideally we need to set up some automated LuaTeX builds to be able > > to get the latest LuaTeX binaries in the future. > > Similar to TeX live I have set up an automated Travis CI build, which can > deploy > binaries to GitHub releases. > https://github.com/hmenke/luatex/blob/master/.travis.yml > > However, I just forked Adam's mirror and I am not planning to keep mine > updated. > It would be nice to have some sort of =E2=80=9Cofficial=E2=80=9D LuaTeX m= irror on GitHub > for > that. Nevertheless, it might be worthwhile to check the '.travis.yml' I > posted > above into the LuaTeX SVN. > > > > > > > > > Has anyone run ConTeXt on Alpine? > > At the moment it should work if you install TeX Live 2018 pretest with > > the ConTeXt scheme or if you fiddle a bit with the installation (you > > need to hardcode the platform name in first-setup.sh and then still > > some minor things might still go wrong, not sure). But in fact very > > little is required to fix the remaining issues. > > > > Can you please remind us to pick this up again in a couple of days? > > > > In the meantime, if you are willing to do some more extensive testing > > of patches (see full thread linked above) on both musl & non-musl > > linuxes, in various shells etc., as well as perhaps come up with a > > patch for mtxrun, that might help. > > > > Mojca > > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > _________________________________________________________________________= __________ --=20 *from the personal account of:* *Brian M Hunt * Direct: +1-289-684-4677 LinkedIn: https://linkedin.com/in/brianmhunt *This e-mail may contain information that is private, privileged, confidential and/or exempt from disclosure. Except as per this notice no waiver of any kind is intended by sending this e-mail, and this email is intended only for the named recipient(s) or the subscribers of a forwarding service the email is sent directly to and to which service you are an authorized recipient. Use, dissemination or copying without authorization is prohibited. Please notify the sender and destroy all copies of this e-mail if you have received this email in error.* --f403045dbb74b3204205696f001e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here are a couple experimental observations.

1. Detecting musl.

-- Alpine Linux/sh --
=
$ ldd --version 2>&1 | grep -F musl
musl libc (x= 86_64)
$? =3D 0

-- Debian/bash --<= /div>
$ ldd --version 2>&1 | grep -F musl
=C2=A0(n= othing; $? =3D 1)

-- Debian/zsh --
$ ldd --version 2>&1 | grep -F musl
(nothing; $? =3D 1)

A few notes:
a.) On some platforms fgrep = has been deprecated (in favour of `grep -F`) so it's not future-proof
b.) The caret (^) passed to `grep -F` will not be interpreted as a= regex, since -F forces non-regexp, meaning the '^' will be interpr= eted literally (and the string "^musl" is not in the ldd output).=
c.) It's likely safe to assume that the string 'musl'= ; will only occur in `ldd --version` where musl is installed
d.) = I did not test a case Arthur described here=C2=A0https://m= ailman.ntg.nl/pipermail/ntg-context/2018/091123.html, but the use of -F= ought to avoid the zsh EXTENDED_GLOB=C2=A0 problem

Based on this, a reasonably portable detection of musl in first-setup.sh = and tex/setuptex might be:

if command -v ldd >/dev/null && ldd --version 2>&1 |= grep -Fq 'musl' >/dev/null
=

2. Running /context/first-setup.sh the link /= context/bin/texlua did not exist and first-setup.sh fails.
Once s= ymlinked to `luatex` in the same directory, first-setup.sh will run rsync.<= /div>

3. Similarly=C2=A0/context/tex/texmf-linuxmusl-64/= bin/texlua does not exist, so setuptex fails.
Once symlinked `lua= tex -> texlua` then setuptex can be executed (bearing in mind `setuptex`= needs to be updated with the same musl detection test as first-setup.sh)

4.=C2=A0setuptex needs to be called with an explici= t directory otherwise it complains with

"&quo= t;/bin" is not a valid TEXROOT path.
(There is no file "= ;/bin/texmf/tex/plain/base/plain.tex")
provide a proper tex = root (like '. setuptex /something/tex')"

<= div>Running this will run setuptex variables:

$ . = /context/tex/setuptex /context/tex
Setting "/context/tex&quo= t; as ConTeXt root.

5. Running context exits w= ith:
mtxrun=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | unknown script &#= 39;context.lua' or 'mtx-context.lua'

That's as far as I have gotten for now, but I thought this enough to= report.

6. I am happy to take direction and repor= t, but it is also straightforward to reproduce with Docker via the Dockerfi= le:

FROM python:3.6-alpine3.7
RUN apk --no-cache add rsync
WORKDIR /context
Then run= ning docker:
$ docker build -t context .
<=
code style=3D"margin:0px;padding:0px;border:0px;font-style:inherit;font-var=
iant:inherit;font-weight:inherit;font-stretch:inherit;line-height:19.5px;fo=
nt-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation=
 Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono&quo=
t;,"Courier New",monospace,sans-serif;vertical-align:baseline;box=
-sizing:inherit;white-space:inherit">$ docker run -ti context /bin/sh
Then in the docker container shell, run:

$ cd /context<=
br>
$ wget http://minimals.contextgarden.=
net/setup/first-setup.sh \
$ sh ./first-setup.sh --modules=3Dall --engine=3Dluatex
(please pardon the= formatting - some copying and pasting here).

I ho= pe this is helpful.

Cheers,
Brian
<= div>

On Sun, 8 Apr= 2018 at 20:52 Henri Menke <henrimenke@gmail.com> wrote:
On Sun, 2018-04-08 at 22:50 +0200, Mojca Miklavec wrote:
> Dear Brian,
>
> On 8 April 2018 at 16:56, Brian Hunt wrote:
> >
> > Hello everyone,
> >
> > Per this question on tex.StackOverflow, I am having trouble getti= ng ConTeXt
> > (LuaTeX specifically) to run on Alpine Linux:
> >
> > https://tex.stackexchange.com/questions/4254= 63
> >
> > Specifically, the build from ConTeXt standalone has a LuaTeX that= seems not
> > to run against the musl libc6 library.
> We have a "nearly working" one. At least all the binaries sh= ould be
> there, see for example:
> =C2=A0=C2=A0=C2=A0=C2=A0http://distrib= ution.contextgarden.net/setup/linuxmusl-64/
>
> There are two to three remaining problems:
>
> 1.) I disabled automatic musl recognition (short after enabling it) > after this bug report:
> =C2=A0=C2=A0=C2=A0=C2=A0https://ma= ilman.ntg.nl/pipermail/ntg-context/2018/091094.html
> I need to finish "parsing"
> =C2=A0=C2=A0=C2=A0=C2=A0https://ma= ilman.ntg.nl/pipermail/ntg-context/2018/091123.html
> and a few other posts in that thread and maybe make some additional > testing. There was some "oh no, it has to be the other way around= "
> discussion where I no longer followed and I need some more time to
> read everything more carefully (no time for that right now).
>
> 2.) Most likely a patch in mtxrun is still needed (but I admit that I<= br> > didn't check) for proper platform recognition. The fact that we ar= e
> struggling in shell doesn't really help doing this part either :)<= br> >
> 3.) Ideally we need to set up some automated LuaTeX builds to be able<= br> > to get the latest LuaTeX binaries in the future.

Similar to TeX live I have set up an automated Travis CI build, which can d= eploy
binaries to GitHub releases.
https://github.com/hmenke/luatex/blob/master= /.travis.yml

However, I just forked Adam's mirror and I am not planning to keep mine= updated.
It would be nice to have some sort of =E2=80=9Cofficial=E2=80=9D LuaTeX mir= ror on GitHub for
that.=C2=A0 Nevertheless, it might be worthwhile to check the '.travis.= yml' I posted
above into the LuaTeX SVN.

>
> >
> > Has anyone run ConTeXt on Alpine?
> At the moment it should work if you install TeX Live 2018 pretest with=
> the ConTeXt scheme or if you fiddle a bit with the installation (you > need to hardcode the platform name in first-setup.sh and then still > some minor things might still go wrong, not sure). But in fact very > little is required to fix the remaining issues.
>
> Can you please remind us to pick this up again in a couple of days? >
> In the meantime, if you are willing to do some more extensive testing<= br> > of patches (see full thread linked above) on both musl & non-musl<= br> > linuxes, in various shells etc., as well as perhaps come up with a
> patch for mtxrun, that might help.
>
> Mojca
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--

from the personal account of:

Brian M Hunt <brianmhunt@gmail.com>
Direct: += 1-289-684-4677
LinkedIn:=C2=A0https://linkedin.com/in/brianmhunt

This e-mail may contain information that = is private, privileged, confidential and/or exempt from disclosure. Except = as per this notice no waiver of any kind is intended by sending this e-mail= , and this email is intended only for the named recipient(s) or the subscri= bers of a forwarding service the email is sent directly to and to which ser= vice you are an authorized recipient. Use, dissemination or copying without= authorization is prohibited. Please notify the sender and destroy all copi= es of this e-mail if you have received this email in error.
<= /p>

--f403045dbb74b3204205696f001e-- --===============6984618871270387684== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============6984618871270387684==--