Skip to content

Add possibility to install global environments#221

Merged
pavelzw merged 29 commits intoprefix-dev:mainfrom
olivier-lacroix:global-environments
Sep 22, 2025
Merged

Add possibility to install global environments#221
pavelzw merged 29 commits intoprefix-dev:mainfrom
olivier-lacroix:global-environments

Conversation

@olivier-lacroix
Copy link
Contributor

@olivier-lacroix olivier-lacroix commented Aug 12, 2025

If updating documentation:

closes #150

Copy link
Collaborator

@pavelzw pavelzw left a comment

Choose a reason for hiding this comment

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

could you write some documentation please?

@pavelzw pavelzw added the enhancement New feature or request label Aug 13, 2025
@olivier-lacroix
Copy link
Contributor Author

Alright, so I took the option of having two separate caches. one for the global environment(s), one for project environment(s).

Let me know if you are happy with this direction, or if you'd rather keep a single cache

@olivier-lacroix
Copy link
Contributor Author

olivier-lacroix commented Sep 7, 2025

Sorry @pavelzw , I had missed your comment.

could you write some documentation please?

done. I'll update the pixi documention if / once merged

@pavelzw pavelzw mentioned this pull request Sep 12, 2025
1 task
Copy link
Collaborator

@pavelzw pavelzw left a comment

Choose a reason for hiding this comment

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

sorry for the late reply @olivier-lacroix. i have a comment about the caching that we should discuss before i review the whole thing

src/options.ts Outdated
cache: parseOrUndefinedJSON('cache', z.boolean()),
cacheKey: parseOrUndefined('cache-key', z.string()),
projectCacheKey: parseOrUndefined('cache-key', z.string()),
globalCacheKey: parseOrUndefined('global-cache-key', z.string()),
Copy link
Collaborator

Choose a reason for hiding this comment

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

thinking about this a bit more, i'm not sure a cache for pixi global install is a good idea...
pixi global install is inherently non-reproducible (prefix-dev/pixi#2292) and thus, having a cache for this will result in dependency drifting.
GitHub's cache will get evicted if it wasn't accessed for 7 days: https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#usage-limits-and-eviction-policy

This means that for medium-high-traffic repositories, the cache might never be evicted which will cause staleness and non-reproducibility.
the regular project cache doesn't have this issue because there, we use the lockfile (and some other things) for the hash.

with that in mind, i would prefer not to have a global-cache-key. also, pixi global install is usually fast enough that caching doesn't get you much anyway 😄
wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. This being said, there will be cases where caching does give significant speed up. Gcloud, especially if some extra components are installed, is one such case.

what about a separate global-cache setting? Maybe a TTL option for that cache as well? And / or warnings about enabling that setting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However, I can pull out the cache part for now, and defer that to another PR / discussion

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's move that for now. This will also make the review smaller 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pulled the global cache out of this PR

@olivier-lacroix olivier-lacroix force-pushed the global-environments branch 2 times, most recently from 575f020 to 680b283 Compare September 14, 2025 08:25
@olivier-lacroix
Copy link
Contributor Author

olivier-lacroix commented Sep 17, 2025

@pavelzw this PR is ready for our review

Copy link
Collaborator

@pavelzw pavelzw left a comment

Choose a reason for hiding this comment

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

Mostly looks good, only small comments and then we can merge.

@pavelzw pavelzw merged commit 194d461 into prefix-dev:main Sep 22, 2025
171 of 175 checks passed
@olivier-lacroix
Copy link
Contributor Author

Thanks @pavelzw ! apologies, I was away and could not respond in time.

@olivier-lacroix olivier-lacroix deleted the global-environments branch September 28, 2025 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow global install

2 participants