You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will drastically improve:
- Speed: Not everything will need to be recompiled once making a
minor change to a script.
- Size: Will avoid downloading and building dependencies for each minor
edit.
Copy file name to clipboardExpand all lines: src/main.rs
+21-54Lines changed: 21 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,6 @@ extern crate lazy_static;
5
5
#[macro_use]
6
6
externcrate log;
7
7
8
-
/**
9
-
If this is set to `true`, the digests used for package IDs will be replaced with "stub" to make testing a bit easier. Obviously, you don't want this `true` for release...
10
-
*/
11
-
constSTUB_HASHES:bool = false;
12
-
13
8
/**
14
9
If this is set to `false`, then code that automatically deletes stuff *won't*.
15
10
*/
@@ -637,9 +632,6 @@ This represents what to do with the input provided by the user.
637
632
*/
638
633
#[derive(Debug)]
639
634
structInputAction{
640
-
/// Compile the input into a fresh executable?
641
-
compile:bool,
642
-
643
635
/// Always show cargo output?
644
636
cargo_output:bool,
645
637
@@ -737,13 +729,6 @@ struct PackageMetadata {
737
729
script_hash:String,
738
730
}
739
731
740
-
implPackageMetadata{
741
-
pubfnsha1_hash(&self) -> String{
742
-
// Yes, I *do* feel dirty for doing it like this. :D
743
-
hash_str(&format!("{:?}",self))
744
-
}
745
-
}
746
-
747
732
/**
748
733
For the given input, this constructs the package metadata and checks the cache to see what should be done.
749
734
*/
@@ -753,28 +738,26 @@ fn decide_action_for(
753
738
prelude:Vec<String>,
754
739
args:&Args,
755
740
) -> MainResult<InputAction>{
741
+
let input_id = {
742
+
let deps_iter = deps.iter().map(|&(ref n,ref v)| (n as&str, v as&str));
743
+
// Again, also fucked if we can't work this out.
744
+
input.compute_id(deps_iter).unwrap()
745
+
};
746
+
info!("id: {:?}", input_id);
747
+
756
748
let(pkg_path, using_cache) = args
757
749
.pkg_path
758
750
.as_ref()
759
751
.map(|p| (p.into(),false))
760
752
.unwrap_or_else(|| {
761
753
// This can't fail. Seriously, we're *fucked* if we can't work this out.
762
754
let cache_path = platform::generated_projects_cache_path().unwrap();
763
-
764
-
let id = {
765
-
let deps_iter = deps.iter().map(|&(ref n,ref v)| (n as&str, v as&str));
0 commit comments