Add AppArmor profile to fix Brioche builds on Ubuntu 24.04 #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the
setup-brioche
action with a newinstall-apparmor
input value, which will optionally install an AppArmor profile during setup. When set toauto
(the default), it will try and determine if the AppArmor profile is needed.This Ubuntu blog post provides more context, but the TL;DR is that Ubuntu 23.10+ restricts unprivileged user namespaces by default, unless enabled with an AppArmor profile. Brioche uses unprivileged user namespaces for Linux builds currently (see brioche-dev/brioche#152). So, we need an AppArmor profile to use Brioche on Ubuntu 24.04.
To detect if we need an AppArmor profile, we check if AppArmor is enabled (with the
aa-enabled
command), then check if the file/etc/apparmor.d/abi/4.0
exists. This file is used for the AppArmor 4.0 ABI, which is when the restricted user namespace feature was added.