forked from Mirrors/flatpak-builder
Merge pull request #36 from matthiasclasen/module-errors
flatpak-builder: Print name of failed module on errortingping/wmclass
commit
8362d9cafe
|
@ -552,7 +552,10 @@ builder_module_download_sources (BuilderModule *self,
|
|||
BuilderSource *source = l->data;
|
||||
|
||||
if (!builder_source_download (source, update_vcs, context, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -575,7 +578,10 @@ builder_module_extract_sources (BuilderModule *self,
|
|||
BuilderSource *source = l->data;
|
||||
|
||||
if (!builder_source_extract (source, dest, context, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -680,7 +686,10 @@ build (GFile *app_dir,
|
|||
|
||||
if (subp == NULL ||
|
||||
!g_subprocess_wait_check (subp, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", module_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -727,12 +736,18 @@ builder_module_handle_debuginfo (BuilderModule *self,
|
|||
if (is_shared)
|
||||
{
|
||||
if (!strip (error, "--remove-section=.comment", "--remove-section=.note", "--strip-unneeded", path, NULL))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!strip (error, "--remove-section=.comment", "--remove-section=.note", path, NULL))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!builder_options_get_no_debuginfo (self->build_options, context))
|
||||
|
@ -767,6 +782,7 @@ builder_module_handle_debuginfo (BuilderModule *self,
|
|||
if (g_mkdir_with_parents (debug_dir, 0755) != 0)
|
||||
{
|
||||
glnx_set_error_from_errno (error);
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -774,6 +790,7 @@ builder_module_handle_debuginfo (BuilderModule *self,
|
|||
if (g_mkdir_with_parents (source_dir_path, 0755) != 0)
|
||||
{
|
||||
glnx_set_error_from_errno (error);
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -806,20 +823,29 @@ builder_module_handle_debuginfo (BuilderModule *self,
|
|||
GFileType file_type;
|
||||
|
||||
if (!gs_file_ensure_directory (dst_parent, TRUE, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
file_type = g_file_query_file_type (src, 0, NULL);
|
||||
if (file_type == G_FILE_TYPE_DIRECTORY)
|
||||
{
|
||||
if (!gs_file_ensure_directory (dst, FALSE, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (file_type == G_FILE_TYPE_REGULAR)
|
||||
{
|
||||
if (!g_file_copy (src, dst,
|
||||
G_FILE_COPY_OVERWRITE,
|
||||
NULL, NULL, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -830,7 +856,10 @@ builder_module_handle_debuginfo (BuilderModule *self,
|
|||
"-f", debug_path,
|
||||
"-F", real_debug_path,
|
||||
path, NULL))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -875,7 +904,10 @@ builder_module_build (BuilderModule *self,
|
|||
|
||||
if (!gs_file_ensure_directory (build_parent_dir, TRUE,
|
||||
NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (count = 1; source_dir_path == NULL; count++)
|
||||
{
|
||||
|
@ -895,6 +927,7 @@ builder_module_build (BuilderModule *self,
|
|||
if (!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_EXISTS))
|
||||
{
|
||||
g_propagate_error (error, g_steal_pointer (&my_error));
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
g_clear_error (&my_error);
|
||||
|
@ -910,6 +943,7 @@ builder_module_build (BuilderModule *self,
|
|||
!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||
{
|
||||
g_propagate_error (error, g_steal_pointer (&my_error));
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
g_clear_error (&my_error);
|
||||
|
@ -917,7 +951,10 @@ builder_module_build (BuilderModule *self,
|
|||
if (!g_file_make_symbolic_link (build_link,
|
||||
buildname,
|
||||
NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_print ("========================================================================\n");
|
||||
g_print ("Building module %s in %s\n", self->name, source_dir_path);
|
||||
|
@ -945,7 +982,7 @@ builder_module_build (BuilderModule *self,
|
|||
cmake_file = g_file_get_child (source_subdir, "CMakeLists.txt");
|
||||
if (!g_file_query_exists (cmake_file, NULL))
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Can't find CMakeLists.txt");
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "module: %s: Can't find CMakeLists.txt", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
configure_file = g_object_ref (cmake_file);
|
||||
|
@ -957,7 +994,10 @@ builder_module_build (BuilderModule *self,
|
|||
if (self->rm_configure)
|
||||
{
|
||||
if (!g_file_delete (configure_file, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -981,18 +1021,21 @@ builder_module_build (BuilderModule *self,
|
|||
|
||||
if (autogen_cmd == NULL)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Can't find autogen, autogen.sh or bootstrap");
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "module %s: Can't find autogen, autogen.sh or bootstrap", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
env_with_noconfigure = g_environ_setenv (g_strdupv (env), "NOCONFIGURE", "1", TRUE);
|
||||
if (!build (app_dir, self->name, context, source_dir, source_subdir_relative, build_args, env_with_noconfigure, error,
|
||||
autogen_cmd, NULL))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!g_file_query_exists (configure_file, NULL))
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "autogen did not create configure");
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "module %s: autogen did not create configure", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1007,7 +1050,10 @@ builder_module_build (BuilderModule *self,
|
|||
g_autofree char *configure_content = NULL;
|
||||
|
||||
if (!g_file_load_contents (configure_file, NULL, &configure_content, NULL, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
var_require_builddir = strstr (configure_content, "buildapi-variable-require-builddir") != NULL;
|
||||
use_builddir = var_require_builddir || self->builddir;
|
||||
|
@ -1021,7 +1067,10 @@ builder_module_build (BuilderModule *self,
|
|||
build_dir = g_file_get_child (source_subdir, "_flatpak_build");
|
||||
|
||||
if (!g_file_make_directory (build_dir, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (self->cmake)
|
||||
{
|
||||
|
@ -1074,7 +1123,7 @@ builder_module_build (BuilderModule *self,
|
|||
|
||||
if (makefile_names[i] == NULL)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Can't find makefile");
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "module %s: Can't find makefile", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1106,7 +1155,10 @@ builder_module_build (BuilderModule *self,
|
|||
root_dir = g_file_get_child (app_dir, "files");
|
||||
|
||||
if (!builder_migrate_locale_dirs (root_dir, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (self->post_install)
|
||||
|
@ -1127,10 +1179,16 @@ builder_module_build (BuilderModule *self,
|
|||
if (!builder_context_get_keep_build_dirs (context))
|
||||
{
|
||||
if (!g_file_delete (build_link, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gs_shutil_rm_rf (source_dir, NULL, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -1148,7 +1206,10 @@ builder_module_update (BuilderModule *self,
|
|||
BuilderSource *source = l->data;
|
||||
|
||||
if (!builder_source_update (source, context, error))
|
||||
return FALSE;
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue