Skip to content
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

Use CARGO_PRIMARY_PACKAGE to skip dependencies #316

Merged
merged 1 commit into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions prusti-tests/tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ fn run_verification_core_proof(group_name: &str, filter: &Option<String>) {
}

fn test_runner(_tests: &[&()]) {
env::set_var("PRUSTI_TESTS", "1");

// Spawn server process as child (so it stays around until main function terminates)
let server_address = ServerSideService::spawn_off_thread();
env::set_var("PRUSTI_SERVER_ADDRESS", server_address.to_string());
Expand Down
45 changes: 0 additions & 45 deletions prusti/src/arg_value.rs

This file was deleted.

7 changes: 4 additions & 3 deletions prusti/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ extern crate prusti_common;

mod callbacks;
mod verifier;
mod arg_value;

use log::debug;
use std::{env, panic, borrow::Cow, path::PathBuf};
Expand All @@ -40,7 +39,6 @@ use lazy_static::lazy_static;
use callbacks::PrustiCompilerCalls;
use rustc_middle::ty::TyCtxt;
use prusti_common::config;
use arg_value::arg_value;

/// Link to report Prusti bugs
const BUG_REPORT_URL: &str = "https://github.com/viperproject/prusti-dev/issues/new";
Expand Down Expand Up @@ -125,8 +123,11 @@ fn main() {

// If the environment asks us to actually be rustc, then do that.
// If cargo is compiling a dependency, then be rustc.
let is_prusti_test = env::var("PRUSTI_TESTS").is_ok();
let is_cargo_running = env::var("CARGO_PKG_NAME").is_ok();
let in_primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok();
let prusti_be_rustc = config::be_rustc()
|| arg_value(&rustc_args, "--cap-lints", |val| val == "allow").is_some();
|| (!is_prusti_test && is_cargo_running && !in_primary_package);
if prusti_be_rustc {
rustc_driver::main();
}
Expand Down