Skip to content

Commit

Permalink
Don't be overzealous with triggering full rebuilds
Browse files Browse the repository at this point in the history
Because of a rule that invalidates source files if no artefact exists
yet, projects that are built for the first time would always start from
scratch, even if part of the source files had already been built
before. This is annoying when debugging, because a compiler error could
halt the build.

The reason this rule was introduced is because a change in the project
file can theoretically mean different compiler flags- and so existing
object files _should_ be invalidated. The way it was implemented
however (by comparing timestamp of artefact and project.json) isn’t the
right way.
  • Loading branch information
SanderMertens committed Jun 22, 2018
1 parent 93f6d16 commit 6aa3344
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/bake.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ int16_t bake_check_dependencies(
char *artefact)
{
time_t artefact_modified = 0;
time_t project_modified = 0;

if (corto_file_test("project.json")) {
project_modified = corto_lastmodified("project.json");
}

char *artefact_full = corto_asprintf("bin/%s-%s/%s",
CORTO_PLATFORM_STRING, p->cfg->id, artefact);
Expand All @@ -198,15 +193,6 @@ int16_t bake_check_dependencies(
}
free(artefact_full);

if (artefact_modified < project_modified) {
if (artefact_modified) {
corto_ok("cfg 'project.json' #[green](changed)#[normal]");
}
if (p->managed || artefact_modified) {
p->sources_outdated = true;
}
}

/* For each package, if use_generated_api is enabled, also include
* the package that contains the generated api for the language of
* the package */
Expand Down Expand Up @@ -263,6 +249,7 @@ int16_t bake_check_dependencies(
}
}
}

if (p->use_private) {
corto_iter it = corto_ll_iter(p->use_private);
while (corto_iter_hasNext(&it)) {
Expand Down

0 comments on commit 6aa3344

Please sign in to comment.