Skip to content

Commit c1617a2

Browse files
authored
ci: pin Build/Regression runner to ubuntu-24.04 and guard Bison version for GLR grammar (#2445)
* ci: pin runner to ubuntu-24.04 + guard Bison version for GLR grammar The Cypher GLR grammar pins exact shift/reduce and reduce/reduce conflict counts via %expect / %expect-rr in cypher_gram.y, and Bison treats %expect as exact-match: a different Bison version can report different counts and break the build. ubuntu-latest floats to new Ubuntu releases (and new Bison versions), which would silently shift those counts. Pin runs-on to ubuntu-24.04 to freeze Bison at 3.8.x, and add a guard step that fails loudly with a pointer to cypher_gram.y if Bison ever drifts off 3.8.x. Reproducibility comes from pinning the variable rather than widening the conflict-count tolerance, keeping the exact-match alarm for genuinely new grammar conflicts intact. * ci: make Bison version parse robust (awk + explicit empty guard) Address Copilot review on #2445: the previous grep-based parse could silently yield an empty version and fail with a confusing 'Bison != 3.8.x' message. Parse the version field with awk and error explicitly when it can't be determined.
1 parent 09fce2c commit c1617a2

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/installcheck.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-latest
12+
# Pinned (not ubuntu-latest) so the Bison version stays fixed at 3.8.x.
13+
# The Cypher GLR grammar pins exact conflict counts via %expect / %expect-rr
14+
# in src/backend/parser/cypher_gram.y, and Bison treats %expect as exact-match:
15+
# a different Bison version can report different counts and break the build.
16+
# Freezing the runner image freezes Bison; bump both together, intentionally.
17+
runs-on: ubuntu-24.04
1318

1419
steps:
1520
- name: Get latest commit id of PostgreSQL 18
@@ -28,6 +33,27 @@ jobs:
2833
sudo apt-get update
2934
sudo apt-get install -y build-essential libreadline-dev zlib1g-dev flex bison
3035
36+
- name: Verify Bison version (grammar conflict counts are pinned)
37+
run: |
38+
ver=$(bison --version | awk 'NR==1 {print $NF}')
39+
if [ -z "$ver" ]; then
40+
echo "::error::Could not determine Bison version from 'bison --version'."
41+
echo "::error::Expected the first line to end with a version (e.g. '... 3.8.2')."
42+
exit 1
43+
fi
44+
echo "bison $ver"
45+
case "$ver" in
46+
3.8.*) ;;
47+
*)
48+
echo "::error::Bison $ver != 3.8.x. The Cypher GLR grammar pins exact"
49+
echo "::error::%expect / %expect-rr conflict counts in src/backend/parser/cypher_gram.y."
50+
echo "::error::A new Bison version may report different counts. Re-run bison locally,"
51+
echo "::error::update the %expect/%expect-rr numbers (and the comment block), then bump"
52+
echo "::error::the pinned runner image and this guard together."
53+
exit 1
54+
;;
55+
esac
56+
3157
- name: Install PostgreSQL 18 and some extensions
3258
if: steps.pg18cache.outputs.cache-hit != 'true'
3359
run: |

0 commit comments

Comments
 (0)