ta0kira / zeolite

Zeolite is a statically-typed, general-purpose programming language.
Apache License 2.0
18 stars 0 forks source link

Add a simplified freshness check for dependencies. #93

Closed ta0kira closed 4 years ago

ta0kira commented 4 years ago

Currently, if a dependency isn't out of date, but it's compile-metadata is newer than the module depending on it, the latter will be considered out of date. But, it should be fine if the public .0rp sources from the dependency aren't newer than the module depending on them.

Here is an example situation:

It would be helpful if the freshness check for foo used a simplified freshness check for lib/file that only includes the .0rp files, since recompiling lib/file in incremental mode won't be affected by implementation changes to lib/util.

So, to check a module's freshness:

ta0kira commented 4 years ago

This won't work without removing the Namespace in category deps (in object_files) that come from other modules, because recompiling a dep will invalidate its namespaces.

For example, non-local category deps should be changed to NoNamespace in resolveObjectDeps, and getObjectFileResolver should replace NoNamespace with the owning module's public_namespace.

ta0kira commented 4 years ago

I take that back: Linking fails because compiled .cpp sources depend on an outdated C++ namespace. So, this isn't feasible at the moment.

ta0kira commented 4 years ago

Actually, it should be fine to make the public namespace deterministically based on absolute path and compiler hash.

ta0kira commented 4 years ago

If making the public namespace deterministic is necessary, then that obviates clearing/setting the Namespace in object_files.

ta0kira commented 4 years ago

Rather than assuming the public namespace is deterministic, the freshness check could check that the Namespace in object_files matches the public namespace of the dep.