From 58f6310de437ca2161734f321144fb135bfa7205 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 11 Sep 2024 10:59:34 +0200 Subject: [PATCH] Ruby: update new cargo target directory in make and actions --- .github/workflows/ruby-build.yml | 12 ++++++------ ruby/Makefile | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ruby-build.yml b/.github/workflows/ruby-build.yml index 4a3242ce6041b..fcabff5d110e3 100644 --- a/.github/workflows/ruby-build.yml +++ b/.github/workflows/ruby-build.yml @@ -65,8 +65,8 @@ jobs: id: cache-extractor with: path: | - ruby/extractor/target/release/codeql-extractor-ruby - ruby/extractor/target/release/codeql-extractor-ruby.exe + target/release/codeql-extractor-ruby + target/release/codeql-extractor-ruby.exe ruby/extractor/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-extractor-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/extractor/Cargo.lock') }}-${{ hashFiles('shared/tree-sitter-extractor') }}-${{ hashFiles('ruby/extractor/**/*.rs') }} - uses: actions/cache@v3 @@ -75,7 +75,7 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - ruby/target + target key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-rust-cargo-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/extractor/**/Cargo.lock') }} - name: Check formatting if: steps.cache-extractor.outputs.cache-hit != 'true' @@ -91,7 +91,7 @@ jobs: run: cd extractor && cargo build --release - name: Generate dbscheme if: ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}} - run: extractor/target/release/codeql-extractor-ruby generate --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll + run: ../target/release/codeql-extractor-ruby generate --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll - uses: actions/upload-artifact@v3 if: ${{ matrix.os == 'ubuntu-latest' }} with: @@ -106,8 +106,8 @@ jobs: with: name: extractor-${{ matrix.os }} path: | - ruby/extractor/target/release/codeql-extractor-ruby - ruby/extractor/target/release/codeql-extractor-ruby.exe + target/release/codeql-extractor-ruby + target/release/codeql-extractor-ruby.exe retention-days: 1 compile-queries: if: github.repository_owner == 'github' diff --git a/ruby/Makefile b/ruby/Makefile index d40bc33698b41..23333b494f4ea 100644 --- a/ruby/Makefile +++ b/ruby/Makefile @@ -24,7 +24,7 @@ FILES=codeql-extractor.yml\ ql/lib/ruby.dbscheme.stats\ ql/lib/ruby.dbscheme -BIN_FILES=target/release/codeql-extractor-ruby$(EXE) +BIN_FILES=../target/release/codeql-extractor-ruby$(EXE) extractor-common: rm -rf build @@ -37,14 +37,14 @@ extractor-common: tools: $(BIN_FILES) rm -rf tools/bin mkdir tools/bin - cp -r target/release/codeql-extractor-ruby$(EXE) tools/bin/extractor$(EXE) + cp -r ../target/release/codeql-extractor-ruby$(EXE) tools/bin/extractor$(EXE) -target/release/%$(EXE): +../target/release/%$(EXE): cd extractor && cargo build --release dbscheme: cd extractor && cargo build --release - extractor/target/release/codeql-extractor-ruby generate --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll + ../target/release/codeql-extractor-ruby generate --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll codeql query format -i ql/lib/codeql/ruby/ast/internal/TreeSitter.qll .PHONY: extractor @@ -62,7 +62,7 @@ extractor: $(FILES) $(BIN_FILES) cp tools/autobuild.cmd extractor-pack/tools/autobuild.cmd cp ql/lib/ruby.dbscheme.stats extractor-pack/ruby.dbscheme.stats cp ql/lib/ruby.dbscheme extractor-pack/ruby.dbscheme - cp extractor/target/release/codeql-extractor-ruby$(EXE) extractor-pack/tools/$(CODEQL_PLATFORM)/extractor$(EXE) + cp ../target/release/codeql-extractor-ruby$(EXE) extractor-pack/tools/$(CODEQL_PLATFORM)/extractor$(EXE) test: extractor dbscheme codeql test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path .. --consistency-queries ql/consistency-queries ql/test