-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run
fails on Windows due to latest rust_rules
#2100
Comments
I suspect the build script is writing some localized text in utf16, when the runner expects utf8. You could try:
then edit rules_rust/cargo/cargo_build_script_runner/lib.rs Then the read_line().expect() call can be replaced with read_until() to get bytes, which can then be manually converted to utf8 using lossy conversion. If that fixes it, we can submit a patch upstream. |
Thanks a lot, it works! Will you take care of the upstream patch? |
If you can paste your patch, I'll report it upstream |
diff --git a/cargo/cargo_build_script_runner/lib.rs b/cargo/cargo_build_script_runner/lib.rs
index b1aa7932..809253bc 100644
--- a/cargo/cargo_build_script_runner/lib.rs
+++ b/cargo/cargo_build_script_runner/lib.rs
@@ -103,12 +103,17 @@ impl BuildScriptOutput {
/// Converts a [BufReader] into a vector of [BuildScriptOutput] enums.
fn outputs_from_reader<T: Read>(mut reader: BufReader<T>) -> Vec<BuildScriptOutput> {
let mut result = Vec::<BuildScriptOutput>::new();
- let mut line = String::new();
- while reader.read_line(&mut line).expect("Cannot read line") != 0 {
- if let Some(bso) = BuildScriptOutput::new(&line) {
+ let mut buf = Vec::new();
+ while reader
+ .read_until(b'\n', &mut buf)
+ .expect("Cannot read line")
+ != 0
+ {
+ let line = &String::from_utf8_lossy(&buf);
+ if let Some(bso) = BuildScriptOutput::new(line) {
result.push(bso);
}
- line.clear();
+ buf.clear();
}
result
} |
run
fails on Windows due to latest rust_rules
Thanks, reported on bazelbuild/rules_rust#1583 |
Hi, I am new in Anki. According to documentation I try to download the project. Unfortunately, I have the same bug. There is nothing in documentation where I find rules_rust in my project nor how to use it. Could you tell me how to fix it? |
rules_rust is a separate project. As you are new to Anki, I recommend not trying to fix this on your end and waiting on an upstream fix. In the meantime and depending on your intention, you can make do with |
Since a39a3b4 I can't
.\run
Anki anymore:Clearing out old artifacts did not help. Curiously,
.\tools\runopt
continues to work.The text was updated successfully, but these errors were encountered: