Skip to content
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

Merged
merged 3 commits into from
Jun 12, 2019
Merged

Refactor compile cache #301

merged 3 commits into from
Jun 12, 2019

Conversation

jjant
Copy link
Contributor

@jjant jjant commented Jun 10, 2019

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 builtin compile task, to force compilation, disregarding cache.

filesExtension: string
) {
const dates = await getModificationDatesInDir(dir, filesExtension);
const getMaxSourceDate = (sourceGlobalPaths: string[]) =>
Copy link
Member

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";
Copy link
Member

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

force

@alcuadrado
Copy link
Member

Let's use function

@jjant jjant merged commit 7d08f2e into master Jun 12, 2019
@jjant jjant deleted the cache branch June 12, 2019 21:59
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants