Don't fail the build if rofiles-fuse is not available

My understanding is that rofiles-fuse is just an optimization,
and we support building without it anyway (using --disable-rofiles-fuse).

So, instead of failing the build, we can just not use rofiles-fuse
if it is not present on the system, which seems to be the case on
some OSes, we've seen this reported from Debian and Arch.
tingping/wmclass
Matthias Clasen 2017-04-08 10:29:51 -04:00 committed by Alexander Larsson
parent 91c78e553c
commit 1adec3f186
1 changed files with 14 additions and 0 deletions

View File

@ -68,6 +68,7 @@ struct BuilderContext
gboolean sandboxed;
gboolean rebuild_on_sdk_change;
gboolean use_rofiles;
gboolean have_rofiles;
};
typedef struct
@ -200,7 +201,11 @@ static void
builder_context_init (BuilderContext *self)
{
GLnxLockFile init = GLNX_LOCK_FILE_INIT;
g_autofree char *path = NULL;
self->rofiles_file_lock = init;
path = g_find_program_in_path ("rofiles-fuse");
self->have_rofiles = path != NULL;
}
GFile *
@ -543,6 +548,12 @@ builder_context_enable_rofiles (BuilderContext *self,
if (!self->use_rofiles)
return TRUE;
if (!self->have_rofiles)
{
g_debug ("rofiles-fuse not available, doing without");
return TRUE;
}
g_assert (self->rofiles_dir == NULL);
if (self->rofiles_allocated_dir == NULL)
@ -626,6 +637,9 @@ builder_context_disable_rofiles (BuilderContext *self,
if (!self->use_rofiles)
return TRUE;
if (!self->have_rofiles)
return TRUE;
g_assert (self->rofiles_dir != NULL);
argv[2] = (char *)flatpak_file_get_path_cached (self->rofiles_dir);