Skip to content
Merged
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
26 changes: 26 additions & 0 deletions .github/workflows/build-linux.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,9 @@ jobs:
env:
VCPKG_DEFAULT_TRIPLET: x64-linux
VERSION_SUFFIX: ${{ matrix.version_suffix }}
# Re-use compiled vcpkg packages between runs; otherwise every run
# rebuilds ICU from source (measured: 4m11s on Linux, 10m04s on Windows).
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg-bincache,readwrite"

steps:
- name: Checkout Repository
Expand DownExpand Up@@ -97,6 +100,29 @@ jobs:
shell: bash
working-directory: vcpkg

# The submodule commit pins the ports, so it decides what the built
# packages are; vcpkg.json decides which ones. Key on both. vcpkg checks
# each package's ABI hash itself, so a partial restore-keys hit is safe:
# anything that does not match is simply rebuilt.
- name: Resolve vcpkg commit for cache key
id: vcpkgkey
shell: bash
run: echo "sha=$(git -C vcpkg rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Cache vcpkg binary packages
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg-bincache
key: vcpkg-${{ runner.os }}-${{ matrix.id }}-${{ steps.vcpkgkey.outputs.sha }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ matrix.id }}-${{ steps.vcpkgkey.outputs.sha }}-
vcpkg-${{ runner.os }}-${{ matrix.id }}-

# vcpkg errors out if the binary-cache directory does not exist yet.
- name: Create vcpkg binary cache dir
shell: bash
run: mkdir -p "${{ github.workspace }}/vcpkg-bincache"

- name: Install 3rd Party (Non-20.04)
if: matrix.id != 'docker-ubuntu-20.04'
# Same latent mismatch as the Windows job: use the vcpkg the
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/build-macos.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,6 +14,9 @@ jobs:
name: Build NLP-ENGINE
runs-on: macOS-latest
env:
# Re-use compiled vcpkg packages between runs; otherwise every run
# rebuilds ICU from source (measured: 4m11s on Linux, 10m04s on Windows).
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg-bincache,readwrite"
VCPKG_DEFAULT_TRIPLET: arm64-osx

steps:
Expand All@@ -36,6 +39,29 @@ jobs:
- name: Install Brew
run: brew install automake

# The submodule commit pins the ports, so it decides what the built
# packages are; vcpkg.json decides which ones. Key on both. vcpkg checks
# each package's ABI hash itself, so a partial restore-keys hit is safe:
# anything that does not match is simply rebuilt.
- name: Resolve vcpkg commit for cache key
id: vcpkgkey
shell: bash
run: echo "sha=$(git -C vcpkg rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Cache vcpkg binary packages
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg-bincache
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ steps.vcpkgkey.outputs.sha }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ steps.vcpkgkey.outputs.sha }}-
vcpkg-${{ runner.os }}-${{ runner.arch }}-

# vcpkg errors out if the binary-cache directory does not exist yet.
- name: Create vcpkg binary cache dir
shell: bash
run: mkdir -p "${{ github.workspace }}/vcpkg-bincache"

- name: Install 3rd Party
run: ./vcpkg install
working-directory: vcpkg
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/build-windows.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,11 @@ jobs:
# that root with this repo. (Not the bug fixed below -- the steps were
# running C:\vcpkg's SCRIPTS, not merely honoring its root.)
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
# Re-use compiled vcpkg packages between runs. Without this, every run
# rebuilds ICU from source: measured at 10m04s of a 15m43s job, which was
# about two thirds of CI. "clear;" drops the default sources so only our
# cache dir is consulted.
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg-bincache,readwrite"

steps:
- uses: actions/checkout@v4
Expand All@@ -44,6 +49,29 @@ jobs:
run: .\bootstrap-vcpkg.bat
working-directory: vcpkg

# The submodule commit pins the ports, so it decides what the built
# packages are; vcpkg.json decides which ones. Key on both. vcpkg checks
# each package's ABI hash itself, so a partial restore-keys hit is safe:
# anything that does not match is simply rebuilt.
- name: Resolve vcpkg commit for cache key
id: vcpkgkey
shell: bash
run: echo "sha=$(git -C vcpkg rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Cache vcpkg binary packages
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg-bincache
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ steps.vcpkgkey.outputs.sha }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ steps.vcpkgkey.outputs.sha }}-
vcpkg-${{ runner.os }}-${{ runner.arch }}-

# vcpkg errors out if the binary-cache directory does not exist yet.
- name: Create vcpkg binary cache dir
shell: bash
run: mkdir -p "${{ github.workspace }}/vcpkg-bincache"

- name: Install 3rd Party
# Invoke the vcpkg the step above just bootstrapped, NOT whatever
# "vcpkg" resolves to on PATH. The windows-latest runner ships a
Expand All@@ -57,10 +85,6 @@ jobs:
run: .\vcpkg.exe install
working-directory: vcpkg

- name: List $RUNNER_WORKSPACE before build
shell: pwsh
run: Get-ChildItem -Path $env:RUNNER_WORKSPACE -Recurse -Force | Select-Object FullName

- name: Make build directory
run: mkdir build

Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,13 @@ find_library(DL_LIBRARY dl) # Ensure dl library is found
set(CMAKE_GENERATOR_PLATFORM Win32 HINT)

if(MSVC)
# Compile the sources within each target in parallel. `cmake --build
# --parallel N` with the Visual Studio generator becomes msbuild /m:N,
# which parallelises PROJECTS -- so lite's 101 sources (Arun.cpp alone is
# ~14k lines) compiled one after another no matter what --parallel said.
# Measured on a clean Win32 Release build with --parallel 4:
# 189s without, 49s with /MP4 (modelling a 4-core CI runner).
add_compile_options(/MP)
add_compile_options(/w44005 /w44244 /w44311 /w44211 /w44302 /w44267 /w44312 /w45033 /w44624 /w44996 /w44273)
add_definitions(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
add_definitions(-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS)
Expand Down
Loading