Skip to content
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

WIP: Meson build #6311

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1bf67f4
MWE 1
rusty-snake Oct 29, 2021
b3c20e6
MWE 2
rusty-snake Oct 29, 2021
95451a8
WE 3
rusty-snake Oct 29, 2021
1619d89
Use meson in build/build-extra workflows for now
rusty-snake Oct 29, 2021
9412323
WE 4
rusty-snake Oct 29, 2021
0d2c134
E 5
rusty-snake Oct 29, 2021
ce30f85
E 6
rusty-snake Oct 29, 2021
607a28e
prep for meson
rusty-snake Oct 30, 2021
bd427ec
Build firejail with meson 7
rusty-snake Oct 30, 2021
c658bee
8
rusty-snake Oct 30, 2021
956ccb8
9
rusty-snake Oct 30, 2021
5bfc05b
prep for meson
rusty-snake Oct 30, 2021
6f03cd6
WE 10
rusty-snake Oct 30, 2021
1f09fc0
WE 11
rusty-snake Oct 31, 2021
0756b43
Update .github/workflows/build.yml
rusty-snake Oct 31, 2021
e50afda
Update workflows
rusty-snake Oct 31, 2021
af97761
Update workflows
rusty-snake Oct 31, 2021
d7a175f
Update workflows
rusty-snake Oct 31, 2021
2c077a7
NHWE 11
rusty-snake Oct 31, 2021
46be248
Update workflows
rusty-snake Oct 31, 2021
c1356f2
E 12
rusty-snake Oct 31, 2021
3a7aff3
NHWE 13
rusty-snake Oct 31, 2021
2d03322
NHWE 14
rusty-snake Oct 31, 2021
828f260
NHWE 15
rusty-snake Oct 31, 2021
7ae01d7
NHWE 16
rusty-snake Oct 31, 2021
165db06
Update workflows
rusty-snake Oct 31, 2021
59254b7
Update workflows
rusty-snake Oct 31, 2021
bbd88e2
Update workflows
rusty-snake Oct 31, 2021
775a7fa
17
rusty-snake Oct 31, 2021
9ea43aa
WE 18
rusty-snake Oct 31, 2021
995f7b7
Update workflows
rusty-snake Oct 31, 2021
f27fc9a
WE 19
rusty-snake Oct 31, 2021
b13e588
NHWE 20
rusty-snake Oct 31, 2021
c64f003
Update workflows
rusty-snake Oct 31, 2021
5bf2e28
21
rusty-snake Nov 2, 2021
d2d7b31
WIP: meson build system
topimiettinen Apr 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .github/workflows/build-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ jobs:
egress-policy: block
allowed-endpoints: >
azure.archive.ubuntu.com:80
files.pythonhosted.org:443
github.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
pypi.org:443
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: update package information
run: sudo apt-get update -qy
Expand All @@ -61,15 +63,14 @@ jobs:
libapparmor-dev libselinux1-dev
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
./configure CC=clang-14
--prefix=/usr --enable-fatal-warnings
--enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make
- name: make install
run: sudo make install
- name: print version
run: make print-version
- name: install dependencies
run: sudo apt-get install ninja-build
- name: Install meson
run: pip install --pre meson==0.56.2 # https://packages.debian.org/oldstable/meson
- name: meson setup
run: CC=clang-14 meson setup _builddir -Dprefix=/usr -Dapparmor=true -Dselinux=true --werror
- name: meson compile
run: meson compile -C _builddir
- name: meson install
run: sudo apt-get install meson
- run: sudo meson install -C _builddir
20 changes: 7 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,12 @@ jobs:
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev
gcc-12 libapparmor-dev libselinux1-dev ninja-build meson
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
./configure CC=gcc-12
--prefix=/usr --enable-fatal-warnings --enable-analyzer
--enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make
- name: make install
run: sudo make install
- name: print version
run: make print-version
- name: meson setup
run: CC=gcc-12 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: meson compile -C _builddir
- name: meson install
run: sudo -E meson install -C _builddir
50 changes: 22 additions & 28 deletions .github/workflows/check-c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@ jobs:
- name: install clang-tools-14 and dependencies
run: >
sudo apt-get install -qy
clang-tools-14 libapparmor-dev libselinux1-dev
clang-tools-14 libapparmor-dev libselinux1-dev ninja-build meson
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
./configure CC=clang-14 SCAN_BUILD=scan-build-14
--prefix=/usr --enable-fatal-warnings
--enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: meson setup
run: CC=clang-14 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: meson compile -C _builddir
- name: scan-build
run: make scan-build
run: ninja -C _builddir scan-build

cppcheck:
runs-on: ubuntu-22.04
Expand All @@ -93,14 +91,12 @@ jobs:
- name: update package information
run: sudo apt-get update -qy
- name: install cppcheck
run: sudo apt-get install -qy cppcheck
- name: configure
run: >
./configure CPPCHECK='cppcheck -q'
|| (cat config.log; exit 1)
- run: cppcheck --version
- name: cppcheck
run: make cppcheck
run: sudo apt-get install -qy cppcheck ninja-build meson
- name: meson setup
run: CC=clang-14 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: cppcheck --version
- run: meson compile -C _builddir cppcheck

# new cppcheck version currently chokes on checkcfg.c and main.c, therefore
# scan all files also with older cppcheck version from ubuntu 20.04.
Expand All @@ -124,14 +120,12 @@ jobs:
- name: update package information
run: sudo apt-get update -qy
- name: install cppcheck
run: sudo apt-get install -qy cppcheck
- name: configure
run: >
./configure CPPCHECK='cppcheck -q'
|| (cat config.log; exit 1)
- run: cppcheck --version
- name: cppcheck-old
run: make cppcheck-old
run: sudo apt-get install -qy cppcheck ninja-build meson
- name: meson setup
run: CC=clang-14 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: cppcheck --version
- run: meson compile -C _builddir cppcheck

codeql-cpp:
permissions:
Expand Down Expand Up @@ -165,11 +159,11 @@ jobs:
with:
languages: cpp

- name: configure
run: ./configure
- name: meson setup
run: CC=clang-14 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true

- name: make
run: make -j "$(nproc)"
- name: meson compile
run: meson compile -C _builddir

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@4355270be187e1b672a7a1c7c7bae5afdc1ab94a
19 changes: 19 additions & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
meson==1.3.1 \
--hash=sha256:6020568bdede1643d4fb41e28215be38eff5d52da28ac7d125457c59e0032ad7 \
--hash=sha256:d5223ecca9564d735d36daaba2571abc6c032c8c3a7ffa0674e803ef0c7e0219
ninja==1.11.1.1 \
--hash=sha256:18302d96a5467ea98b68e1cae1ae4b4fb2b2a56a82b955193c637557c7273dbd \
--hash=sha256:185e0641bde601e53841525c4196278e9aaf4463758da6dd1e752c0a0f54136a \
--hash=sha256:376889c76d87b95b5719fdd61dd7db193aa7fd4432e5d52d2e44e4c497bdbbee \
--hash=sha256:3e0f9be5bb20d74d58c66cc1c414c3e6aeb45c35b0d0e41e8d739c2c0d57784f \
--hash=sha256:73b93c14046447c7c5cc892433d4fae65d6364bec6685411cb97a8bcf815f93a \
--hash=sha256:7563ce1d9fe6ed5af0b8dd9ab4a214bf4ff1f2f6fd6dc29f480981f0f8b8b249 \
--hash=sha256:76482ba746a2618eecf89d5253c0d1e4f1da1270d41e9f54dfbd91831b0f6885 \
--hash=sha256:84502ec98f02a037a169c4b0d5d86075eaf6afc55e1879003d6cab51ced2ea4b \
--hash=sha256:95da904130bfa02ea74ff9c0116b4ad266174fafb1c707aa50212bc7859aebf1 \
--hash=sha256:9d793b08dd857e38d0b6ffe9e6b7145d7c485a42dcfea04905ca0cdb6017cc3c \
--hash=sha256:9df724344202b83018abb45cb1efc22efd337a1496514e7e6b3b59655be85205 \
--hash=sha256:aad34a70ef15b12519946c5633344bc775a7656d789d9ed5fdb0d456383716ef \
--hash=sha256:d491fc8d89cdcb416107c349ad1e3a735d4c4af5e1cb8f5f727baca6350fdaea \
--hash=sha256:ecf80cf5afd09f14dcceff28cb3f11dc90fb97c999c89307aea435889cb66877 \
--hash=sha256:fa2ba9d74acfdfbfbcf06fad1b8282de8a7a8c481d9dee45c859a8c93fcc1082
130 changes: 45 additions & 85 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,29 +68,17 @@ jobs:
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils ninja-build meson
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
./configure CC=gcc-12
--prefix=/usr --enable-fatal-warnings --enable-analyzer
--enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print version
run: make print-version
- run: make lab-setup
- run: make test-seccomp-extra
- run: make test-firecfg
- run: make test-capabilities
- run: make test-apparmor
- run: make test-appimage
- run: make test-chroot
- run: make test-fcopy
- name: meson setup
run: CC=gcc-12 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: meson compile -C _builddir
- name: meson install
run: sudo -E meson install -C _builddir
- name: test main
run: meson test -C _builddir seccomp-extra firecfg capabilities apparmor appimage chroot fcopy

#
# Slower tests
Expand All @@ -117,24 +105,17 @@ jobs:
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils ninja-build meson
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
./configure CC=gcc-12
--prefix=/usr --enable-fatal-warnings --enable-analyzer
--enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print version
run: make print-version
- run: make lab-setup
- run: make test-private-etc
- run: make test-fs
- name: meson setup
run: CC=gcc-12 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: meson compile -C _builddir
- name: meson install
run: sudo -E meson install -C _builddir
- name: test fs
run: meson test -C _builddir private-etc fs

test-environment:
runs-on: ubuntu-22.04
Expand All @@ -157,24 +138,17 @@ jobs:
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils ninja-build meson
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
./configure CC=gcc-12
--prefix=/usr --enable-fatal-warnings --enable-analyzer
--enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print version
run: make print-version
- run: make lab-setup
- run: make test-environment
- run: make test-profiles
- name: meson setup
run: CC=gcc-12 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: meson compile -C _builddir
- name: meson install
run: sudo -E meson install -C _builddir
- name: test environment
run: meson test -C _builddir environment profiles

test-utils:
runs-on: ubuntu-22.04
Expand All @@ -200,23 +174,17 @@ jobs:
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils ninja-build meson
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
./configure CC=gcc-12
--prefix=/usr --enable-fatal-warnings --enable-analyzer
--enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print version
run: make print-version
- run: make lab-setup
- run: make test-utils
- name: meson setup
run: CC=gcc-12 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: meson compile -C _builddir
- name: meson install
run: sudo -E meson install -C _builddir
- name: test utils
run: meson test -C _builddir utils

test-network:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -247,22 +215,14 @@ jobs:
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec whois
bridge-utils
bridge-utils ninja-build meson
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
./configure CC=gcc-12
--prefix=/usr --enable-fatal-warnings --enable-analyzer
--enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print version
run: make print-version
- run: make lab-setup
- run: make test-fnetfilter
- run: make test-sysutils
- run: make test-network
- name: meson setup
run: CC=gcc-12 meson setup _builddir --werror --prefix=/usr -Danalyzer=true -Dapparmor=true -Dselinux=true
- name: meson compile
run: meson compile -C _builddir
- name: meson install
run: sudo -E meson install -C _builddir
- name: test network
run: meson test -C _builddir fnetfilter sysutils network
2 changes: 1 addition & 1 deletion config.sh.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @configure_input@
# configure_input
#
# shellcheck shell=sh
# shellcheck disable=SC2034
Expand Down
23 changes: 23 additions & 0 deletions contrib/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
contrib_scripts = [
'fix_private-bin.py',
'fjclip.py',
'fjdisplay.py',
'fj-mkdeb.py',
'fjresize.py',
'gdb-firejail.sh',
'jail_prober.py',
'sort.py',
'syscalls.sh',
'update_deb.sh',
]
install_data(contrib_scripts,
install_dir: libdir_firejail,
install_mode: 'rwxr-xr-x',
)

install_data('vim/ftdetect/firejail.vim',
install_dir: datadir / 'vim' / 'vimfiles' / 'ftdetect',
)
install_data('syntax/files/firejail.vim.in',
install_dir: datadir / 'vim' / 'vimfiles' / 'syntax',
)
Loading
Loading