Azure / Azure/unbounded

CodeQL Rust extraction fails on 172 of 213 files in cmd/unbounded-storage

Open
#616 0 comments 1 reaction 2 assignees Claimed by @plombardi89 View on GitHub
Dominant language
Go
Stars
28
Forks
11
Avg merge
1d 8h
Merged PRs (30d)
55

Description

## Problem

The CodeQL Rust extractor reports that most of the crate fails to extract:

```
| Total number of Rust files that were extracted with errors | 172 |
| Total number of Rust files that were extracted without error | 41 |
```

Observed in the `Analyze (rust)` job of the CodeQL workflow. The extraction log is full of macro-expansion failures, for example:

```
WARN cmd/unbounded-storage/src/fabric/error.rs:36:43: macro expansion failed for 'write'
WARN cmd/unbounded-storage/src/fabric/error.rs:38:17: macro expansion failed for 'write'
WARN cmd/unbounded-storage/src/fabric/error.rs:40:44: macro expansion failed for 'write'
```

These are warnings and do not fail the job, so the check reports green.

## Impact

With 80% of files extracted with errors, CodeQL's Rust coverage of `cmd/unbounded-storage` is largely ineffective. The check passing gives more assurance than it should, which matters as the Rust surface grows (`cmd/unbounded-storage`, and `cmd/racer` alongside it).

## Notes

`codeql.yaml` analyzes Rust with `build-mode: none`, so the extractor works from source without a cargo build. Macro-heavy code is exactly where that struggles. Worth checking whether a build-mode that compiles the crate improves extraction, and whether the extractor needs the workspace's feature flags (the crate has a `sim` feature used by its deterministic simulation harness).

Found while diagnosing an unrelated merge-queue failure; filing so it is not lost.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.