Repository navigation
chore: run tests with ASAN in CI - #360
cartercanedy wants to merge 4 commits into
Conversation
09f43d2 to
103ce7c
Compare
|
Stacked PRs might not work (yet) with forked repositories. Marking this as Draft until #356 has been merged. |
a6c712d to
f7095e4
Compare
390a82f to
72ddf19
Compare
|
I tried to merge |
|
A first local test on Linux/Fedora failed. Update: Probably, because |
|
Run on CI succeeded: https://github.com/uklotzde/open62541/actions/runs/39746865588 |
There was a problem hiding this comment.
🟡 Changes recommended
The ASAN CI matrix can test an unintended target, and unpinned LLVM/nightly versions can cause required-job failures.
1 open issue
What changed in this PR
Adds AddressSanitizer test coverage for Rust tests and integrates native Linux/macOS ASAN jobs into CI.
Changes:
- Adds nightly ASAN test recipes with leak detection.
- Adds Linux and macOS ASAN CI matrix jobs.
- Updates the array ownership test to transfer raw allocation ownership safely.
| File | Description | Review findings |
|---|---|---|
src/ua/array.rs |
Updates the raw-array test to use move-based ownership transfer. | No unresolved findings. |
.justfile |
Defines reusable nightly ASAN test and command recipes. | No unresolved findings. |
.github/workflows/test.yaml |
Adds Linux/macOS ASAN jobs and macOS LLVM configuration. | The matrix target is not enforced by the test recipe; the LLVM/nightly pairing is not pinned or verified; and required-check configuration may still need repository-level updates. |
Review effort: Lite
| steps: | ||
| - name: Install Rust toolchain | ||
| # Sanitizers are only available on nightly Rust. | ||
| uses: dtolnay/rust-toolchain@nightly |
There was a problem hiding this comment.
I feel like this is going to be a complete noop practically. If the target triple is set to something else other than the system's target triple, it's either going to run fine (e.g. x86_64-linux-unknown-musl vs -gnu) or it's going to have an incompatible ABI and running it is going to fail
There was a problem hiding this comment.
I don't think the extra verification is necessary. All the other cargo commands inside our CI workflows don't run such a check either. matrix.target is only ever used to set up the toolchain itself. Therefore, the current change (without this check) is fine, and cargo takes the toolchain's target itself—just as it does in the other steps and jobs.
Closes #348 Implements `UA_RelativePath` factories/methods: - `UA_RelativePath_parse` -> `ua::RelativePath::parse() -> Result<Self>` - `UA_RelativePath_print` -> `impl Display for ua::RelativePath` - `get`/`get_mut` that folds the fallible access into the array validity check - `iter`/`iter_mut` that also maps invalid array access to an empty iterator - ~`Index`/`IndexMut` for unsafe element access~ initially implemented, but removed since unsafe to reinforce safe access semantics Accesser methods were also implemented. _Note: rebased this onto the stack above #360 to unblock downstream work_ --------- Co-authored-by: Uwe Klotz <uwe.klotz@gmail.com>
| - target: aarch64-apple-darwin | ||
| runner_os: macos-15 | ||
|
|
||
| - target: x86_64-unknown-linux-gnu | ||
| runner_os: ubuntu-24.04 |
There was a problem hiding this comment.
Should we switch to macos-26 and ubuntu-26.04 after the merge of #365?
There was a problem hiding this comment.
How about using -latest for both runner_os?
There was a problem hiding this comment.
That would move the new check to latest-dependencies.yaml. I don't think that's the right spot, though, because that workflow specifically checks whether the library still builds on the latest CI environments and dependencies (running cargo update first), thus mixing the two cases.
So, I'd continue to use fixed versions in test.yaml, to prevent sudden unexpected failures in the CI due to newly-released runner environments.
There was a problem hiding this comment.
Then we should add a comment to keep the runners pinned at the latest available image, currently macos-26 and ubuntu-26.04.
| steps: | ||
| - name: Install Rust toolchain | ||
| # Sanitizers are only available on nightly Rust. | ||
| uses: dtolnay/rust-toolchain@nightly |
There was a problem hiding this comment.
I don't think the extra verification is necessary. All the other cargo commands inside our CI workflows don't run such a check either. matrix.target is only ever used to set up the toolchain itself. Therefore, the current change (without this check) is fine, and cargo takes the toolchain's target itself—just as it does in the other steps and jobs.

Closes #358
Summary
NOTE: stacked on top of #356, needs to be rebased before merge