-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic build of Bubblewrap with Meson. #133
Conversation
Can one of the admins verify this patch?
|
bot, add author to whitelist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build logic looks nice, but I really don't like config.h.meson
as is.
@@ -0,0 +1,98 @@ | |||
/* config.h.in. Generated from configure.ac by autoheader. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh. Why do we need to carry this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the simplest way of getting a build going is to do this. Meson does not actually need a config.h.in
, if you don't have one it will just serialise out values set in the configuration object. Which one to use depends on how the project maintainers want to set things up.
#mesondefine HAVE_MEMORY_H | ||
|
||
/* Define if SELinux is available */ | ||
#mesondefine HAVE_SELINUX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically having things like this seems pretty broken. It should be detected at build time, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what it's for. If you do cdata.set('HAVE_SELINUX', 1)
then that will get replaced by
#define HAVE_SELINUX 1
If it is not set, then it will be replaced with
/* undef HAVE_SELINUX */
As mentioned above I don't have an SELinux machine to test this with so I left it out.
Is this a PoC or are you planning to use it? I'm OK merging this if it'll be used. |
This is a PoC. |
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. One feature that is deliberately missing is an equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 that still require a setuid bwrap, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this in the packaging rather than the upstream build system. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. One feature that is deliberately missing is an equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 that still require a setuid bwrap, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this in the packaging rather than the upstream build system. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. One feature that is deliberately missing is an equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 that still require a setuid bwrap, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this in the packaging rather than the upstream build system. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. One feature that is deliberately missing is an equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 that still require a setuid bwrap, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this in the packaging rather than the upstream build system. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. One feature that is deliberately missing is an equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 that still require a setuid bwrap, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this in the packaging rather than the upstream build system. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. One feature that is deliberately missing is an equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 that still require a setuid bwrap, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this in the packaging rather than the upstream build system. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. One feature that is deliberately missing is an equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 that still require a setuid bwrap, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this in the packaging rather than the upstream build system. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. One feature that is deliberately missing is an equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 that still require a setuid bwrap, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this in the packaging rather than the upstream build system. Loosely based on previous work by Jussi Pakkanen (see containers#133). Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. Loosely based on previous work by Jussi Pakkanen (see containers#133). Differences between the Autotools and Meson builds: The Meson build requires a version of libcap that has pkg-config metadata (introduced in libcap 2.23, in 2013). The Meson build has no equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 and RHEL <= 7 that require a setuid bwrap executable, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this via packaging rather than the upstream build system. The Meson build supports being used as a subproject, and there is CI for this. It automatically disables shell completions and man pages, moves the bubblewrap executable to ${libexecdir}, and renames the bubblewrap executable according to a program_prefix option that the caller must specify (for example, Flatpak would use -Dprogram_prefix=flatpak- to get /usr/libexec/flatpak-bwrap). See the tests/use-as-subproject/ directory for an example. Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. Loosely based on previous work by Jussi Pakkanen (see containers#133). Differences between the Autotools and Meson builds: The Meson build requires a version of libcap that has pkg-config metadata (introduced in libcap 2.23, in 2013). The Meson build has no equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 and RHEL <= 7 that require a setuid bwrap executable, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this via packaging rather than the upstream build system. The Meson build supports being used as a subproject, and there is CI for this. It automatically disables shell completions and man pages, moves the bubblewrap executable to ${libexecdir}, and renames the bubblewrap executable according to a program_prefix option that the caller must specify (for example, Flatpak would use -Dprogram_prefix=flatpak- to get /usr/libexec/flatpak-bwrap). See the tests/use-as-subproject/ directory for an example. Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. Verified to be backwards-compatible as far as Meson 0.49.0 (Debian 9 backports). Loosely based on previous work by Jussi Pakkanen (see containers#133). Differences between the Autotools and Meson builds: The Meson build requires a version of libcap that has pkg-config metadata (introduced in libcap 2.23, in 2013). The Meson build has no equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 and RHEL <= 7 that require a setuid bwrap executable, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this via packaging rather than the upstream build system. The Meson build supports being used as a subproject, and there is CI for this. It automatically disables shell completions and man pages, moves the bubblewrap executable to ${libexecdir}, and renames the bubblewrap executable according to a program_prefix option that the caller must specify (for example, Flatpak would use -Dprogram_prefix=flatpak- to get /usr/libexec/flatpak-bwrap). See the tests/use-as-subproject/ directory for an example. Signed-off-by: Simon McVittie <smcv@collabora.com>
I guess this PR can be closed given that #432 is merged. |
Yes, thanks for the reminder. |
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. Verified to be backwards-compatible as far as Meson 0.49.0 (Debian 9 backports). Loosely based on previous work by Jussi Pakkanen (see containers#133). Differences between the Autotools and Meson builds: The Meson build requires a version of libcap that has pkg-config metadata (introduced in libcap 2.23, in 2013). The Meson build has no equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 and RHEL <= 7 that require a setuid bwrap executable, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this via packaging rather than the upstream build system. The Meson build supports being used as a subproject, and there is CI for this. It automatically disables shell completions and man pages, moves the bubblewrap executable to ${libexecdir}, and renames the bubblewrap executable according to a program_prefix option that the caller must specify (for example, Flatpak would use -Dprogram_prefix=flatpak- to get /usr/libexec/flatpak-bwrap). See the tests/use-as-subproject/ directory for an example. Signed-off-by: Simon McVittie <smcv@collabora.com>
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. Verified to be backwards-compatible as far as Meson 0.49.0 (Debian 9 backports). Loosely based on previous work by Jussi Pakkanen (see containers#133). Differences between the Autotools and Meson builds: The Meson build requires a version of libcap that has pkg-config metadata (introduced in libcap 2.23, in 2013). The Meson build has no equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 and RHEL <= 7 that require a setuid bwrap executable, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this via packaging rather than the upstream build system. The Meson build supports being used as a subproject, and there is CI for this. It automatically disables shell completions and man pages, moves the bubblewrap executable to ${libexecdir}, and renames the bubblewrap executable according to a program_prefix option that the caller must specify (for example, Flatpak would use -Dprogram_prefix=flatpak- to get /usr/libexec/flatpak-bwrap). See the tests/use-as-subproject/ directory for an example. Signed-off-by: Simon McVittie <smcv@collabora.com>
Builds and installs Bubblewrap, the man page and the Bash completion file.
I could not properly comprehend how the setuid binary thing should work so I left that alone. FWICT it should just be a case of a custom install script or a custom target.
Selinux mode not tested because I don't have an selinux machine but It Should Work (TM).
The werror flags are not added. Maybe a better combination would be
warning_level=2
+ werror? Anyway it is just a question of adding those toadd_project_arguments
.