Skip to content

Commit

Permalink
cmake: rewrite grammar generation
Browse files Browse the repository at this point in the history
The script to generate our grammar files is now written in CMake's
scripting language, and as such is cross-platform. Additionally, the
script is run as part of the build. We commit a copy of the Cypher.g4
file so that Java is not a build dependency of Kuzu: specifically, if
the grammar has not changed, the generation command will do nothing.

Additionally, a sanity check that the generated files are up to date has
been added to CI.
  • Loading branch information
Riolku committed Dec 4, 2023
1 parent 7e3890b commit 97b78f8
Show file tree
Hide file tree
Showing 5 changed files with 928 additions and 47 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:
jobs:
gcc-build-test:
name: gcc build & test
needs: [clang-formatting-check, include-guard-and-no-std-assert]
needs: [clang-formatting-check, sanity-checks]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:

clang-build-test:
name: clang build and test
needs: [clang-formatting-check, include-guard-and-no-std-assert]
needs: [clang-formatting-check, sanity-checks]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:

msvc-build-test:
name: msvc build & test
needs: [clang-formatting-check, include-guard-and-no-std-assert]
needs: [clang-formatting-check, sanity-checks]
runs-on: self-hosted-windows
env:
# Shorten build path as much as possible
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
tidy-and-diagnostics:
name: clang tidy & clangd diagnostics check
needs: [clang-formatting-check, include-guard-and-no-std-assert]
needs: [clang-formatting-check, sanity-checks]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
Expand All @@ -251,8 +251,8 @@ jobs:
- name: Run clang-tidy analyzer
run: make tidy-analyzer

include-guard-and-no-std-assert:
name: include guard & no std::assert check
sanity-checks:
name: sanity checks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand All @@ -263,6 +263,9 @@ jobs:
- name: Checks files for std::assert
run: ./scripts/check-no-std-assert.sh src

- name: Ensure generated grammar files are up to date
run: cmp src/antlr4/Cypher.g4 scripts/antlr4/Cypher.g4.copy

clang-formatting-check:
name: clang-format check
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -311,7 +314,7 @@ jobs:

macos-clang-tidy:
name: macos clang tidy & clangd diagnostics check
needs: [clang-formatting-check, include-guard-and-no-std-assert]
needs: [clang-formatting-check, sanity-checks]
runs-on: self-hosted-mac-x64
env:
NUM_THREADS: 32
Expand All @@ -336,7 +339,7 @@ jobs:

macos-build-test:
name: apple clang build & test
needs: [clang-formatting-check, include-guard-and-no-std-assert, rustfmt-check]
needs: [clang-formatting-check, sanity-checks, rustfmt-check]
runs-on: self-hosted-mac-x64
env:
NUM_THREADS: 32
Expand Down
Loading

0 comments on commit 97b78f8

Please sign in to comment.