tmp dirs target to farf (#5079)

This commit is contained in:
Rob Walker 2019-07-12 18:28:42 -07:00 committed by GitHub
parent 1c966aac25
commit 0d27515d09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
70 changed files with 79 additions and 13 deletions

View File

@ -1,3 +1,4 @@
/target/ /target/
/config/ /config/
/config-local/ /config-local/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
/config/ /config/
/config-local/ /config-local/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -46,16 +46,22 @@ if _ git --no-pager grep -n 'Default::default()' -- '*.rs'; then
fi fi
# Let's keep a .gitignore for every crate, ensure it's got # Let's keep a .gitignore for every crate, ensure it's got
# /target/ in it # /target/ and /farf/ in it
declare gitignores_ok=true declare gitignores_ok=true
for i in $(git --no-pager ls-files \*/Cargo.toml ); do for i in $(git --no-pager ls-files \*/Cargo.toml ); do
dir=$(dirname "$i") dir=$(dirname "$i")
if [[ ! -f $dir/.gitignore ]]; then if [[ ! -f $dir/.gitignore ]]; then
echo 'error: nits.sh .gitnore missing for crate '"$dir" >&2 echo 'error: nits.sh .gitnore missing for crate '"$dir" >&2
gitignores_ok=false gitignores_ok=false
elif ! grep -q -e '^/target/$' "$dir"/.gitignore; then else
if ! grep -q -e '^/target/$' "$dir"/.gitignore; then
echo 'error: nits.sh "/target/" apparently missing from '"$dir"'/.gitignore' >&2 echo 'error: nits.sh "/target/" apparently missing from '"$dir"'/.gitignore' >&2
gitignores_ok=false gitignores_ok=false
fi
if ! grep -q -e '^/farf/$' "$dir"/.gitignore ; then
echo 'error: nits.sh "/farf/" apparently missing from '"$dir"'/.gitignore' >&2
gitignores_ok=false
fi
fi fi
done done
"$gitignores_ok" "$gitignores_ok"

1
client/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
core/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -477,7 +477,7 @@ mod tests {
} }
fn get_tmp_snapshots_path() -> TempPaths { fn get_tmp_snapshots_path() -> TempPaths {
let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let path = format!("{}/snapshots", out_dir); let path = format!("{}/snapshots", out_dir);
TempPaths { TempPaths {
paths: path.to_string(), paths: path.to_string(),
@ -486,7 +486,7 @@ mod tests {
fn get_tmp_bank_accounts_path(paths: &str) -> TempPaths { fn get_tmp_bank_accounts_path(paths: &str) -> TempPaths {
let vpaths = get_paths_vec(paths); let vpaths = get_paths_vec(paths);
let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let vpaths: Vec<_> = vpaths let vpaths: Vec<_> = vpaths
.iter() .iter()
.map(|path| format!("{}/{}", out_dir, path)) .map(|path| format!("{}/{}", out_dir, path))

View File

@ -1820,10 +1820,10 @@ macro_rules! get_tmp_ledger_path {
pub fn get_tmp_ledger_path(name: &str) -> String { pub fn get_tmp_ledger_path(name: &str) -> String {
use std::env; use std::env;
let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let keypair = Keypair::new(); let keypair = Keypair::new();
let path = format!("{}/tmp/ledger/{}-{}", out_dir, name, keypair.pubkey()); let path = format!("{}/ledger/{}-{}", out_dir, name, keypair.pubkey());
// whack any possible collision // whack any possible collision
let _ignored = fs::remove_dir_all(&path); let _ignored = fs::remove_dir_all(&path);

View File

@ -910,7 +910,7 @@ mod tests {
fn tmp_file_path(name: &str) -> PathBuf { fn tmp_file_path(name: &str) -> PathBuf {
use std::env; use std::env;
let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let keypair = Keypair::new(); let keypair = Keypair::new();
let mut path = PathBuf::new(); let mut path = PathBuf::new();

1
drone/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
genesis/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
gossip/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
install/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
keygen/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
kvstore/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
logger/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
measure/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
metrics/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
netutil/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
runtime/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -77,7 +77,7 @@ impl Accounts {
fn make_new_dir() -> String { fn make_new_dir() -> String {
static ACCOUNT_DIR: AtomicUsize = AtomicUsize::new(0); static ACCOUNT_DIR: AtomicUsize = AtomicUsize::new(0);
let dir = ACCOUNT_DIR.fetch_add(1, Ordering::Relaxed); let dir = ACCOUNT_DIR.fetch_add(1, Ordering::Relaxed);
let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let keypair = Keypair::new(); let keypair = Keypair::new();
format!( format!(
"{}/{}/{}/{}", "{}/{}/{}/{}",

View File

@ -750,7 +750,7 @@ mod tests {
fn get_tmp_accounts_path(paths: &str) -> TempPaths { fn get_tmp_accounts_path(paths: &str) -> TempPaths {
let vpaths = get_paths_vec(paths); let vpaths = get_paths_vec(paths);
let out_dir = std::env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = std::env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let vpaths: Vec<_> = vpaths let vpaths: Vec<_> = vpaths
.iter() .iter()
.map(|path| format!("{}/{}", out_dir, path)) .map(|path| format!("{}/{}", out_dir, path))

View File

@ -298,7 +298,7 @@ pub mod test_utils {
} }
pub fn get_append_vec_dir() -> String { pub fn get_append_vec_dir() -> String {
std::env::var("OUT_DIR").unwrap_or_else(|_| "target/append_vec_tests".to_string()) std::env::var("OUT_DIR").unwrap_or_else(|_| "farf/append_vec_tests".to_string())
} }
pub fn get_append_vec_path(path: &str) -> TempFile { pub fn get_append_vec_path(path: &str) -> TempFile {

1
sdk/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -1,3 +1,4 @@
/target/ /target/
Cargo.lock Cargo.lock
/farf/

View File

@ -194,7 +194,7 @@ mod tests {
use crate::signature::{Keypair, KeypairUtil}; use crate::signature::{Keypair, KeypairUtil};
fn make_tmp_path(name: &str) -> String { fn make_tmp_path(name: &str) -> String {
let out_dir = std::env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = std::env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let keypair = Keypair::new(); let keypair = Keypair::new();
let path = format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey()); let path = format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey());

View File

@ -147,7 +147,7 @@ mod tests {
fn tmp_file_path(name: &str) -> String { fn tmp_file_path(name: &str) -> String {
use std::env; use std::env;
let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let keypair = Keypair::new(); let keypair = Keypair::new();
format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey()).to_string() format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey()).to_string()

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1 +1,2 @@
/target/ /target/
/farf/

1
wallet/.gitignore vendored
View File

@ -1 +1,2 @@
/target/ /target/
/farf/

View File

@ -1883,7 +1883,7 @@ mod tests {
); );
fn make_tmp_path(name: &str) -> String { fn make_tmp_path(name: &str) -> String {
let out_dir = std::env::var("OUT_DIR").unwrap_or_else(|_| "target".to_string()); let out_dir = std::env::var("OUT_DIR").unwrap_or_else(|_| "farf".to_string());
let keypair = Keypair::new(); let keypair = Keypair::new();
let path = format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey()); let path = format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey());