Commit graph

131 commits

Author SHA1 Message Date
Kelvin M. Klann
5abf0577a7
feature: add ${PROJECTS} macro (#7157)
Based on the new ~/Projects directory from version 0.20 of the
xdg-user-dirs specification[1]:

* `XDG_PROJECTS_DIR="$HOME/Projects"`

Relates to #7147 #7151.

[1] https://www.freedesktop.org/wiki/Software/xdg-user-dirs/
2026-05-09 13:19:42 +00:00
For compliance reasons, we're required
e07510100f
build: remove unused install.sh (#7124)
install.sh was used for AC_PROG_INSTALL, which was removed in
4421517c55 (corresponding PR #5133)

From the manual of GNU Autoconf (version 2.73):

>     Autoconf comes with a copy of ‘install-sh’ that you can use.  If
>     you use ‘AC_PROG_INSTALL’, you must include ‘install-sh’ in your
>     distribution; otherwise ‘autoreconf’ and ‘configure’ will produce
>     an error message saying they can’t find it—even if the system
>     you’re on has a good ‘install’ program.  This check is a safety
>     measure to prevent you from accidentally leaving that file out,
>     which would prevent your package from installing on systems that
>     don’t have a BSD-compatible ‘install’ program.

If install-sh wasn't found, configure would check for install.sh in
srcdir. install.sh is a placeholder that does nothing, without it
configure would abort.
2026-04-02 11:55:42 +00:00
netblue30
c13331305c adding apparmor profiles for --nettrace option 2026-02-11 09:17:22 -05:00
netblue30
a655b7d1ba removed ./configure --disable-man option 2026-01-21 14:14:40 -05:00
netblue30
83bcb6b38b fix make dist (broken earlier) 2026-01-20 07:47:09 -05:00
netblue30
9dfbaa9f3b testing 2026-01-17 11:51:42 -05:00
Kelvin M. Klann
324010c1ae build: fix whitespace in root Makefile
Related commits:

* 8a5ec7b10 ("some profile updates", 2023-01-18)
* 096c99664 ("testing", 2026-01-16)
2026-01-17 02:26:46 -03:00
Kelvin M. Klann
56a8abab95 build: sort/format gcov-dir in clean target
This amends commit 65ca515ff ("gcov test coverage update", 2026-01-14).
2026-01-17 02:15:08 -03:00
Kelvin M. Klann
f9cc7b24eb build: move cleaning of test files to test/Makefile
Move them from the distclean target in the root Makefile.

Related commits:

* a1ff0c3fd ("testing", 2026-01-16)
* 2f6afc99d ("gcov testing", 2026-01-16)
2026-01-17 02:14:51 -03:00
netblue30
e6b240b3fa remove make test-sysutlis 2026-01-16 13:16:34 -05:00
netblue30
2f6afc99d5 gcov testing 2026-01-16 11:17:29 -05:00
netblue30
b72411292e testing 2026-01-16 09:37:31 -05:00
netblue30
a1ff0c3fd3 testing 2026-01-16 08:54:26 -05:00
netblue30
096c99664f testing 2026-01-16 08:28:49 -05:00
netblue30
7136c6697c make test-fnettrace 2026-01-15 08:03:50 -05:00
netblue30
65ca515ff8 gcov test coverage update 2026-01-14 10:48:48 -05:00
Kelvin M. Klann
4fa7a64f18 build: add sort-profiles target for sort.py
And use it in CI.

Note: The target currently always runs sort.py for all profiles.

Before:

    $ ./ci/check/profiles/sort.py etc/inc/*.inc etc/profile*/*.profile

After:

    $ make sort-profiles
2025-12-28 19:15:34 -03:00
Kelvin M. Klann
92d049cdf9 build: use variables for profiles 2025-12-28 18:27:55 -03:00
Kelvin M. Klann
f9769ecbde build: use simpler shell wildcards for profiles 2025-12-28 18:27:55 -03:00
Kelvin M. Klann
381c3cf1a3 build: remove remnants of IDS/fids
Remove what remains of the Intrusion Detection System (IDS)/fids,
`--ids` commands and the `--enable-ids` configure option.

Commands:

* `--ids-check`
* `--ids-init`

Related commits:

* 5e962ff78 ("removed IDS feature, it was never enabled by default in
  our builds", 2025-12-17)

Relates to #6995.
2025-12-19 15:24:37 -03:00
netblue30
33d07c2320 bwrap replacement - part 1 2025-12-18 08:04:12 -05:00
netblue30
5e962ff78e removed IDS feature, it was never enabled by default in our builds 2025-12-17 09:09:44 -05:00
Kelvin M. Klann
76ae89e4ca
build: cppcheck: use --check-level=exhaustive (#6877)
The `--check-level=exhaustive` option was briefly added, then changed to
`--max-ctu-depth=40`, presumably because the version being used in CI
(cppcheck 2.7 on ubuntu-22.04) did not support the former.

The current version in CI (cppcheck 2.13 on ubuntu-24.04) supports that
option, so restore it.

This fixes a flood of `information:` messages (which appear even with
`-q`) in the latest version of cppcheck:

    $ cppcheck --version
    Cppcheck 2.18.0
    $ make cppcheck
    cppcheck -q -j 4 --force --error-exitcode=1 --enable=warning,performance \
      --max-ctu-depth=40 \
      -i src/firejail/checkcfg.c \
      -i src/firejail/main.c \
      -i src/lib/syscall.c \
      .
    cppcheck: --max-ctu-depth is being capped at 10. This limitation will be removed in a future Cppcheck version.
    src/etc-cleanup/main.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

    ^
    src/fbuilder/build_bin.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

    ^
    src/fbuilder/build_fs.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

    ^
    [...]

This is a follow-up to #6874.

Related commits:

* be3c2a071 ("some problems reported by ccpcheck", 2025-08-17)
* d4881b6bc ("cppcheck cleanup", 2025-08-17)
* ebb368780 ("ci: cppcheck: upgrade ubuntu-22.04 to ubuntu-24.04",
  2025-08-20) / PR #6874
2025-08-21 12:37:07 +00:00
Kelvin M. Klann
a8c13152ac build: cppcheck: ignore src/lib/syscalls.c
cppcheck 2.18.0 fails to parse this file:

    $ cppcheck --version
    Cppcheck 2.18.0
    $ cppcheck -q --force --error-exitcode=1 \
      --enable=warning,performance --max-ctu-depth=40 \
      src/lib/syscall.c
    cppcheck: --max-ctu-depth is being capped at 10. This limitation will be removed in a future Cppcheck version.
    src/lib/syscall.c:80:26: error: syntax error [syntaxError]
     { .name = "@aio", .list =
                             ^
    src/lib/syscall.c:109:31: error: syntax error [syntaxError]
     { .name = "@basic-io", .list =
                                  ^
2025-08-18 09:54:06 -03:00
Kelvin M. Klann
89f5d8f5fb build: cppcheck: format make target 2025-08-18 09:16:02 -03:00
netblue30
d4881b6bc3 cppcheck cleanup 2025-08-17 17:17:42 -04:00
netblue30
be3c2a0713 some problems reported by ccpcheck 2025-08-17 12:04:58 -04:00
沈澄心
36de842b77
contrib/vim: add ftplugin file (based on cfg.vim) (#6680)
Add a simple vim filetype plugin.
2025-03-10 02:57:57 +00:00
Kelvin M. Klann
e98395b9aa
build: remove cppcheck-old target/job (#6676)
To avoid CI failures.

From the first run of `cppcheck_old` on commit 8f69e9841 ("bugfix:
firecfg: check full filename in check_profile() (#6674)", 2025-03-04)
[1]:

> This is a scheduled Ubuntu 20.04 brownout. Ubuntu 20.04 LTS runner
> will be removed on 2025-04-01. For more details, see
> https://github.com/actions/runner-images/issues/11101

The target depends on the cppcheck version from Ubuntu 20.04 in order to
work properly and this distribution will become EOL next month (April
2025), so just remove the target.

Added on commit 53f0b3950 ("CI: keep old cppcheck job and ignore two
files in new job that take too long to check", 2022-07-26).

[1] https://github.com/netblue30/firejail/actions/runs/13658953453/job/38185280665
2025-03-07 03:54:19 +00:00
Kelvin M. Klann
4ebd14734a build: fix outdated build.yml reference in Makefile comment
This amends commit 82d28795a ("ci: split build and test into separate
workflows", 2023-08-14) / PR #5960.
2025-01-25 10:38:45 -03:00
Kelvin M. Klann
1a576d15a9
build: rename print-version target to installcheck (#6620)
To make it consistent with the standard GNU make targets.

From the manual of GNU Make (version 4.4.1-2):

> 'installcheck'
>      Perform installation tests (if any).  The user must build and
>      install the program before running the tests.  You should not
>      assume that '$(bindir)' is in the search path.

Commands used to search and replace:

    $ git grep -Ilz print-version |
      xargs -0 -I '{}' sh -c "printf '%s\n' \"\$(sed \
        's/print-version/installcheck/g' '{}')\" >'{}'"
    $ git grep -Ilz 'print version' .github/workflows |
      xargs -0 -I '{}' sh -c "printf '%s\n' \"\$(sed \
        's/print version/make installcheck/g' '{}')\" >'{}'"

Added on commit c9531d95e ("build: add print-version target and use in
CI", 2024-02-22) / #6230.
2025-01-18 04:48:56 +00:00
Kelvin M. Klann
68d06a1359 build: sort/split some install commands
For increased consistency and readability.
2024-06-02 12:08:41 -03:00
Kelvin M. Klann
e30c57eebf build: use -t in applicable install commands
For increased consistency and readability.
2024-06-02 12:08:41 -03:00
Kelvin M. Klann
5430535a27 build: stop checking for dir existence on install
Just try to install them, as is done in the other `$(INSTALL) -d`
commands.
2024-06-02 12:08:41 -03:00
Kelvin M. Klann
afdb371f27 build: fix some inconsistencies in install commands
Changes:

* Remove / after `$(DESTDIR)`
* Remove useless -c
* Use 0755 instead of 755
* Use -d after -m

See also commit dae3933bc ("rework make realinstall and uninstall
(#3435)", 2020-06-04).
2024-06-02 12:08:41 -03:00
Kelvin M. Klann
6b35ed7997 build: remove redundant parent dir install
The command below already installs it.

Added on commit 926790411 ("add basic Firejail support to AppArmor base
abstraction (#3226)", 2021-10-21) / PR #4628.
2024-06-02 12:08:36 -03:00
Kelvin M. Klann
c633ba3ead build: line-break sh install commands
And remove the extraneous semicolon at the end of the command string.

See also commit dae3933bc ("rework make realinstall and uninstall
(#3435)", 2020-06-04).
2024-06-02 12:02:23 -03:00
Kelvin M. Klann
fb11081bec build: allow overriding common tools
Tools:

* gzip
* install
* rm
* strip
* tar

For the programs not checked in configure.ac:

From the manual of GNU Autoconf (version 2.71):

> If you use `AC_PROG_INSTALL`, you must include `install-sh` in your
> distribution

So set `install` just in the Makefile.  Use `$(RM)` to ensure that `-f`
is always used and to make it easier to spot when `-r` is used.

See commit 93d623fdf ("build: allow overriding certain tools",
2024-02-23) / PR #6222.
2024-05-29 17:35:35 -03:00
Kelvin M. Klann
753d199bc9
build: remove clean dependency from cppcheck targets (#6343)
Cleaning does not appear to make a difference; the same amount of files
is checked with/without cleaning.

Environment: cppcheck 2.12.0-3 on Artix Linux.

Added on commit 4e22add64 ("llvm scan", 2015-11-29).

This is a follow-up to #6222.
2024-05-20 03:43:40 +00:00
Kelvin M. Klann
97de0e08b9 build: remove redundant realinstall target
Leave just the "install" and "install-strip" targets.

See commit 099925e18 ("added install-strip, make install now without
strip.", 2015-09-10) / PR #60 and commit 0215cbc02 ("make install, make
install-strip", 2015-09-11).
2024-05-17 03:45:02 -03:00
Kelvin M. Klann
8748d76e80 build: add a standalone strip target
Move the strip invocation into its own target to allow stripping
binaries without having to run the "realinstall" target.
2024-05-17 03:45:02 -03:00
Kelvin M. Klann
c9531d95ed build: add print-version target and use in CI
To reduce TARNAME hardcoding.

Added on commit 6a89ab023 ("ci: run firejail --version after
build/install", 2022-05-16) / PR #5148.
2024-02-29 08:52:24 -03:00
Kelvin M. Klann
1f6400bd89 build: sync scan-build target with CI
Changes:

* Use --status-bugs in the scan-build target to exit with an error if
  bugs are found
* Call the make target in the CI job
2024-02-24 18:53:07 -03:00
Kelvin M. Klann
f4f7a814e7 build: sync cppcheck targets with CI
Changes:

* Use the same command from the cppcheck CI job in the cppcheck target
* Add cppcheck-old target based on the cppcheck_old CI job
* Call the make targets in CI to avoid duplicating the commands
2024-02-24 18:53:06 -03:00
Kelvin M. Klann
93d623fdf9 build: allow overriding certain tools
Allow overriding the following tools at configure-time and build-time:

* codespell
* cppcheck
* gawk
* scan-build

For example, instead of hardcoding `gawk`, enable overriding it at
configure-time with:

    ./configure GAWK=/path/to/gawk

To override it for a single `make` invocation:

    make GAWK=/path/to/gawk

Also, add default values for the programs that are not found (rather
than leaving the variables empty), to make error messages clearer when
trying to run them:

    $ make CPPCHECK= cppcheck-old
    [...]
    force --error-exitcode=1 --enable=warning,performance .
    make: force: No such file or directory
    $ make CPPCHECK=cppcheck cppcheck-old
    [...]
    cppcheck --force --error-exitcode=1 --enable=warning,performance .
    make: cppcheck: No such file or directory
2024-02-24 18:50:43 -03:00
Kelvin M. Klann
6815d71cff build: fix running make clean with undefined vars
In the `debian_ci` job in .gitlab-ci.yml, dpkg-deb calls `make
distclean` before calling ./configure, which makes `make clean` fail due
to certain variables not being declared:

     dpkg-source -i -I --before-build .
    [...]
       dh_auto_clean
    	make -j2 distclean
    make[1]: Entering directory '/builds/kmk3/firejail_ci'
    error: run ./configure to generate config.mk
    [...]
    rm -f contrib/syntax/files/example [...]
    rm -fr - -.tar.xz
    rm: invalid option -- '.'
    Try 'rm --help' for more information.
    make[1]: *** [Makefile:175: clean] Error 1

This amends commit 8a783cdc2 ("build: use TARNAME and remove more paths
on clean", 2023-07-29) / PR #6186.
2024-02-07 09:45:41 -03:00
Kelvin M. Klann
71ffe7ac8f
Merge pull request #6186 from kmk3/build-improve-clean
build: improve main clean target
2024-02-04 23:25:23 +00:00
Kelvin M. Klann
58e0b5c01b build: fix codespell warnings
Warnings:

    $ make codespell
    Running codespell...
    ./README:757: Manuel ==> Manual
    ./RELNOTES:269: relpaced ==> replaced
    ./src/firecfg/desktop_files.c:60: diectory ==> directory
    ./platform/debian/control.i386:11: namepaces ==> namespaces
    ./platform/debian/control.amd64:11: namepaces ==> namespaces
    make: *** [Makefile:383: codespell] Error 65
    $ codespell --version
    2.2.6
2024-02-01 22:31:18 -03:00
Kelvin M. Klann
b23f484df9 build: ignore depfiles on codespell
This amends commit e665769f5 ("build: automatically generate header
dependencies", 2023-07-05) / PR #6164.
2024-02-01 22:20:08 -03:00
Kelvin M. Klann
8a783cdc2f build: use TARNAME and remove more paths on clean 2024-02-01 19:28:43 -03:00