[PR #6158] [MERGED] build: use full paths on compile/link targets #5851

Closed
opened 2026-05-05 10:46:05 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/6158
Author: @kmk3
Created: 1/16/2024
Status: Merged
Merged: 1/20/2024
Merged by: @kmk3

Base: masterHead: build-use-full-paths


📝 Commits (2)

  • a8abb78 modif: Change errExit msg format to match assert
  • 5b1bd33 build: use full paths on compile/link targets

📊 Changes

30 files changed (+86 additions, -60 deletions)

View changed files

📝 config.mk.in (+1 -1)
📝 src/etc-cleanup/Makefile (+3 -2)
📝 src/fbuilder/Makefile (+3 -2)
📝 src/fcopy/Makefile (+3 -2)
📝 src/fids/Makefile (+3 -2)
📝 src/firecfg/Makefile (+3 -2)
📝 src/firejail/Makefile (+3 -2)
📝 src/firemon/Makefile (+3 -2)
📝 src/fldd/Makefile (+3 -2)
📝 src/fnet/Makefile (+3 -2)
📝 src/fnetfilter/Makefile (+3 -2)
📝 src/fnetlock/Makefile (+3 -2)
📝 src/fnettrace-dns/Makefile (+3 -2)
📝 src/fnettrace-icmp/Makefile (+3 -2)
📝 src/fnettrace-sni/Makefile (+3 -2)
📝 src/fnettrace/Makefile (+5 -4)
📝 src/fsec-optimize/Makefile (+3 -2)
📝 src/fsec-print/Makefile (+3 -2)
📝 src/fseccomp/Makefile (+3 -2)
📝 src/ftee/Makefile (+3 -2)

...and 10 more files

📄 Description

This makes the compile commands clearer when building in parallel (with
make -j) and ensures that __FILE__ includes the full build-time path
(relative to the root of the repository) whenever it is referenced, such
as in failed assert() messages (currently the full path is only shown in
errExit() messages). Example:

Before:

firejail: main.c:100: main: Assertion `1 == 2' failed.
Error src/firecfg/main.c:100: main: malloc: Cannot allocate memory

After:

firejail: ../../src/firejail/main.c:100: main: Assertion `1 == 2' failed.
Error ../../src/firecfg/main.c:100: main: malloc: Cannot allocate memory

Commands used to search and replace:

$ git grep -Ilz '^MOD_DIR =' -- '*Makefile' | xargs -0 -I '{}' \
  sh -c "printf '%s\n' \"\$(sed -E \
    -e 's|^MOD_DIR = src/(.*)|MOD = \\1\\nMOD_DIR = \$(ROOT)/src/\$(MOD)|' \
    -e 's:^(PROG|SO) = [^.]+(\.so)?$:\\1 = \$(MOD_DIR)/\$(MOD)\2:' \
    '{}')\" >'{}'"
$ git grep -Ilz '^HDRS :=' -- '*.mk' | xargs -0 -I '{}' \
  sh -c "printf '%s\n' \"\$(sed -E \
    -e 's|wildcard (\*\..)|wildcard \$(MOD_DIR)/\\1|' '{}')\" >'{}'"

Note: config.mk.in, src/fnettrace/Makefile and src/include/common.h were
edited manually.

This is a follow-up to #5871.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/6158 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 1/16/2024 **Status:** ✅ Merged **Merged:** 1/20/2024 **Merged by:** [@kmk3](https://github.com/kmk3) **Base:** `master` ← **Head:** `build-use-full-paths` --- ### 📝 Commits (2) - [`a8abb78`](https://github.com/netblue30/firejail/commit/a8abb78009fb5797d4116619809bce5bc220b014) modif: Change errExit msg format to match assert - [`5b1bd33`](https://github.com/netblue30/firejail/commit/5b1bd33c7dc1b96cc27e4e52e8bdfe63268887e9) build: use full paths on compile/link targets ### 📊 Changes **30 files changed** (+86 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `config.mk.in` (+1 -1) 📝 `src/etc-cleanup/Makefile` (+3 -2) 📝 `src/fbuilder/Makefile` (+3 -2) 📝 `src/fcopy/Makefile` (+3 -2) 📝 `src/fids/Makefile` (+3 -2) 📝 `src/firecfg/Makefile` (+3 -2) 📝 `src/firejail/Makefile` (+3 -2) 📝 `src/firemon/Makefile` (+3 -2) 📝 `src/fldd/Makefile` (+3 -2) 📝 `src/fnet/Makefile` (+3 -2) 📝 `src/fnetfilter/Makefile` (+3 -2) 📝 `src/fnetlock/Makefile` (+3 -2) 📝 `src/fnettrace-dns/Makefile` (+3 -2) 📝 `src/fnettrace-icmp/Makefile` (+3 -2) 📝 `src/fnettrace-sni/Makefile` (+3 -2) 📝 `src/fnettrace/Makefile` (+5 -4) 📝 `src/fsec-optimize/Makefile` (+3 -2) 📝 `src/fsec-print/Makefile` (+3 -2) 📝 `src/fseccomp/Makefile` (+3 -2) 📝 `src/ftee/Makefile` (+3 -2) _...and 10 more files_ </details> ### 📄 Description This makes the compile commands clearer when building in parallel (with `make -j`) and ensures that `__FILE__` includes the full build-time path (relative to the root of the repository) whenever it is referenced, such as in failed assert() messages (currently the full path is only shown in errExit() messages). Example: Before: firejail: main.c:100: main: Assertion `1 == 2' failed. Error src/firecfg/main.c:100: main: malloc: Cannot allocate memory After: firejail: ../../src/firejail/main.c:100: main: Assertion `1 == 2' failed. Error ../../src/firecfg/main.c:100: main: malloc: Cannot allocate memory Commands used to search and replace: $ git grep -Ilz '^MOD_DIR =' -- '*Makefile' | xargs -0 -I '{}' \ sh -c "printf '%s\n' \"\$(sed -E \ -e 's|^MOD_DIR = src/(.*)|MOD = \\1\\nMOD_DIR = \$(ROOT)/src/\$(MOD)|' \ -e 's:^(PROG|SO) = [^.]+(\.so)?$:\\1 = \$(MOD_DIR)/\$(MOD)\2:' \ '{}')\" >'{}'" $ git grep -Ilz '^HDRS :=' -- '*.mk' | xargs -0 -I '{}' \ sh -c "printf '%s\n' \"\$(sed -E \ -e 's|wildcard (\*\..)|wildcard \$(MOD_DIR)/\\1|' '{}')\" >'{}'" Note: config.mk.in, src/fnettrace/Makefile and src/include/common.h were edited manually. This is a follow-up to #5871. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:46:05 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5851
No description provided.