Skip to content

Commit

Permalink
Merge a493c26 into b5ce8e6
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Feb 1, 2024
2 parents b5ce8e6 + a493c26 commit 9a29052
Show file tree
Hide file tree
Showing 309 changed files with 8,807 additions and 6,116 deletions.
23 changes: 23 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -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 these and we are *not* forcing them here, this will not
# affect release builds. It will affect `cargo run`, `cargo clippy` and others
# making it easier to test locally since the Lua loader path and other
# resources will be relative to the current sources.
[env]
SILE_PATH = { value = "", relative = true }
CONFIGURE_DATADIR = { 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`
"-Asuspicious_double_ref_op",
"-Aclippy::ptr_arg",
]
33 changes: 16 additions & 17 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,28 @@ 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-luaexpat lua54-lpeg lua54-luafilesystem lua54-luarocks lua54-luasec lua54-luasocket
- luarocks54 install cassowary
- luarocks54 install cldr
- luarocks54 install compat53
- luarocks54 install cosmo
- luarocks54 install fluent
- luarocks54 install linenoise
- luarocks54 install loadkit
- luarocks54 install lua-zlib
- luarocks54 install lua_cliargs
- luarocks54 install luaepnf
- luarocks54 install luarepl
- luarocks54 install luautf8
- luarocks54 install penlight
- luarocks54 install vstruct
- pkg install -y autoconf automake fontconfig GentiumPlus git gmake harfbuzz jq libtool pkgconf png rust
- pkg install -y luajit lua51-luaexpat lua51-lpeg lua51-luafilesystem lua51-luarocks lua51-luasec lua51-luasocket lua51-lzlib
- luarocks51 install cassowary
- luarocks51 install cldr
- luarocks51 install compat53
- luarocks51 install fluent
- luarocks51 install linenoise
- luarocks51 install loadkit
- luarocks51 install lua_cliargs
- luarocks51 install luaepnf
- luarocks51 install luarepl
- luarocks51 install luautf8
- luarocks51 install penlight
- luarocks51 install vstruct
bootstrap_script:
- git fetch --prune --tags ||:
- ./bootstrap.sh
configure_script: |
./configure MAKE=gmake \
--enable-developer LUAROCKS=false LUACHECK=false BUSTED=false PDFINFO=false NIX=false \
--enable-developer LUAROCKS=false LUACHECK=false BUSTED=false DELTA=cat PDFINFO=false NIX=false NPM=false DOCKER=false \
--disable-font-variations \
--with-system-lua-sources \
--with-system-luarocks \
--without-manual
make_script:
Expand Down
21 changes: 17 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,28 @@ insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[{Makefile*,*.mk,*.mk.in}]
indent_style = tab
indent_size = 4

[*.m4]
indent_style = space
indent_size = 8

[*.md]
trim_trailing_whitespace = false

[{*.lua,*.lua.in,sile.in,*rockspec,.busted,.luacheckrc}]
indent_style = space
indent_size = 2
indent_size = 3
max_line_length = 120

[*rockspec]
max_line_length = 190

[*.pl]
indent_style = space
indent_size = 4
indent_size = 2

[makefile*]
indent_style = tab
[*.rs]
indent_size = 4
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
41 changes: 33 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ concurrency:
jobs:

build-ubuntu:
strategy:
matrix:
configuration:
- [ 'dynamic', '' ]
- [ 'system', '--with-system-lua-sources' ]
- [ 'embeded', '--enable-embeded-resources' ]
- [ 'static', '--enable-embeded-resources --disable-shared --enable-static' ]
runs-on: ubuntu-22.04
name: Build Ubuntu ${{ matrix.configuration[0] }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -28,43 +36,60 @@ jobs:
path: |
lua_modules
key: luarocks-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install fonts-sil-gentiumplus ghostscript graphviz 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 fonts-sil-gentiumplus ghostscript graphviz 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: Setup ‘cargo’
uses: actions-rs/toolchain@v1
- name: Configure
run: |
./bootstrap.sh
./configure \
--disable-font-variations \
--without-system-luarocks \
--with-manual
--with-manual \
${{ matrix.configuration[1] }}
echo "VERSION=$(./build-aux/git-version-gen .tarball-version)" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc) -Otarget" >> $GITHUB_ENV
echo "CARCH=$(uname -m)" >> $GITHUB_ENV
- name: Make
run: |
make
- name: Package
run: |
make dist
- name: Upload artifacts
if: ${{ !contains(github.ref, 'refs/tags/v') }}
- name: Upload source dist artifact
if: ${{ matrix.configuration[0] == 'dynamic' && !contains(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
with:
name: sile-${{ env.VERSION }}
path: sile-${{ env.VERSION }}.zip
- name: Append architecture to static binary
if: ${{ matrix.configuration[0] == 'static' }}
run: |
cp sile sile-${{ env.CARCH }}
- name: Upload static binary artifact
if: ${{ matrix.configuration[0] == 'static' && !contains(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
with:
name: sile-${{ env.CARCH }}
path: sile-${{ env.CARCH }}
- name: Release
uses: softprops/action-gh-release@v1
if: github.repository == 'sile-typesetter/sile' && startsWith(github.ref, 'refs/tags/v')
if: matrix.configuration[0] == 'static' && github.repository == 'sile-typesetter/sile' && startsWith(github.ref, 'refs/tags/v')
with:
body_path: sile-${{ env.VERSION }}.md
files: |
sile-${{ env.VERSION }}.pdf
sile-${{ env.VERSION }}.zip
sile-${{ env.VERSION }}.tar.xz
sile-${{ env.CARCH }}
build-nix:
runs-on: ubuntu-22.04
name: Build Nix
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -86,6 +111,6 @@ jobs:
nix develop --command ./bootstrap.sh
nix develop --configure
nix develop --command make
- name: Run HB6+ only regressions
- name: Run regression tests for which Ubuntu can't provide deps
run: |
nix develop --command make regressions TESTSRCS=tests/variations-axis.sil
nix develop --command make regressions TESTSRCS='tests/variations-axis.sil tests/feat-unicode-softhyphen.sil'
4 changes: 1 addition & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ jobs:
run: |
./bootstrap.sh
./configure \
--enable-developer LUACHECK=false NIX=false \
--enable-developer LUACHECK=false NIX=false DELTA=cat \
--disable-font-variations \
--without-system-luarocks \
--with-luajit \
--without-manual
- name: Make
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- develop
- rel*
tags:
- latest
Expand All @@ -24,7 +25,7 @@ jobs:
run: |
echo "REF=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV
./bootstrap.sh
./configure --disable-dependency-checks --enable-developer
./configure --disable-dependency-checks --enable-developer DOCKER=docker
- name: Publish Docker Image to GH Container Registry
run: |
make docker-build-push
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/rust_lint.yml
Original file line number Diff line number Diff line change
@@ -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@v4
- 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' '*.rs.in' | xargs rustfmt --check --config skip_children=true
clippy:
strategy:
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- 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: --features luajit,vendored -- -D warnings
13 changes: 11 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
path: |
lua_modules
key: luarocks-${{ matrix.luaVersion[0] }}-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt-get update
Expand All @@ -48,6 +50,8 @@ jobs:
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 @@ -66,10 +70,11 @@ jobs:
run: |
./bootstrap.sh
./configure \
--enable-developer LUACHECK=false NIX=false \
${{ matrix.luaVersion[1] }} \
--enable-developer LUACHECK=false NIX=false DELTA=cat \
--disable-font-variations \
--without-system-luarocks \
--with${{ !startsWith(matrix.luaVersion[0], 'luajit') && 'out' || '' }}-luajit \
--without-system-luarocks \
--without-manual
- name: Make
run: |
Expand All @@ -86,6 +91,10 @@ jobs:
timeout-minutes: ${{ runner.debug && 20 || 2 }}
run: |
make regressions
- name: Test Cargo
timeout-minutes: ${{ runner.debug && 20 || 2 }}
run: |
make cargo-test
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
24 changes: 17 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ build-aux/ltversion.m4
build-aux/lt~obsolete.m4
build-aux/missing
build-aux/list-dist-files.sh
build-aux/rust_boilerplate.mk
tests/regressions.pl

# Other autojunk
Expand Down Expand Up @@ -65,7 +66,6 @@ node_modules
lua_modules
lua_modules_dist
package-lock.json
yarn.lock

# Editor entrails
.vscode/
Expand All @@ -79,16 +79,26 @@ 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
*.o
core/version.lua
core/features.lua
target/
completions/
core/pathsetup.lua
src/embed.rs
src/embed-includes.rs

# Nix symlink to builds
/result
result
result-man
result-doc
result-dev
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

6 changes: 3 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit $1
npx --no -- commitlint --edit "$1"
2 changes: 0 additions & 2 deletions .husky/pre-commit

This file was deleted.

4 changes: 1 addition & 3 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ globals = {
"luautf8",
"pl",
"fluent",
"extendSilePath",
"executablePath",
"SYSTEM_SILE_PATH",
"SHARED_LIB_EXT"
"extendSilePath"
}
max_line_length = false
ignore = {
Expand Down
4 changes: 1 addition & 3 deletions .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"luautf8",
"pl",
"fluent",
"extendSilePath",
"executablePath",
"SYSTEM_SILE_PATH",
"SHARED_LIB_EXT"
"extendSilePath"
],
"Lua.workspace.preloadFileSize": 5120,
"Lua.workspace.checkThirdParty": false
Expand Down
Loading

0 comments on commit 9a29052

Please sign in to comment.