Skip to content

Commit cd9927c

Browse files
committed
Ruby: Update create-extractor-pack
1 parent 0e5dcdd commit cd9927c

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

ruby/actions/create-extractor-pack/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
uses: actions/cache@v3
1111
with:
1212
path: ruby/extractor-pack
13-
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-extractor-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/scripts/create-extractor-pack.sh', 'ruby/**/Cargo.lock', 'ruby/actions/create-extractor-pack/action.yml') }}-${{ hashFiles('ruby/**/*.rs') }}-${{ hashFiles('ruby/codeql-extractor.yml', 'ruby/downgrades', 'ruby/tools', 'ruby/ql/lib/ruby.dbscheme', 'ruby/ql/lib/ruby.dbscheme.stats') }}
13+
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-extractor-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/scripts/create-extractor-pack.sh', 'ruby/extractor/**/Cargo.lock', 'ruby/actions/create-extractor-pack/action.yml') }}-${{ hashFiles('ruby/extractor/**/*.rs') }}-${{ hashFiles('ruby/codeql-extractor.yml', 'ruby/downgrades', 'ruby/tools', 'ruby/ql/lib/ruby.dbscheme', 'ruby/ql/lib/ruby.dbscheme.stats') }}
1414
- name: Cache cargo
1515
uses: actions/cache@v3
1616
if: steps.cache-extractor.outputs.cache-hit != 'true'
@@ -19,7 +19,7 @@ runs:
1919
~/.cargo/registry
2020
~/.cargo/git
2121
ruby/target
22-
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-qltest-cargo-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/scripts/create-extractor-pack.sh', 'ruby/**/Cargo.lock') }}
22+
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-qltest-cargo-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/scripts/create-extractor-pack.sh', 'ruby/extractor/**/Cargo.lock') }}
2323
- name: Build Extractor
2424
if: steps.cache-extractor.outputs.cache-hit != 'true'
2525
shell: bash
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
cd extractor
12
cargo build --release
3+
cargo run --release --bin generator -- --dbscheme ../ql/lib/ruby.dbscheme --library ../ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
4+
cd ..
25

3-
cargo run --release -p ruby-generator -- --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
46
codeql query format -i ql\lib\codeql/ruby\ast\internal\TreeSitter.qll
57

68
rm -Recurse -Force extractor-pack
@@ -9,5 +11,5 @@ cp codeql-extractor.yml, ql\lib\ruby.dbscheme, ql\lib\ruby.dbscheme.stats extrac
911
cp -Recurse tools extractor-pack
1012
cp -Recurse downgrades extractor-pack
1113
mkdir extractor-pack\tools\win64 | Out-Null
12-
cp target\release\ruby-extractor.exe extractor-pack\tools\win64\extractor.exe
13-
cp target\release\ruby-autobuilder.exe extractor-pack\tools\win64\autobuilder.exe
14+
cp extractor\target\release\ruby-extractor.exe extractor-pack\tools\win64\extractor.exe
15+
cp extractor\target\release\ruby-autobuilder.exe extractor-pack\tools\win64\autobuilder.exe

ruby/scripts/create-extractor-pack.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ else
1313
exit 1
1414
fi
1515

16+
pushd extractor
1617
"$CARGO" build --release
18+
"$CARGO" run --release --bin generator -- --dbscheme ../ql/lib/ruby.dbscheme --library ../ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
19+
popd
1720

18-
"$CARGO" run --release -p ruby-generator -- --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
1921
codeql query format -i ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
2022

2123
rm -rf extractor-pack
2224
mkdir -p extractor-pack
2325
cp -r codeql-extractor.yml downgrades tools ql/lib/ruby.dbscheme ql/lib/ruby.dbscheme.stats extractor-pack/
2426
mkdir -p extractor-pack/tools/${platform}
25-
cp target/release/ruby-extractor extractor-pack/tools/${platform}/extractor
26-
cp target/release/ruby-autobuilder extractor-pack/tools/${platform}/autobuilder
27+
cp extractor/target/release/ruby-extractor extractor-pack/tools/${platform}/extractor
28+
cp extractor/target/release/ruby-autobuilder extractor-pack/tools/${platform}/autobuilder

0 commit comments

Comments
 (0)