Skip to content

Conversation

@bradhe
Copy link
Contributor

@bradhe bradhe commented Nov 19, 2025

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.

This prevents users from using binaries, etc., that are already installed on the environment.
Copy link
Contributor

@konstantinoscs konstantinoscs left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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")
Copy link
Contributor

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 .)

Copy link
Contributor Author

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@bradhe bradhe merged commit 0af3e3f into develop Nov 19, 2025
5 checks passed
@bradhe bradhe deleted the tasks/add-caching-to-tower-apps branch November 19, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants