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

wip: cache environment #288

Closed
wants to merge 1 commit into from
Closed

wip: cache environment #288

wants to merge 1 commit into from

Conversation

molleweide
Copy link
Collaborator

@molleweide molleweide commented Feb 20, 2025

I have implemented a basic version for caching the environment and loading it.

TODO/FIX:
So, I realize, that with the variables defined in init.sh, now sourcing only environment.sh fails.
Should we export the cache variables, but then the variables would be included in the cache when
environment is storing the cache, and could that have some bad consequences? Hmm.

I need to sleep on this.

@balupton
Copy link
Member

balupton commented Feb 21, 2025

This is the wrong way to handle it unfortunately.

Both login.* and interactive.* need to source environment.*

Login.* sourcing of environment.* will instruct environment.* to check if it is login and interactive, if it is, check for cache, if there is cache, save current bare env and load the cache.

Interactive.* will source and instruct environment.* to check if a cache was used, and if so, reset the current env to the saved bare env and load the setup-environment-commands and save the result as the cache.

init.sh shouldn't be changed.

in practice, the cache just needs to be the output of setup-environment-commands

In fact, setup-environment-commands itself could probably handle the loading of the cache and the saving of both caches (original and result).

Perhaps we should have login.* and interactive.* call setup-environment-commands directly, such that they can pass --login and --interactive flags or --cache flags to it appropriately. That way the environment.* commands operate as is and ignore the cache and do not write to it.

@balupton
Copy link
Member

balupton commented Feb 21, 2025

From our signal discussion, this can be and should be done entirely in user land via their environment.bash user config file.

We should update docs/dorothy/... with instructions however once we have a prototype going. Or better yet, track the caching idea in an issue with the OP having the latest instructions.

@molleweide
Copy link
Collaborator Author

Closing this as further discussions on caching and implementation has been started in #290.

@molleweide molleweide closed this Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants