You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/01/05 08:44:02 UTC

[avro] branch master updated: AVRO-3247 Rust: Run MIRI checks (#1390)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 87d04ef  AVRO-3247 Rust: Run MIRI checks (#1390)
87d04ef is described below

commit 87d04ef9065e3ef21f1fb4135c56d3c6500d2530
Author: Martin Grigorov <ma...@users.noreply.github.com>
AuthorDate: Wed Jan 5 10:43:55 2022 +0200

    AVRO-3247 Rust: Run MIRI checks (#1390)
---
 .github/workflows/test-lang-rust-miri.yml | 53 +++++++++++++++++++++++++++++++
 lang/rust/src/schema.rs                   |  1 +
 2 files changed, 54 insertions(+)

diff --git a/.github/workflows/test-lang-rust-miri.yml b/.github/workflows/test-lang-rust-miri.yml
new file mode 100644
index 0000000..a29f192
--- /dev/null
+++ b/.github/workflows/test-lang-rust-miri.yml
@@ -0,0 +1,53 @@
+# 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: Rust MIRI Check
+on:
+  workflow_dispatch:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+    paths:
+      - .github/workflows/test-lang-rust-miri.yml
+      - lang/rust/**
+
+defaults:
+  run:
+    working-directory: lang/rust
+
+jobs:
+  miri_check:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup Rust toolchain
+        run: |
+          MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
+          echo "Installing latest nightly with Miri: $MIRI_NIGHTLY"
+          rustup toolchain install $MIRI_NIGHTLY
+          rustup default $MIRI_NIGHTLY
+          rustup component add miri
+      - name: Run MIRI Checks
+        env:
+          RUST_BACKTRACE: full
+          RUST_LOG: trace
+          MIRIFLAGS: "-Zmiri-disable-isolation"
+        run: |
+          cargo miri setup
+          cargo clean
+          cargo miri test --lib
diff --git a/lang/rust/src/schema.rs b/lang/rust/src/schema.rs
index efafed5..8e15cd4 100644
--- a/lang/rust/src/schema.rs
+++ b/lang/rust/src/schema.rs
@@ -1291,6 +1291,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)] // Sha256 uses an inline assembly instructions which is not supported by miri
     fn test_schema_fingerprint() {
         use crate::rabin::Rabin;
         use md5::Md5;