Skip to content

Add cargo-miri github action#225

Merged
danielsn merged 8 commits into
mainfrom
dsn/miri-action
Aug 29, 2023
Merged

Add cargo-miri github action#225
danielsn merged 8 commits into
mainfrom
dsn/miri-action

Conversation

@danielsn

@danielsn danielsn commented Aug 22, 2023

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a cargo miri github action to our CI.

Motivation

I added some unsafe code in #219, which I verified using miri. But, this doesn't run in CI, so it could break without us knowing. Adding it to CI increases safety.

Additional Notes

Miri is slower than regular test. Currently, I'm only running this on the unsafe changes I made in #219. We might want to consider expanding the filter to cover more code.

How to test the change?

I added a bug, which miri caught https://github.com/DataDog/libdatadog/actions/runs/5941345114/job/16111983401?pr=225
I then rolled back the bug, and Miri passed https://github.com/DataDog/libdatadog/actions/runs/5941396845/job/16112151552?pr=225

@danielsn
danielsn requested a review from a team as a code owner August 22, 2023 15:38
@github-actions github-actions Bot added the profiling Relates to the profiling* modules. label Aug 22, 2023
@github-actions github-actions Bot removed the profiling Relates to the profiling* modules. label Aug 22, 2023
ivoanjo
ivoanjo previously approved these changes Aug 22, 2023

@ivoanjo ivoanjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious -- how slow is miri? Although annoying, I think a CI run that takes a few minutes is probably fine (or we could add another job that runs full miri, but only every night and not on every PR).

One other thing we can make use of is a faster machine -- here's a PR where we did that for dd-trace-go to improve performance of CI stuff ( DataDog/dd-trace-go#2068 ) .

None of this is blocking for this PR, but I'm excited about the possibilities :)

@@ -0,0 +1,21 @@
name: Miri test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since right now we're scoped to profile::internal::observation, I would suggest maybe including that here on the name (to avoid a misleading sense of safety -- oh we're running miri on stuff)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@danielsn

Copy link
Copy Markdown
Contributor Author

I'm curious -- how slow is miri? Although annoying, I think a CI run that takes a few minutes is probably fine (or we could add another job that runs full miri, but only every night and not on every PR).

One other thing we can make use of is a faster machine -- here's a PR where we did that for dd-trace-go to improve performance of CI stuff ( DataDog/dd-trace-go#2068 ) .

None of this is blocking for this PR, but I'm excited about the possibilities :)

The other issue is that not all tests will work under Miri. We'd need to take a pass to see which to exclude

@ivoanjo ivoanjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants