By default, don't rebuild apps if the SDK changes

Rebuilding all apps because a minor change in the runtime is way too wasteful
and generated unnecessary app updates, especially since runtimes are supposed
to be API stable.

We add an a --rebuild-on-sdk-change option which you use to disable this feature,
for instance if you're building against an unstable SDK.
This commit is contained in:
Alexander Larsson committed 2017-02-10 16:37:33 +01:00
1 parent 08ea3baf49
commit f2fb0eaf55
5 files changed
+34 -1

No files matched your search

+14
View File
@@ -58,6 +58,7 @@ struct BuilderContext
gboolean build_extension;
gboolean separate_locales;
gboolean sandboxed;
gboolean rebuild_on_sdk_change;
};
typedef struct
@@ -389,6 +390,19 @@ builder_context_set_separate_locales (BuilderContext *self,
self->separate_locales = !!separate_locales;
}
gboolean
builder_context_get_rebuild_on_sdk_change (BuilderContext *self)
{
return self->rebuild_on_sdk_change;
}
void
builder_context_set_rebuild_on_sdk_change (BuilderContext *self,
gboolean rebuild_on_sdk_change)
{
self->rebuild_on_sdk_change = !!rebuild_on_sdk_change;
}
gboolean
builder_context_enable_ccache (BuilderContext *self,
GError **error)
+3
View File
@@ -76,6 +76,9 @@ void builder_context_set_build_extension (BuilderContext *self,
gboolean builder_context_get_separate_locales (BuilderContext *self);
void builder_context_set_separate_locales (BuilderContext *self,
gboolean separate_locales);
gboolean builder_context_get_rebuild_on_sdk_change (BuilderContext *self);
void builder_context_set_rebuild_on_sdk_change (BuilderContext *self,
gboolean rebuild_on_sdk_change);
BuilderContext *builder_context_new (GFile *base_dir,
GFile *app_dir);
+3
View File
@@ -47,6 +47,7 @@ static gboolean opt_keep_build_dirs;
static gboolean opt_force_clean;
static gboolean opt_allow_missing_runtimes;
static gboolean opt_sandboxed;
static gboolean opt_rebuild_on_sdk_change;
static char *opt_stop_at;
static char *opt_arch;
static char *opt_repo;
@@ -81,6 +82,7 @@ static GOptionEntry entries[] = {
{ "sandbox", 0, 0, G_OPTION_ARG_NONE, &opt_sandboxed, "Enforce sandboxing, disabling build-args", NULL },
{ "stop-at", 0, 0, G_OPTION_ARG_STRING, &opt_stop_at, "Stop building at this module (implies --build-only)", "MODULENAME"},
{ "jobs", 0, 0, G_OPTION_ARG_INT, &opt_jobs, "Number of parallel jobs to build (default=NCPU)", "JOBS"},
{ "rebuild-on-sdk-change", 0, 0, G_OPTION_ARG_NONE, &opt_rebuild_on_sdk_change, "Rebuild if sdk changes", NULL },
{ NULL }
};
@@ -324,6 +326,7 @@ main (int argc,
builder_context_set_keep_build_dirs (build_context, opt_keep_build_dirs);
builder_context_set_sandboxed (build_context, opt_sandboxed);
builder_context_set_jobs (build_context, opt_jobs);
builder_context_set_rebuild_on_sdk_change (build_context, opt_rebuild_on_sdk_change);
if (opt_arch)
builder_context_set_arch (build_context, opt_arch);
+4 -1
View File
@@ -1274,7 +1274,10 @@ builder_manifest_checksum (BuilderManifest *self,
builder_cache_checksum_str (cache, self->runtime);
builder_cache_checksum_str (cache, builder_manifest_get_runtime_version (self));
builder_cache_checksum_str (cache, self->sdk);
builder_cache_checksum_str (cache, self->sdk_commit);
/* Always rebuild on sdk change if we're actually including the sdk in the cache */
if (self->writable_sdk || self->build_runtime ||
builder_context_get_rebuild_on_sdk_change (context))
builder_cache_checksum_str (cache, self->sdk_commit);
builder_cache_checksum_str (cache, self->var);
builder_cache_checksum_str (cache, self->metadata);
builder_cache_checksum_strv (cache, self->tags);
+10
View File
@@ -822,6 +822,16 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--rebuild-on-sdk-change</option></term>
<listitem><para>
Record the exact version of the sdk in the cache, and rebuild everything
if it changes. This is useful if you're building against an API-unstable
runtime, like a nightly build.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>