-
Notifications
You must be signed in to change notification settings - Fork 1
Add caching and don't clear environments all the time #134
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
Conversation
This prevents users from using binaries, etc., that are already installed on the environment.
Need to add envs after we clear_env!
konstantinoscs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks ok to me
| cache_dir: Option<PathBuf>, | ||
|
|
||
| // protected_mode is a flag that indicates whether the UV instance is in protected mode. | ||
| // In protected mode, the UV instance do things like clear the environment variables before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // In protected mode, the UV instance do things like clear the environment variables before | |
| // In protected mode, the UV instance does things like clear the environment variables before |
| // that you don't have to create underlying directory, uv will do that automagically for us. | ||
| pub fn default_cache_dir() -> PathBuf { | ||
| let dir = dirs::data_local_dir().unwrap(); | ||
| dir.join("tower").join("cache") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should be a hidden folder (prefixed with .)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically it ends up in the .local dir in your home directory (which is way data_local_dir resolves to in this package) so it's kinda hidden.
| // cache_dir is the directory that dependencies should be cached in. | ||
| cache_dir: Option<PathBuf>, | ||
|
|
||
| // protected_mode is a flag that indicates whether the UV instance is in protected mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is protected mode something that comes from UV itself or our own terminology?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's my own fancy new term :) We'll need to iterate on this a bit.
Clearing the environment isolates the process too much from the host. This makes it difficult to do things like use pre-installed assets on the relevant host.