-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add Miri workflow #636
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0b70677
add miri workflow
andygrove abf91b4
fix
andygrove 5faf167
ignore some tests when miri is enabled
andygrove dff2e47
fix one safety warning and ignore some slow tests
andygrove 87cd6c8
fmt
andygrove c7f34ab
prepare for review
andygrove 2cac6ef
add comments
andygrove ac6d29b
Merge remote-tracking branch 'apache/main' into miri
andygrove 48fe6c1
update to reflect change in directory name
andygrove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: Run Miri Safety Checks | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "doc/**" | ||
- "docs/**" | ||
- "**.md" | ||
pull_request: | ||
paths-ignore: | ||
- "doc/**" | ||
- "docs/**" | ||
- "**.md" | ||
# manual trigger | ||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | ||
workflow_dispatch: | ||
|
||
jobs: | ||
miri: | ||
name: "Miri" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Miri | ||
run: | | ||
rustup toolchain install nightly --component miri | ||
rustup override set nightly | ||
cargo miri setup | ||
- name: Test with Miri | ||
run: | | ||
cd core | ||
MIRIFLAGS="-Zmiri-disable-isolation" cargo miri test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ twox-hash = "1.6.3" | |
|
||
[features] | ||
default = [] | ||
nightly = [] | ||
|
||
[profile.release] | ||
debug = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,10 +89,7 @@ pub(crate) fn spark_compatible_murmur3_hash<T: AsRef<[u8]>>(data: T, seed: u32) | |
// data is &[u8] so we do not need to check for proper alignment | ||
unsafe { | ||
let mut h1 = if len_aligned > 0 { | ||
hash_bytes_by_int( | ||
std::slice::from_raw_parts(data.get_unchecked(0), len_aligned), | ||
seed, | ||
) | ||
hash_bytes_by_int(&data[0..len_aligned], seed) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes a miri warning. I ran the murmur3 bench before and after this change and did not see a significant difference. |
||
} else { | ||
seed as i32 | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,7 +165,7 @@ where | |
// because they are defined as Vec<Vec<T>> | ||
ptr::copy_nonoverlapping( | ||
bucket.as_ptr(), | ||
self.get_unchecked_mut(pos), | ||
self.as_mut_ptr().add(pos), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes a miri warning |
||
bucket.len(), | ||
); | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some references to this feature in our code and get warnings when we run miri (which requires use of nightly Rust)