Skip to content

Commit e7ead76

Browse files
committed
Ruby: Build extractor via cargo-cross on linux
1 parent 907fbea commit e7ead76

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/ruby-build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
run: |
4949
brew install gnu-tar
5050
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
51+
- name: Install cargo-cross
52+
if: runner.os == 'Linux'
53+
run: cargo install cross --version 0.2.1
5154
- uses: ./.github/actions/os-version
5255
id: os_version
5356
- name: Cache entire extractor
@@ -80,7 +83,15 @@ jobs:
8083
run: cd extractor && cargo test --verbose
8184
- name: Release build
8285
if: steps.cache-extractor.outputs.cache-hit != 'true'
83-
run: cd extractor && cargo build --release
86+
# On linux, build the extractor via cross in a centos7 container.
87+
# This ensures we don't depend on glibc > 2.17.
88+
run: |
89+
if [[ "$RUNNER_OS" == "Linux" ]]; then
90+
CARGO=cross
91+
else
92+
CARGO=cargo
93+
fi
94+
cd extractor && "$CARGO" build --release
8495
- name: Generate dbscheme
8596
if: ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}}
8697
run: extractor/target/release/generator --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll

0 commit comments

Comments
 (0)