-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
Allow cache location configuration #357
Comments
Here is my proposal for this:
Last we could also include some crude and quick stats on the amount temporary disk space used in the current temp dir. In all cases, deleting the whole temp directory would have no impact (unless this is done while a scan is mid air of course) Feedback welcomed! |
@pombredanne Your proposal makes sense to me and I'd like to give implementing it a try (in order to fix #685). Just two questions/suggestions:
|
@haikoschol excellent!
well, either way works: your call SCANCODE_DEV_MODE is a bit of a wart I created IMHO . I am not very happy about this
That works too. Having it everywhere the same is indeed better: either |
True, a tag file is not ideal but the concept of "dev mode" and "user mode" is very useful, I think. The advantage of a tag file is that it is explicit and easy to create for testing/reproducing bugs/etc. |
so now you are convincing me that it may not be such a wart after all :P |
Signed-off-by: Haiko Schol <[email protected]>
This follows the logic proposed in aboutcode-org#357 and is intended to fix aboutcode-org#685. Signed-off-by: Haiko Schol <[email protected]>
See instead this #685 (comment) for a comprehensive analysis and suggested solution for both cache and temp files |
This is based on the design in #685 (comment) * add new scancode_config.py with centralized global defaults for cache and temp_dir, SCANCODE_DEV_MODE, and scancode version. * add --cache-dir and --temp-dir as new CLI options * ensure that plugins can receive all CLI args when they are called * ensure that all accesses to temp-dirs and all accesses cache files are properly using the top level cache and temp args * refactor code that creates temp directories codebase-wide to always accept an argument which is the base dir under which this is created * refactor licensedcode cache to use the the cache_dir as an option * refactor scancode.cli to use the the temp_dir for the per-scan cache * Fixed bug when an output option is followed by another option and not a file name (@JonoYang reported this). This will raise an error. * Fixed bug on dates that were not properly filtered in the test results comparison * refactor output filter plugins to be regular codebase plugins that process a whole codebase. They now set an is_filtered Resource attribute. * move output filter processing entirely inside the Codebase/Resource processing * Modified resource.Codebase/resource walking code accrodingly, removed the sort option from walk(): walk() and children() are always returning sorted resources now: default sort order of the resource tree is by file, then directories, then case-insentive name * fix bug on incorrect file_counts * wrap call to plugins in try/except to catch plugins errors on plugins runs and exit cleanly with a message. This is now done in a function for all plugins except scanners * add concrete kwargs for options to plugin methods. Plugins now receive all the CLI options as kwargs and there is no Command Option ugly tuple anymore. * cleanup output to use only a process_codebase and not a save_results * Since all errors stack trace is now fully reported, ensure that only the last and first line of an error message is used for test results comparison. * add siblings(), has_(children, parent, siblings) methods to resource.Resource * add size_count for descendants size to a Resource. Also available in JSON outputs. The size attribute of a dir is now always 0. * removed plugincode.output._TEST_MODE flag. * renamed SCANCODE_DEBUG* flags. * other minor refactorings and formatting Signed-off-by: Philippe Ombredanne <[email protected]>
*also do not use metavar in help Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
* make sure skip_filtered is used where needed and only there * ensure counts are correct in various cases Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
* this restore the proper cache warmup Signed-off-by: Philippe Ombredanne <[email protected]>
* in licensedcode.cached Signed-off-by: Philippe Ombredanne <[email protected]>
* this is now essentailly a copy of commoncode.fileutils.create_dir() Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
This has been implemented as part of the #885 merge. Closing! |
* this will allow to support facets where one file can be in multiple facets Signed-off-by: Philippe Ombredanne <[email protected]>
* this is generally useful when builoding plugins with options Signed-off-by: Philippe Ombredanne <[email protected]>
facets are based on path only Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
* this will allow to support facets where one file can be in multiple facets Signed-off-by: Philippe Ombredanne <[email protected]>
* this is generally useful when builoding plugins with options Signed-off-by: Philippe Ombredanne <[email protected]>
facets are based on path only Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
* this will allow to support facets where one file can be in multiple facets Signed-off-by: Philippe Ombredanne <[email protected]>
* this is generally useful when builoding plugins with options Signed-off-by: Philippe Ombredanne <[email protected]>
facets are based on path only Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
* this will allow to support facets where one file can be in multiple facets Signed-off-by: Philippe Ombredanne <[email protected]>
* this is generally useful when builoding plugins with options Signed-off-by: Philippe Ombredanne <[email protected]>
facets are based on path only Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Philippe Ombredanne <[email protected]>
Since this could be eventually large and does not play well with any network storage (NTFS shares or NFS) the location where the cache is stored on disk should be configurable, ideally with env variables
The text was updated successfully, but these errors were encountered: