Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lualatex.fmt not portable between 32-bit/64-bit machines #775

Open
kberry opened this issue Feb 4, 2022 · 28 comments
Open

lualatex.fmt not portable between 32-bit/64-bit machines #775

kberry opened this issue Feb 4, 2022 · 28 comments
Assignees
Labels

Comments

@kberry
Copy link

kberry commented Feb 4, 2022

Evidently lualatex.fmt cannot be shared between 32-bit and 64-bit systems. All other fmts, including xelatex.fmt, pdflatex.fmt, and the plain luahbtex.fmt, are sharable. Of course the fmts are created by the exact same version of luahbtex (current TL svn).

I get the same mesage with either creating lualatex.fmt on 32-bit and reading on 64-bit, or the other way around. (The fmts can be read fine on the machine where they are created.) I run this command in the TL
Build/source/Work/texk/web2c/ directory (I'll explain trytexenv below):

trytexenv ./luahbtex -fmt ~/lualatex.fmt \\stop

where ~/lualatex.fmt has been copied in from the other machine,
and get this error:

This is LuaHBTeX, Version 1.15.0 (TeX Live 2022)                                
 restricted system commands enabled.                                            
LaTeX2e <2021-11-15> patch level 1                                              
L3 programming layer <2021-11-22>...live/karl/Master/texmf-dist/tex/latex/l3ker
nel/expl3.lua:244: bad bytecode register                                        
stack traceback:                                                                
        [C]: in function 'lua.getbytecode'                                      
        ...live/karl/Master/texmf-dist/tex/latex/l3kernel/expl3.lua:244: in main chunk                                                                         
                                                                                
        [C]: in function 'require'                                              
        [\directlua]:1: in main chunk.                                          
\lua_now:e #1->\__lua_now:n {#1}                                                
                                                                                
<*>                                                                             
 \stop                                                                          
?                            

Akira reports that he gets the same message with his Windows binaries in the same cross-architecture situation.

Above I said "all" other fmts work, but in truth there is one other that doesn't: optex. I noticed this last year, and asked Petr about it. I don't know if it is related to whatever is going on with expl3.lua , but FWIW, he wrote (sorry for the poor line breaks, looked fine in my editor):

Date: Tue, 20 Jul 2021 20:02:02 +0200
From: Petr Olsak
Subject: Re: optex.fmt on BigEndian machine?

[...] The idea used in OpTeX (to save a lua code as "bytecode" into the
format file and then use it when the format is used) was borrowed from
ConTeX. So, Context cannot be shared between architectures too.

The lua manual (man luac) says:

Precompiled chunks are not portable across different architectures.

Of course, I can change this concept and read lua files at \everyjob
(not converted to bytecode and not saved to the format) but I prefer to
keep the bytecode saved to the format: it seems to be more compact and
the speed is better. There is very small number of users they want to
share OpTeX between architectures. I hope, they can create two versions
of formats if they want to use OpTeX at two different architectures.

M. Vlasak suggests another solution: use bytecode if it can be
succesfully loaded else read the .lua files again:
olsak/OpTeX@dbf5b6e
but I don't plan to use this code because the code can be usable for
almost zero users.

I expect that it's also the case for lualatex that "almost zero users" will notice if lualatex.fmt written on 64-bit fails to read on 32-bit and vice versa. It's pretty hard even to find such a pair of machines nowadays. However, if it'd ever be a problem it would surely be with latex where it got noticed. So, I wanted to report it to you.

If you want access to a 32-bit machine, I expect Nelson would be happy to provide. That's where I am testing this stuff.

wdyt? --thanks, karl.

Appendix. The trytexenv script I used above is this:

#!/bin/sh
# $Id: trytexenv,v 1.3 2022/02/03 18:26:23 karl Exp $
# envvars to run from build tree.
TEXMFROOT=$tm; export TEXMFROOT
TEXMFCNF=$TEXMFROOT/texmf-dist/web2c; export TEXMFCNF
LUAINPUTS=$TEXMFROOT/texmf-dist/tex//:; export LUAINPUTS
exec "$@"

where $tm is an envvar I define outside the script to be the "Master" tree for whatever system I'm working on. The actual /Master subdir from an svn checkout, etc.

These environment settings are needed because when running from the build dir, of course the usual search based on $0 and SELFAUTO* cannot find texmf.cnf, and thus nothing else is defined.

As for LUAINPUTS, which seems like it should not be necessary, I think it needs to be defined explicitly because of the different binary name. I can get different errors if I change the search order around. I didn't investigate in depth. Without defining it at all, the file lualatexquotejobname.lua can't be loaded, so the fmt reading aborts early.

@kberry
Copy link
Author

kberry commented Feb 4, 2022

Akira just wrote me:

Date: Sat, 5 Feb 2022 07:32:07 +0900
From: Akira Kakuto <kakuto@jcom.zaq.ne.jp>
To: Karl Berry <karl@freefriends.org>

[...] The error seems to occur in

llualib.c: line 193 in llualib.c

     } else if (!bytecode_register_shadow_get(L, k)) {
         if (k <= luabytecode_max && lua_bytecode_registers[k].buf !=
NULL) {
             if (lua_load
                 (L, reader, (void *) (lua_bytecode_registers + k),
#ifdef LuajitTeX
                  "bytecode")) {
#else
                  "bytecode", NULL)) {
#endif
                 return luaL_error(L, "bad bytecode register");
             } else {

lua_bytecode_registers is a pointer:
static bytecode *lua_bytecode_registers;
where
typedef struct {
     unsigned char *buf;
     int size;
  /* int done; */
     int alloc;
} bytecode;

The sizeof(bytecode) is 96 in 32bit case and it is 128 in
64bit case, so I think that
lua_bytecode_registers + k is architecture dependent.

@u-fischer
Copy link
Member

I could reproduce the error some days ago as I have both 32bit and 64bit binaries. But I doubt that this has any impact in the real world. I have the formats in different texmf-var trees and had to copy them manually to check the error.

@kberry
Copy link
Author

kberry commented Feb 6, 2022 via email

@davidcarlisle
Copy link
Member

@kberry I don't know how feasible a fix at the engine level would be (making 32 bit systems byte compile Lua in the same format as 64bit) That would be the most stable fix, otherwise every time you bye compile anything that might get dumped you need to arrange to test for incompatible systems and arrange that the Lua is available in a file that can be reloaded in everyjob rather than using the byte compiled version which must be doable in theory but seems like work...

Note a real user did hit this the other day so it does not just fail theoretical test setups:

https://tex.stackexchange.com/q/632772/1090

@FrankMittelbach
Copy link
Member

@davidcarlisle but wouldn't it be better, aka much simpler and more reliable, to have a simple test in the engine that the format is compatible and just bail out if not. I don't think it is unreasonable to say that formats generated for one architecture do not work with other architectures, and if that is possible for some engines but if not you get an appropriate error.

@davidcarlisle
Copy link
Member

@FrankMittelbach if formats had been architecture dependent from the start that would be quite natural but web2c implementations go to some lengths to make them cross platform and the default texlive directory structure has multiple bin directories one for each architecture installed, but only a single default directory for generated formats so
if the texlive tree is in a shared directory with more than one bin directory the formats will by default be shared. That's what hits windows users who have both the 32 and 64 bit binaries installed. You can configure separate format paths but...

@FrankMittelbach
Copy link
Member

@davidcarlisle well, as for "from the start", I think I remember that the format have not been cross compatible in the 80ties, so speaking from the start ... but perhaps I'm mistaken

but anyway, I see your point. On the other hand, as you say, it is not clear how feasible that would be, while putting some flag in the formats for windows and luatex or even simpler identifying them by file name extension (which would also resolve the problem with parallel installations) should be fairly easy I would imagine

@kberry
Copy link
Author

kberry commented Feb 6, 2022 via email

@kberry
Copy link
Author

kberry commented Feb 6, 2022

Luigi just wrote me:

I fear that akira's answer is the definitive answer. I will look [...] but I think that changing the bytecode  is too dangerous, and almost
for sure will slowdown the interpreter. About portability iirc there is
also an issue with  the glue, which is a floating point value.

@davidcarlisle
Copy link
Member

See also the thread on the luatex list starting https://tug.org/pipermail/luatex/2022-February/007612.html

@davidcarlisle
Copy link
Member

@kberry As the situation is I suspect unlikely to change before texlive 2022, would it be possible for texmf.cnf to arrange that the default path for luatex formats is architecture dependent (or at least different for win32) so that you can by default build both 32 and 64 bit formats?

@kberry
Copy link
Author

kberry commented Feb 7, 2022 via email

@u-fischer
Copy link
Member

I have since quite a long time three sets of binaries, the standard 32bit, 64bit and "experimental" and typically some of the formats are different. I have therefore in the 64bit and in the experimental bin folder a texmf.cnf which changes TEXMFSYSVAR:

 TEXMFSYSVAR = $TEXMFROOT/texmf-var-exp

That works without any problems. And imho it is easy to document as a work around if there are format clashes.

@davidcarlisle
Copy link
Member

@kberry it's not my code so I'm not sure how much complexity it would be to avoid byte compilation, it is not a single block of code it's a call before dump that iterates through any declared intarrays that are in the Lua state at that time and byte compiles them so they can be saved in the format, l3intarray.dtx documents as follows

% Since in \LaTeX{} this is loaded in the format, we want to preserve any intarrays
% which are created while format building for the actual run.
%
% To do this, we use the \texttt{register_luadata} mechanism from \pkg{l3luatex}:
% Directly before the format get dumped, the following function gets invoked and serializes
% all existing tables into a string. This string gets compiled and dumped into the format and
% is made available at the beginning of regular runs as \texttt{get_luadata'@@'}.
%    \begin{macrocode}
  if register_luadata then
    register_luadata('@@', function()
      local t = "{[0]={},"
      for i=1, #tables do
        t = string.format("%s{%s},", t, table.concat(tables[i], ','))
      end
      return t .. "}"
    end)
  end
end

You mention lualatexquotejobname.lua but that's only a line or two of Lua, but if you have tables of for example Unicode data they are rather larger and avoiding dumping them in the format is a high price to pay

@kberry
Copy link
Author

kberry commented Feb 7, 2022 via email

@vlasakm
Copy link

vlasakm commented Feb 7, 2022

@kberry Out of curiosity, do you have one of those 32 bit format files handy? I think this is more of a Lua issue, but I don't know yet how much problematic it would be, and would rather try on an example file.

We already discussed the portability of format files, but that was about endianness. That in particular can be done through patching of https://tug.org/svn/texlive/trunk/Build/source/libs/lua53/lua53-src/src/ldump.c?view=markup and the respective (lundump.c) - the dumping is similar to Web2C's and same byte swapping should work and should be relatively cheap if the canonical format is little endian. Although, detecting endianness is never nice approach IMO (https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html).

@davidcarlisle
Copy link
Member

davidcarlisle commented Feb 7, 2022 via email

@vlasakm
Copy link

vlasakm commented Feb 8, 2022

Actually, nevermind I got "cross compilation" to 32 bits working.

Quick patch to LuaTeX revealed the real error message and also that by mistake I was looking at Lua 5.4 sources, because the error in 5.3 is obvious.

$ ./build/src/luatex/mmluatex -fmt ./build32/mmoptex.fmt \\relax
This is LuaHBTeX, Version 1.13.2 (mmtex 20210902)
This is OpTeX (Olsak's Plain TeX), version <1.04 Aug.2021>
bytecode: size_t size mismatch in precompiled chunk
stack traceback:
        [C]: in function 'lua.getbytecode'
        [\directlua]:1: in main chunk.
[...]

I didn't yet study all changes in Lua dumping for version 5.4, but there was this note in one of the commits:

    - 'sizeof(int)' and 'sizeof(size_t)' removed from the header, as
    the binary format does not depend on these sizes. (It uses its
    own serialization for unsigned integer values.)

So it may be safe to remove the checks even for 5.3(?). Without them I get to load OpTeX format correctly.

No luck with lualatex.fmt so far, got "not enough memory".

$ env TEXMF=~/src/texlive/texmf-dist ./build32/src/luatex/mmluatex -ini lualatex.ini
[...]
$ env TEXMF=~/src/texlive/texmf-dist ./build/src/luatex/mmluatex -fmt lualatex.fmt \\relax
This is LuaHBTeX, Version 1.13.2 (mmtex 20210902)
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-05>not enough memory
stack traceback:
        [C]: in function 'lua.getbytecode'
        ...chal/src/texlive/texmf-dist/tex/latex/l3kernel/expl3.lua:244: in main chunk
        [C]: in function 'require'
        [\directlua]:1: in main chunk.
\lua_now:e #1->\__lua_now:n {#1}

<*>
 \relax
?

I used https://github.com/vlasakm/mmtex for testing this, maybe someone finds these rough steps useful:

meson setup build   --prefix /usr -D luahbtex=true
meson setup build32 --prefix /usr -D luahbtex=true --cross-file=linux32
meson compile -C build
meson compile -C build32
# ~/.local/share/meson/cross/linux32
[binaries]
c = '/usr/bin/gcc'
cpp = '/usr/bin/g++'
ar = '/usr/bin/gcc-ar'
strip = '/usr/bin/strip'
pkgconfig = '/usr/bin/pkg-config'
llvm-config = '/usr/bin/llvm-config32'

[properties]
c_args = ['-m32']
c_link_args = ['-m32']
cpp_args = ['-m32']
cpp_link_args = ['-m32']
pkg_config_libdir = '/usr/lib32/pkgconfig'

[host_machine]
system = 'linux'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'

Required patch:

diff --git a/src/lua/src/ldump.c b/src/lua/src/ldump.c
index f025aca..d1c1ee6 100644
--- a/src/lua/src/ldump.c
+++ b/src/lua/src/ldump.c
@@ -186,8 +186,8 @@ static void DumpHeader (DumpState *D) {
   DumpByte(LUAC_VERSION, D);
   DumpByte(LUAC_FORMAT, D);
   DumpLiteral(LUAC_DATA, D);
-  DumpByte(sizeof(int), D);
-  DumpByte(sizeof(size_t), D);
+  //DumpByte(sizeof(int), D);
+  //DumpByte(sizeof(size_t), D);
   DumpByte(sizeof(Instruction), D);
   DumpByte(sizeof(lua_Integer), D);
   DumpByte(sizeof(lua_Number), D);
diff --git a/src/lua/src/lundump.c b/src/lua/src/lundump.c
index edf9eb8..4451518 100644
--- a/src/lua/src/lundump.c
+++ b/src/lua/src/lundump.c
@@ -247,8 +247,8 @@ static void checkHeader (LoadState *S) {
   if (LoadByte(S) != LUAC_FORMAT)
     error(S, "format mismatch in");
   checkliteral(S, LUAC_DATA, "corrupted");
-  checksize(S, int);
-  checksize(S, size_t);
+  //checksize(S, int);
+  //checksize(S, size_t);
   checksize(S, Instruction);
   checksize(S, lua_Integer);
   checksize(S, lua_Number);
diff --git a/src/luatex/meson.build b/src/luatex/meson.build
index 6439c00..1393767 100644
--- a/src/luatex/meson.build
+++ b/src/luatex/meson.build
@@ -3,7 +3,6 @@ luatex_src = files(
   'src/luamd5/md5.c',
   'src/luamd5/md5lib.c',
   'src/luapeg/lpeg.c',
-  'src/luazip/src/luazip.c',
   'src/luazlib/lgzip.c',
   'src/luazlib/lzlib.c',
   'src/slnunicode/slnunico.c',
@@ -221,7 +220,6 @@ luatex_dependencies = [
   cc.find_library('dl', required: false),
   dependency('libpng'),
   dependency('zlib'),
-  dependency('zziplib'),
   lua_dep,
   mplib_dep,
   pplib_dep,
diff --git a/src/luatex/src/lua/llualib.c b/src/luatex/src/lua/llualib.c
index 0586aba..2b4db72 100644
--- a/src/luatex/src/lua/llualib.c
+++ b/src/luatex/src/lua/llualib.c
@@ -199,7 +199,8 @@ static int get_bytecode(lua_State * L)
 #else
                  "bytecode", NULL)) {
 #endif
-                return luaL_error(L, "bad bytecode register");
+                // error message is on top of the stack
+                return lua_error(L);
             } else {
                 lua_pushvalue(L, -1);
                 bytecode_register_shadow_set(L, k);
diff --git a/src/luatex/src/lua/luastuff.c b/src/luatex/src/lua/luastuff.c
index fb05c60..b10e6fe 100644
--- a/src/luatex/src/lua/luastuff.c
+++ b/src/luatex/src/lua/luastuff.c
@@ -179,7 +179,6 @@ static const luaL_Reg lualibs[] = {
 #endif
     /*tex additional (public) libraries */
     { "unicode",   luaopen_unicode },
-    { "zip",       luaopen_zip },
     { "md5",       luaopen_md5 },
     { "sha2",      luaopen_sha2 },
     { "lfs",       luaopen_lfs },

@vlasakm
Copy link

vlasakm commented Feb 8, 2022

In Lua 5.4 (unlike Lua 5.3) "ints" and "sizes" are not dumped as are, but instead in a variable length encoding (with a bounds check when loading). This is even the reason why the checks on size_t and int I mentioned were later removed.

It seems ideal for our use case, because 64 bit formats that are in the 32 bit bounds will work on 32 bit.

I backported the changes to Lua 5.3. No changes in "LuaTeX" needed, just in TeX Live "libs", probably can be coordinated with other distributions as well, but I don't know what's their attitude towards format sharing.

Here are the changes (note that I use a different setup and didn't actually test in TeX Live) I propose for LuaTeX:

--- a/src/luatex/src/lua/llualib.c
+++ b/src/luatex/src/lua/llualib.c
@@ -195,11 +195,12 @@ static int get_bytecode(lua_State * L)
             if (lua_load
                 (L, reader, (void *) (lua_bytecode_registers + k),
 #ifdef LuajitTeX
-                 "bytecode")) {
+                 "bytecode") != LUA_OK) {
 #else
-                 "bytecode", NULL)) {
+                 "bytecode", NULL) != 0) {
 #endif
-                return luaL_error(L, "bad bytecode register");
+                // error message is on top of the stack
+                return lua_error(L);
             } else {
                 lua_pushvalue(L, -1);
                 bytecode_register_shadow_set(L, k);

And here are the Lua ones:

--- a/src/lua/src/ldump.c
+++ b/src/lua/src/ldump.c
@@ -55,8 +55,23 @@ static void DumpByte (int y, DumpState *D) {
 }
 
 
+/* dumpInt Buff Size */
+#define DIBS    ((sizeof(size_t) * 8 / 7) + 1)
+
+static void DumpSize (size_t x, DumpState *D) {
+  lu_byte buff[DIBS];
+  int n = 0;
+  do {
+    buff[DIBS - (++n)] = x & 0x7f;  /* fill buffer in reverse order */
+    x >>= 7;
+  } while (x != 0);
+  buff[DIBS - 1] |= 0x80;  /* mark last byte */
+  DumpVector(buff + DIBS - n, n, D);
+}
+
+
 static void DumpInt (int x, DumpState *D) {
-  DumpVar(x, D);
+  DumpSize(x, D);
 }
 
 
@@ -72,17 +87,12 @@ static void DumpInteger (lua_Integer x, DumpState *D) {
 
 static void DumpString (const TString *s, DumpState *D) {
   if (s == NULL)
-    DumpByte(0, D);
+    DumpSize(0, D);
   else {
-    size_t size = tsslen(s) + 1;  /* include trailing '\0' */
+    size_t size = tsslen(s);
     const char *str = getstr(s);
-    if (size < 0xFF)
-      DumpByte(cast_int(size), D);
-    else {
-      DumpByte(0xFF, D);
-      DumpVar(size, D);
-    }
-    DumpVector(str, size - 1, D);  /* no need to save '\0' */
+    DumpSize(size + 1, D);
+    DumpVector(str, size, D);
   }
 }
 
@@ -186,8 +196,6 @@ static void DumpHeader (DumpState *D) {
   DumpByte(LUAC_VERSION, D);
   DumpByte(LUAC_FORMAT, D);
   DumpLiteral(LUAC_DATA, D);
-  DumpByte(sizeof(int), D);
-  DumpByte(sizeof(size_t), D);
   DumpByte(sizeof(Instruction), D);
   DumpByte(sizeof(lua_Integer), D);
   DumpByte(sizeof(lua_Number), D);
--- a/src/lua/src/lundump.c
+++ b/src/lua/src/lundump.c
@@ -10,6 +10,7 @@
 #include "lprefix.h"
 
 
+#include <limits.h>
 #include <string.h>
 
 #include "lua.h"
@@ -64,13 +65,30 @@ static lu_byte LoadByte (LoadState *S) {
 }
 
 
-static int LoadInt (LoadState *S) {
-  int x;
-  LoadVar(S, x);
+static size_t LoadUnsigned (LoadState *S, size_t limit) {
+  size_t x = 0;
+  int b;
+  limit >>= 7;
+  do {
+    b = LoadByte(S);
+    if (x >= limit)
+      error(S, "integer overflow");
+    x = (x << 7) | (b & 0x7f);
+  } while ((b & 0x80) == 0);
   return x;
 }
 
 
+static size_t LoadSize (LoadState *S) {
+  return LoadUnsigned(S, ~(size_t)0);
+}
+
+
+static int LoadInt (LoadState *S) {
+  return cast_int(LoadUnsigned(S, INT_MAX));
+}
+
+
 static lua_Number LoadNumber (LoadState *S) {
   lua_Number x;
   LoadVar(S, x);
@@ -87,10 +105,8 @@ static lua_Integer LoadInteger (LoadState *S) {
 
 static TString *LoadString (LoadState *S, Proto *p) {
   lua_State *L = S->L;
-  size_t size = LoadByte(S);
+  size_t size = LoadSize(S);
   TString *ts;
-  if (size == 0xFF)
-    LoadVar(S, size);
   if (size == 0)
     return NULL;
   else if (--size <= LUAI_MAXSHORTLEN) {  /* short string? */
@@ -247,8 +263,6 @@ static void checkHeader (LoadState *S) {
   if (LoadByte(S) != LUAC_FORMAT)
     error(S, "format mismatch in");
   checkliteral(S, LUAC_DATA, "corrupted");
-  checksize(S, int);
-  checksize(S, size_t);
   checksize(S, Instruction);
   checksize(S, lua_Integer);
   checksize(S, lua_Number);

So why should this work? For runtime values, Lua uses either "lua_Integer" for integers or "lua_Number" for floats. Usually these are "long long" and "double" respectively. There is also Instruction, which is "unsigned int" (if it is at least 32 bits long) or "unsinged long". As long as these types are the same, I think that there shouldn't be any problems. Are there TeX Live architectures where sizeof(long long) != 8, double isn't IEEE 754 double precision number or sizeof(unsigned int) != 4?

Size of struct bytecode doesn't matter, because it isn't dumped. The size field is dumped, and is in fact dumped as int, which poses further portability concerns, but given that a lot of ints are dumped by LuaTeX and it was never an issue, I don't think that bytecodes make it worse.

Somebody please review the patch, I also haven't thoroughly tested, though I got lualatex.fmt working both ways (64->32, 32->64), if I didn't mess something up.

@vlasakm
Copy link

vlasakm commented Feb 8, 2022

Also a thought: Lua is very configurable, and the types for "lua_Integer" and "Instruction" could be customly #defined in headers, to the appropriate stdint.h types if all TeX Live architectures provide those. Then there will be even less uncertainty.

@kberry
Copy link
Author

kberry commented Feb 8, 2022 via email

@vlasakm
Copy link

vlasakm commented Feb 9, 2022

@kberry

I'll point Luigi to your patch here and we'll see what he thinks.

Already posted an updated patch to the list.

https://tug.org/pipermail/luatex/2022-February/007623.html

It includes also code that (if needed) byte swaps loaded bytecode.

@kberry
Copy link
Author

kberry commented Feb 17, 2022

  1. Luigi is not prepared to change lua(hb)tex for portable bytecode for 2022; I don't disagree with that. Whether it will happen for 2023 is tbd.

  2. He suggests having an option to choose whether the Lua source files are read or byte compiling happens. In the context of TL, I can imagine providing such an "option" via, say, lualatex-portable[.fmt] and lualatex-unportable[.fmt], with lualatex a link to one or other. The .ini files would have to arrange to avoid the byte compiling for the portable version. I am not enthused about such a complication, which will trickle down into the config files and tlmgr and more, but it would provide for both sides.

  3. How much slower does lualatex start up if it doesn't do the byte compiling? Plausible to discern?

  4. Alternatively, if we just want to release as is, that's fine with me. I can add something to the release notes. In addition, ideally, you/we could provide instructions for users who need a portable fmt on how to disable the byte compilation. I imagine having an .ini that they can run by hand to make the portable .fmt.

@blefloch
Copy link
Member

blefloch commented Feb 17, 2022 via email

@zauguin
Copy link
Member

zauguin commented Feb 25, 2022

@kberry

2. He suggests having an option to choose whether the Lua source files are read or byte compiling happens.

That's not really the question here. At the moment, LaTeX never byte compiles instead of reading the source files (I thought about adding that though), instead only data created dynamically during the format building process gets preserved for the actual run as bytecode. So there are no files we could read instead. We could probably write the Lua code into TeX macros which then get parsed in \everyjob, but that seems like quite some overhead.

Ignoring the bytecode question for a second, doesn't expl3 also store other system specific data in the format? E.g. what does \c_sys_platform_str do if it's used on Windows but loaded from a format build on Linux? (@josephwright?)

@kberry
Copy link
Author

kberry commented Feb 27, 2022 via email

@stale
Copy link

stale bot commented Apr 29, 2022

This issue has been automatically marked as stale because it has not had recent activity.

@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the stale label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants