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

Cache in a ~/.pants directory, instead of ~/.nce #283

Open
huonw opened this issue Sep 20, 2023 · 6 comments
Open

Cache in a ~/.pants directory, instead of ~/.nce #283

huonw opened this issue Sep 20, 2023 · 6 comments

Comments

@huonw
Copy link
Contributor

huonw commented Sep 20, 2023

scie-pants currently caches its setup (e.g. downloaded interpreters, venvs, etc.) into ~/.nce, which is different to where all the usual pants caches are: ~/.cache/pants (by default). This is confusing for users.

It'd be nice if we could put it all in one place, e.g. return to the PANTS_SETUP_CACHE="${PANTS_SETUP_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/pants/setup}" logic that the old ./pants script used.

This should now be possible in some form with a-scie/lift#41, although there's some questions about migration.

@huonw
Copy link
Contributor Author

huonw commented Sep 20, 2023

With #284, scie-pants uses appropriate dep versions to support this: science >= 0.2.0 (https://github.com/a-scie/lift/releases/tag/v0.2.0) and jump >= 0.12 (https://github.com/a-scie/jump/releases/tag/v0.12.0).

@kaos
Copy link
Member

kaos commented Feb 14, 2024

[..] there's some questions about migration.

Can you elaborate on this?

When you upgrade scie-pants, the cache key will change, effectively abandoning any previous cache entries, right? So I'm not sure what needs migrating here..

@huonw
Copy link
Contributor Author

huonw commented Feb 14, 2024

Ah hm, let me dig that out of my memory... maybe it was: People may have CI configuration that caches the old directory that needs updating or else their builds may get notably slower (eg suggestions in https://www.pantsbuild.org/2.19/docs/using-pants/using-pants-in-ci#directories-to-cache).

I guess there's also the smaller factor of the nce caches turning into wasted disk space, and thus maybe we could be nice and help people clean up.

I agree we don't need to actually move things on disk, though.

@kaos
Copy link
Member

kaos commented Feb 15, 2024

People may have CI configuration that caches the old directory that needs updating or else their builds may get notably slower (eg suggestions in https://www.pantsbuild.org/2.19/docs/using-pants/using-pants-in-ci#directories-to-cache).

Right. So we'd need to update the docs there.

I guess there's also the smaller factor of the nce caches turning into wasted disk space, and thus maybe we could be nice and help people clean up.

I see this as an unrelated issue.
Relates to: pantsbuild/pants#11167

I agree we don't need to actually move things on disk, though.

Ack.

So it comes down to clear documentation/communication about the change so users can adapt as appropriate when upgrading.

@huonw
Copy link
Contributor Author

huonw commented Feb 15, 2024

For CI, I think a "perfect state" for the change would do more. In particular, someone who has already set up CI and had it chugging along for a while won't be rereading the docs to notice. (Although of course we need to update the docs for new users.)

So, we might want to consider a switchover period (eg opt in by setting an environment variable), warnings and/or other active help so people are alerted.

However, we might decide to do less, but let's do so explicitly rather than accidentally.

@kaos
Copy link
Member

kaos commented Feb 15, 2024

yea, I imagined part of the "/communication" part to be messages (warnings) from scie-pants itself at runtime.

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

No branches or pull requests

2 participants