Open CharlieSuP1 opened 2 years ago
I think main code change to achieve this is here (In file DependencyProcessor.swift):
return files.map { file -> Dependency in
let filePath = file.resolvingSymlinksInPath().path
//.........
if filePath.hasPrefix(sourcePath) {
#return Dependency(url: file, type: .source)
if module's swiftinterface is produced {
return module's swiftinterface
} else {
return Dependency(url: file, type: .source)
}
}
//.........
}
}
Yes, that could potentially. I am not sure if the location of the pseudocode is correct, but the idea seems valid.
Yes, after second thought, pseudocode is not correct, but the whole idea is still potential. I’ll try to implement and see if can submit a merge request.
Another question is that is there any way to check if a swiftinterface file's change is backward compatible? If we can check that, then any backward compatible api changes in module B, will not trigger module A cache invalidation.
Yes, after second thought, pseudocode is not correct, but the whole idea is still potential. I’ll try to implement and see if can submit a merge request.
Is there any progress?
Let's say module A depends on module B,so in A's meta file(which all A's dependencies are listed), line "B.swiftmodule.md5" is contained.
So in consumer mode, if any code change in B module occurs, module B.swiftmodule.md5 is changed, thus triggers A's cache invalidation. And module A is compiled locally(other than use remote cache).
Is there any possibility that:if module B is compiled with "build_library_for_distribution",then A use B's swiftinterface(other than swiftmodule.md5) to be its dependency. If so, is module changes are constrained internally ( no public or open api changes), module A can still use remote cache.