DanielKeep / cargo-script

Cargo script subcommand
Other
729 stars 37 forks source link

Cache entries should be keyed to rustc -V #9

Closed durka closed 9 years ago

durka commented 9 years ago

If you swap out the rustc version, things don't get recompiled, which gives surprising interactions with things like multirust.

alex@burka ~> cargo script -e 'vec!["a", "b"].join("")'
   Compiling expr v0.1.0 (file:///home/alex/.cargo/script-cache/expr-c347d606935bd18c)
"ab"
alex@burka ~> rustc -vV
rustc 1.3.0-beta.3 (2a89bb6ba 2015-08-11)
binary: rustc
commit-hash: 2a89bb6ba033b236c79a90486e2e3ee04d0e66f9
commit-date: 2015-08-11
host: x86_64-unknown-linux-gnu
release: 1.3.0-beta.3
alex@burka ~> multirust run stable cargo script -e 'vec!["a", "b"].join("")'
"ab"
durka commented 9 years ago

Actually, multirust munges $CARGO_HOME already so if platform::get_cache_dir_for checked $CARGO_HOME before $HOME, then they would work together.