Skip to content

Commit

Permalink
Merge aa7eda6 into 1392f74
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jul 11, 2023
2 parents 1392f74 + aa7eda6 commit 37cca4b
Show file tree
Hide file tree
Showing 24 changed files with 1,614 additions and 48 deletions.
23 changes: 23 additions & 0 deletions .cargo/config.toml
@@ -0,0 +1,23 @@
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-args=-rdynamic"]

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-rdynamic"]

# Since autotools sets this and we are *not* forcing it here, this will not
# affect release builds. It will affect `cargo run` and make it easier to test
# locally since the Lua loader path will be relative to the current sources.
# For debug builds it is assumed you configured `--without-system-luarocks`,
# this convenience won't enable you to use system packages in debug builds.
[env]
SILE_PATH = { value = "", relative = true }

[target.'cfg(all())']
rustflags = [
# CLIPPY LINT SETTINGS
# This is a workaround to configure lints for the entire workspace, pending the ability to configure this via TOML.
# See: `https://github.com/rust-lang/cargo/issues/5034`
# `https://github.com/EmbarkStudios/rust-ecosystem/issues/22#issuecomment-947011395`
"-Aclippy::clone_double_ref",
"-Aclippy::ptr_arg",
]
10 changes: 4 additions & 6 deletions .cirrus.yml
Expand Up @@ -2,7 +2,7 @@ task:
name: Cirrus CI (FreeBSD)
freebsd_instance:
matrix:
- image_family: freebsd-13-0
- image_family: freebsd-13-2
- image_family: freebsd-12-3
env:
MAKEFLAGS: -j$(nproc) -Otarget
Expand All @@ -23,10 +23,8 @@ task:
folder: /usr/local/lib/lua
fingerprint_script: cat sile.rockspec.in
dependencies_script:
- pkg install -y autoconf automake fontconfig GentiumPlus git gmake harfbuzz libtool pkgconf png
- pkg install -y lua54 lua54-lpeg lua54-luafilesystem lua54-luarocks lua54-luasec lua54-luasocket
# lua54-luaexpat exists but seems boken on 13.0, system doesn't have expat 2.4+ so 1.5.x isn't an option either
- luarocks54 install luaexpat 1.4.1
- pkg install -y autoconf automake fontconfig GentiumPlus git gmake harfbuzz jq libtool pkgconf png rust
- pkg install -y lua54 lua54-luaexpat lua54-lpeg lua54-luafilesystem lua54-luarocks lua54-luasec lua54-luasocket
- luarocks54 install cassowary
- luarocks54 install cldr
- luarocks54 install compat53
Expand All @@ -46,7 +44,7 @@ task:
- ./bootstrap.sh
configure_script: |
./configure MAKE=gmake \
--enable-developer LUAROCKS=false LUACHECK=false BUSTED=false NIX=false \
--enable-developer LUAROCKS=false LUACHECK=false BUSTED=false PDFINFO=false NIX=false \
--disable-font-variations \
--with-system-luarocks \
--without-manual
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -31,11 +31,12 @@ jobs:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install fonts-sil-gentiumplus libarchive-tools libfontconfig1-dev libharfbuzz-dev libicu-dev liblua5.3-dev libpng-dev lua5.3 lua-sec lua-socket lua-zlib-dev luarocks poppler-utils
sudo apt-get install cargo fonts-sil-gentiumplus jq libarchive-tools libfontconfig1-dev libharfbuzz-dev libicu-dev libluajit-5.1-dev libpng-dev luajit lua-sec lua-socket lua-zlib-dev luarocks poppler-utils
- name: Configure
run: |
./bootstrap.sh
./configure \
./configure PDFINFO=false \
--with-luajit \
--disable-font-variations \
--without-system-luarocks \
--with-manual
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/rust_lint.yml
@@ -0,0 +1,42 @@
name: Rust Lint

on: [ push, pull_request ]

jobs:

rustfmt:
strategy:
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Run rustfmt
run: |
git ls-files '*.rs' | xargs rustfmt --check
clippy:
strategy:
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- uses: actions-rs/clippy-check@v1
with:
token: ${{ github.token }}
args: -- -D warnings
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -39,11 +39,15 @@ jobs:
path: |
lua_modules
key: luarocks-${{ matrix.luaVersion[0] }}-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Setup ‘lua’
uses: leafo/gh-actions-lua@v10
with:
luaVersion: ${{ matrix.luaVersion[0] }}
luaCompileFlags: ${{ matrix.luaVersion[1] }}
- name: Setup ‘cargo’
uses: actions-rs/toolchain@v1
- name: Setup ‘luarocks’
uses: leafo/gh-actions-luarocks@v4
- name: Prep system Lua for use
Expand All @@ -65,7 +69,7 @@ jobs:
- name: Configure
run: |
./bootstrap.sh
./configure \
./configure PDFINFO=false \
--enable-developer LUACHECK=false NIX=false \
--disable-font-variations \
--without-system-luarocks \
Expand All @@ -82,6 +86,10 @@ jobs:
timeout-minutes: ${{ runner.debug && 60 || 6 }}
run: |
make regressions
- name: Test Cargo
timeout-minutes: ${{ runner.debug && 60 || 6 }}
run: |
make cargo-test
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
16 changes: 10 additions & 6 deletions .gitignore
Expand Up @@ -79,16 +79,20 @@ gource.webm
*.rockspec
.fonts/*
.sources/*
/sile
sile
sile.1
/.version
/.version-prev
/.tarball-version
/.built-subdirs
sile-lua
sile-lua.1
.version
.version-prev
.tarball-version
.built-subdirs
*.so
core/version.lua
core/features.lua
target/
completions/
core/pathsetup.lua

# Nix symlink to builds
/result
result/
2 changes: 1 addition & 1 deletion .luacheckrc
Expand Up @@ -26,8 +26,8 @@ globals = {
"luautf8",
"pl",
"fluent",
"extendSilePath",
"executablePath",
"extendSilePath",
"SYSTEM_SILE_PATH",
"SHARED_LIB_EXT"
}
Expand Down
2 changes: 1 addition & 1 deletion .luarc.json
Expand Up @@ -7,8 +7,8 @@
"luautf8",
"pl",
"fluent",
"extendSilePath",
"executablePath",
"extendSilePath",
"SYSTEM_SILE_PATH",
"SHARED_LIB_EXT"
],
Expand Down

0 comments on commit 37cca4b

Please sign in to comment.