about summary refs log tree commit diff
path: root/src/librustpkg/workcache_support.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustpkg/workcache_support.rs')
-rw-r--r--src/librustpkg/workcache_support.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/librustpkg/workcache_support.rs b/src/librustpkg/workcache_support.rs
index 8af24ff4c38..34404ad625c 100644
--- a/src/librustpkg/workcache_support.rs
+++ b/src/librustpkg/workcache_support.rs
@@ -30,7 +30,12 @@ pub fn digest_file_with_date(path: &Path) -> ~str {
             (*sha).input_str(st.st_mtime.to_str());
             (*sha).result_str()
         }
-        Err(e) => cond.raise((path.clone(), format!("Couldn't read file: {}", e))).to_str()
+        Err(e) => {
+            let path = cond.raise((path.clone(), format!("Couldn't read file: {}", e)));
+            // FIXME (#9639): This needs to handle non-utf8 paths
+            // XXX: I'm pretty sure this is the wrong return value
+            path.as_str().unwrap().to_owned()
+        }
     }
 }
 
@@ -51,13 +56,15 @@ pub fn digest_only_date(path: &Path) -> ~str {
 pub fn discover_outputs(e: &mut workcache::Exec, outputs: ~[Path]) {
     debug2!("Discovering {:?} outputs", outputs.len());
     for p in outputs.iter() {
-        debug2!("Discovering output! {}", p.to_str());
+        debug2!("Discovering output! {}", p.display());
         // For now, assume that all discovered outputs are binaries
-        e.discover_output("binary", p.to_str(), digest_only_date(p));
+        // FIXME (#9639): This needs to handle non-utf8 paths
+        e.discover_output("binary", p.as_str().unwrap(), digest_only_date(p));
     }
 }
 
 /// Returns the function name for building a crate
 pub fn crate_tag(p: &Path) -> ~str {
-    p.to_str() // implicitly, it's "build(p)"...
+    // FIXME (#9639): This needs to handle non-utf8 paths
+    p.as_str().unwrap().to_owned() // implicitly, it's "build(p)"...
 }