Commit Graph

2471 Commits

Author SHA1 Message Date
Gleb Fotengauer-Malinovskiy
d60876ea4f brp-sign-kmodules.in: fix couple of shellcheck warnings
SC2162 ("read without -r will mangle backslashes") and SC2086: ("Double
quote to prevent globbing and word splitting").  These actually seem to
be harmless in our case.
2021-11-03 03:11:44 +03:00
Gleb Fotengauer-Malinovskiy
7a87954821 process-debuginfo.in: sync xz compression flags with the Linux kernel 2021-11-03 03:11:44 +03:00
Gleb Fotengauer-Malinovskiy
b996912c5d brp-debuginfo.in, process-debuginfo.in: add support for zstd-compressed modules 2021-11-03 03:11:44 +03:00
Gleb Fotengauer-Malinovskiy
b07d68eab5 process-debuginfo.in: rewrite module (de)compression logic
This change makes easier to add support of zstd-compressed modules in
the next commit.
2021-11-03 02:33:13 +03:00
f852e0e407 4.0.4.178-alt1
- process-lto: enhanced error diagnostics.
2021-09-09 08:00:00 +00:00
fcc291f3a6 process-lto: enhance __gnu_lto_slim diagnostics
Turn __gnu_lto_slim diagnostics into a concise phrase printed for each
faulty archive file followed by a single lengthy multi-line descriptive
text.

Suggested-by: Vitaly Chikunov <vt@altlinux.org>
Link: https://lore.altlinux.org/devel/20210827221847.arp4wv7ngnkdliwm@altlinux.org/T/#u
2021-09-08 08:00:00 +00:00
457de4ae02 process-lto: add explicit diagnostics about failed strip
While strip is verbose when it fails to process files,
it's not quite obvious that it exits with a non-zero status,
hence an explicit diagnostics message might be useful.
2021-09-08 08:00:00 +00:00
8c5c47a2a1 Remove remaining vestiges of python bindings
Build of python bindings was turned off by commit 4.0.4-alt100.97~5 made
about 5 years ago, not it's time to remove the remaining unused bits.
2021-09-08 08:00:00 +00:00
00cd0e2abb 4.0.4-alt177
- Reverted the change introduced in 4.0.4-alt174.
2021-08-25 08:00:00 +00:00
ff43db6168 Revert "Add support for --runstatedir configure option"
Unfortunately, many generated configure files do not accept this option,
failing build with the following diagnostics:
configure: error: unrecognized option: `--runstatedir=/var/run'

This reverts commit 9bed7dcbad.
2021-08-25 08:00:00 +00:00
eae4fd7c15 4.0.4-alt176
- platform.in: Added more systemd macros.
2021-08-25 02:58:35 +03:00
01d2120325 platform.in: add more systemd macros 2021-08-25 02:57:37 +03:00
4547eecb7c 4.0.4-alt175
- platform.in: Parallelize LTO with -flto=auto.
- process-lto: Fix suggestion text.
2021-08-24 22:35:31 +03:00
e080be091a platform.in: Parallelize LTO with -flto=auto
Man gcc: "Use -flto=auto to use GNU make's job server, if available, or
otherwise fall back to autodetection of the number of CPU threads
present in your system."
2021-08-24 22:34:59 +03:00
6903fbf1b7 process-lto: Fix suggestion text
Using `%define` produces error messages like this:

  [i586] error: Recursion depth(25) greater than max(24)
  [i586]  23<                                               (empty)
  [i586]  22<                                             (empty)
  [i586]  21<                                           (empty)
  [i586]  20<                                         (empty)
  [i586]  19<                                       (empty)
  [i586]  18<                                     (empty)
  [i586]  17<                                   (empty)
  [i586]  16<                                 (empty)
  [i586]  15<                               (empty)
  [i586]  14<                             (empty)
  [i586]  13<                           (empty)
  [i586]  12<                         (empty)
  [i586]  11<                       (empty)
  [i586]  10<                     (empty)
  [i586]   9<                   (empty)
  [i586]   8<                 (empty)
  [i586]   7<               (empty)
  [i586]   6<             (empty)
  [i586]   5<           (empty)
  [i586]   4<         (empty)
  [i586]   3<       (empty)
  [i586]   2<     (empty)
  [i586]   1<   -pipe -frecord-gcc-switches -Wall -g -O2
  [i586]   0< CFLAGS="-pipe -frecord-gcc-switches -Wall -g -O2
  [i586] error: line 90: CFLAGS="-pipe -frecord-gcc-switches -Wall -g -O2
  [i586] hsh-rebuild: pkg.tar: failed to fetch build dependencies.
2021-08-24 22:34:59 +03:00
e15e40078f 4.0.4-alt174
- Added support for --runstatedir configure option.
2021-08-24 08:00:00 +00:00
9bed7dcbad Add support for --runstatedir configure option
Update %configure macro to pass --runstatedir=%_runtimedir
option to configure.
Update %makeinstall macro to pass runstatedir=%buildroot%_runtimedir
argument to make.
2021-08-24 08:00:00 +00:00
25488ec95c 4.0.4-alt173
- platform.in: Enable LTO by default.
- brp: Add brp-strip-lto & process-lto scripts.
2021-08-24 01:39:36 +03:00
9fdc144edd platform.in: Enable LTO by default
To opt out:

  %define optflags_lto %nil

To compile libs add `-ffat-lto-objects' like this:

  %define optflags_lto %optflags_lto -ffat-lto-objects

Do not use `-ffat-lto-objects' for anything except exported libs as it
doubles compile time.
2021-08-24 00:52:22 +03:00
715065e999 brp: Add brp-strip-lto script
Strip LTO sections and symbols from objects and archives (static
libraries). %brp_strip_none macro is respected.

Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2021-08-24 00:52:22 +03:00
8851274e51 4.0.4-alt172
- Fix regression introduced by forgotten file usage.
2021-08-18 01:21:31 +03:00
b893f89a7f Fix regression introduced by forgotten file usage
There was two forgotten file instances. Fix error such as:

  /root/tmp/rpm-tmp.80ZNEF: line 1: /usr/sbin/post_service: No such file or directory
  error: %post(traefik-2.4.14-alt1.x86_64) scriptlet failed, exit status 127
  error: traefik-2.4.14-alt1.x86_64: install failed

Fixes: 5ef5c8ff4 ("Use file4 instead of file")
2021-08-18 01:20:36 +03:00
ffb8342a16 4.0.4-alt171
- Use file4 instead of file.
2021-08-12 13:23:31 +03:00
5ef5c8ff4a Use file4 instead of file
This will allow upgrading system file to v5, leaving rpmbuild using
stable file v4.
2021-08-12 13:23:31 +03:00
Gleb Fotengauer-Malinovskiy
1d03e6395e 4.0.4-alt170
- rpm-build: do not record directory sizes in packages.
2021-07-06 16:18:08 +03:00
Panu Matilainen
0bf0dd0809 Do not record directory sizes in packages
Directory size is an install-time filesystem specific implementation
detail, build-time just doesn't have a clue. If we want to try taking
directory sizes into account, this needs to happen in the disk space
checking at install time.

It also helps making builds a bit more reproducable (PR #229)

(cherry picked from commit 2cf7096ba534b065feb038306c792784458ac9c7)
2021-07-06 16:17:15 +03:00
Arseny Maslennikov
1b8549bf5d 4.0.4-alt169
- Introduced %_smp_build_ncpus macro.
2021-06-08 18:40:15 +03:00
Arseny Maslennikov
87424e1d65 Introduce %_smp_build_ncpus macro
This macro offers %{_smp_mflags}, but without the -j prefix, to signify
the configured number of processor cores to use.
We can use this to pass that number to utilities that do not understand
the -j number syntax, for example:
`cmake --build %_cmake__builddir --verbose --parallel %_smp_build_ncpus'

The name was picked to be compatible with RH:
https://github.com/rpm-software-management/rpm/blob/rpm-4.16.1.3/platform.in#L51
We preserve ALT semantics though.
2021-06-08 18:38:35 +03:00
46c42b83ee 4.0.4-alt168
- rpm-build: added rpm-macros-python3 to requirements.
2021-05-01 08:00:00 +00:00
62370d58b8 spec: add rpm-macros-python3 to rpm-build requirements
This is required to guarantee that no python3 req/prov are accidentally
lost because python3.{req,prov} are not installed.

Unlike rpm-build-python3, rpm-macros-python3 can be installed without
python3, so no extra dependencies are pulled in.

If rpm-build-python3 is not installed but python3.{req,prov}.files
decide that python3.{req,prov} have to be invoked, the latter will issue
an error.
2021-05-01 08:00:00 +00:00
1a750d8e21 4.0.4-alt167
- Use external debugedit.
2021-04-29 22:39:57 +03:00
3a74c95016 Remove internal debugedit
Do not build internal debugedit and its tests. Debugedit is now external
package.
2021-04-29 22:39:57 +03:00
89e3f8b764 Use system provided debugedit
Debugedit is split into a separate package, use it.

References:
  https://sourceware.org/bugzilla/show_bug.cgi?id=27351
  http://lists.rpm.org/pipermail/rpm-ecosystem/2021-February/000734.html
  https://sourceware.org/debugedit/
2021-04-29 22:39:21 +03:00
4ceb43a3b9 4.0.4-alt166
- Moved brp-bytecompile_python and brp-hardlink_pyo_pyc to rpm-build-python.
2021-04-29 12:00:00 +00:00
bb6b349cb4 Move brp-bytecompile_python and brp-hardlink_pyo_pyc to rpm-build-python
If there are .py files to bytecompile, then rpm-build-python has to be
installed, so move these scripts to rpm-build-python where they belong.
2021-04-29 12:00:00 +00:00
efeccf82ff 4.0.4-alt165
- Replaced rpm-build-python with rpm-macros-python in rpm-build requirements.
- Removed python-devel from BuildRequires.
2021-04-28 20:00:00 +00:00
9fd0523dfd spec: apply some specfile hardening
%define _unpackaged_files_terminate_build 1
%define _stripped_files_terminate_build 1
%set_verify_elf_method strict
2021-04-28 20:00:00 +00:00
9299e5cba9 spec: remove python-devel from BR
python-devel is not needed for build.
2021-04-28 20:00:00 +00:00
501ebe3ec0 spec: replace rpm-build-python with rpm-macros-python in rpm-build requirements
The idea is that rpm-macros-python could be installed without python2,
consequently, python2 will no longer be installed by default, but no
python2 req/prov would be lost because of that change because,
if a python2 module package or a package containing a python2 script
would miss to pull in python2, it would fail to build.
2021-04-28 20:00:00 +00:00
0901ca7282 4.0.4-alt164
- ldd.in: fix trace_elf error diagnostics (ldv).
- rpmio: Workaround another liblzma memory allocation failure on armh.
- rpmio+pack: Update rpmio_flags 'T' with actual threads used.
- rpmio: Make xzdio errors more informative.
- rpmio: Fix lzopen_internal mode parsing when 'Tn' is used.
2021-01-16 03:16:55 +03:00
161dbaaeb1 rpmio: Fix lzopen_internal mode parsing when 'Tn' is used
When there is number after "T" (suggested number of threads or "0" for
getncpus), lzopen_internal() mode parser would skip one byte, and when
it's at the end of the string it would then parse undesired garbage from
the memory, making intermittent compression failures.

Fixes: c23872d71 ("Add support for multithreaded xz compression")
Fixes-upstream: 7740d1098.
Upstream-PR: https://github.com/rpm-software-management/rpm/pull/1478
2021-01-16 03:16:55 +03:00
ef8e18f471 rpmio: Make xzdio errors more informative
Mode flags could change from what is specified in defines and errors
could happen before any other descriptive messages would appear, but
it's useful to know some additional info about xz compression to debug
multi-threading memory failures.

Reviewed-by: Arseny Maslennikov <arseny@altlinux.org>
2021-01-16 03:16:55 +03:00
56e441c403 rpmio+pack: Update rpmio_flags 'T' with actual threads used
Useful information for debugging liblzma memory issues.

Reviewed-by: Arseny Maslennikov <arseny@altlinux.org>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2021-01-16 03:16:55 +03:00
cae4cfe66f rpmio: Fix formatting of liblzma error messages
Add forgotten new lines.

Fixes: c254b0d63 ("add rpmlog(RPMLOG_ERR, ...) for liblzma return codes")
2021-01-16 01:57:20 +03:00
58313570f4 rpmio: Workaround another liblzma memory allocation failure on armh
Liblzma is non-robust on memory allocation problems - while it works
well on 64-bit architectures with plenty of RAM, it's problematic on
32-bit architectures when multi-threading is used.

Try another workaround: instead of just guessing the best delta, move
half of the current (512MiB) delta into 'guard malloc' allocation test
of what LZMA encoder memusage would return.

This is definitely hackish (and vulnerable to toctou), but it's that
much we could do without significantly reworking stream_encoder_mt.

Error message:

  Wrote: /usr/src/RPM/RPMS/armh/libmozjs78-tools-78.0.1-alt2.armh.rpm (w5.lzdio)
  error: lzwrite: lzma error 5
  error: lzclose: lzma error 11
  error: create archive failed on file /usr/src/tmp/libmozjs78-buildroot/usr/lib/debug/usr/lib/libmozjs-78.so.debug: cpio: write failed - Bad file descriptor

Amends: f5fcb8f43 ("Lower memory limit on 32-bit arches for xz compression, again")
Amends: afe660558 ("Lower memory limit on 32-bit systems for xz compression")
Amends: 0b18c0498 ("prevent exceeding 32 bit memory limitations with multithreaded xz compression")
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2021-01-16 01:57:02 +03:00
ca8e8131b4 ldd.in: fix trace_elf error diagnostics 2021-01-11 08:00:00 +00:00
83ce032556 4.0.4-alt163
- Added fixup method: gnuconfig.
2020-12-21 08:00:00 +00:00
5e710ba046 Add fixup method: gnuconfig
Replaces all config.guess and config.sub files outside gnu-config
to symlinks leading to /usr/share/gnu-config/{config.guess,config.sub}.
2020-12-21 08:00:00 +00:00
c2007ceab8 4.0.4-alt162
- Downgrade XZ->LZMA automatically for small payloads (by Alexey Tourbin).
- Added payload compression string diagnostics.
- Fixed exit status of "rpmbuild --version" command.
2020-12-19 22:43:47 +00:00
fde66de855 Fix exit status of rpmbuild --version
Reported-by: Michael Bykov <m.bykov@gmail.com>
2020-12-19 22:43:47 +00:00