Commit Graph

604 Commits

Author SHA1 Message Date
Denys Vlasenko
817f533126 kmod.prov: fix and speed it up
For kernel builds, /usr/lib/rpm/kmod.prov is fork+execed by rpmbuild
in "Processing files:" step about 8000 times, single-threaded,
with cumulative run time of ~2 minutes.

Speed up this script, by avoiding additional fork+execing.

Tested to work, observed speedup: almost exactly 2 times faster.

While verifying correctness, noticed that old script was buggy -
it was generating a bogus "Provides:" item - kmod(modules.builtin.modinfo),
because the logic in script was filtering for */*.ko files and
for */modules.builtin* files, and wasn't prepared for
the existence of */modules.builtin.modinfo file.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-05 13:53:31 +01:00
Igor Gnatenko
2721f1c528
Bump version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-12-03 15:48:35 +01:00
Pavel Raiskup
e345575f97 %set_build_flags: define LT_SYS_LIBRARY_PATH
This config is to let libtool recognize that our 64bit variant of
%_libdir is actually on the standard/default library path, so libtool
doesn't think it has to be hard-wired as RPATH.  This is proper solution
for libtool RPATH issues described in:

  https://docs.fedoraproject.org/en-US/packaging-guidelines/#_removing_rpath

The libtool script/macros (new enough, v2.4.6+) honor this variable when
it isn't possible to detect the system-wide default library path.  It is
e.g. able to parse /etc/ld.so.* configuration, but there's no info about
/usr/lib64 on Fedora.

So to not force everybody to do:

   %configure LT_SYS_LIBRARY_PATH=...

... rather set this system-wide.  This is low-risk change since
older libtool scripts don't use this variable, and really no other
tools should.
2019-12-03 15:04:51 +01:00
Nicolas Mailhot
f5f6818d6e wordwrap: fix some corner cases
– handle CR in addition to LF
– be smarter in presence of lists
– fix off-by-one mistake when a LF in the processed text falls exactly on the 81st column
2019-12-03 12:02:01 +00:00
Denys Vlasenko
ddce306578
Bump version
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-03 13:01:10 +01:00
Denys Vlasenko
140ee1de89
brp-mangle-shebangs: do not stat / touch files needlessly
Run "stat" to get mtime, and "touch -d $saved_mtime"
only if we indeed modify file's shebang.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-03 13:00:36 +01:00
Denys Vlasenko
618362d6fb
brp-mangle-shebangs: fix unsafe/incorrect command expansion
trim() {
  printf '%s' "$*"
}
...
  read shebang_line < "$f" || :
  orig_shebang=$(trim $(echo "$shebang_line" | grep -Po "#!\K.*" || echo))

The "trimming", i.e. replacement of multiple spaces and removal of leading
and trailing spaces, is achieved because "trim $(cmd)" construct has an
unquoted $(), which is subject to word splitting.

This works, yes. BUT.

It is also subject to glob expansion - any ?s and *s will be attempted
to be expanded as well - definitely NOT what we want!

This change replaces this trick with code which avoids the expansion issue,
and which does not spawn any subprocesses for string manipulations -
this is ~3 times faster (fork+execs are expensive).

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-03 13:00:36 +01:00
Denys Vlasenko
63d7e4dc11
brp-mangle-shebangs: speed up finding of "text executables" (scripts)
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2019-12-03 13:00:35 +01:00
Lumir Balhar
6335a7ff4a Fix brp-python-bytecompile with the new features from compileall2
Resolves: rhbz#1595265

The problem this change is intended to solve is with how `real_libdir`
is calculated. Let's assume we want to recursively byte-compile all
`*.py` files in
`/builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8`.
Then, `real_libdir` is this path without `$RPM_BUILD_ROOT` with
the filename at the end which displays in the error message like this:

```
Bytecompiling .py files below /builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8 using /usr/bin/python3.8
*** Error compiling '/builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8/site-packages/greplin/bar.py'...
  File "/usr/lib/python3.8/bar.py", line 1
    import sin from math
               ^
SyntaxError: invalid syntax
```

`/usr/lib/python3.8/bar.py` is obviously wrong.

One of the new features of the `compileall2` module (which will
be available in stdlib in Python 3.9) is that the path byte-compiled to
`*.pyc` files is calculated for each file. This means that by using
`-s` and `-p` we can strip `$RPM_BUILD_ROOT` and prepend `/` for each
file individually which will fix the problem.

```
Bytecompiling .py files below /builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8 using /usr/bin/python3.8
*** Error compiling '/builddir/build/BUILDROOT/python-scales-1.0.9-250.fc32.x86_64/usr/lib/python3.8/site-packages/greplin/bar.py'...
  File "/usr/lib/python3.8/site-packages/greplin/bar.py", line 1
    import sin from math
               ^
SyntaxError: invalid syntax
```

This change has an effect only for Python >= 3.4.
2019-12-02 16:39:32 +01:00
Miro Hrončok
4d93255fb3 Fix the simple API of %gpgverify 2019-11-01 08:04:12 +01:00
Jason Tibbitts
2c88f0ec58 Bump release and add changelog entry. 2019-08-22 10:46:36 -05:00
Miro Hrončok
3490049617 Simplify the API of %gpgverify
Instead of:

  %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'

It is now possible to do:

  %gpgverify -k2 -s1 -d0

I haven't yet assumed any defaults not to break backwards compatibility.
2019-07-25 11:20:37 +02:00
Richard W.M. Jones
0b30be56e5 Bump version and rebuild. 2019-07-25 10:13:28 +01:00
David Abdurachmanov
0676a754f0 rpmrc: update optflags for riscv64
Match other architectures by adding missing flags:

    -fasynchronous-unwind-tables -fstack-clash-protection

This is already in Fedora/RISCV for 1+ year.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
2019-07-25 10:12:03 +01:00
Igor Gnatenko
4a1d1dd78f
Fixup python-srpm-macros version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-07-20 18:47:27 +02:00
Lumir Balhar
5437dfca81 Use compileall2 Python module for byte-compilation in brp-python-bytecompile 2019-07-20 08:08:26 +02:00
Miro Hrončok
53617406d9 Move brp-python-bytecompile from rpm, so we can easily adapt it 2019-07-20 08:07:57 +02:00
Nicolas Mailhot
faef29eb93 bump release 2019-07-08 23:32:20 +02:00
Nicolas Mailhot
b8797dcd02 listfiles: make it robust against all kinds of “interesting” input
– restore protection against empty input
 – handle non-empty inputs, with whitespace, quotes, linebreaks, etc
2019-07-08 23:30:42 +02:00
Nicolas Mailhot
1f7310110e wordwrap: make list indenting smarter, to produce something with enough structure that it can be converted into AppStream metadata 2019-07-08 23:24:08 +02:00
Robert-André Mauchin
1e9cb0e970 Revert "listfiles: fix expansion of listfiles_exclude/listfiles_include"
This reverts commit 9deb0680eb.

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
2019-07-08 17:13:20 +02:00
Nicolas Mailhot
9deb0680eb listfiles: fix expansion of listfiles_exclude/listfiles_include 2019-07-08 01:14:41 +02:00
Florian Festi
6b139317d5 Add changelog entry for previous change 2019-07-01 17:12:12 +02:00
Daniel Mach
38d0d92d5c Switch binary payload compression to Zstandard level 19
Fedora Change: https://fedoraproject.org/w/index.php?title=Changes/Switch_RPMs_to_zstd_compression
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1720729
Fesco ticket: https://pagure.io/fesco/issue/2144
Rel-eng ticket: https://pagure.io/releng/issue/8395
2019-07-01 16:41:12 +02:00
Vít Ondruch
86aae600e6 Enable RPM to set SOURCE_DATE_EPOCH environment variable.
If %source_date_epoch_from_changelog is true, RPM can set the SOURCE_DATE_EPOCH
environment variable to the timestamp of the topmost changelog entry. The
SOURCE_DATE_EPOCH can be in turn used by various projects to override otherwise
dynamically generated timestamps.

E.g. this might help to have stable timestamps in generated
documentation etc.
2019-06-27 08:41:44 +02:00
Igor Gnatenko
6708d7876e
Bump release
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-25 08:14:09 +02:00
Robert-André Mauchin
29b504fa55 Expand listfiles_include and listfiles_exclude in condition
listfiles_include and listfiles_exclude can contain multiline data that should be expanded, otherwise it breaks the if condition on newlines.
2019-06-24 22:47:59 +00:00
Jitka Plesnikova
c68c6bd353 Remove perl macro refugees 2019-06-12 12:54:26 +02:00
Panu Matilainen
bab65715b2 Provide temporary shelter for rpm 4.15 perl macro refugees
Rpm 4.15 removes various language-specific macros. Python side is
already covered by the versioned python macros but this is not the
case with Perl, macros. Add them here temporarily to avoid breaking
the world, but these really belong to perl-macros or such.
2019-06-10 14:12:21 +03:00
Igor Gnatenko
5878df46c0
Bump release
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-04 08:25:50 +02:00
Nicolas Mailhot
02f4a20583 misc: protect listfiles against empty input, to avoid harmless but annoying messages in build logs 2019-06-04 08:24:14 +02:00
Nicolas Mailhot
8394d3cf12
misc: add a wordwrap helper 2019-06-04 08:23:55 +02:00
Björn Persson
3da0ad5da8 Added gpgverify. 2019-05-30 19:54:13 +02:00
Nicolas Mailhot
c6773c14ed misc: listfiles: improve argument passing, simplify it and make it more robust 2019-04-24 17:16:46 +02:00
Nicolas Mailhot
61ec2ef5ba forge: add pagure driver 2019-04-24 16:48:00 +02:00
Nicolas Mailhot
68a8a3b402 misc: writevars: fix code formatting 2019-04-24 16:47:34 +02:00
Miro Hrončok
f29acc639b buildflags.md: Fix the packaging guidelines link 2019-01-18 22:38:59 +01:00
Panu Matilainen
20a0e63249 Drop redundant _smp_mflag re-definition, use the one from rpm instead
Once upon a time these did differ (for various bad reasons) but the
version in rpm has been identical to ours for many years, lets shed
some old baggage.
2019-01-15 12:02:22 +02:00
Florian Weimer
e80fa1344a Build flags: Add support for extension builders (#1543394) 2018-12-20 11:34:27 +01:00
Panu Matilainen
98ffd5040d Silence the annoying warning from ldconfig brp-script (#1540971) 2018-12-17 16:16:25 +02:00
Nicolas Mailhot
5335ee546b common: add a writevars helper 2018-12-04 17:25:02 +01:00
Nicolas Mailhot
353f8b9faf common: add a setcurrent helper 2018-12-04 17:25:01 +01:00
Nicolas Mailhot
7b6ec4668c forge: fix handling of / in refs as showcased by github.com/dnstap/golang-dnstap 2018-12-04 17:24:34 +01:00
Nicolas Mailhot
d6f71146ac forge: keep distprefixes lowercase, even for not primary ones 2018-12-04 17:24:34 +01:00
Miro Hrončok
a212174975 Make automagic Python bytecompilation optional
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2
2018-11-15 12:13:14 +01:00
Jason Tibbitts
b725d1e38a Bump version/update changelog. 2018-11-08 08:34:28 -06:00
Nicolas Mailhot
455084c511 forge: add more distprefix cleaning (bz1646724) 2018-11-06 17:47:28 +01:00
Igor Gnatenko
65fc49d917
bump version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-10-22 11:09:13 +02:00
Nicolas Mailhot
8ba2a65b5c forge: add back a no-op -q in %forgeautosetup, even though being quiet was always its default behaviour
https://lists.fedoraproject.org/archives/users/81059352675829171399634426908237561548/
2018-10-22 10:10:19 +02:00
Igor Gnatenko
39fa88418c
bump version
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-10-20 12:32:45 +02:00