From 6883db3335199666f8291d4d002f2cbff15e22ba Mon Sep 17 00:00:00 2001 From: Yunuuuu Date: Mon, 15 Apr 2024 21:08:33 +0800 Subject: [PATCH] fix build error for ubuntu: Problem locating local R install (#223) --- build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 9cb38d7e..768c4d56 100644 --- a/build.rs +++ b/build.rs @@ -158,7 +158,10 @@ fn byte_array_to_os_string(bytes: &[u8]) -> OsString { // Execute an R script and return the captured output fn r_command>(r_binary: S, script: &str) -> io::Result { - let out = Command::new(r_binary).args(["-s", "-e", script]).output()?; + // we must use --vanilla, + // 1. user Rprofile may contain message into stdout + // 2. prevent R startup message + let out = Command::new(r_binary).args(["-s", "--vanilla", "-e", script]).output()?; // if there are any errors we print them out, helps with debugging if !out.stderr.is_empty() {