Commit Graph

2483 Commits

Author SHA1 Message Date
Ivan Zakharyaschev
142f0fa117 installplatform: drop unsused variables from the script 2020-06-28 19:23:11 +03:00
Ivan Zakharyaschev
6ca12cdba9 add /usr/lib/rpm/armv8l-alt-linux/macros for builds on armv8l machines
If rpmbuild is invoked without --target, it looks for the macros based
on `uname -m`. The resulting error message on armv8l machines (when
building a noarch package) was like this:

> Invalid or unknown architecture: noarch-alt-linux
> Executing(%install): /bin/sh -e /tmp/sh.txFqhrP3/rpm-tmp.63120
> error: Bad exit status from /tmp/sh.txFqhrP3/rpm-tmp.63120 (%install)

--a bit misleading due to the following fallback code from macros.in
being executed:

    %___build_pre	\
    %{warn:Invalid or unknown architecture: %{_target_cpu}-%{_vendor}-%{_target_os}\
    }exit 1\
    %nil

(Are there additional customizations that we might want to enable on
armv8l compared to our armv7l or armh configuration?

armv8l means having AArch32 architecture, typically on a CPU with
AArch64, too. AArch32 means that A32 (ARM) and T32 (Thumb-2)
instruction sets are admitted. See, e.g.,
<https://bgamari.github.io/posts/2019-06-12-arm-terminology.html>.

Currently, our armv8l-alt-linux/macros won't differ essentially from
armv7l-alt-linux/macros. Probably, that's fine, because it seems that
all ARMv8 and all ARMv7 processors support Thumb-2 instructions in the
T32 instruction set, so there are no essential differences in the
optimizations that can be applied.)

Reported-by: Vitaly Chikunov <vt@altlinux.org>
Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: c18f1b7d ("installplatform, rpmrc.in: made armv8l compatible with armh")
2020-06-28 19:22:55 +03:00
Panu Matilainen
41380d7394 Execute tests in independent testing roots to enable parallel running
Up to now we've run tests in a mish-mash of an environment where bits
and pieces of previous tests might exist, and as state has been shared
it's been impossible to execute tests in parallel.

This makes the pre-populated testing-root read-only to the owner to force
all writers to perform an extra setup call to gain a private testing
environment. Most of the users needing this already had RPMDB_INIT calls
to ensure clean rpmdb state so that's where this is hooked onto.

There's a fair bit of gymnastics with the environment to make things match
on both sides of fakechroot, some of which can hopefully go away eventually
once the dust from this settles. This is also rather heavy as it is,
on my laptop serial execution goes down from ~1m15s to ~1m45s, but then
parallel execution with -j8 is down to ~50s. There should be a number of
optimizations that can be made, such as setting up links for writable
directories instead of copying the entire testing-tree around, but leaving
that as a future exercise. This is more of an enabler than the goal state.

Note that this does *not* enable test-suite parallel running for
`make -jN check`, because `make` does not export the -j argument in
a way that we could pass to `./rpmtests` from the makefile. To enable
that, one needs to pass a suitable -jN argument through TESTSUITEFLAGS,
such as `make -j8 check TESTSUITEFLAGS="-j8"`. Or run invoke `rpmtests`
manually.
2020-06-12 13:18:56 +03:00
Andrew Savchenko
7f9d1409c8
4.0.4-alt140
- Export FCFLAGS as modern FFLAGS replacement for gfortran.
2020-05-29 11:50:29 +03:00
Andrew Savchenko
dae6334333
Export FCFLAGS as well as FFLAGS
FCFLAGS is modern replacement of FFLAGS for gfortran.
Details can be found in [1].

Modern Fortran applications use FCFLAGS instead of FFLAGS, so we have
them built without platform-specific and general optimizations.
As an example one may look how libgfortran is being built within gcc-9:
libgfortran/Makefile.in uses only FCFLAGS, not FFLAGS and mary other
applications follow.

[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Fortran-Compiler.html
2020-05-29 11:46:12 +03:00
48b14cf1b8 4.0.4-alt139
- ldd.in: made preloading of PIE objects work again.
- Set the value of SOURCE_DATE_EPOCH environment variable (if any)
  as the source package buildtime.
2020-04-21 17:37:55 +00:00
56058a3e7d ldd.in: make preloading of PIE objects work again
glibc starting with commit glibc-2.30~85
(elf: Refuse to dlopen PIE objects [BZ #24323])
no longer supports preloading of PIE objects.

Workaround this by swapping the target object and the preloading
PIE object when possible.

Reported-by: ALT beekeeper
Reported-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
2020-04-21 17:37:55 +00:00
d304554617 packageSources: override RPMTAG_BUILDTIME with $SOURCE_DATE_EPOCH
When hasher generates an src.rpm from pkg.tar, it sets $SOURCE_DATE_EPOCH
according to pkg.tar's specfile modification time which in turn is set to
the corresponding commit time.

When hasher builds from an src.rpm, it sets $SOURCE_DATE_EPOCH according
to the src.rpm's RPMTAG_BUILDTIME.

This changes helps to connect these two stages, setting the
RPMTAG_BUILDTIME of the generated src.rpm to $SOURCE_DATE_EPOCH.

Co-Authored-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
2020-04-21 15:54:47 +00:00
Alexey Tourbin
7c77534fe7 4.0.4-alt138
- find-package, shebang.req: introduced RPM_FINDPACKAGE_MANDATORY=1.
  When an interpreter is invoked by name, as in "#!/usr/bin/env python32",
  and is missing, this will now force the dependency on /usr/bin/python32.
2020-04-07 11:11:19 +03:00
Alexey Tourbin
75b044f2cb find-package, shebang.req: introduced RPM_FINDPACKAGE_MANDATORY=1 2020-04-07 11:05:34 +03:00
6c3490a2cf 4.0.4-alt137
- Fixed %autopatch and %patch regression introduced in previous release.
2020-01-04 10:43:44 +00:00
252df9b61a Fix %patch and %autopatch
* build/parsePrep.c (doPatch): Do not pass null pointer to sprintf.
(doAutopatchMacro): Do not pass null pointer to strcmp.

Fixes: 9c18a402 ("Make %autopatch and %patch accept -pg")
2020-01-04 10:43:44 +00:00
6da99494b5 4.0.4-alt136
- Generate requirements on binaries used in systemd service files
  (by Anton V. Boyarshinov)
- Made %autopatch and %patch accept -pg (by Vladimir D. Seleznev).
- Fixed build with new gettext.
2020-01-03 19:33:48 +00:00
a7ed02398b spec: fix license tags 2020-01-03 19:33:48 +00:00
915bc8b5ff spec: remove %if 0'd parts
... because they confuse rpmspec.
2020-01-03 19:33:48 +00:00
0954baaf05 Remove AM_INTL_SUBDIR
This macro is no longer exported by gettext.
2020-01-03 19:33:48 +00:00
Anton V. Boyarshinov
54a2ca259c Auto-requies on binaries used in systemd .service files added 2019-12-26 14:09:03 +00:00
9c18a40269 Make %autopatch and %patch accept -pg
* parsePrep.c (doPatch): Change strip argument type to const char *.
(doPatchMacro, doAutopatchMacro): Change opt_p variable type to char *,
change checking of opt_p: it can be either a number or a 'g' symbol
assuming that -pg is a valid option for patch command.
2019-12-15 21:57:32 +00:00
b0a545f593 4.0.4-alt135
- Fixed build with glibc >= 2.28.
2019-11-24 11:58:18 +00:00
90d5486688 Check for cookie_io_functions_t provided by stdio.h
Do not check for libio.h, it's not included anyway.
Check for cookie_io_functions_t and conditionalize
on HAVE_COOKIE_IO_FUNCTIONS_T instead.
2019-11-24 11:58:18 +00:00
5133ad68aa setcmp: use 'm' instead of 'a' as the assignment-allocation modifier
Support for the 'm' modifier was added to glibc starting with version 2.7,
programs should use that modifier instead of 'a'.
2019-11-24 11:58:18 +00:00
fdd98a7997 Replace all uses of _IO_off64_t with off64_t
Mechanically substitute _IO_off64_t with off64_t using
$ git grep -Fwl _IO_off64_t |xargs -r sed -i s/_IO_off64_t/off64_t/g

This follows glibc-2.28~574 and fixes build with glibc >= 2.28.
2019-11-24 11:58:18 +00:00
9977eae223 4.0.4-alt134
- Backported RPMTAG_VCS support from rpm.org.
2019-11-01 16:16:23 +00:00
Colin Walters
8e0d85c61e Add 'VCS' key
Spec files have a lot of metadata about a project.  However one of the
most key components is the upstream version control system which was
notably lacking.

Resolve this by adding a "VCS" key.  There is no specification
for contents of this key, given that the set of version control
systems (and features thereof) are not well-defined.  However,
recommendations are:

 * git: This URL should be in a form that can be passed to "git clone",
   with the additional feature that an optional fragment identifier "#foo"
   denotes a branch or tag.
2019-11-01 16:16:23 +00:00
ee9e17c3ad 4.0.4-alt133
- Added %autopatch support.
2019-10-03 21:19:34 +03:00
efe5536cfe build: add %autopatch support
%autopatch is a directive to apply all patches, it supports -p<num> and
-F<num> options

%autopatch was initially introduced in rpm.org with version 4.11 but with
different implementation.
2019-10-03 21:14:18 +03:00
Mark Wielaard
add384514f debugedit: Make sure .debug_line old/new idx start equal.
Found by running the debugedit tests under valgrind.
If the old and new .debug_line offset isn't changed then we might
write out an uninitialized new_idx.
2019-06-19 15:06:55 +03:00
Mark Wielaard
a78871c0bc Handle .debug_macro in debugedit.
When compiling with -g3 gcc will generate a .debug_macro section
which has pointers to the .debug_str section. Since we might rewrite
the .debug_str section, we also need to update any .debug_macro
pointers.

Updated the debugedit.at testcase by building everything with -g
and add various checks to see the .debug_macro section looks OK
after running debugedit. Added a new rpmbuild.at testcase to check
handing of .debug_macro in the whole rpmbuild debuginfo pipeline
to double check the separate .debug file also contains the macros.

Original patch by Michael Schroeder <mls@suse.de>. Extended by
Mark Wielaard <mark@klomp.org> to deal with relocations and possible
multiple COMDAT .debug_macro sections.
2019-06-19 15:06:55 +03:00
Mark Wielaard
15118eb683 Handle .debug_macro in debugedit.
When compiling with -g3 gcc will generate a .debug_macro section
which has pointers to the .debug_str section. Since we might rewrite
the .debug_str section, we also need to update any .debug_macro
pointers.

Updated the debugedit.at testcase by building everything with -g
and add various checks to see the .debug_macro section looks OK
after running debugedit. Added a new rpmbuild.at testcase to check
handing of .debug_macro in the whole rpmbuild debuginfo pipeline
to double check the separate .debug file also contains the macros.

Original patch by Michael Schroeder <mls@suse.de>. Extended by
Mark Wielaard <mark@klomp.org> to deal with relocations and possible
multiple COMDAT .debug_macro sections.
2019-06-19 15:06:55 +03:00
Mark Wielaard
ab0b014eaa Add some debugedit tests.
debugedit didn't have any direct tests, it was only tested indirectly
through some other debuginfo testcases.  So add some testcases that
just test debugedit functionality directly.

The tests create different kinds of ELF files (object files, partially
linked files and executables) and run debugedit path replacements on
them, checking that the resulting .debug_str, .debug_info and .debug_line
sections look sane.

Testcases verified against various different gcc and binutils versions.
gcc 4.8 and gcc 6 generate slightly different .debuginfo

Also add debugedit --version. Which makes it easy to see we are
testing the correct version/install of debugedit in rpmtests.log.

Adjust autotest paths to include rpmlibexecdir, where debuginfo
is installed.  Note that rpmlibexecdir != libexecdir (see rpm.am).
2019-06-19 15:06:55 +03:00
Mark Wielaard
5d7ca6efec debugedit: Refactor reading/writing of relocated values.
This refactors the reading and writing of relocated values into seperate
helper functions (setup_relbuf and update_rela_data). It will be easier
to reuse this code in case we want to read/write relocated values in other
sections than DEBUG_INFO. The only functional change is that we explicitly
track whether the relocation data is updated, and only explicitly update
and write out the relocation data if so. In the case there were no strp
or stmt updates, there will also not be any relocation updates, even if
there is relocation data available.

All new debugedit testcases pass before and after this refactoring.
2019-06-19 15:06:55 +03:00
Mark Wielaard
83e6accd81 Add some debugedit tests.
debugedit didn't have any direct tests, it was only tested indirectly
through some other debuginfo testcases.  So add some testcases that
just test debugedit functionality directly.

The tests create different kinds of ELF files (object files, partially
linked files and executables) and run debugedit path replacements on
them, checking that the resulting .debug_str, .debug_info and .debug_line
sections look sane.

Testcases verified against various different gcc and binutils versions.
gcc 4.8 and gcc 6 generate slightly different .debuginfo

Also add debugedit --version. Which makes it easy to see we are
testing the correct version/install of debugedit in rpmtests.log.

Adjust autotest paths to include rpmlibexecdir, where debuginfo
is installed.  Note that rpmlibexecdir != libexecdir (see rpm.am).
2019-06-19 15:06:55 +03:00
Gleb Fotengauer-Malinovskiy
ba5873f889 4.0.4-alt132
- Added %_pointer_size, %_is_ilp32, and %_is_lp64 macros.
2019-05-11 17:26:56 +03:00
Gleb Fotengauer-Malinovskiy
3dfc13a782 Add %_pointer_size, %_is_ilp32, and %_is_lp64 macros 2019-05-11 17:26:56 +03:00
Gleb Fotengauer-Malinovskiy
8a97cf8dca installplatform: disable glob; disallow undefined variables; fail on error 2019-05-11 17:08:40 +03:00
9b9737913f 4.0.4-alt131
- Fixed syntax check regression introduced in the latest release.
2019-04-19 05:10:27 +00:00
1b6d0ed4c2 parseBits: fix regression introduced by the latest fix 2019-04-19 05:08:33 +00:00
d21fe32b27 4.0.4-alt130
- %configure: added --disable-silent-rules.
- Disallowed Provides specifying version ranges.
- Disallowed syntax errors in qualifiers of Requires and BuildRequires tags.
2019-04-16 18:46:34 +00:00
988b7b0106 parseBits: disallow syntax errors and unknown qualifiers
The previous attempt to fail build in case of syntax errors
and unknown dependency qualifiers made in commit
rpm-4.8.0-beta1-385-gbf2bc18ebb325f081ade65adc2fbb6858f0b8396
missed the following classes of erroneous dependencies:

Requires(,) -- erroneously treated as Requires(),
Requires(;) -- erroneously treated as Requires(),
Requires(,pre) -- erroneously treated as Requires(),
Requires(;pre) -- erroneously treated as Requires(),
Requires(pre,) -- erroneously treated as Requires(pre),
Requires(pre,,postun) -- erroneously treated as Requires(pre),
Requires(pre,,junk) -- erroneously treated as Requires(pre),
Requires(pre;postun) -- erroneously treated as Requires(pre),
Requires(pre;junk) -- erroneously treated as Requires(pre).

Found by code inspection.

Fixes: bf2bc18ebb32 ("Always fail build on unknown dependency qualifiers")

(cherry picked from rpm.org commit aafb861846db97d78964e98d603b4e6cd88ed3ae)

The two last cases listed above have already been fixed by commit
f7280d8302.
2019-04-16 18:46:34 +00:00
a765b58010 parseRCPOT: reject Provides containing logical operator < or >
Disallow those types of Provides that specify version ranges
because Provides are not compatible with version ranges.
2019-04-16 18:46:34 +00:00
37bfd938fd %configure: add --disable-silent-rules
It's always annoying when important information such as compilation
options used for build is not available in build logs just because
silent build rules are enabled by default.

Fix this for the case of build rules generated by configure
by disabling silent rules.
2019-04-16 18:46:34 +00:00
Ivan Zakharyaschev
52a00bd293 4.0.4-alt129
- Fixed deps optimization "due to repentancy": if subpkg A requires subpkg B,
  and B has a dependency on C, a weaker dependency on C is removed from A
  (say, without an epoch or disttag).
2019-02-27 07:30:19 +03:00
Ivan Zakharyaschev
4bf78baf6c interdep.c: fix the optimization ("due to repentancy") of a non-identical dep
compare_deps() was simply called with a wrong argument (an illegal value
for this parameter); so it returned a meaningful result only if
the compared deps were identical. (Always, since the inception in f5ed7f870a .)

Example where the dep was not optimized out:

Name: test-epoch-repentancy
Version: 1
Release: alt1

Summary: test-epoch-repentancy

License: public domain
Group: Other

Requires: %name-sub = %EVR
Requires: foo = 1-alt1

BuildArch: noarch

%description
%summary

%package sub
Summary: sub
Group: Other

Requires: foo = 0:1-alt1

%description sub
%summary

%files
%files sub

%changelog
* Wed Feb 27 2019 Ivan Zakharyaschev <imz@altlinux.org> 1-alt1
- initial build for ALT Linux Sisyphus.

(cherry picked from commit 492396b532660f4debc46e96eb306f07a3261d66)

# Conflicts:
#	build/interdep.c
2019-02-27 07:30:19 +03:00
Ivan Zakharyaschev
3cec7c6d8c reqprov.c: fix a comment (after the disttag handling was inserted) 2019-02-27 07:30:19 +03:00
Ivan Zakharyaschev
b2e5528c36 4.0.4-alt128
- Reverted one of the changes (for disttag-unaware tools compatibility)
  from 4.0.4-alt127 (useful in rare cases, but bad for external dependencies
  on virtual Provides when interpreted by the old rpm):
  + %EVR macro (for intersubpackage deps) upgraded to include %disttag
- Always fix interpackage deps that need Epoch or Disttag (ALT#36180).
  (This completes the improvement of 4.0.4-alt100.63.)
- Made deps optimization more aware of disttag:
  + build/reqprov.c: made addReqProv() aware of the disttag of
    the package (affects deps optimization).
  + add disttag to struct availablePackage (like buildtime; affects
    rpm -U & interdep.c)
  [rpm-4.13.0.1-alt5 alike]
  + Implemented DistTag support when comparing package versions (with
    help by Vladimir D. Seleznev).
  [rpm-4.13.0.1-alt6 alike]
  + rpmEVRcmp() (and hence rpmRangesOverlap()) made asymmetric w.r.t.
    underspecified release. (Provides: N = V can't anymore satisfy
    Requires: N = V-R.) (with help of Vladimir D. Seleznev)
2019-02-26 23:27:17 +03:00
Ivan Zakharyaschev
475e2b6865 (.spec) listed most source code changes in the changelog 2019-02-26 23:19:51 +03:00
Ivan Zakharyaschev
6f68e5cbc0 Revert "%%EVR macro (for intersubpackage deps) upgraded to include %%disttag (ALT#35930)"
This reverts commit 66e8bff6e4.
2019-02-26 23:19:51 +03:00
Ivan Zakharyaschev
5bc7c3086d build/reqprov.c: made addReqProv() aware of the disttag of the package 2019-02-26 23:19:51 +03:00
Ivan Zakharyaschev
e805931cf3 remark: we don't print the disttag 2019-02-26 23:19:51 +03:00
Ivan Zakharyaschev
3c72c222d5 lib/depends.c: remark: There is no psp->problems->byDisttag. (TODO?) 2019-02-26 23:19:51 +03:00