From 04ee593d3635cf1e2a9ae0e49e87841b6fbe9869 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Wed, 4 Sep 2024 10:48:22 -0400 Subject: [PATCH] Explicitly pin the mir-json version that SAW requires SAW's MIR backend requires a particular MIR JSON schema, but it is not entirely obvious which version of the JSON schema to use (#2111). This patch is one step towards addressing this concern. It: * Adds `mir-json` as a submodule. At present, nothing in the repo (CI or otherwise) actually _builds_ this submodule. Its presence is purely to communicate which version of `mir-json` must be used to compile Rust code to JSON that SAW can ingest. * Documents this in the `README`. In the future, we will want to actually build and use `mir-json` in the CI (see #1868 for an in-progress attempt at this), but in the meantime, this is a decent first step. Until we actually start building `mir-json` in the CI and using it, we will need to remember to bump the `mir-json` submodule each time that SAW's JSON schema requirement changes. Addresses one part of #2111. --- .gitmodules | 3 +++ README.md | 12 ++++++++++++ deps/mir-json | 1 + 3 files changed, 16 insertions(+) create mode 160000 deps/mir-json diff --git a/.gitmodules b/.gitmodules index e5c13b8f0e..7b798103ff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "deps/lmdb"] path = deps/lmdb url = https://github.com/GaloisInc/lmdb.git +[submodule "deps/mir-json"] + path = deps/mir-json + url = https://github.com/GaloisInc/mir-json.git diff --git a/README.md b/README.md index 18bfd91120..4bc5cf09fc 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,18 @@ will be possible for all language constructs. There are various instructions that are not supported during verification. However, any failure during `llvm_load_module` should be considered a bug. +## Notes on Rust + +SAW has experimental support for analyzing Rust programs. To do so, one must +compile Rust code using [`mir-json`](https://github.com/GaloisInc/mir-json), a +tool which compiles Rust code to a machine-readable, JSON-based format. Each +version of SAW understands the JSON output of a particular version of +`mir-json`, so make sure that you build the version `mir-json` that is included +in the `mir-json` submodule (located in `deps/mir-json`). + +For more information on how to install `mir-json`, follow the instructions +[here](https://github.com/GaloisInc/mir-json#installation-instructions). + ## Notes on Windows If you have trouble loading the SAW REPL on Windows, try invoking it diff --git a/deps/mir-json b/deps/mir-json new file mode 160000 index 0000000000..131980a17b --- /dev/null +++ b/deps/mir-json @@ -0,0 +1 @@ +Subproject commit 131980a17bb27c2c3c616a1e8bfb4253a528c328