public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michel Lind <salimma@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/folly-rpm-macros] epel10.3: Never install an RPATH into the executables
Date: Thu, 08 Oct 2026 09:20:42 GMT	[thread overview]
Message-ID: <179145124218.1.13113354492883942671.rpms-folly-rpm-macros-075f90ad8f05@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/folly-rpm-macros
            Branch : epel10.3
            Commit : 075f90ad8f059355d17b4e931d7a62b02a867f0e
            Author : Michel Lind <salimma@fedoraproject.org>
            Date   : 2026-09-29T16:25:55+01:00
            Stats  : +23/-6 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/folly-rpm-macros/c/075f90ad8f059355d17b4e931d7a62b02a867f0e?branch=epel10.3

            Log:
            Never install an RPATH into the executables

- Pass CMAKE_SKIP_INSTALL_RPATH=ON to every getdeps build, so a project's
  relocatable-tarball RPATH stays out of the installed binaries
- Document that the release comes from fedpkg verrel, not from builds

cachelib's CMakeLists sets an install RPATH of "$ORIGIN/../lib:
$ORIGIN/../lib64:$ORIGIN/../lib-os" for the relocatable tarball
contrib/prepare-rpath-dist.sh builds, and forces it into the binaries at
build time. In the package those directories do not exist and nothing needs
them, since the vendored stack is static. rpminspect fails on it twice, in
the runpath inspection and as the only annocheck hardening failure (the
run-path test objects to ".." in the tag), on every architecture.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Michel Lind <salimma@fedoraproject.org>

---
diff --git a/AGENTS.md b/AGENTS.md
index 8f234a1..fd9c491 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -51,9 +51,14 @@ folly-rpm-macros' Version is the Fedora release number current when it was
 last touched (46 today), not a version of its own, so a macro change usually
 only moves the *release*: 46-2, 46-3. A dependent that needs the new
 behaviour must therefore require the release too, `BuildRequires:
-folly-rpm-macros >= 46-3`, which cachelib and mcrouter both do. A bare
-`>= 46` would be satisfied by a macros build that predates the change and
-the package would fail in a way that points at the wrong file. Bump the
+folly-rpm-macros >= 46-9`, which cachelib and mcrouter both do. Ask
+`fedpkg verrel` for the number rather than counting builds: rpmautospec
+counts the commits since the last version change, one release each, so
+commits that were never built still raise it. On a clean tree it reports
+what a build of HEAD would get; with uncommitted changes it already counts
+them as one more commit, so the number does not move when you then commit.
+A bare `>= 46` would be satisfied by a macros build that predates the change
+and the package would fail in a way that points at the wrong file. Bump the
 dependents whenever a macro change is meaningful to them, in the same round
 as the macros build.
 
@@ -141,7 +146,9 @@ Read `cachelib.spec` as the reference. The pieces, in order:
   `getdeps_scratch_dir` (defaults under `%_builddir`; never `/tmp`, a tmpfs),
   `getdeps_job_weight_mib` (3072, fed to `%limit_build`),
   `getdeps_extra_cmake_defines` (JSON *contents* without braces, applies to
-  every project getdeps builds; cachelib uses it for `LIB_INSTALL_DIR`,
+  every project getdeps builds, after the macros' own
+  `CMAKE_SKIP_INSTALL_RPATH=ON`, which keeps a project's relocatable-tarball
+  RPATH out of the executables and rpminspect quiet; cachelib uses it for `LIB_INSTALL_DIR`,
   `CACHELIB_MAJOR_VERSION`, `CONFIGS_INSTALL_DIR`; mcrouter for
   `MCROUTER_PACKAGE_VERSION`, which upstream's CMake conversion left at
   "0.1.0-dev").

diff --git a/README.md b/README.md
index c8b81d5..80521e6 100644
--- a/README.md
+++ b/README.md
@@ -63,7 +63,8 @@ Other knobs, all overridable with `%global` before use: `%getdeps_project`
 requires that name), `%getdeps_scratch_dir`, `%getdeps_job_weight_mib` (3072,
 fed to `%limit_build`) and `%getdeps_extra_cmake_defines` (the contents of a
 JSON object without the outer braces, e.g. `"FOO": "ON"`; applies to every
-project getdeps builds). `%getdeps_build -t` also builds the project's
+project getdeps builds, after the defines the macros always pass, today
+`CMAKE_SKIP_INSTALL_RPATH=ON`). `%getdeps_build -t` also builds the project's
 tests, which `%getdeps_test` then runs in `%check`.
 
 ### Licenses of the vendored tree

diff --git a/macros.folly-rpm b/macros.folly-rpm
index 9296a1e..2a71b78 100644
--- a/macros.folly-rpm
+++ b/macros.folly-rpm
@@ -77,9 +77,18 @@
   --vendor-dir %{getdeps_vendor_dir}
   --scratch-path %{getdeps_scratch_dir}
   --num-jobs %{__getdeps_num_jobs}
-  %{?getdeps_extra_cmake_defines:--extra-cmake-defines '{%{getdeps_extra_cmake_defines}}'}
+  --extra-cmake-defines '{%{__getdeps_policy_cmake_defines}%{?getdeps_extra_cmake_defines:, %{getdeps_extra_cmake_defines}}}'
 }
 
+# Defines every getdeps package wants, prepended to the spec's own.
+# CMAKE_SKIP_INSTALL_RPATH: projects that ship a relocatable tarball set an
+# install RPATH for it (cachelib: "$ORIGIN/../lib:$ORIGIN/../lib64:
+# $ORIGIN/../lib-os"), which ends up in the installed executables. Nothing
+# here needs it, since the vendored stack is linked statically, and rpminspect
+# fails a DT_RUNPATH containing ".." (its annocheck run-path test, and the
+# runpath inspection). Fedora's own %%cmake macro passes the same define.
+%__getdeps_policy_cmake_defines "CMAKE_SKIP_INSTALL_RPATH": "ON"
+
 # getdeps_generate_buildrequires: for %%generate_buildrequires. Emits the
 # distro packages getdeps would take from the system for %%getdeps_project,
 # so the BuildRequires follow the manifests instead of being copied by hand.

                 reply	other threads:[~2026-10-08  9:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179145124218.1.13113354492883942671.rpms-folly-rpm-macros-075f90ad8f05@fedoraproject.org \
    --to=salimma@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox