latex3 / l3build

A testing and building system for LaTeX
LaTeX Project Public License v1.3c
90 stars 17 forks source link

recordstatus gives different values for errors on windows and github #383

Open u-fischer opened 2 months ago

u-fischer commented 2 months ago

I'm trying to use recordstatus in various testsuites (to get better warnings about unrelated errors from deprecation and similar). It works fine for tests with status 0 (no error), but fails for non-zero status. E.g. if I save a simple test with a \show\START on windows and then test that on github I get the following diff:

*** 9,15 ****
  l. ...\show\START
  (test-errorstatus.aux)
  ***************
! Compilation 1 of test file completed with exit status 1
! Compilation 2 of test file completed with exit status 1
--- 9,15 ----
  l. ...\show\START
  (test-errorstatus.aux)
  ***************
! Compilation 1 of test file completed with exit status 256
! Compilation 2 of test file completed with exit status 256

Could l3build please normalize that message to something like with non-zero exit status?

josephwright commented 2 months ago

I guess we should perhaps coerce status 256 to be the same as 1 - that's where the issue really lies. I'm wary of doing more - what if 1 vs 2 vs ... is important?

zauguin commented 2 months ago

256 should not be a special case but we should use (0xFF00 & ret) >> 8 instead of the direct return code on Linux. The same or something similar is likely needed on Mac. The underlying issue is that LuaTeX fails to run the code through WERRORCODE, so we get it shifted.

josephwright commented 2 months ago

@zauguin OK, I'll assign this one to you :)

u-fischer commented 1 month ago

@zauguin can we sort that?