Files
PathOfBuilding/Dockerfile
Lars Viklund be184b3076 Fix fallout from SimpleGraphic upgrade with wider Unicode support (#8412)
* fix: enable Unicode separators and caret motions

As the runtime is going to support Unicode installation locations and
build directories, some UTF-8 text is going to reach the Lua side of
the project. This includes the script path, the user path, any paths
yielded from file searches and also imported character names from
accounts.

Care needs to be taken in many places where string operations are
performed as no longer does a byte necessarily correspond to a single
character and anything that truncates, reverses or otherwise slices
strings could need an audit.

This change fixes cursor movement in `EditControl`s with the arrow keys
as those historically used string matching and byte offsets. It also
ensures that the use of arbitrary Unicode codepoints as decimal and
thousands separators works correctly as the previous code used unaware
reversing and slicing.

* fix: turn update paths relative for wide installs

The updater is a fixed piece of older code that uses a Lua runtime that
only handles paths that are representable in the user's text codepage.

As the software may be installed in a location that cannot be expressed
in that way, to mitigate the problem we turn all the paths in the
update op-files into relative paths. That way as long as we never use
exotic codepoints in our own paths it should be able to apply them
cleanly and restart Path of Building afterward with a relative path.

The updater executable can ironically enough not be updated at all with
the related type of runtime hacks we introduced in SimpleGraphic as the
updater deadlocks in updating itself. We have to work around its
shortcomings in how we produce the op-files and possibly the update
application script that runs under that limited runtime.

* fix: convert GIFs masquerading as PNG to PNG

Upon removing support for several file formats like GIF and BLP from the
SimpleGraphic runtime, we noticed that there were some assets that had
incorrect file extensions and loaded only thanks to file format
detection ignoring extensions.

As the actual file format loader for GIF was removed, these stealth GIFs
are now losslessly converted to PNG.

* Add luautf8 to Dockerfile

---------

Co-authored-by: Wires77 <Wires77@users.noreply.github.com>
2025-01-28 19:01:01 -06:00

41 lines
1.7 KiB
Docker

FROM alpine:3.18 AS base
# Common dependencies
RUN apk add --no-cache cmake readline-dev build-base tar
FROM base AS buildbase
# Build dependencies
RUN apk add --no-cache git
WORKDIR /opt
RUN wget https://www.lua.org/ftp/lua-5.1.5.tar.gz && tar -xf lua-5.1.5.tar.gz
RUN cd lua-5.1.5 && make linux && make install
FROM buildbase AS luarocks
RUN wget https://luarocks.org/releases/luarocks-3.7.0.tar.gz && tar xf luarocks-3.7.0.tar.gz
RUN cd luarocks-3.7.0 && ./configure && make
FROM buildbase AS luajit
RUN git clone https://github.com/LuaJIT/LuaJIT && cd LuaJIT && git checkout c7db8255e1eb59f933fac7bc9322f0e4f8ddc6e6
RUN cd LuaJIT && make
FROM buildbase AS emmyluadebugger
RUN git clone --depth 1 --branch 1.7.1 https://github.com/EmmyLua/EmmyLuaDebugger
RUN cd EmmyLuaDebugger && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ../ && make
FROM base
# Luarocks packages dependencies
RUN apk add --no-cache curl unzip openssl
RUN --mount=type=cache,from=buildBase,source=/opt,target=/opt make -C /opt/lua-5.1.5/ install
RUN --mount=type=cache,from=luarocks,source=/opt,target=/opt make -C /opt/luarocks-3.7.0/ install
# Install here to install lua rocks pkgs in pararell with compilation of emmylua and luajit
RUN luarocks install busted 2.2.0-1;\
luarocks install cluacov 0.1.2-1;\
luarocks install luacov-coveralls 0.2.3-1;\
luarocks install luautf8 0.1.6-1
RUN --mount=type=cache,from=emmyluadebugger,source=/opt,target=/opt make -C /opt/EmmyLuaDebugger/build/ install
RUN --mount=type=cache,from=luajit,source=/opt,target=/opt make -C /opt/LuaJIT/ install
CMD [ "echo", "This container is meant to be ran with docker compose. See: https://github.com/PathOfBuildingCommunity/PathOfBuilding/blob/dev/CONTRIBUTING.md" ]