Omikhleia / resilient.sile

Advanced book classes and packages for the SILE typesetting system
MIT License
21 stars 4 forks source link

`Invalid color specification at examples/manual-layouts/layouts.sil` when rendering the manual #81

Closed nawordar closed 3 months ago

nawordar commented 3 months ago

I'm trying to package resilient.sile on nixpkgs. To make sure that everything works correctly, I tried rendering the manual, but got the error in the title.

I will link the repository with the Nix flake so it is easier to reproduce, once I publish it.

SILE/Lua version

SILE v0.14.17 (LuaJIT 2.1.1693350652)

Traceback

[21] [22] [23] 
! Invalid color specification at:
    ./packages/resilient/sectioning/init.lua:250: in \internal:open-spread[parity="odd"] after 225: in \supereject
    ./packages/resilient/sectioning/init.lua:84: in \open-on-odd-page
    examples/manual-layouts/layouts.sil:77:1: in \sectioning[style="sectioning-chapter"]
    examples/manual-layouts/layouts.sil:77:1: in \chapter[style="sectioning-chapter"]
    examples/manual-layouts/layouts.sil: in <snippet>:
        [[\begin{document}␤\chapter{Choosing a page layout}␤␤\section{The layout class option}␤␤Paper sizes fo]]
    examples/manual-layouts/layouts.sil: in <snippet>:
        [[\begin{document}␤\chapter{Choosing a page layout}␤␤\section{The layout class option}␤␤Paper sizes fo]]
    examples/sile-resilient-manual.silm:0:0: in \include[["meta:author"]="Didier Willis",["meta:authors"]="Didier Willis",["meta:copyright"]="© 2021–2024, Didier Willis.",["meta:keywords"]="SILE, typesetting, book",["meta:legal"]=[[This material may be distributed only subject to the terms and conditions
set forth in the  Creative Commons Attribution, Share-Alike License,
version 2.0 (http://creativecommons.org/licenses/by-sa/2.0/).
]],["meta:pubdate"]="2024-03-17",["meta:pubdate-day"]="17",["meta:pubdate-month"]="3",["meta:pubdate-year"]="2024",["meta:publisher"]="Omikhleia",["meta:subject"]="User manual for the resilient.sile module",["meta:subtitle"]="User Guide",["meta:title"]="The re·sil·ient collection of classes & packages for SILE",["meta:url"]="https://github.com/Omikhleia/resilient.sile",shift_headings=0,src="manual-layouts/layouts.sil"]
    examples/sile-resilient-manual.silm: in <snippet>:
        [[masterfile: 1.0␤metadata:␤  title: The re·sil·ient collection of classes & packages for SILE␤  sub]]

stack traceback:
    [C]: in function 'error'
    ...99j49wx1q0fwk-sile-0.14.17/share/sile/core/utilities.lua:42: in function 'error'
    ...are/lua/5.1/sile/packages/framebox/graphics/renderer.lua:46: in function 'makeColorHelper'
    ...are/lua/5.1/sile/packages/framebox/graphics/renderer.lua:270: in function 'rectangle'
    ./resilient/layouts/base.lua:137: in function 'buildFrameRect'
    ./resilient/layouts/base.lua:195: in function 'outputYourself'
    ...j49wx1q0fwk-sile-0.14.17/share/sile/core/nodefactory.lua:557: in function 'outputYourself'
    ...350652-env/share/lua/5.1/sile/silex/typesetters/base.lua:953: in function 'outputLinesToPage'
    ...350652-env/share/lua/5.1/sile/silex/typesetters/base.lua:762: in function 'buildPage'
    ...350652-env/share/lua/5.1/sile/silex/typesetters/base.lua:973: in function 'leaveHmode'
    ...
    ...h79qh99j49wx1q0fwk-sile-0.14.17/share/sile/core/sile.lua:385: in function <...h79qh99j49wx1q0fwk-sile-0.14.17/share/sile/core/sile.lua:350>
    ...h79qh99j49wx1q0fwk-sile-0.14.17/share/sile/core/sile.lua:444: in function 'call'
    ...h79qh99j49wx1q0fwk-sile-0.14.17/share/sile/core/sile.lua:279: in function 'process'
    ...h79qh99j49wx1q0fwk-sile-0.14.17/share/sile/core/sile.lua:345: in function 'processString'
    ...h79qh99j49wx1q0fwk-sile-0.14.17/share/sile/core/sile.lua:385: in function 'fun'
    ...p1-luajit-2.1.1693350652-env/share/lua/5.1/pl/tablex.lua:351: in function 'imap'
    ...e/4ms3s9jcizknrmh79qh99j49wx1q0fwk-sile-0.14.17/bin/sile:56: in function <...e/4ms3s9jcizknrmh79qh99j49wx1q0fwk-sile-0.14.17/bin/sile:55>
    [C]: in function 'xpcall'
    ...e/4ms3s9jcizknrmh79qh99j49wx1q0fwk-sile-0.14.17/bin/sile:55: in main chunk
    [C]: at 0x004062d0

error summary:
    Processing at: ./packages/resilient/sectioning/init.lua:250: in \internal:open-spread[parity="odd"] after 225: in \supereject
    Using code at: ...are/lua/5.1/sile/packages/framebox/graphics/renderer.lua:46: 
nawordar commented 3 months ago

Here is the repository with the flake: https://github.com/nawordar/nix-resilient-manual. Installing Nix and running this command should be enough to reproduce:

nix --experimental-features 'nix-command flakes' build github:nawordar/nix-resilient-manual
Omikhleia commented 3 months ago

Greetings,

Which version of resilient.sile are you packaging, and with which dependencies?

The reported error "Invalid color specification" is at line ...are/lua/5.1/sile/packages/framebox/graphics/renderer.lua:46̀̀ in dependency ptable.sile 2.x -- but resilient.sile 2.3 (latest release) requires ptable.sile 3.0 (and the makeColorHelper code indeed changed there)

So there is a strong chance you are experiencing a version mismatch issue.

You can check the rockspec to verify the minimal dependency for each co-dependent module.

It's also in the release notes but you might have to check the dependencies' own dependencies as well too...

Omikhleia commented 3 months ago

That's indeed ptable 2.x used with resilient 3.x -- See my comments in your commit here: https://github.com/nawordar/nixpkgs/commit/81b3a52995f2907cd544e6629e6115ac3d781034

nawordar commented 3 months ago

Thank you, it does look like the problem

Omikhleia commented 3 months ago

For the record, I don't want to refrain anyone buiding their own packaging of my SILE modules for different operating systems. Alerque did it for Arch Linux AUR.

But as I've written there, I don't have the time (or the skills) to help here, let alone become a co-maintainer. So as far as I am concerned, the officially supported installation method is based on luarocks, since this is the package manager recommended by SILE since v0.13.

nawordar commented 3 months ago

You've already helped me a lot. I just thought this was a resilient.sile bug, now I know that it was on my side