Failed to read …: nesting of [[...]] is deprecated near '[' (ceylon and rst)
I ran into this problem when building Highlight on Alpine Linux:
$ highlight --list-scripts langs
Installed langDefs (located in /usr/share/highlight/langDefs/):
ABAP/4 : abap ( abp )
…
Failed to read '/usr/share/highlight/langDefs/ceylon.lang': /usr/share/highlight/langDefs/ceylon.lang:50: nesting of [[...]] is deprecated near '['
…
Failed to read '/usr/share/highlight/langDefs/rst.lang': /usr/share/highlight/langDefs/rst.lang:35: nesting of [[...]] is deprecated near '['
…
Seems similar to #165 (closed).
This Dockerfile detects the issue by failing to build if it's present:
FROM alpine:3.18.4 as builder
RUN apk add g++
RUN apk add make
RUN apk add lua5.1-dev
RUN apk add boost-dev==1.82.0-r1
WORKDIR /highlight
RUN wget https://gitlab.com/saalen/highlight/-/archive/master/highlight-master.zip --output-document /highlight/highlight.zip
RUN unzip highlight.zip
WORKDIR /highlight/highlight-master
RUN make
RUN make install
RUN ! ( highlight --list-scripts langs | grep 'Failed to read' )
💡 At the time of creating this issue,master
pointed at7cc21508f1a7d4e9df2d9082b5597c8b30242c38
.
Replacing lua5.1-dev
with lua5.4-dev
doesn't work:
Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
Package 'lua', required by 'virtual:world', not found
g++ -Wall -O2 -DNDEBUG -std=c++11 -D_FILE_OFFSET_BITS=64 -c -I ./include/ ./core/xhtmlgenerator.cpp
In file included from ./include/syntaxreader.h:39,
from ./include/codegenerator.h:39,
from ./include/htmlgenerator.h:34,
from ./include/xhtmlgenerator.h:32,
from ./core/xhtmlgenerator.cpp:27:
./include/Diluculum/LuaState.hpp:31:10: fatal error: lua.hpp: No such file or directory
31 | #include <lua.hpp>
| ^~~~~~~~~
compilation terminated.
Edited by Simon Alling