Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- hylo
- iwyu
- lc3
- lua
- misc
- nasm
- ncc-ng
Expand Down
16 changes: 16 additions & 0 deletions Dockerfile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt update -y -q && apt upgrade -y -q && apt update -y -q && \
apt install -y -q \
build-essential \
curl \
xz-utils \
&& \
rm -rf /var/lib/apt/lists/*

RUN mkdir -p /root
COPY lua /root/
COPY common.sh /root/

WORKDIR /root
37 changes: 37 additions & 0 deletions lua/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

set -ex
source common.sh

VERSION=$1

URL=https://www.lua.org/ftp/lua-${VERSION}.tar.gz

FULLNAME=lua-${VERSION}
OUTPUT=$2/${FULLNAME}.tar.xz

REVISION="lua-${VERSION}"
LAST_REVISION="${3:-}"

initialise "${REVISION}" "${OUTPUT}" "${LAST_REVISION}"

STAGING_DIR=/opt/compiler-explorer/${FULLNAME}
rm -rf "${STAGING_DIR}"
mkdir -p "${STAGING_DIR}"

BUILD_DIR=$(pwd)/build
rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
curl -sL "${URL}" | tar zxf - --strip-components 1

# posix is supported by every released Lua version and avoids the readline
# dependency of the linux target; lua/luac are still fully functional.
make -j"$(nproc)" posix
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure this doesn't need a --prefix or something? where does the make install copy its files to?

make INSTALL_TOP="${STAGING_DIR}" install

# Sanity-check the built binaries.
"${STAGING_DIR}/bin/lua" -v
"${STAGING_DIR}/bin/luac" -v

complete "${STAGING_DIR}" "${FULLNAME}" "${OUTPUT}"