diff --git a/src/render/solver.rs b/src/render/solver.rs
index c2a888d6..39db5417 100644
--- a/src/render/solver.rs
+++ b/src/render/solver.rs
@@ -35,8 +35,7 @@ fn print_as_table(packages: &[RepoDataRecord]) {
package
.channel
.as_ref()
- .map(|s| s.rsplit('/').find(|s| !s.is_empty()))
- .flatten()
+ .and_then(|s| s.rsplit('/').find(|s| !s.is_empty()))
.expect("expected channel to be defined and contain '/'")
.to_string()
} else {
diff --git a/src/script/interpreter/bash.rs b/src/script/interpreter/bash.rs
new file mode 100644
index 00000000..1d17ffe2
--- /dev/null
+++ b/src/script/interpreter/bash.rs
@@ -0,0 +1,66 @@
+use std::path::PathBuf;
+
+use rattler_conda_types::Platform;
+use rattler_shell::shell;
+
+use crate::script::{interpreter::DEBUG_HELP, run_process_with_replacements, ExecutionArgs};
+
+use super::{find_interpreter, Interpreter};
+
+const BASH_PREAMBLE: &str = r#"#!/bin/bash
+## Start of bash preamble
+if [ -z ${CONDA_BUILD+x} ]; then
+ source ((script_path))
+fi
+# enable debug mode for the rest of the script
+set -x
+## End of preamble
+"#;
+
+pub(crate) struct BashInterpreter;
+
+impl Interpreter for BashInterpreter {
+ async fn run(&self, args: ExecutionArgs) -> Result<(), std::io::Error> {
+ let script = self.get_script(&args, shell::Bash).unwrap();
+
+ let build_env_path = args.work_dir.join("build_env.sh");
+ let build_script_path = args.work_dir.join("conda_build.sh");
+
+ tokio::fs::write(&build_env_path, script).await?;
+
+ let preamble = BASH_PREAMBLE.replace("((script_path))", &build_env_path.to_string_lossy());
+ let script = format!("{}\n{}", preamble, args.script.script());
+ tokio::fs::write(&build_script_path, script).await?;
+
+ let build_script_path_str = build_script_path.to_string_lossy().to_string();
+ let cmd_args = ["bash", "-e", &build_script_path_str];
+
+ let output = run_process_with_replacements(
+ &cmd_args,
+ &args.work_dir,
+ &args.replacements("$((var))"),
+ )
+ .await?;
+
+ if !output.status.success() {
+ let status_code = output.status.code().unwrap_or(1);
+ tracing::error!("Script failed with status {}", status_code);
+ tracing::error!("Work directory: '{}'", args.work_dir.display());
+ tracing::error!("{}", DEBUG_HELP);
+ return Err(std::io::Error::new(
+ std::io::ErrorKind::Other,
+ "Script failed".to_string(),
+ ));
+ }
+
+ Ok(())
+ }
+
+ async fn find_interpreter(
+ &self,
+ build_prefix: Option<&PathBuf>,
+ platform: &Platform,
+ ) -> Result