-
Notifications
You must be signed in to change notification settings - Fork 564
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
feat: auto-generate ruleset cache on source change #2133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased)
section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required changes marked with 👀
Great first pass!
I don't love this logic living somewhat deep in the library code, since it depends on the environment of the program (capa). For example, another project that uses capa as a library may not want to have this behavior. Do you think it's possible to cleanly move the dev/git logic into capa.main
?
CHANGELOG updated or no update needed, thanks! 😄
agree here to move this to capa.main or a utils file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beyond splitting this up we'd prefer to call this from capa.main (and not deep in the library)
can we add the check if this is a dev environment there instead? (e.g. around get_rules)
Moving the dev environment checks to capa.main and importing them from capa.main would create circular dependencies when I tested it. |
I mean to call it from there not to implement them in main. |
This commits groups the computing cache identifier logic into a a single function: compute_cache_identifier. Initially, this the cache id computing was split into two functions compute_ruleset_cache_identifier and compute_cache_identifier.
This commits groups the computing cache identifier logic into a a single function: compute_cache_identifier. Initially, this the cache id computing was split into two functions compute_ruleset_cache_identifier and compute_cache_identifier.
98916be
to
077d4bb
Compare
4f26e07
to
8b89a70
Compare
8b89a70
to
5b2c5ea
Compare
if "site-packages" in __file__: | ||
# running from a site-packages installation | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also consider dist-packages
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't seem important but if you can demonstrate it's relevant this shouldn't be hard
Any concerns or blockers before merging this? |
ping @s-ff, @williballenthin, @mike-hunhoff |
Co-authored-by: Willi Ballenthin <[email protected]>
Closes #1898.
This is a proposal for the issue discussed in #1898.
Let's test out its feasibility and make sure it does not introduce an overhead.