summaryrefslogtreecommitdiff
path: root/builder
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-02-23 14:12:20 +0100
committerAlexander Larsson <alexl@redhat.com>2016-02-23 14:12:20 +0100
commit90aaed7f7b1763832f8d39f056d1dd4a2c8efa34 (patch)
treebb1d60ce20331e58a6a37ff9c0f260f3e0fe0c0d /builder
parent22d997e7120616cdbccf7562593c76420a2f5957 (diff)
downloadxdg-app-90aaed7f7b1763832f8d39f056d1dd4a2c8efa34.tar.gz
builder: Build runtimes in /run/build-runtime
This way we the runtime build dir doesn't conflict with the app dir. Which is good if we want debuginfo with sources for both.
Diffstat (limited to 'builder')
-rw-r--r--builder/builder-manifest.c4
-rw-r--r--builder/builder-module.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/builder/builder-manifest.c b/builder/builder-manifest.c
index 77161d5..57be175 100644
--- a/builder/builder-manifest.c
+++ b/builder/builder-manifest.c
@@ -1971,7 +1971,9 @@ builder_manifest_run (BuilderManifest *self,
g_ptr_array_add (args, g_strdup ("build"));
build_dir_path = g_file_get_path (builder_context_get_build_dir (context));
- g_ptr_array_add (args, g_strdup_printf ("--bind-mount=/run/build=%s", build_dir_path));
+ g_ptr_array_add (args, g_strdup_printf ("--bind-mount=/run/%s=%s",
+ builder_context_get_build_runtime (context) ? "build-runtime" : "build",
+ build_dir_path));
if (g_file_query_exists (builder_context_get_ccache_dir (context), NULL))
{
diff --git a/builder/builder-module.c b/builder/builder-module.c
index b5e39c4..9640d4b 100644
--- a/builder/builder-module.c
+++ b/builder/builder-module.c
@@ -572,6 +572,7 @@ build (GFile *app_dir,
g_autofree char *source_dir_path = g_file_get_path (source_dir);
g_autofree char *source_dir_path_canonical = NULL;
g_autofree char *ccache_dir_path = NULL;
+ const char *builddir;
va_list ap;
int i;
@@ -581,14 +582,19 @@ build (GFile *app_dir,
source_dir_path_canonical = canonicalize_file_name (source_dir_path);
+ if (builder_context_get_build_runtime (context))
+ builddir = "/run/build-runtime/";
+ else
+ builddir = "/run/build/";
+
g_ptr_array_add (args, g_strdup ("--nofilesystem=host"));
g_ptr_array_add (args, g_strdup_printf ("--filesystem=%s", source_dir_path_canonical));
- g_ptr_array_add (args, g_strdup_printf ("--bind-mount=/run/build/%s=%s", module_name, source_dir_path_canonical));
+ g_ptr_array_add (args, g_strdup_printf ("--bind-mount=%s%s=%s", builddir, module_name, source_dir_path_canonical));
if (cwd_subdir)
- g_ptr_array_add (args, g_strdup_printf ("--build-dir=/run/build/%s/%s", module_name, cwd_subdir));
+ g_ptr_array_add (args, g_strdup_printf ("--build-dir=%s%s/%s", builddir, module_name, cwd_subdir));
else
- g_ptr_array_add (args, g_strdup_printf ("--build-dir=/run/build/%s", module_name));
+ g_ptr_array_add (args, g_strdup_printf ("--build-dir=%s%s", builddir, module_name));
if (g_file_query_exists (builder_context_get_ccache_dir (context), NULL))
{