-
Notifications
You must be signed in to change notification settings - Fork 37
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
Problems with self-modifying scripts #27
Comments
I've been trying to reproduce this, but I just can't observe this behaviour. Part of the caching system involves writing a metadata file to the cache for every script built. This includes the source script's mtime (assuming it wasn't an expression on the command line), and a hash of the input script. If the metadata block computed for an invocation doesn't exactly match the metadata block stored in the cache, it triggers a rebuild of the package. This rebuild involves rewriting the manifest and the source file. However, to avoid incessant recompiling, it won't touch the files if they haven't changed (it computes and compares hashes of the existing file and the new contents before overwriting). Finally, it invokes Cargo. About the only way I can see this happening is if Cargo itself decides it doesn't need to rebuild the executable (even if the filesystem has very low-precision mtimes, the hash check should prevent If you can reliably reproduce this, it might help to run If it's Cargo deciding not to build, I'm not sure what I can do that doesn't involve blindly forcing Cargo to always rebuild everything every time, which would rather defeat the point of |
Here is the long log. It has stopped on 8.
|
This hack is supposed to increment on each run:
But it stops incrementing if I run if quickly (without waiting after
cargo-script script q
):Although self-modifying scripts are no priority for cargo-script, this may indicate some issue with caching and lead to stale caches after updating normal scripts.
The text was updated successfully, but these errors were encountered: