Commit Graph

2483 Commits

Author SHA1 Message Date
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
b6d1778c72 pack.c: print payload compression string
Given that downgradeLzmaLevel can change the payload compression,
it's useful to have this diagnostics in the output produced by rpmbuild.
2020-12-19 22:43:47 +00:00
Alexey Tourbin
b295de5893 pack.c: downgrade XZ->LZMA automatically for small payloads
Recent changes left downgradeLzmaLevel dysfunctional (because it does
not recognize 'T').  In my view, the only advantage of XZ over LZMA is
that XZ can can split input into blocks and compress them in parallel
(resulting in a speed-up).  Other advantages, such as a checksum, are
immaterial for our purpose (because the package manager must verify the
integrity of a package beforehand).  Therefore, downgradeLzmaLevel will
also downgrade XZ->LZMA automatically, for payloads smaller than
5*dictSize (the default blockSize being 3*dictSize, so that there are
at least two blocks, the second block not too small).
2020-12-19 22:43:47 +00:00
ef75eb0b2e 4.0.4-alt161
- debuginfo: strip --reloc-debug-sections for kernel modules.
- rpmio: Lower memory limit on 32-bit arches for xz compression, again.
- brp-debuginfo: Add debug sources check.
- rpmio: Include rpmmacro.h to fix compilation warning.
2020-12-18 06:27:08 +03:00
9726c71d1e rpmio: Include rpmmacro.h to fix compilation warning
rpmio.c: In function 'get_compression_threads':
rpmio.c:2114:12: warning: implicit declaration of function 'rpmExpandNumeric' [-Wimplicit-function-declaration]
 2114 |  threads = rpmExpandNumeric("%{getncpus}");
      |            ^~~~~~~~~~~~~~~~

Reported-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-18 06:26:31 +03:00
cd0eca00e9 brp-debuginfo: Add debug sources check
Warn if debuginfo is present, but debug sources aren't.

Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-18 03:45:22 +03:00
457fef1d64 debuginfo: strip --reloc-debug-sections for kernel modules
`--reloc-debug-sections` resolves trivial relocs between debug
sections and designed for use on kernel modules debug (.ko.debug)
reducing their sizes.
2020-12-18 03:45:22 +03:00
f5fcb8f43d rpmio: Lower memory limit on 32-bit arches for xz compression, again
For armh 256 MiB delta is not enough for `w7T.xzdio`.

Fixes:

  [armh] error: lzwrite: lzma error 5
  [armh] error: lzclose: lzma error 11
  [armh] error: create archive failed on file /usr/src/tmp/llvm11.0-buildroot/usr/lib/debug/.build-id/61/30f51d2a9f8b999e986a2f6c027c1266ba2cf9: cpio: write failed - Bad file descriptor

Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-18 03:45:15 +03:00
ac623ad5b7 4.0.4-alt160
- Add a wrapper for install in %install section to skip strip.
2020-12-15 04:05:15 +03:00
a2e3f87824 Add a wrapper for install in %install section to skip strip
`strip' is called by `install -s` that could occur in unpatched
Makefiles, breaking debuginfo generation.

Try to catch `install` invocations via:

- %__install macro used in `make INSTALL=`.
- Prefix PATH with `/usr/libexec/rpm-build` with install and strip
  wrappers.

Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-15 04:05:15 +03:00
bfb4142971 4.0.4-alt159
- rpmio: Lower memory limit on 32-bit systems for xz compression.
- rpmio: Make liblzma errors more verbose.
2020-12-13 02:35:44 +03:00
afe6605589 rpmio: Lower memory limit on 32-bit systems for xz compression
For some systems 128 MiB delta is not enough for `w7T.xzdio`. Found by
experiment that 256 MiB is enough.

Fixes:

  error: create archive failed on file /usr/src/in/source/FlightGear-data-2020.1.2.tar: cpio: write failed - Bad file descriptor
2020-12-13 02:35:37 +03:00
e3d73c95d5 rpmio: Make liblzma errors more verbose
LZMA error codes lost in the depths of IO callbacks. But they could be
informative to user, especially LZMA_MEM_ERROR (5).
2020-12-13 02:35:30 +03:00
4d2baaf881 4.0.4-alt158
- Prevent exceeding 32 bit memory limitations with xz compression.
2020-12-10 19:15:42 +03:00
0b18c0498e prevent exceeding 32 bit memory limitations with multithreaded xz compression
Based on commit a60f36a55 by Per Øyvind Karlsen. Original commit message:

  As 32 bit build suffers under the limitation of 32 bit address space,
  regardless of it's environment would be ie. 64 bit and not have this
  constration, rpm must make sure not to exceed this memory limitation.
  When using multithreaded xz compression, the number of threads used will
  increase the memory usage, making it necessary to check the memory
  required with the number of threads to be used.

  Number of compression threads will therefore be kept reduced untill
  amount of memory required won't exceed this limitation.

  For 32 bit binaries running under 64 bit host environment, where less
  available memory will be reserved for kernel, easing memory constraints,
  determination of this will be done by a combination of checking host
  arch as well as whether 32 bit personality flag is set, thereby still
  allow a sligthly greater memory usage for such cases to avoid
  imposing unnecessatry limitations under such environments.

Changes from the original commit:

- Do not call uname(2).
- Limits are increased.
- Do not call lzma_memlimit_set().
- No message about thread limitation.

Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-10 19:15:42 +03:00
e434333b9a 4.0.4-alt157
- Add support and enable multi-threaded xz payload compression.
- Add affinity aware %getncpus macro.
- platform: change %__nprocs to use %getncpus instead of nproc(1).
2020-12-08 22:49:11 +03:00
117a2e6042 platform.in: change %__nprocs definition to use %getncpus instead of nproc(1)
Both use sched_getaffinity(2), but %getncpus is built-in and saves fork
and execve.

Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-08 22:49:11 +03:00
6ffa199751 macros: Enable multi-threaded xz payload compression
`T' (or `T0') meant auto-detect number of threads by `%getncpus' macro.
2020-12-08 22:49:11 +03:00
a4bace1771 Merge branch 'xz-multi-thread' into sisyphus
Multi-thread xz payload compression patches from upstream rpm.
These include new affinity aware %getncpus macro.

* xz-multi-thread:
  Add get_compression_threads and refactor code.
  Add documentation for %getncpus macro
  Add a built-in macro for fetching number of CPUs, affinity aware and all
  Only use multi thread support with liblzma >= 5.2.0
  Add support for multithreaded xz compression
  add support for setting xz memlimit
  add rpmlog(RPMLOG_ERR, ...) for liblzma return codes
2020-12-08 22:48:41 +03:00
Martin Liska
7ebe00643c Add get_compression_threads and refactor code.
Merged-by: Vitaly Chikunov <vt@altlinux.org>

Removed 4 thread limitation for 32-bit systems.
2020-12-08 22:48:19 +03:00
Pavlina Moravcova Varekova
1af22e100d Add documentation for %getncpus macro
Merged-by: Vitaly Chikunov <vt@altlinux.org>
2020-12-08 22:48:05 +03:00
Panu Matilainen
e3bd69c7df Add a built-in macro for fetching number of CPUs, affinity aware and all
There's an increasing number of placing wanting to know the number of
CPU's for parallel processing, and increasingly these things are running
in containers and such where the total host CPU count is not meaningful.

Merged-by: Vitaly Chikunov <vt@altlinux.org>
2020-12-08 22:47:59 +03:00
Florian Festi
0263f6ebbd Only use multi thread support with liblzma >= 5.2.0
Merged-by: Vitaly Chikunov <vt@altlinux.org>
2020-12-08 22:47:50 +03:00
Per Øyvind Karlsen
c23872d713 Add support for multithreaded xz compression
Merged-by: Vitaly Chikunov <vt@altlinux.org>
2020-12-08 22:47:50 +03:00
Per Øyvind Karlsen
222d4ff7fc add support for setting xz memlimit
Merged-by: Vitaly Chikunov <vt@altlinux.org>
2020-12-08 22:47:50 +03:00
Per Øyvind Karlsen
c254b0d63f add rpmlog(RPMLOG_ERR, ...) for liblzma return codes 2020-12-08 22:47:50 +03:00
459b3bc3f8 4.0.4-alt156
- debugedit: Do not 'edit_dwarf2' when just extracting build-id.
- debuginfo: Fix 'warning: File listed twice' for debug sources.
2020-11-15 17:55:01 +03:00
623707e728 debuginfo: Fix 'warning: File listed twice' for debug sources
debugedit sometimes output top level directory, since we do not filter
regular files in process-debuginfo since 309af2d59 ("debuginfo: Create
empty src/debug directories for paths with `..'") we need to filter
them out before passing into %files for debuginfo package.

Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: 309af2d59 ("debuginfo: Create empty src/debug directories for paths with `..'")
2020-11-15 17:54:34 +03:00
0bbb4e84c3 debugedit: Do not 'edit_dwarf2' when just extracting build-id
No need to call edit_dwarf2() if debugedit is invoked just to extract
build-id (with `-i -n'). Otherwise, we will get `DWARF version 0
unhandled' error for compressed .debug files:

  /usr/lib/rpm/debugedit: ./usr/lib/debug/...e.ko.debug: DWARF version 0 unhandled

Partial forward port of: 1f2ad272a ("debugedit: Add -n to avoid recomputing of
build-id").
2020-11-14 18:25:07 +03:00
0993473ed3 4.0.4-alt155
- debugedit: Fix 'Unhandled relocation 0 in .debug_info section' on e2k.
- debuginfo: Fix source paths with `..` by creating appropriate empty dirs
  under `/usr/src/debug` tree (closes: #39175).
2020-11-12 22:24:18 +03:00
309af2d59e debuginfo: Create empty src/debug directories for paths with `..'
Create empty directories under `/usr/src/debug` tree for source paths
containing `..` (for example `../../src` in elfutils). This should fix
debuginfo sources for autotools builds in subdir.

Fixes: https://bugzilla.altlinux.org/39175
2020-11-12 22:08:42 +03:00
bb0b76e759 debugedit: Fix 'Unhandled relocation 0 in .debug_info section' on e2k
Fix parsing Elbrus ELFs. brp-debuginfo error:

  /usr/lib/rpm/debugedit: ./lib/modules/5.4.58-elbrus-def-alt1.5.2/misc/xt_so.ko: Unhandled relocation 0 in .debug_info section

Reported-by: Michael Shigorin <mike@altlinux.org>
Tested-by: Andrey Savchenko <bircoph@altlinux.org>
2020-11-12 18:53:05 +03:00
a2370b4983 4.0.4-alt154
- addReqProv: issue a warning and ignore self-provides,
  providePackageNVR already does the right thing.
2020-11-11 08:00:00 +00:00
128d160548 addReqProv: ignore self-provides
providePackageNVR already does the right thing.
2020-11-11 08:00:00 +00:00
a1f907ca9c 4.0.4-alt153
- debugedit: Copy debugedit with its tests from upstream.
2020-11-10 06:43:20 +03:00
14e97e6b25 tests: Add debugedit tests
Copy reduced tests/Makefile.am from RPM upstream and make tests work.
2020-11-10 06:43:20 +03:00
29ac9fc75a tests/debugedit: Uncompress object files before tests
We have in `*.o` `.debug_*` sections compressed by default, thus,
getting `DWARF version 0 unhandled' error.
2020-11-10 06:43:20 +03:00
018ae0a853 Merge (theirs) branch 'debugedit.at' into sisyphus
rpm:
   git fast-export HEAD -- tests/debugedit.at \
       tests/data/SOURCES/???.c tests/data/SOURCES/*.h > b

rpm-build:
  git fast-import < b
  git br -m master debugedit.at
  git merge -X theirs --allow-unrelated-histories debugedit.at
2020-11-10 06:43:14 +03:00
08c5331f48 debugedit: Build newly imported debugedit 2020-11-09 23:07:25 +03:00