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

Feature: test result cache #2

Closed
metux opened this issue Oct 1, 2023 · 1 comment
Closed

Feature: test result cache #2

metux opened this issue Oct 1, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@metux
Copy link
Owner

metux commented Oct 1, 2023

Rationale:

Since many tests involve expensive tasks like compiler runs, these can make up large portion of the whole build time. From decades long experience w/ autoconf we already learned that in many smaller packages it can take the majority part.

Especially when building whole distros (eg ptxdist, yocto, buildroot,..), there's a huge potential for optimizing overall build time by caching.

Additionally, this provides a chance for globally injecting very target specific decisions by prepopulating the cache by the system integrator. (eg if certain present platform items really should be treated as absent, more tight limits, etc)

Design:

  1. univeral check identification by hashing
    • done in spec loader phase
    • hashing over all fields defining what to check for
    • excluding anything related to check's consequences (eg setting symbols, switching featues), dynamic state, ...
    • results are stored in a dict inside runtime project config
  2. prepopulation and writeback
  • recording whether check was actually run or cached
  • preload test results from cache into project config before actual running checks
  • after check run, write back (only) the new results to the cache
  • preloading from multiple sources - the integrator's items always take precedence
  1. Check run
  • when cached result exists, check run is skipped
  • check item is flagged as cached and consequences applied normally
  • when not cached, run the check and write back result to cache, before applying consequences
  • add "answer" field: when given, the check isn't actually run, but the result directly taken from that field.

Prepopulation by config-as-code:

  • create a little dummy project for generating the cache
  • checks written in the usual way, but already filling "answer" field.
  • integrators just run this package at first, so others following already have a prepopulated cache
@metux
Copy link
Owner Author

metux commented Oct 2, 2023

Status:

  • internal cache ok
  • writeback not implemented yet
  • cache load not implemented yet

@metux metux added the enhancement New feature or request label Oct 11, 2023
@metux metux closed this as completed Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant