Skip to content

Commit

Permalink
chore(build): Build Lua C modules with position independent code flag
Browse files Browse the repository at this point in the history
Backtraking, but yes we need these flags and we need the ability to
tweak them on a per-lua basis too. Yuck but...
  • Loading branch information
alerque committed Nov 1, 2023
1 parent e651d01 commit 49ef9d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/test.yml
Expand Up @@ -13,14 +13,14 @@ jobs:
fail-fast: false
matrix:
luaVersion:
- '5.4'
- '5.3'
- '5.2'
- '5.1'
- 'luajit'
# - 'luajit-openresty'
- [ '5.4', 'MYCFLAGS=-fPIC' ]
- [ '5.3', 'MYCFLAGS=-fPIC' ]
- [ '5.2', 'MYCFLAGS=-fPIC' ]
- [ '5.1', 'CFLAGS="-O2 -Wall -DLUA_USE_LINUX -fPIC"' ]
- [ 'luajit', 'XCFLAGS=-fPIC' ]
# - [ 'luajit-openresty', 'XCFLAGS=-fPIC' ]
runs-on: ubuntu-22.04
name: Test on Lua ${{ matrix.luaVersion }}
name: Test on Lua ${{ matrix.luaVersion[0] }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -38,7 +38,7 @@ jobs:
with:
path: |
lua_modules
key: luarocks-${{ matrix.luaVersion }}-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
key: luarocks-${{ matrix.luaVersion[0] }}-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install system dependencies
Expand All @@ -48,7 +48,8 @@ jobs:
- name: Setup ‘lua’
uses: leafo/gh-actions-lua@v10
with:
luaVersion: ${{ matrix.luaVersion }}
luaVersion: ${{ matrix.luaVersion[0] }}
luaCompileFlags: ${{ matrix.luaVersion[1] }}
- name: Setup ‘cargo’
uses: actions-rs/toolchain@v1
- name: Setup ‘luarocks’
Expand All @@ -71,7 +72,7 @@ jobs:
./configure \
--enable-developer LUACHECK=false NIX=false \
--disable-font-variations \
--with${{ !startsWith(matrix.luaVersion, 'luajit') && 'out' || '' }}-luajit \
--with${{ !startsWith(matrix.luaVersion[0], 'luajit') && 'out' || '' }}-luajit \
--without-manual
- name: Make
run: |
Expand All @@ -80,7 +81,7 @@ jobs:
run: |
make selfcheck
- name: Test Busted
continue-on-error: ${{ matrix.luaVersion == '5.1' }}
continue-on-error: ${{ matrix.luaVersion[0] == '5.1' }}
timeout-minutes: ${{ runner.debug && 20 || 2 }}
run: |
make busted
Expand All @@ -95,5 +96,5 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: test-${{ matrix.luaVersion }}-actuals
name: test-${{ matrix.luaVersion[0] }}-actuals
path: tests/*.actual
2 changes: 1 addition & 1 deletion justenough/Makefile.am
Expand Up @@ -14,7 +14,7 @@ else
LIBTEXPDF_LIB=../libtexpdf/libtexpdf.la
endif

AM_CFLAGS = $(WARNING_CFLAGS) -I../libtexpdf
AM_CFLAGS = $(WARNING_CFLAGS) -I../libtexpdf -fPIC
AM_LDFLAGS = -module -avoid-version $(UNDEFINED)

pkglib_LTLIBRARIES = justenoughharfbuzz.la
Expand Down

0 comments on commit 49ef9d7

Please sign in to comment.