Skip to content

Commit 59554ec

Browse files
committed
builder-module: Change the default wrap-mode policy of meson
By default network access inside the build sandbox is disabled, however meson defaults into trying to initialize fallbacks and attempt to download them, returning a potentially misleading error message. Setting wrap-mode to nodownload will instruct meson to not try to use the network to fetch any resources and only the pre-existing checkouts will be taken into account. This matches both the default network permission and the design of flatpak-builder for bundling and staging all the sources ahead of time. Side effect is that it makes it slightly harder for projects to use the network access at build time, is they also have to edit their meson setup arguments to change the wrap-mode.
1 parent d2abdda commit 59554ec

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/builder-module.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,22 @@ builder_module_build_helper (BuilderModule *self,
17801780
{
17811781
/* Meson's setup command is now meson setup */
17821782
g_ptr_array_add (configure_args_arr, g_strdup ("setup"));
1783+
/*
1784+
* By default network access inside the build sandbox is disabled,
1785+
* however meson defaults into trying to initialize fallbacks and attempt to
1786+
* download them, returning a potentially misleading error message.
1787+
*
1788+
* Setting wrap-mode to nodownload will instruct meson to not try to use the
1789+
* network to fetch any resources and only the pre-existing checkouts will be
1790+
* taken into account. This matches both the default network permission
1791+
* and the design of flatpak-builder for bundling and staging all the sources
1792+
* ahead of time.
1793+
*
1794+
* Side effect is that it makes it slightly harder for projects to use the
1795+
* network access at build time, is they also have to edit their meson setup
1796+
* arguments to change the wrap-mode.
1797+
*/
1798+
g_ptr_array_add (configure_args_arr, g_strdup ("--wrap-mode=nodownload"));
17831799
}
17841800

17851801
if (cmake || cmake_ninja)

0 commit comments

Comments
 (0)