I realized I didn’t motivate why hash tree is a good approach. For example, why not include HOME_PROJECT[]
in the data from which the hash is computed [1]? Hash tree approach is better because, when your multiple projects share a dependency subtree, it gets shared automatically and there is no need for precompilation even for newly created projects. This is a big help for short-lived projects as in the workflow @oxinabox explained.
[1] Side note: It may be a good enough short-term solution (which is orthogonal to what I am proposing here). But simply doing so didn’t work because it is reset in load_path_setup_code
, IIRC.
Edit: there is also LOAD_PATH
which complicates the problem further