-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Refactor compile cache #301
Conversation
filesExtension: string | ||
) { | ||
const dates = await getModificationDatesInDir(dir, filesExtension); | ||
const getMaxSourceDate = (sourceGlobalPaths: string[]) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResolvedFile
already has a lastModificationDate
field.
); | ||
}; | ||
|
||
const LAST_CONFIG_USED_FILENAME = "path-to-last-config-used.txt"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use solc
config and Buidler version instead
async (__, { run }) => run(TASK_BUILD_ARTIFACTS) | ||
); | ||
task(TASK_COMPILE, "Compiles the entire project, building all artifacts") | ||
.addFlag("f", "Force compilation ignoring cache") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force
Let's use |
Description
This refactor is fairly simple, we still use modification timestamps to check "change" in source files, but we now check library files (we get all the dependency source files from the
DependencyGraph
object).We know check for buidler's and solc's version, if they change, the cache is invalidated.
I've also simplified some of the code, using the observation that we just need to check the max date for source files against the min date of compiled artifacts (special casing the Buidler config file).
Feature
This pr includes a new
--force
flag to the builtincompile
task, to force compilation, disregarding cache.