This should be an error for consistency with other macro argument
checking but as there appear to be usages in the wild, make it a
warning for now.
Fixes: #2932
Commit adad2be2e4 moved the detection of
awk outside of makemacros() so that we could require it at build time,
but that isn't ideal. These are two separate use cases, really, they
just happen to involve awk in both cases.
In the first case (build time), keep using find_program(REQUIRED) as
normal, however for makemacros(), revert back to the custom findutil()
function.
The find-debuginfo script is the same story so fix that too while at it.
In practice, it's not likely for there to be multiple implementations of
this script installed on the build system for this to matter, so this
change is mostly just for the sake of consistency.
Also add a short description of findutil() to make its purpose a bit
clearer to the casual onlooker.
Fixes: #2926
If a dependency generator dies while we're still writing to its stdin,
it causes us to die rather randomly. Typically happens with fake
dependency generators that don't actually bother reading their input
and/or write anything back. This is almost certainly the ghost failure
we've occasionally seen in the test-suite too (#2470).
Resurrect the explicit SIG_IGN that got removed apparently in commit
375a6b5630, and restore SIG_DFL in the
child. The matter was further confused by NSPR (which we once relied on)
always setting SIGPIPE to SIG_IGN.
Suggested-by: Michael Schroeder <mls@suse.de>
Fixes: #2949
Commit ddbf30cf96 neglected to update the
preamble table types for the weak dependency tags, so it never worked.
Add a test to ensure it works and stays that way.
Test depends on 078ccae5a655e044a9b867206cf4215acb3f0113
Fixes: #624
We need Awk in the build process (twice) so make it required at
configure time, and remove the now redundant findutil() call in
makemacros().
Fixes: #2926
Something like this can't really be a macro configurable between such
wildly differing purposes, especially when callers almost certainly
expect the traditional default behavior anyway. I can't see anybody
missing this.
Besides nuking an apparently unnecessary feature and weird logic (how
many levels of default do you want?), it eliminates an unwanted
static initializer relying on a non-enum value of an enum variable.
This changes the behaviour of %dirname to something sane. No longer
return the argument unchanged if there is no / found. Also handle
several cornercases properly.
Resolves: #2928
Many things need to be known before the build can be started. Make
declaring these sections or directives an error when encountered parsing
the generated Spec parts.
Resolves: #2693
As we now have three different sources of spec content we need a proper
enum to tell them apart and get rid of the seconday bool parameter.
No functional change but is needed for the next patch
Prior to this, the respective build options would get enabled depending
on whether or not these components were found on the build system.
I believe it's better to make them strict (add REQUIRED parameter),
so that rpm builds are always deterministic, subject to cmake options.
Resolves: https://github.com/rpm-software-management/rpm/issues/2855
(https://github.com/rpm-software-management/rpm/pull/2933 is required
for $RPM_BUILD_TIME.)
When %autosetup -S git is used, a bunch of git commits are created. Without an
override, their metadata will include the current time. Many projects include
the git hash of HEAD in the build information, which means that the build result
is not reproducible. Since we're creating a scratch repo ourselves, this hash
doesn't have any meaning outside of the build. If $SOURCE_DATE_EPOCH is set, use
that as the commit timestamp instead. If $SOURCE_DATE_EPOCH is _not_ set, fall
back to $RPM_BUILD_TIME, which should always be set.
For projects which somehow make use of the git commit information, this fixes
an irreproducibility. For projects which don't care about the git hash, this
should make no difference.
Fixes https://pagure.io/fedora-reproducible-builds/project/issue/9.
Sqlite upstream has deprecated case_sensitive_like, but we no longer
use SQL LIKE since c9380471ad so we
can just drop it.
Suggested-by: Michael Schroeder <mls@suse.de>
Fixes: #2925
rpm2archive does use somewhat more librpm functionality than rpm2cpio
does, but both link to librpm which has to be there and functional
for either of them to work.
The OS will clean it up yes, but in the meanwhile ASAN (when enabled)
blew up on your face and scared you silly. Use the opportunity to add a
test for a test on invalid option.
%config is only allowed for regular files and links. While rpmbuild won't
produce package with other files with %config other tools might. Handle
these cases gracefully by ignoring the %config flag.
Resolves: #2890
Using rpmdump output for comparison lets us inspect the file format
aspects without drowning ourselves in the details of tag contents
in the way --xml/--json output does. It should also be useful to
guard against accidental changes, deity knows we could've used
this before.
As rpmdump output is rather verbose, putting the output to a separate
file to keep the .at file manageable.
Compared to header.c, rpmdump is obviously taking all manner of
shortcuts. The address sanitizer helpfully points out why the former
has the "mysterious" memcpy() on the trailer data.
We have the list of tests in cmake, we can just as well generate the
master rpmtests.at file from there.
As the order of tests now depends on the list in tests/CMakeLists.txt,
update it to match the former order in rpmtests.at. As arbitrary as
that order is, people seem to get attached to certain test numbers. Er.
It feels like a decade since I've last been here, git disagrees.
How in the deity we still have these manual string length calculations
and stuff in this day and age there ... ick.
Allow declaring file attributes from the spec via %_local_file_attrs
macro. This allows enabling file attributes and their dependency
generators even if they are only shipped in the package itself and are
not yet installed.
The names need to be separated by colons (:).
Co-authored-by: Florian Festi <ffesti@redhat.com>
Resolves: #782
eBPF ELF represents a virtual machine where our file colors make no
sense at all. Filter out the color from these files to avoid a
"Arch dependent binaries in noarch package" error from them in noarch
packages.
We don't want to pull in clang to the check images just because of
this, so add a pre-built binary for the check and a simple way to
reproduce from the test-spec.
Fixes: #2875
Ninja doesn't support passing environment as command line arguments
like make does, access TESTOPTS through environment instead of the
make syntax to make it work for both generators.
BYPRODUCTS is only relevant for Ninja generator which we officially
don't even support, but on which these usages cause Ninja to error out
with "phony target names itself as an input" messages.
I don't remember why exactly I put these BYPRODUCTS in there, but I know
it was NOT to support Ninja explicitly. Probably it seemed somehow
relevant to this cmake newbie and since it didn't harm anything ... on
the make generator. Taking them out makes Ninja happy except for the
test-suite. The make generator is still the only officially supported
one though.
Reported-by: Timothy Brackett <brackett.tc@gmail.com>
Even max-rpm philosophy section points out that rpm builds are
unattended, but then we do nothing at all to prevent it? I first though
maybe this regressed when we switched the build scripts to use rpmfcExec()
a few years ago, but there wasn't anything before that either. Weird.