Skip to content

Commit

Permalink
tmp dirs target to farf (solana-labs#5079)
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-solana authored Jul 13, 2019
1 parent 1c966aa commit 0d27515
Show file tree
Hide file tree
Showing 70 changed files with 79 additions and 13 deletions.
1 change: 1 addition & 0 deletions bench-exchange/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/
/config/
/config-local/
/farf/
1 change: 1 addition & 0 deletions bench-streamer/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions bench-tps/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/
/config/
/config-local/
/farf/
1 change: 1 addition & 0 deletions chacha-sys/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
10 changes: 8 additions & 2 deletions ci/nits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,22 @@ if _ git --no-pager grep -n 'Default::default()' -- '*.rs'; then
fi

# Let's keep a .gitignore for every crate, ensure it's got
# /target/ in it
# /target/ and /farf/ in it
declare gitignores_ok=true
for i in $(git --no-pager ls-files \*/Cargo.toml ); do
dir=$(dirname "$i")
if [[ ! -f $dir/.gitignore ]]; then
echo 'error: nits.sh .gitnore missing for crate '"$dir" >&2
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
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
done
"$gitignores_ok"
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions core/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
4 changes: 2 additions & 2 deletions core/src/bank_forks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ mod tests {
}

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);
TempPaths {
paths: path.to_string(),
Expand All @@ -486,7 +486,7 @@ mod tests {

fn get_tmp_bank_accounts_path(paths: &str) -> TempPaths {
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
.iter()
.map(|path| format!("{}/{}", out_dir, path))
Expand Down
4 changes: 2 additions & 2 deletions core/src/blocktree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1820,10 +1820,10 @@ macro_rules! get_tmp_ledger_path {

pub fn get_tmp_ledger_path(name: &str) -> String {
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 path = format!("{}/tmp/ledger/{}-{}", out_dir, name, keypair.pubkey());
let path = format!("{}/ledger/{}-{}", out_dir, name, keypair.pubkey());

// whack any possible collision
let _ignored = fs::remove_dir_all(&path);
Expand Down
2 changes: 1 addition & 1 deletion core/src/replicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ mod tests {

fn tmp_file_path(name: &str) -> PathBuf {
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 mut path = PathBuf::new();
Expand Down
1 change: 1 addition & 0 deletions drone/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions genesis/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions gossip/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions install/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions keygen/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions kvstore/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions ledger-tool/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions logger/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions measure/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions merkle-tree/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions metrics/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions netutil/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/bpf/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/128bit/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/128bit_dep/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/alloc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/dep_crate/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/external_spend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/iter/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/many_args/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/many_args_dep/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/noop/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/panic/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf/rust/tick_height/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions programs/bpf_loader_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/bpf_loader_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/budget_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/budget_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/config_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/config_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/exchange_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/exchange_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/failure_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/noop_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/stake_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/stake_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/stake_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/storage_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/storage_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/token_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/token_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/vote_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions programs/vote_program/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions replicator/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
2 changes: 1 addition & 1 deletion runtime/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Accounts {
fn make_new_dir() -> String {
static ACCOUNT_DIR: AtomicUsize = AtomicUsize::new(0);
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();
format!(
"{}/{}/{}/{}",
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ mod tests {

fn get_tmp_accounts_path(paths: &str) -> TempPaths {
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
.iter()
.map(|path| format!("{}/{}", out_dir, path))
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/append_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ pub mod test_utils {
}

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 {
Expand Down
1 change: 1 addition & 0 deletions sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions sdk/bpf/rust/rust-no-std/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions sdk/bpf/rust/rust-test/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
1 change: 1 addition & 0 deletions sdk/bpf/rust/rust-utils/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target/

Cargo.lock
/farf/
2 changes: 1 addition & 1 deletion sdk/src/genesis_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ mod tests {
use crate::signature::{Keypair, KeypairUtil};

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 path = format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey());
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ mod tests {

fn tmp_file_path(name: &str) -> String {
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();

format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey()).to_string()
Expand Down
1 change: 1 addition & 0 deletions upload-perf/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions validator-info/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions validator/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions vote-signer/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
1 change: 1 addition & 0 deletions wallet/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target/
/farf/
2 changes: 1 addition & 1 deletion wallet/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ mod tests {
);

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 path = format!("{}/tmp/{}-{}", out_dir, name, keypair.pubkey());
Expand Down

0 comments on commit 0d27515

Please sign in to comment.