Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Use relative paths in demo/example Cargo.toml files #137

Open
gww-parity opened this issue May 20, 2021 · 4 comments
Open

Use relative paths in demo/example Cargo.toml files #137

gww-parity opened this issue May 20, 2021 · 4 comments

Comments

@gww-parity
Copy link

Example :

diff --git a/compatibility-test/Cargo.toml b/compatibility-test/Cargo.toml
index 7a18f73..2b31ff5 100644
--- a/compatibility-test/Cargo.toml
+++ b/compatibility-test/Cargo.toml
@@ -11,7 +11,7 @@ description = "Tests for both the propverify and the proptest crates - to check
 [dependencies]
 
 [target.'cfg(verify)'.dependencies]
-propverify = { path="/home/rust-verification-tools/propverify" }
+propverify = { path="../propverify" }
 
 [target.'cfg(not(verify))'.dependencies]
 proptest = { version = "*" }
diff --git a/demos/simple/klee/Cargo.toml b/demos/simple/klee/Cargo.toml
index 11fe766..fa1e6f4 100644
--- a/demos/simple/klee/Cargo.toml
+++ b/demos/simple/klee/Cargo.toml
@@ -5,7 +5,8 @@ authors = [""]
 edition = "2018"
 
 [dependencies]
-verification-annotations = { path="/home/rust-verification-tools/verification-annotations" }
+#verification-annotations = { path="/home/rust-verification-tools/verification-annotations" }
+verification-annotations = { path="../../../verification-annotations" }
 

btw. also maybe consider +nightly in scripts as it seems that some nightly features are required, example:

 cargo clean
-cargo build --features=verifier-klee
+cargo  +nightly build --features=verifier-klee
@alastairreid
Copy link
Contributor

Your comment crossed paths with a PR that just landed that improves the docker/build system.
In particular, we now use +nightly in the docker/init script that rebuilds all the tools.
(The docker build process is also much faster than before: 15-20 minutes instead of 3 hours)

We deliberately do not use +nightly in the verify.sh scripts, the cargo-verify script or the Cargo.toml files in regression tests (demos///Cargo.toml, compatibility-test/Cargo.toml) because those need to be built with an LLVM-10 compatible version of Rust. (Our docker build uses the last LLVM-10 version of rustc (nightly-2020-08-03) and makes that the default Rust compiler. Support for LLVM11-based rustc is partially done - but many of our regression tests break.)

@alastairreid
Copy link
Contributor

wrt this change

[target.'cfg(verify)'.dependencies]
-propverify = { path="/home/rust-verification-tools/propverify" }
+propverify = { path="../propverify" }

What we really want to do here is to use path="$RVT_DIR/propverify" but, unfortunately, Cargo does not support environment variables in toml files.

We chose to use an absolute path because then it is easy to use the same dependency information in any toml file, examples, etc. But this only works if you are using docker (where we mount $RVT_DIR) as /home/rust-verification-tools.

Until now, we have been assuming that building directly (not using docker) was too painful for people to do - so this seemed like a good choice. But

  1. It sounds as if you are not using docker
  2. The PR that I just merged dramatically simplified the build process (you no longer have to build a custom version of rustc/libstd/libcore) and we are wondering whether we could further simplify our use of docker.

I need to think about this a bit more...

@gww-parity
Copy link
Author

gww-parity commented May 21, 2021

or maybe just make package propverify and put it on crates.io ?

@alastairreid
Copy link
Contributor

alastairreid commented May 21, 2021 via email

@alastairreid alastairreid changed the title TODO: update parths to relative in Cargo.toml files Use relative paths in demo/example Cargo.toml files Jun 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants