Commit Graph

1071 Commits

Author SHA1 Message Date
William Douglas 0e5f88efe0 Remove unused function
This hasn't been in use for some time and with the rework of pip
requirement capture is no longer required.
2020-03-24 18:05:27 -07:00
Juro Bystricky 54a94e123f support for openmpi sections
Initial support for concurrent serial and parallel build.
Parallel MPI build enabled via a new setting in "options.conf":
    openmpi = false|true (false is default)

 * Serial builds remain unaffected.
 * Parallel build: Only OpenMPI is supported.
 * Parallel builds always assume AVX2.
 * Build patterns implemented: "configure" and "cmake".
   The build process is controlled by additional files:
   "cmake_arg_openmpi": same functionality as "cmake_args"
   "configure_openmpi": same functionality as "configure"

The openmpi (configure, build, check, install) sections follow these steps:

module load openmpi
...[configure,build,install,check]
module unload openmpi

Once "openmpi=true", the packages "openmpi-dev", "modules" and "openssh"
are automatically added to BuildRequires. ("openssh" is generally required
to run any MPI test suites).

Packages created:
   foo-openmpi:    binaries, libraries, docs, ...
   foo-dev :       contains both serial and MPI devel. files
   foo-staticdev:  contains both serial and MPI devel. files
2020-03-10 10:49:37 -07:00
William Douglas b757c28a15 Disable use of go modules
Unless a user specifically opts into using go modules don't try and
parse go.mod files for dependencies.
2020-03-09 13:38:03 -07:00
William Douglas b274d9dfff Normalize the package names from the pypi ecosystem 2020-03-05 16:32:45 -08:00
William Douglas 70ae12f135 Add pypi requires for pypi packages
Turn on pypi requires now that Clear Linux packages have the pypi
provides.
2020-03-05 16:32:45 -08:00
William Douglas 5f6a38d890 Add support for package alias name
The package alias is intended to be used as a manual override in cases
where the upstream package name is not the one that Clear Linux used
as the package name (due to conflicts or other reasons) and there is
tooling that requires the use of the upstream package name that
autotools runs (pypi is the motivating usage currently).
2020-03-05 16:32:45 -08:00
William Douglas 1c51261d1a Keep global file list in a set instead
Rather than iterate through a list for existence checks, use a set
instead for performance reasons.
2020-03-05 16:32:45 -08:00
Juro Bystricky 26a9210743 specfile.py: fix incorrect install folder for AVX/AVX512
The combined usage of "subdir" and AVX2/AVX512 builds fails to install
for certain build patterns (notably for "configure").

This can be verified, for example,  by trying to build the package "ntl" with:
    use_avx2 = true
    use_avx512 = true

This will fail with an error during install, similar to this:
    pushd: ../buildavx512/: No such file or directory

This patch fixes this by descending to the correct folder:
    pushd ../buildavx512/src

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2020-02-28 15:16:34 -08:00
William Douglas e4f229d10b Use the pypi api for distutils3 builds
Get metadata about the package from pypi for distutils3 build patterns
then use that metadata to get summary, description and provides
information (license and requires maybe leveraged in the future).

The description isn't always very useful (often too long) so only use
it if there isn't one already.
2020-02-27 12:30:33 -08:00
Auke Kok a6067f4017 Add two more patterns to blacklist. 2020-02-26 10:56:05 -08:00
Athenas Jimenez 808b7d7224 Consolidate source management in Source class.
This patch consolidates the code that manages the sources
(.zip, .tar, etc) in Source class. This class is written in a way
that allows the reuse of code for all current supported types of
sources and at the same time, it allows the easy addition of new
ones.

Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2020-02-21 16:15:22 -08:00
Patrick McCarty d6dd491899 build: only record files when they are first listed
Because rpmbuild dumps a list of build errors after the build has
stopped and any errors have occurred, the "Installed (but unpackaged)
file(s) found" line is repeated, and thus autospec will always parse the
list of unpackaged files twice. Also, the repeated listing of unpackaged
files is sometimes truncated, possibly due to a bug in rpmbuild.

Since autospec already understands how to locate the end of the initial
unpackaged file listing, it can avoid the duplicate parsing and any
possible truncation issues by ensuring that the `infiles` variable is
set to `1` exactly once. Then, `infiles` will continue to have value `2`
from the end of the first file listing until parsing stops.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-02-20 10:17:29 -08:00
William Douglas 615f5a44a5 Stop adding maven build requirements
Turn off adding maven and gradle dependencies and build requirements
due to the reduction of support for this content in Clear Linux.
2020-02-11 13:05:45 -08:00
Athenas Jimenez d0b3aa3ac5 tarball: Simplify Go packages management.
Add a special archives list (go_archives), so we can remove Go specific
methods and simply make use of regular methods.

Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2020-01-31 14:07:09 -08:00
Patrick McCarty 7939a3d1e8 Add meson test autodetection
For the meson pattern, scan for any calls to `test(...)` within
meson.build files in the source tree.

The scan exits early if the toplevel srcdir lacks a meson.build file,
but we can probably remove that check in the future to support test
execution of projects like `zstd`.

Fixes #208

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-30 19:02:23 -08:00
Patrick McCarty 756d1871a8 Improve meson test results reporting
Support the output of `meson test` in addition to `ninja test`, since
the meson docs recommend running `meson test`.

Also add a new unit test to cover some of the test result summary line
differences.

Fixes #323

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-30 19:02:23 -08:00
Patrick McCarty c3dc981d95 Add subdir support for meson pattern
The `zstd` package in Clear Linux OS requires subdir support.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-30 18:13:41 -08:00
Athenas Jimenez 5a4e7e66f9 tarball: Remove extract support for 7zip and gem
Clear is no longer using sources compressed using 7zip or gem.

Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2020-01-23 13:42:19 -08:00
Patrick McCarty 4d9d88733f tests: add new tests for the multiple-sig handling
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-21 14:33:32 -08:00
Patrick McCarty 7f6009a909 pkg_integrity: return GPGCliStatus instances when appropriate
In this function, returning `None` indicates success, so instead, a
GPGCliStatus instance should be returned for the new error cases.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-21 14:33:32 -08:00
Patrick McCarty 874709500f pkg_integrity: skip first-sig extraction if packet length is unknown
Older versions of gnupg do not print the "packet separator" lines in
`gpg --list-packets` output, so the length information is not parsed by
autospec and thus verification must be skipped for now.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-21 14:33:32 -08:00
Patrick McCarty d0fcb20e90 pkg_integrity: only track parsed packets
There are only two GPG packet types that autospec needs to know about
for now ("signature" and "user ID"), so update `parse_gpg_packets` to
only add those packets for tracking.

Also, update unit tests to account for packets that are now skipped,
thus reducing the size of the packets list.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-21 14:33:32 -08:00
Patrick McCarty d766329ead tests: update pkg_integrity tests for recent changes
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-21 14:33:32 -08:00
Patrick McCarty 4b08d7d9eb pkg_integrity: only verify the first GPG signature
The only package in Clear Linux OS that (occasionally) has its source
archive signed by multiple keys is `gnupg`, so to unblock updates for
it, only verify the first signature from the .sig file.

When only one signature is present in the sig file (the common case),
pass the entire sig file to `gpg --verify ...`, keeping the existing
behavior.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-21 14:33:32 -08:00
Patrick McCarty 4b4c3629dd Add new function for parsing GPG key and signature files
To prepare for more general parsing of GPG key and signature files,
implement a new function, parse_gpg_packets(), and start using it where
appropriate.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-21 14:33:32 -08:00
Patrick McCarty 91f7493ed4 Ban a few percent-encoded characters
These characters should never appear in version strings, because rpm
complains. If there are additional percent-encoded characters to add in
the future, we can update the list.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-16 14:49:03 -08:00
Patrick McCarty dae9f825e1 Read old version/patch info from git when possible
In the process of updating packages to new releases, the build may fail,
and the spec file and other files are left in an intermediate,
uncommitted state.

This intermediate state is useful for some of the files, but for the
spec file (generally), we care more about the state transition from
commit to commit.

This change begins teaching autospec how to read spec file state from
the latest commit, specifically for the "old version" of the package and
the patch list from that old version.

Fixes #433

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-15 11:59:55 -08:00
Auke Kok e82b02e38c The license file may be a symlink, that is missing.
Allow this situation to skip - if the license file is indeed
"missing" like it is, it should not be an error/crash.
2020-01-13 14:16:10 -08:00
Patrick McCarty 71aea93152 Avoid printing warning when buildreq_cache does not exist
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-13 12:46:12 -08:00
Patrick McCarty ea9c22a361 Print warning if buildreq_cache could not be removed
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-10 15:46:48 -08:00
Patrick McCarty 438d87bbb3 Remove buildreq_cache when the version has changed
The buildreq_cache is only meant to apply when re-packaging the same
version. To prevent the cache from becoming stale during version
changes, remove it initially. If the new version has cached buildreqs,
the file will be written later.

Fixes #481

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-10 15:46:48 -08:00
Athenas Jimenez f57f5da140 config: Consolidate fail patterns
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2020-01-10 15:46:25 -08:00
Athenas Jimenez 2b2c2d5f90 config: Sort fail patterns
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2020-01-10 15:46:25 -08:00
Auke Kok 376155948c Fix PECL builds.
PECL tarballs have an annoying `package.xml` in the toplevel. We
detect PECL by URL and eliminate this file from the files list
so that we do not need to compensate for path magic. This fixes
all the PECL builds. Thanks to Athenas for coming up with the
magic bit :).
2020-01-10 11:01:56 -08:00
Athenas Jimenez cf52709df9 test_build: Increase coverage for build errors patterns
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2020-01-07 13:45:42 -08:00
Patrick McCarty 96b6c161af Sync latest patterns
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-07 12:22:48 -08:00
Juro Bystricky 9bd8e185da count.py: Fix false positive FAIL
The following pattern match expression:
    match = re.search(r"(---\s+)?FAIL:?\s*", line)

would match both XFAIL and FAIL.
In the case of XFAIL in the line, the match would be interpreted as FAIL.

Remedy: use this instead:
   match = re.search(r"(---\s+)?(?<!X)FAIL:?\s*", line).

Kudos to phmccarty.
2020-01-06 14:09:42 -08:00
Juro Bystricky 9c87095072 specfiles.py: fix build_prepend for avx512
write_configure_pattern: for avx512 the user defined
"build_prepend" was executed outside of the avx512 build
folder.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2020-01-06 10:53:08 -08:00
Patrick McCarty fa7dc8f8a2 fail patterns: replace kcalcore with kcalendarcore
Upstream project has been renamed, so autospec fail patterns need
updating.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-12-17 10:24:34 -08:00
Athenas Jimenez a44cd25540 Move get_contents() and get_sha1sum() to util.py
Both are general-use functions so moving to util.py.

Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2019-12-16 12:51:28 -08:00
Patrick McCarty e2ec286eb3 Only add files that begin with slash
In the section of the mock build.log that lists unpackaged files, rpm
4.14 will print warnings if any files have build ID issues.

Because file names must begin with a forward slash, it's easy to filter
out these warnings, since the warnings themselves do not begin with a
forward slash.

Fixes #547

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-12-12 11:01:53 -08:00
Patrick McCarty 196235ca22 Avoid adding extra newlines to script files
The recently added read_script_file() function preserves newline
characters, and because the specfile writer functions already add
newlines, extra blank lines were being written to spec files.

Avoid the extra newline characters by stripping them with rstrip(). Note
that any trailing whitespace is also stripped.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-12-11 12:25:34 -08:00
Athenas Jimenez 8d3e09de2f Add generic function to do regex with multiple patterns.
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2019-12-10 13:45:19 -08:00
Thiago Macieira cd2fcdfc59 Add the ability to include more sources found in the Git dir
So we don't have to create extra sources by way of install_append. It's
much nicer to edit shell scripts and other files directly in-line.
2019-12-04 16:10:23 -08:00
Patrick McCarty 5236118229 Ensure banned requirements are always banned
If a banned dependency is added to the buildreqs, buildreq_cache, or
requires sets before the configuration files are read, the dependency
will not actually be banned.

Fix this issue by removing banned dependencies from the sets if present
during *_ban configuration file parsing.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-12-04 12:29:35 -08:00
Thiago Macieira 04302af60c Read _append and _prepend scripts almost verbatim
Don't skip empty lines or lines starting with # or simplify
whitespace. This makes non-trivial scripts nicer to read in the .spec
file, like those found in llvm.spec:

	for f in *; do
	    ...indented lines go here...
	    mv $f $f-$VERSION
	    ln -s -f $f-$VERSION $f
	done

We skip the first line if it is a shebang or a file format annotation.
2019-12-03 22:52:16 -08:00
Juro Bystricky 41619db3b9 license_translation: CPL->CPL-1.0
If CPL license is found by autospec, we end up with an
error:
ERROR: License 'CPL' is not an allowed SPDX license ID

Translate CPL to a valid SPDX license CPL-1.0

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-12-02 13:02:17 -08:00
Brett T. Warden 4c4e04a589 Allow generic TODO in test failures
When parsing TAP, reduce the match pattern for expected failures to just
through "TODO", instead of "TODO known breakage".

https://testanything.org/tap-version-13-specification.html#todo-tests
2019-11-27 12:31:20 -08:00
Thiago Macieira d2bb0415e9 Fix build: the trailing / shouldn't be there.
Sorry, I had uncommitted changes. The builds worked for me, but not
with the committed version.
2019-11-25 15:19:22 -08:00
William Douglas 1f4ceea069 Test key existance without throwing exceptions
We are speculatively evaluating if a key exists, this can throw a key
error exception so avoid that by using get instead.
2019-11-25 15:19:00 -08:00