Conversation
Writing a script in teal introduces a noticable delay since it needs to
be compiled each time. Using our patented
check-the-mod-time-of-the-files™®© technology we can compile it once and
shove it in some random directory to be pulled up later when it hasn't
changed.
This behavior can be controlled with a few environment variables:
- CYAN_DISABLE_SCRIPT_CACHE: disables saving and loading to and from
the cache
- CYAN_SCRIPT_CACHE_DIR: controls what directory saving and loading are
done to and from.
The default values on unix-likes are:
- $XDG_CACHE_HOME/cyan-script-cache
- $HOME/.cache/cyan-script-cache
And on windows:
- %AppData%\Temp\cyan-script-cache
Errors while saving and loading to and from the cache are not considered
failures as it is trivial to just recompile the script.
For script caching we started storing script paths as absolute, but displayed paths are generally relative to the starting directory. This was hacked in as `script.base_directory`. Introducing the `InvocationContext`. To avoid global state, things that need information about how cyan itself was invoked should take this as a parameter. Right now it only contains the initial directory and project root directory.
Member
Author
|
Closes #47 |
Member
Author
|
Tests run fine locally, and I can't repro luarocks not being able to satisfy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Writing a script in teal introduces a noticable delay since it needs to
be compiled each time. Using our patented
check-the-mod-time-of-the-files™®© technology we can compile it once and
shove it in some random directory to be pulled up later when it hasn't
changed.
This behavior can be controlled with a few environment variables:
CYAN_DISABLE_SCRIPT_CACHE: disables saving and loading to and from
the cache
CYAN_SCRIPT_CACHE_DIR: controls what directory saving and loading are
done to and from.
The default values on unix-likes are:
And on windows:
Errors while saving and loading to and from the cache are not considered
failures as it is trivial to just recompile the script.
Note that this has not been tested yet on windows and I'm not super familiar with its directory conventions. So until that is figured out this won't be merged.