Skip to content
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

Runnables don't work for folder-local tool installations #13106

Closed
1 task done
WeetHet opened this issue Jun 16, 2024 · 1 comment · Fixed by #17964
Closed
1 task done

Runnables don't work for folder-local tool installations #13106

WeetHet opened this issue Jun 16, 2024 · 1 comment · Fixed by #17964
Labels
defect [core label] rust Rust programming language support tasks

Comments

@WeetHet
Copy link
Contributor

WeetHet commented Jun 16, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Recently, my PR to enable using rust-analyzer from PATH was merged. After that I've decided to use a nix + direnv based installation which does not expose cargo or any other rust binary to the PATH. This is problematic, because if I understand correctly, currently runnables don't use delegate.which to determine the PATH to the binaries, instead just using the name. It doesn't work with directory local installations as right now create_terminal function from project/terminals.rs does not pass the full environment (the one acquired by executing delegate.shell_env) to the executed task.

The two possible solutions might be

  1. Use delegate.which for runnables, falling back to just the name
  2. Pass the shell_env to all task which is, in my opinion better, as it allows in the future to just use sh or something similar for language defined runnables without needing to worry about not having adequate environment variables set, therefore allowing for more advanced predefined tasks
    See the create_terminal function to understand what environment we are using right now

Environment

Zed: v0.140.4 (Zed Preview)
OS: macOS 14.5.0
Memory: 8 GiB
Architecture: aarch64

@WeetHet WeetHet added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Jun 16, 2024
@Moshyfawn Moshyfawn added tasks and removed triage Maintainer needs to classify the issue labels Jun 16, 2024
@notpeter notpeter removed the admin read Pending admin review label Jun 18, 2024
@WeetHet
Copy link
Contributor Author

WeetHet commented Jun 22, 2024

Also, in my opinion, some of the instances of Command should be using which as well, at least the language related ones 100% should do that

@notpeter notpeter added the rust Rust programming language support label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] rust Rust programming language support tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants