ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Brian Hunt <brianmhunt@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Build for Alpine Linux
Date: Mon, 09 Apr 2018 18:59:06 +0000	[thread overview]
Message-ID: <CA+Zb4MzVeKrQRzo8wR0ivXck5Cm=7+xfj1ezrx8v=S+SiWnf+g@mail.gmail.com> (raw)
In-Reply-To: <1523235042.18581.29.camel@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 6921 bytes --]

Here are a couple experimental observations.

1. Detecting musl.

-- Alpine Linux/sh --
$ ldd --version 2>&1 | grep -F musl
musl libc (x86_64)
$? = 0

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

-- Debian/zsh --
$ ldd --version 2>&1 | grep -F musl
(nothing; $? = 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=all --engine=luatex

(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 <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 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 “official” LuaTeX mirror 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
>
> ___________________________________________________________________________________

-- 

*from the personal account of:*

*Brian M Hunt *<brianmhunt@gmail.com>
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.*

[-- Attachment #1.2: Type: text/html, Size: 18471 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2018-04-09 18:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 21:04 double followtokens? Pablo Rodriguez
2018-04-07 21:25 ` Hans Hagen
2018-04-07 22:11   ` Pablo Rodriguez
2018-04-08 14:41     ` Hans Hagen
2018-04-08 14:56       ` Build for Alpine Linux Brian Hunt
2018-04-08 20:50         ` Mojca Miklavec
2018-04-08 21:09           ` Arthur Reutenauer
2018-04-08 21:26           ` Henri Menke
2018-04-08 21:45             ` Arthur Reutenauer
2018-04-09  0:50           ` Henri Menke
2018-04-09 18:59             ` Brian Hunt [this message]
2018-04-09 19:35               ` Arthur Reutenauer
2018-04-10 11:05                 ` Brian Hunt
2018-04-10 12:26                   ` Brian Hunt
2018-04-10 16:27                   ` Alan Braslau
2018-04-10 20:55                   ` Arthur Reutenauer
2018-04-11 12:30                     ` Brian Hunt
2018-04-11 20:08                       ` Brian Hunt
2018-04-11 20:24                         ` Aditya Mahajan
2018-04-11 20:37                         ` Hans Hagen
2018-04-11 21:08                           ` Brian Hunt
2018-04-13 11:14                           ` Mojca Miklavec
2018-04-13 11:42                             ` Henri Menke
2018-04-13 19:54                               ` Henning Hraban Ramm
2018-04-13 20:02                                 ` Aditya Mahajan
2018-04-13 12:49                             ` Hans Hagen
2018-04-11 23:13                         ` Henri Menke
2018-04-13 10:37                           ` Brian Hunt
     [not found]                             ` <CALBOmsaXyTXhR=j6Ht1LwKGcfxMD4sHjQnEOxtjH-4gc3b5R8g@mail.gmail.com>
     [not found]                               ` <20180417152547.GA1755070@phare.normalesup.org>
2018-04-17 15:54                                 ` Thomas A. Schmitz
2018-04-08 18:10       ` double followtokens? Pablo Rodriguez
2018-04-08 21:17         ` Hans Hagen
2018-04-09 18:25           ` Pablo Rodriguez
2019-01-01 18:17       ` Hans van der Meer
2019-01-01 20:17         ` Hans Hagen

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='CA+Zb4MzVeKrQRzo8wR0ivXck5Cm=7+xfj1ezrx8v=S+SiWnf+g@mail.gmail.com' \
    --to=brianmhunt@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).