Skip to content

Commit 295fc87

Browse files
committed
Rust: Avoid malformed parser fixture in code scanning
The new rust-analyzer version fixed a bug related to unicode parsing. As at test for this, one of the `ra_ap_parser` crate contain a test fixture with this invalid unicode. The _current_ Rust extractor naturally inherits the parsing bug present in the older rust-analyzer dependency that it uses. When CI does Code Scanning on the _new_ Rust extractor with the _old_ Rust extractor the parsing bug is hit since the beforementioned test fixture is extracted when extracting the Rust extractor through the `ra_ap_parser` dependency. As a temporaty workaroyund, we remove the test fixture from Cargo's downloaded dependency source before extracting. This avoid the old extractor failing in CI. Once the updated extractor is running on CI we should be able to remove this again.
1 parent fab1660 commit 295fc87

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎.github/workflows/rust-analysis.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ jobs:
5757
languages: ${{ matrix.language }}
5858
config-file: ./.github/codeql/codeql-config.yml
5959

60+
- name: Remove malformed rust-analyzer parser fixture
61+
shell: bash
62+
run: |
63+
cargo fetch
64+
find "${CARGO_HOME:-$HOME/.cargo}/registry/src" \
65+
-path '*/ra_ap_parser-0.0.352/test_data/lexer/err/incomplete_frontmatter_before_unicode.rs' \
66+
-delete
67+
6068
- name: Autobuild
6169
uses: github/codeql-action/autobuild@main
6270

0 commit comments

Comments
 (0)