Compare commits

...

2 Commits

Author SHA1 Message Date
Conrad Irwin
c86522c572 build pls 2024-09-11 13:13:41 -04:00
Conrad Irwin
b9d782f27a Add logging for path env 2024-09-11 12:49:43 -04:00
5 changed files with 20 additions and 0 deletions

1
Cargo.lock generated
View File

@@ -11155,6 +11155,7 @@ dependencies = [
"futures 0.3.30",
"gpui",
"hex",
"log",
"parking_lot",
"schemars",
"serde",

View File

@@ -218,6 +218,8 @@ async fn load_shell_environment(
additional_command.unwrap_or("")
);
log::error!("loading shell env for project with this command: {command:?}. direnv_environment: {direnv_environment:?}");
let output = smol::process::Command::new(&shell)
.args(["-i", "-c", &command])
.envs(direnv_environment)
@@ -232,6 +234,8 @@ async fn load_shell_environment(
);
let stdout = String::from_utf8_lossy(&output.stdout);
log::error!("loaded login shell for project. stdout: {stdout:?}");
let env_output_start = stdout.find(marker).ok_or_else(|| {
anyhow!(
"failed to parse output of `env` command in login shell: {}",

View File

@@ -118,6 +118,11 @@ impl Project {
.read(cx)
.get_cli_environment()
.unwrap_or_default();
log::error!("get_cli_environment().PATH: {:?}", env.get("PATH"));
log::error!("settings.env: {:?}", settings.env.get("PATH"));
log::error!("os.env: {:?}", env::var("PATH"));
// Then extend it with the explicit env variables from the settings, so they take
// precedence.
env.extend(settings.env.clone());
@@ -169,6 +174,7 @@ impl Project {
completion_rx,
});
log::error!("spawn_task.env.PATH: {:?}", spawn_task.env.get("PATH"));
env.extend(spawn_task.env);
if let Some(venv_path) = &python_venv_directory {

View File

@@ -14,6 +14,7 @@ collections.workspace = true
futures.workspace = true
gpui.workspace = true
hex.workspace = true
log.workspace = true
parking_lot.workspace = true
schemars.workspace = true
serde.workspace = true

View File

@@ -185,6 +185,8 @@ impl TaskTemplate {
let env = {
// Start with the project environment as the base.
let mut env = cx.project_env.clone();
log::error!("cx.project_env.PATH {:?}", env.get("PATH"));
log::error!("self.env.PATH {:?}", self.env.get("PATH"));
// Extend that environment with what's defined in the TaskTemplate
env.extend(self.env.clone());
@@ -197,8 +199,14 @@ impl TaskTemplate {
&mut substituted_variables,
)?;
log::error!(
"env.PATH after replacing template variables in map: {:?}",
env.get("PATH")
);
// Last step: set the task variables as environment variables too
env.extend(task_variables.into_iter().map(|(k, v)| (k, v.to_owned())));
env
};