Hacker News new | past | comments | ask | show | jobs | submit login

I've implemented a configuration caching mechanism for myself (in one important project) which stores configuration artifacts in a cache directory, associated by the commit hash. It works as a git hook:

  $ git bisect good
  Bisecting: 7 revisions left to test after this (roughly 3 steps)
  restored cached configuration for 2f8679c346a88c07b81ea8e9854c71dae2ade167
  [2f8679c346a88c07b81ea8e9854c71dae2ade167] expander: noexpand mechanism.

The "restored cached configuration" message is from the git hook. What it's not saying is that it also saved the config for the commit it is navigating away from.

I primed the cache by executing a "git checkout" for each of a range of commits.

Going forward, it will populate itself.

This is the only issue I would conceivably care about with regard to configure performance. When not navigating in git history, I do not often run configure.

Downstream distros do not care; they keep their machines and cores busy by building multiple packages in parallel.

It's not ideal because the cache from one host is not applicable to another; you can't port it. I could write an intelligent script to populate it, which basically identifies commits (within some specified range) that have touched the config system, and then assumes that for all in-between commits, it's the same.

The hook could do this. When it notices that the current sha doesn't have a cached configuration, it could search backwards through history for the most recent commit which does have it. If the configure script (or something influencing it) has not been touched since that commit, then its cached material can be populated for all in-between commits right through the current one. That would take care of large swaths of commits in a typical bisect session.






The right way to do this is not to rely on the git hashes, but to hash the inputs into the configuration system (those that are in version control, not the implicit environmental inputs from the platform).

For instance, if the only input to the configuration system is the body of the configure script, then we hash that. That is then our key to the generated materials.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: