nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 49 lines 1.4 kB view raw
1--- a/librubyfmt/build.rs 2+++ b/librubyfmt/build.rs 3@@ -33,27 +33,9 @@ 4 let path = env::current_dir()?; 5 let ruby_checkout_path = path.join("ruby_checkout"); 6 7- let old_checkout_sha = if ruby_checkout_path.join(ripper).exists() { 8- Some(get_ruby_checkout_sha()) 9- } else { 10- None 11- }; 12- 13- let _ = Command::new("git") 14- .args(["submodule", "update", "--init"]) 15- .status(); 16- 17- let new_checkout_sha = get_ruby_checkout_sha(); 18- 19- // Only rerun this build if the ruby_checkout has changed 20- match old_checkout_sha { 21- Some(old_sha) if old_sha == new_checkout_sha => {} 22- _ => { 23- make_configure(&ruby_checkout_path)?; 24- run_configure(&ruby_checkout_path)?; 25- build_ruby(&ruby_checkout_path)?; 26- } 27- } 28+ make_configure(&ruby_checkout_path)?; 29+ run_configure(&ruby_checkout_path)?; 30+ build_ruby(&ruby_checkout_path)?; 31 32 let arch = extract_ruby_arch(&ruby_checkout_path); 33 34@@ -225,15 +207,3 @@ 35 Err(format!("Command {} failed with: {}", command, code).into()) 36 } 37 } 38- 39-fn get_ruby_checkout_sha() -> String { 40- String::from_utf8( 41- Command::new("git") 42- .args(["rev-parse", "HEAD"]) 43- .current_dir("./ruby_checkout") 44- .output() 45- .expect("git rev-parse shouldn't fail") 46- .stdout, 47- ) 48- .expect("output should be valid utf8") 49-}