Skip bpf-build while running clippy

This commit is contained in:
Michael Vines 2020-11-01 19:26:17 -08:00
parent 68ce3cc03b
commit 8944f428fe
3 changed files with 26 additions and 14 deletions

View File

@ -1,8 +1,14 @@
use std::process::{exit, Command}; use std::process::{exit, Command};
fn main() { fn main() {
if std::env::var("XARGO").is_err() { if std::env::var("XARGO").is_err()
println!("cargo:warning=(not a warning) Building BPF shared-memory program"); && std::env::var("RUSTC_WRAPPER").is_err()
&& std::env::var("RUSTC_WORKSPACE_WRAPPER").is_err()
{
println!(
"cargo:warning=(not a warning) Building BPF {} program",
std::env::var("CARGO_PKG_NAME").unwrap()
);
if !Command::new("cargo") if !Command::new("cargo")
.arg("build-bpf") .arg("build-bpf")
.status() .status()

View File

@ -1,17 +1,20 @@
use std::process::{exit, Command}; use std::process::{exit, Command};
fn main() { fn main() {
if std::env::var("XARGO").is_err() { if std::env::var("XARGO").is_err()
println!("cargo:warning=(not a warning) Building BPF themis program"); && std::env::var("RUSTC_WRAPPER").is_err()
if !Command::new("cargo") && std::env::var("RUSTC_WORKSPACE_WRAPPER").is_err()
.args(&[ {
"build-bpf", println!("cargo:warning=(not a warning) Building BPF {} program", std::env::var("CARGO_PKG_NAME").unwrap());
"--manifest-path", if !Command::new("cargo")
"../program_ristretto/Cargo.toml", .args(&[
]) "build-bpf",
.status() "--manifest-path",
.expect("Failed to build BPF themis program") "../program_ristretto/Cargo.toml",
.success() { ])
.status()
.expect("Failed to build BPF themis program")
.success() {
exit(1); exit(1);
} }
} }

View File

@ -1,7 +1,10 @@
use std::process::{exit, Command}; use std::process::{exit, Command};
fn main() { fn main() {
if std::env::var("XARGO").is_err() { if std::env::var("XARGO").is_err()
&& std::env::var("RUSTC_WRAPPER").is_err()
&& std::env::var("RUSTC_WORKSPACE_WRAPPER").is_err()
{
println!("cargo:warning=(not a warning) Building BPF token program"); println!("cargo:warning=(not a warning) Building BPF token program");
if !Command::new("cargo") if !Command::new("cargo")
.args(&["build-bpf", "--manifest-path", "../program/Cargo.toml"]) .args(&["build-bpf", "--manifest-path", "../program/Cargo.toml"])