Compare commits

...

8 Commits
v3 ... v4

Author SHA1 Message Date
William Douglas 25ad860d7f Add handling for APX configure patterns
Support APX package builds using the configure patterns (needed to
handle cross compilation via --host option).

Also fixup some flag usage inconsistencies.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-02-05 10:55:39 -08:00
William Douglas 750e50d160 Add support for building APX binaries
Add early support for APX builds in autospec. This change also makes
APX disabled by default for now but may revert back to enabled by
default in the future. The APX prefix will be /VA as the arch flag is
not yet finalized. This also may change in the future though for now
there are no plans to move it.

Currently autotools builds are unable to use this as it detects as a
cross compilation.

Currently only C using GCC is supported.

This change also reworks how R language optimized binaries are built
and distributed. They will now work as all the other tooling does with
the /VX prefix.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-02-03 07:25:59 -08:00
William Douglas fae1327921 Correct configure pattern LDFLAGS setting
Update LDFLAGS to use the intermediate flags and be set the same as
the other avx2 flags.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-23 12:23:35 -08:00
William Douglas 1eaf8cd10c Rework avx2/512 flag passing
Instead of hard coding flags in each use, add global constants that
are substituted on use (removes a little copypasta and fixes up some
flags that were unintentionally different between build systems).

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-18 10:07:48 -08:00
William Douglas 8c949329a8 Update regex for reconfigure detection
Update regex as grep doesn't need escape slashes and python hates
them.

Signed-off-by: William Douglas <william.douglas@intel.com>
2024-01-18 10:07:48 -08:00
Brett T. Warden 537da873db Add unit tests for allow_exe 2024-01-16 14:29:07 -08:00
Brett T. Warden e664610c0e Add a mechanism to automatically exclude Windows executables
Some packages, especially PIP wheels, install Windows executables.
Introduce an option, allow_exe, with which to permit installing those
executables. Otherwise, explicitly delete them so they're not
inadvertently installed via wildcards later.
2024-01-16 13:59:27 -08:00
Brett T. Warden ab27b0e7ad Add use_apx flag to options.conf
Set value True by default, but other added options still default to
false.

diff --git a/options.conf b/options.conf
index ed481d682825..127ec6e6ffaa 100644
--- a/options.conf
+++ b/options.conf
@@ -59,6 +59,16 @@ server = false
 skip_tests = false
 # add .so files to the lib package instead of dev
 so_to_lib = false
+# configure build for apx
+use_apx = true
+# configure build for avx2
+use_avx2 = false
+# configure build for avx512
+use_avx512 = false
+# add clang flags
+use_clang = false
+# configure build for lto
+use_lto = false
 # require package verification for build
 verify_required = false
2024-01-04 11:49:16 -08:00
4 changed files with 418 additions and 136 deletions
+8 -2
View File
@@ -74,6 +74,7 @@ class Config(object):
self.extra_configure64 = ""
self.extra_configure_avx2 = ""
self.extra_configure_avx512 = ""
self.extra_configure_apx = ""
self.extra_configure_openmpi = ""
self.config_files = set()
self.parallel_build = " %{?_smp_mflags} "
@@ -153,6 +154,7 @@ class Config(object):
"broken_c++": "extend flags with '-std=gnu++98",
"cargo_vendor": "create vendor archive with cargo",
"use_lto": "configure build for lto",
"use_apx": "configure build for APX",
"use_avx2": "configure build for avx2",
"use_avx512": "configure build for avx512",
"keepstatic": "do not remove static libraries",
@@ -180,7 +182,8 @@ class Config(object):
"nodebug": "do not generate debuginfo for this package",
"openmpi": "configure build also for openmpi",
"server": "Package is only used by servers",
"no_glob": "Do not use the replacement pattern for file matching"
"no_glob": "Do not use the replacement pattern for file matching",
"allow_exe": "Allow Windows executables (*.exe, *.dll) to be packaged",
}
# simple_pattern_pkgconfig patterns
# contains patterns for parsing build.log for missing dependencies
@@ -875,7 +878,7 @@ class Config(object):
self.patches += self.read_conf_file(os.path.join(self.download_path, "series"))
pfiles = [("%s/%s" % (self.download_path, x.split(" ")[0])) for x in self.patches]
cmd = "grep -E \"(\+\+\+|\-\-\-).*((Makefile.am)|(aclocal.m4)|(configure.ac|configure.in))\" %s" % " ".join(pfiles) # noqa: W605
cmd = "grep -E \"(+++|---).*((Makefile.am)|(aclocal.m4)|(configure.ac|configure.in))\" %s" % " ".join(pfiles) # noqa: W605
if self.patches and call(cmd,
check=False,
stdout=subprocess.DEVNULL,
@@ -908,6 +911,9 @@ class Config(object):
content = self.read_conf_file(os.path.join(self.download_path, "configure_avx512"))
self.extra_configure_avx512 = " \\\n".join(content)
content = self.read_conf_file(os.path.join(self.download_path, "configure_apx"))
self.extra_configure_apx = " \\\n".join(content)
content = self.read_conf_file(os.path.join(self.download_path, "configure_openmpi"))
self.extra_configure_openmpi = " \\\n".join(content)
+15 -5
View File
@@ -59,7 +59,7 @@ class FileManager(object):
r"/usr/src.*",
r"/var.*"]
for bpath in banned_paths:
if re.search(r"^(/V3|/V4)?" + bpath, path):
if re.search(r"^(/V3|/V4|/VA)?" + bpath, path):
return True
return False
@@ -101,7 +101,7 @@ class FileManager(object):
exclude = True
for pat in patterns:
pat = re.compile(r"^(/V3|/V4)?" + pat)
pat = re.compile(r"^(/V3|/V4|/VA)?" + pat)
if pat.search(filename):
exclude = False
break
@@ -126,10 +126,10 @@ class FileManager(object):
# All patterns at this time and should always be prefixed by '^'
# but just in case add the following to strip just the '^'
pattern = pattern if not pattern.startswith('^') else pattern[1:]
pat = re.compile(r"^(/V3|/V4)?" + pattern)
pat = re.compile(r"^(/V3|/V4|/VA)?" + pattern)
match = pat.search(filename)
if match:
if len(match.groups()) > 0 and match.groups()[0] in ['/V3', '/V4']:
if len(match.groups()) > 0 and match.groups()[0] in ['/V3', '/V4', '/VA']:
norm_filename = filename.removeprefix(match.groups()[0])
if replacement != filename:
replacement = match.groups()[0] + replacement
@@ -236,7 +236,7 @@ class FileManager(object):
# Explicit file packaging
for k, v in self.file_maps.items():
for match_name in v['files']:
match = re.search(r"^/(V3|V4)", filename)
match = re.search(r"^/(V3|V4|VA)", filename)
norm_filename = filename if not match else filename.removeprefix(match.group())
if isinstance(match_name, str):
if norm_filename == match_name:
@@ -272,6 +272,16 @@ class FileManager(object):
if self.want_dev_split and self.file_pat_match(filename, r"^/usr/.*/include/.*\.h$", "dev"):
return
# Exclude Windows executables and DLLs unless otherwise configured
# Can't just skip them because they could be swept up in a python lib wildcard, for example
if re.search(r"[^/]+\.(exe|dll)$", filename):
if self.config.config_opts.get('allow_exe'):
util.print_warning("Allowing {} because allow_exe is true".format(filename))
else:
util.print_warning("Blocking {} because allow_exe is false".format(filename))
self.excludes.append(filename)
return
# if configured to do so, add .so files to the lib package instead of
# the dev package. THis is useful for packages with a plugin
# architecture like elfutils and mesa.
+328 -129
View File
@@ -28,6 +28,17 @@ from collections import OrderedDict
import git
from util import _file_write, open_auto
AVX2_CFLAGS = "-march=x86-64-v3"
AVX2_LCFLAGS = "-march=x86-64-v3"
AVX2_LFLAGS = "-Wl,-z,x86-64-v3"
AVX512_CFLAGS = "-march=x86-64-v4 -mprefer-vector-width=512"
AVX512_FCFLAGS = "-march=x86-64-v4 -mprefer-vector-width=256"
AVX512_LCFLAGS = "-march=x86-64-v4"
AVX512_LFLAGS = "-Wl,-z,x86-64-v4"
APX_CFLAGS = "-march=x86-64-v3 -mapxf -mavx10.1"
APX_LCFLAGS = "-march=x86-64-v3"
APX_LFLAGS = "-Wl,-z,x86-64-v3"
class Specfile(object):
"""Holds data and methods needed to write the spec file."""
@@ -481,11 +492,7 @@ class Specfile(object):
if self.config.subdir:
self._write_strip("popd")
if self.config.default_pattern == "distutils3" or self.config.default_pattern == "pyproject":
self._write_strip("pushd ..")
self._write_strip("cp -a {} buildavx2".format(self.content.tarball_prefix))
self._write_strip("popd")
elif self.config.default_pattern != 'cmake':
if self.config.default_pattern != 'cmake':
if self.config.config_opts['32bit']:
self._write_strip("pushd ..")
self._write_strip("cp -a {} build32".format(self.content.tarball_prefix))
@@ -498,6 +505,10 @@ class Specfile(object):
self._write_strip("pushd ..")
self._write_strip("cp -a {} buildavx512".format(self.content.tarball_prefix))
self._write_strip("popd")
if self.config.config_opts['use_apx']:
self._write_strip("pushd ..")
self._write_strip("cp -a {} buildapx".format(self.content.tarball_prefix))
self._write_strip("popd")
if self.config.config_opts['openmpi']:
self._write_strip("pushd ..")
self._write_strip("cp -a {} build-openmpi".format(self.content.tarball_prefix))
@@ -727,6 +738,11 @@ class Specfile(object):
self._write_strip("%s_v4 %s\n" % (self.config.install_macro, self.config.extra_make_install))
self._write_strip("popd")
if self.config.config_opts['use_apx']:
self._write_strip("pushd ../buildapx/" + self.config.subdir)
self._write_strip("%s_va %s\n" % (self.config.install_macro, self.config.extra_make_install))
self._write_strip("popd")
if self.config.config_opts['openmpi']:
self._write_strip("pushd ../build-openmpi/" + self.config.subdir)
self.write_install_openmpi()
@@ -795,10 +811,12 @@ class Specfile(object):
skips = ""
for setuid in self.setuid:
skips = f"{skips} --skip-path {setuid}"
if self.config.config_opts['use_avx2'] or self.config.default_pattern == "distutils3" or self.config.default_pattern == "pyproject":
if self.config.config_opts['use_avx2']:
self._write_strip('/usr/bin/elf-move.py avx2 %{buildroot}-v3 %{buildroot} %{buildroot}/usr/share/clear/filemap/filemap-%{name}' + skips)
if self.config.config_opts['use_avx512']:
self._write_strip('/usr/bin/elf-move.py avx512 %{buildroot}-v4 %{buildroot} %{buildroot}/usr/share/clear/filemap/filemap-%{name}' + skips)
if self.config.config_opts['use_apx']:
self._write_strip('/usr/bin/elf-move.py apx %{buildroot}-va %{buildroot} %{buildroot}/usr/share/clear/filemap/filemap-%{name}' + skips)
def write_exclude_deletes(self):
"""Write out deletes for excluded files."""
@@ -893,6 +911,11 @@ class Specfile(object):
self._write_strip("%s_v4 %s || :\n" % (self.config.install_macro, self.config.extra_make_install))
self._write_strip("popd")
if self.config.config_opts['use_apx']:
self._write_strip("pushd clr-build-apx")
self._write_strip("%s_va %s || :\n" % (self.config.install_macro, self.config.extra_make_install))
self._write_strip("popd")
if self.config.config_opts['openmpi']:
self._write_strip("pushd clr-build-openmpi")
self.write_install_openmpi()
@@ -1008,11 +1031,11 @@ class Specfile(object):
self._write_strip("unset PKG_CONFIG_PATH")
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$LDFLAGS -m64 -march=x86-64-v3 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
self._write_strip("%configure {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
@@ -1024,11 +1047,11 @@ class Specfile(object):
self._write_strip("unset PKG_CONFIG_PATH")
self._write_strip("pushd ../buildavx512/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 -Wl,-z,x86-64-v4 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 -Wl,-z,x86-64-v4 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v4 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX512_FCFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX512_LCFLAGS} "')
self._write_strip("%configure {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
@@ -1036,16 +1059,33 @@ class Specfile(object):
self.write_make_line()
self._write_strip("popd")
if self.config.config_opts['use_apx']:
self._write_strip("unset PKG_CONFIG_PATH")
self._write_strip("pushd ../buildapx/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CC="gcc-14"')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {APX_LCFLAGS} "')
self._write_strip("%configure --host=x86_64-clr-linux-gnu {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
self.config.extra_configure_avx2))
self.write_make_line()
self._write_strip("popd")
if self.config.config_opts['openmpi']:
self._write_strip("pushd ../build-openmpi/" + self.config.subdir)
self._write_strip(". /usr/share/defaults/etc/profile.d/modules.sh")
self._write_strip("module load openmpi")
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v3 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
self._write_strip("./configure {0} \\\n{1} {2}"
.format(self.config.conf_args_openmpi,
self.config.disable_static,
@@ -1092,11 +1132,11 @@ class Specfile(object):
self._write_strip("unset PKG_CONFIG_PATH")
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v3 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
self._write_strip("%reconfigure {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
@@ -1108,11 +1148,11 @@ class Specfile(object):
self._write_strip("unset PKG_CONFIG_PATH")
self._write_strip("pushd ../buildavx512/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 -Wl,-z,x86-64-v4 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 -Wl,-z,x86-64-v4 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 -Wl,-z,x86-64-v4 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=256 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v4 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX512_FCFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX512_LCFLAGS} "')
self._write_strip("%reconfigure {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
@@ -1120,6 +1160,23 @@ class Specfile(object):
self.write_make_line()
self._write_strip("popd")
if self.config.config_opts['use_apx']:
self._write_strip("unset PKG_CONFIG_PATH")
self._write_strip("pushd ../buildapx/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CC="gcc-14"')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {APX_LCFLAGS} "')
self._write_strip("%reconfigure --host=x86_64-clr-linux-gnu {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
self.config.extra_configure_avx2))
self.write_make_line()
self._write_strip("popd")
self._write_strip("\n")
self.write_check()
self.write_make_install()
@@ -1144,21 +1201,32 @@ class Specfile(object):
if self.config.config_opts['use_avx2']:
self._write_strip("pushd ../buildavx2" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v3 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
self.write_make_line()
self._write_strip("popd")
if self.config.config_opts['use_avx512']:
self._write_strip("pushd ../buildavx512" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 -Wl,-z,x86-64-v4 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 -Wl,-z,x86-64-v4 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=512 -Wl,-z,x86-64-v4 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v4 -mprefer-vector-width=256 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v4 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX512_FCFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX512_LCFLAGS} "')
self.write_make_line()
self._write_strip("popd")
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip("pushd ../buildapx" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CC=gcc-14')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {APX_LCFLAGS} "')
self.write_make_line()
self._write_strip("popd")
@@ -1197,11 +1265,11 @@ class Specfile(object):
if self.config.config_opts['use_avx2']:
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v3 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
self._write_strip("%autogen {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
@@ -1212,11 +1280,11 @@ class Specfile(object):
if self.config.config_opts['use_avx512']:
self._write_strip("pushd ../buildavx512/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 -mprefer-vector-width=512"')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 -mprefer-vector-width=512"')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v4 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v4 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX512_FCFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX512_LCFLAGS} "')
self._write_strip("%autogen {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
@@ -1224,6 +1292,22 @@ class Specfile(object):
self.write_make_line()
self._write_strip("popd")
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip("pushd ../buildapx/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CC=gcc-14')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {APX_LCFLAGS} "')
self._write_strip("%autogen {0} {1} {2} "
.format(self.config.disable_static,
self.config.extra_configure,
self.config.extra_configure_apx))
self.write_make_line()
self._write_strip("popd")
self.write_check()
self.write_make_install()
@@ -1239,18 +1323,34 @@ class Specfile(object):
self._write_strip(f"pypi-dep-fix.py . {module}")
self._write_strip("python3 -m build --wheel --skip-dependency-check --no-isolation " + self.config.extra_configure)
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v3 "')
for module in self.config.pypi_overrides:
self._write_strip(f"pypi-dep-fix.py . {module}")
self._write_strip("python3 -m build --wheel --skip-dependency-check --no-isolation " + self.config.extra_configure)
self._write_strip("\n")
self._write_strip("popd")
if self.config.config_opts['use_avx2']:
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self.write_build_prepend()
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
for module in self.config.pypi_overrides:
self._write_strip(f"pypi-dep-fix.py . {module}")
self._write_strip("python3 -m build --wheel --skip-dependency-check --no-isolation " + self.config.extra_configure)
self._write_strip("\n")
self._write_strip("popd")
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip("pushd ../buildapx/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CC=gcc-14')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {APX_LCFLAGS} "')
for module in self.config.pypi_overrides:
self._write_strip(f"pypi-dep-fix.py . {module}")
self._write_strip("python3 -m build --wheel --skip-dependency-check --no-isolation " + self.config.extra_configure)
self._write_strip("\n")
self._write_strip("popd")
self._write_strip("\n")
if self.config.subdir:
@@ -1276,14 +1376,26 @@ class Specfile(object):
self._write_strip("cat %{buildroot}/usr/lib/python3*/site-packages/*/requires.txt || :")
self._write_strip("echo ----[ mark ]----")
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v3 "')
self._write_strip("python3 -m installer --destdir=%{buildroot}-v3 dist/*.whl")
self._write_strip("popd")
if self.config.config_opts['use_avx2']:
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
self._write_strip("python3 -m installer --destdir=%{buildroot}-v3 dist/*.whl")
self._write_strip("popd")
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip("pushd ../buildapx/" + self.config.subdir)
self._write_strip('CC=gcc-14')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {APX_LCFLAGS} "')
self._write_strip("python3 -m installer --destdir=%{buildroot}-va dist/*.whl")
self._write_strip("popd")
self.write_find_lang()
@@ -1302,18 +1414,34 @@ class Specfile(object):
if self.config.subdir:
self._write_strip("popd")
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v3 "')
for module in self.config.pypi_overrides:
self._write_strip(f"pypi-dep-fix.py . {module}")
self._write_strip("python3 setup.py build " + self.config.extra_configure)
self._write_strip("\n")
self._write_strip("popd")
if self.config.config_opts['use_avx2']:
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self.write_build_prepend()
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
for module in self.config.pypi_overrides:
self._write_strip(f"pypi-dep-fix.py . {module}")
self._write_strip("python3 setup.py build " + self.config.extra_configure)
self._write_strip("\n")
self._write_strip("popd")
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip("pushd ../buildapx/" + self.config.subdir)
self.write_build_prepend()
self._write_strip('CC=gcc-14')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {APX_LCFLAGS} "')
for module in self.config.pypi_overrides:
self._write_strip(f"pypi-dep-fix.py . {module}")
self._write_strip("python3 setup.py build " + self.config.extra_configure)
self._write_strip("\n")
self._write_strip("popd")
self.write_build_append()
self.write_check()
@@ -1336,14 +1464,26 @@ class Specfile(object):
self._write_strip("cat %{buildroot}/usr/lib/python3*/site-packages/*/requires.txt || :")
self._write_strip("echo ----[ mark ]----")
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 "')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -m64 -march=x86-64-v3 "')
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -m64 -march=x86-64-v3 "')
self._write_strip("python3 -tt setup.py build install --root=%{buildroot}-v3")
self._write_strip("popd")
if self.config.config_opts['use_avx2']:
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {AVX2_LCFLAGS} "')
self._write_strip("python3 -tt setup.py build install --root=%{buildroot}-v3")
self._write_strip("popd")
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip("pushd ../buildapx/" + self.config.subdir)
self._write_strip('CC=gcc-14')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip(f'LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS {APX_LCFLAGS} "')
self._write_strip("python3 -tt setup.py build install --root=%{buildroot}-va")
self._write_strip("popd")
self.write_find_lang()
@@ -1368,30 +1508,33 @@ class Specfile(object):
self._write_strip('LDFLAGS="$CLEAR_INTERMEDIATE_LDFLAGS -Wl,-z -Wl,relro"\n')
self._write_strip("mkdir -p %{buildroot}/usr/lib64/R/library")
self._write_strip("mkdir -p %{buildroot}-v3/usr/lib64/R/library")
self._write_strip("mkdir -p %{buildroot}-v4/usr/lib64/R/library")
self._write_strip("mkdir -p %{buildroot}-va/usr/lib64/R/library")
self._write_strip("\n")
self._write_strip("mkdir -p ~/.R")
self._write_strip("mkdir -p ~/.stash")
self._write_strip("echo \"CFLAGS = $CFLAGS -march=x86-64-v3 -ftree-vectorize -mno-vzeroupper\" > ~/.R/Makevars")
self._write_strip("echo \"FFLAGS = $FFLAGS -march=x86-64-v3 -ftree-vectorize -mno-vzeroupper \" >> ~/.R/Makevars")
self._write_strip("echo \"CXXFLAGS = $CXXFLAGS -march=x86-64-v3 -ftree-vectorize -mno-vzeroupper \" >> ~/.R/Makevars")
self._write_strip(f"echo \"CFLAGS = $CFLAGS {AVX2_CFLAGS} -ftree-vectorize -mno-vzeroupper\" > ~/.R/Makevars")
self._write_strip(f"echo \"FFLAGS = $FFLAGS {AVX2_CFLAGS} -ftree-vectorize -mno-vzeroupper \" >> ~/.R/Makevars")
self._write_strip(f"echo \"CXXFLAGS = $CXXFLAGS {AVX2_CFLAGS} -ftree-vectorize -mno-vzeroupper \" >> ~/.R/Makevars")
self._write_strip("R CMD INSTALL "
f"{self.config.extra_configure} "
"--install-tests "
"--use-LTO "
"--built-timestamp=${SOURCE_DATE_EPOCH} "
"--data-compress=none "
"--compress=none "
"--build -l "
"%{buildroot}/usr/lib64/R/library .")
self._write_strip("for i in `find %{buildroot}/usr/lib64/R/ -name \"*.so\"`; do mv $i $i.avx2 ; mv $i.avx2 ~/.stash/; done\n")
"%{buildroot}-v3/usr/lib64/R/library .")
self._write_strip("echo \"CFLAGS = $CFLAGS -march=x86-64-v4 -ftree-vectorize -mno-vzeroupper -mprefer-vector-width=512 \" > ~/.R/Makevars")
self._write_strip("echo \"FFLAGS = $FFLAGS -march=x86-64-v4 -ftree-vectorize -mno-vzeroupper -mprefer-vector-width=512 \" >> ~/.R/Makevars")
self._write_strip("echo \"CXXFLAGS = $CXXFLAGS -march=x86-64-v4 -ftree-vectorize -mno-vzeroupper -mprefer-vector-width=512 \" >> ~/.R/Makevars")
self._write_strip(f"echo \"CFLAGS = $CFLAGS {AVX512_CFLAGS} -ftree-vectorize -mno-vzeroupper \" > ~/.R/Makevars")
self._write_strip(f"echo \"FFLAGS = $FFLAGS {AVX512_CFLAGS} -ftree-vectorize -mno-vzeroupper \" >> ~/.R/Makevars")
self._write_strip(f"echo \"CXXFLAGS = $CXXFLAGS {AVX512_CFLAGS} -ftree-vectorize -mno-vzeroupper \" >> ~/.R/Makevars")
self._write_strip("R CMD INSTALL "
"--preclean "
f"{self.config.extra_configure} "
"--install-tests "
"--use-LTO "
"--no-test-load "
@@ -1399,8 +1542,21 @@ class Specfile(object):
"--compress=none "
"--built-timestamp=${SOURCE_DATE_EPOCH} "
"--build -l "
"%{buildroot}/usr/lib64/R/library .")
self._write_strip("for i in `find %{buildroot}/usr/lib64/R/ -name \"*.so\"`; do mv $i $i.avx512 ; mv $i.avx512 ~/.stash/; done\n")
"%{buildroot}-v4/usr/lib64/R/library .")
self._write_strip(f"echo \"CFLAGS = $CFLAGS {APX_CFLAGS} -ftree-vectorize -mno-vzeroupper\" > ~/.R/Makevars")
self._write_strip(f"echo \"FFLAGS = $FFLAGS {APX_CFLAGS} -ftree-vectorize -mno-vzeroupper \" >> ~/.R/Makevars")
self._write_strip(f"echo \"CXXFLAGS = $CXXFLAGS {AVX2_CFLAGS} -ftree-vectorize -mno-vzeroupper \" >> ~/.R/Makevars")
self._write_strip("R CMD INSTALL "
f"{self.config.extra_configure} "
"--install-tests "
"--use-LTO "
"--built-timestamp=${SOURCE_DATE_EPOCH} "
"--data-compress=none "
"--compress=none "
"--build -l "
"%{buildroot}-va/usr/lib64/R/library .")
self._write_strip("echo \"CFLAGS = $CFLAGS -ftree-vectorize \" > ~/.R/Makevars")
self._write_strip("echo \"FFLAGS = $FFLAGS -ftree-vectorize \" >> ~/.R/Makevars")
@@ -1408,6 +1564,7 @@ class Specfile(object):
self._write_strip("R CMD INSTALL "
"--preclean "
f"{self.config.extra_configure} "
"--use-LTO "
"--install-tests "
"--data-compress=none "
@@ -1415,7 +1572,6 @@ class Specfile(object):
"--built-timestamp=${SOURCE_DATE_EPOCH} "
"--build -l "
"%{buildroot}/usr/lib64/R/library .")
self._write_strip("cp ~/.stash/* %{buildroot}/usr/lib64/R/library/*/libs/ || :")
self._write_strip("%{__rm} -rf %{buildroot}%{_datadir}/R/library/R.css")
self.write_find_lang()
@@ -1444,10 +1600,10 @@ class Specfile(object):
self._write_strip("pushd clr-build-avx2")
self.write_build_prepend()
self.write_variables()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -march=x86-64-v3 -m64 -Wl,-z,x86-64-v3"')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -march=x86-64-v3 -m64 -Wl,-z,x86-64-v3"')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -march=x86-64-v3 -m64 -Wl,-z,x86-64-v3"')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -march=x86-64-v3 -m64 -Wl,-z,x86-64-v3"')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self._write_strip("%cmake {} {}".format(self.config.cmake_srcdir, self.extra_cmake))
self.write_make_line()
self._write_strip("popd")
@@ -1457,10 +1613,24 @@ class Specfile(object):
self._write_strip("pushd clr-build-avx512")
self.write_build_prepend()
self.write_variables()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -march=x86-64-v4 -m64 -Wl,-z,x86-64-v4 -mprefer-vector-width=512"')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -march=x86-64-v4 -m64 -Wl,-z,x86-64-v4 -mprefer-vector-width=512"')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -march=x86-64-v4 -m64 -Wl,-z,x86-64-v4 -mprefer-vector-width=512"')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -march=x86-64-v4 -m64 "')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX512_CFLAGS} "')
self._write_strip("%cmake {} {}".format(self.config.cmake_srcdir, self.extra_cmake))
self.write_make_line()
self._write_strip("popd")
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip("mkdir -p clr-build-apx")
self._write_strip("pushd clr-build-apx")
self.write_build_prepend()
self.write_variables()
self._write_strip('CC=gcc-14')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
self._write_strip("%cmake {} {}".format(self.config.cmake_srcdir, self.extra_cmake))
self.write_make_line()
self._write_strip("popd")
@@ -1486,10 +1656,10 @@ class Specfile(object):
self._write_strip("module load openmpi")
self.write_build_prepend()
self.write_variables()
self._write_strip('CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS -march=x86-64-v3 -m64 -Wl,-z,x86-64-v3"')
self._write_strip('CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS -march=x86-64-v3 -m64 -Wl,-z,x86-64-v3"')
self._write_strip('FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS -march=x86-64-v3 -m64 -Wl,-z,x86-64-v3"')
self._write_strip('FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS -march=x86-64-v3 -m64"')
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
self.write_cmake_line_openmpi()
self.write_make_line()
self._write_strip("module unload openmpi")
@@ -1533,8 +1703,8 @@ class Specfile(object):
if self.config.config_opts['use_avx2']:
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
self._write("%qmake 'QT_CPU_FEATURES.x86_64 += avx avx2 bmi bmi2 f16c fma lzcnt popcnt'\\\n")
self._write(" QMAKE_CFLAGS+=\"-march=x86-64-v3 -Wl,-z,x86-64-v3\" QMAKE_CXXFLAGS+=\"-march=x86-64-v3 -Wl,-z,x86-64-v3\" \\\n")
self._write(" QMAKE_LFLAGS+=-march=x86-64-v3 {} {}\n".format(extra_qmake_args, self.config.extra_configure))
self._write(f' QMAKE_CFLAGS+="{AVX2_CFLAGS} {AVX2_LFLAGS}" QMAKE_CXXFLAGS+="{AVX2_CFLAGS} {AVX2_LFLAGS}" \\\n')
self._write(f' QMAKE_LFLAGS+="{AVX2_LCFLAGS}" {extra_qmake_args} {self.config.extra_configure}\n')
self.write_make_line()
self._write_strip("popd")
@@ -1603,8 +1773,8 @@ class Specfile(object):
self._write_strip("ninja -v -C builddir")
if self.config.config_opts['use_avx2']:
if self.config.config_opts['pgo'] and self.config.profile_payload != "":
self._write_strip('CFLAGS="$CFLAGS_GENERATE -m64 -march=x86-64-v3 -O3 -Wl,-z,x86-64-v3" CXXFLAGS="$CXXFLAGS_GENERATE '
'-m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 " LDFLAGS="$LDFLAGS_GENERATE -m64 -march=x86-64-v3" '
self._write_strip(f'CFLAGS="$CFLAGS_GENERATE {AVX2_CFLAGS} {AVX2_LFLAGS} " CXXFLAGS="$CXXFLAGS_GENERATE '
f'{AVX2_CFLAGS} {AVX2_LFLAGS} " LDFLAGS="$LDFLAGS_GENERATE {AVX2_LCFLAGS} " '
'meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
'{1} builddiravx2'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddiravx2')
@@ -1612,21 +1782,21 @@ class Specfile(object):
self._write_strip("\n".join(self.config.profile_payload))
self._write_strip('popd')
self._write_strip('rm -rf builddiravx2')
self._write_strip('CFLAGS="$CFLAGS_USE -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 -O3" CXXFLAGS="$CXXFLAGS_USE '
'-m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 " LDFLAGS="$LDFLAGS_USE -m64 -march=x86-64-v3" '
self._write_strip(f'CFLAGS="$CFLAGS_USE {AVX2_CFLAGS} {AVX2_LFLAGS} " CXXFLAGS="$CXXFLAGS_USE '
f'{AVX2_CFLAGS} {AVX2_LFLAGS} " LDFLAGS="$LDFLAGS_USE {AVX2_LCFLAGS} " '
'meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
'{1} builddiravx2'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddiravx2')
else:
self._write_strip('CFLAGS="$CFLAGS -m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 -O3" CXXFLAGS="$CXXFLAGS '
'-m64 -march=x86-64-v3 -Wl,-z,x86-64-v3 " LDFLAGS="$LDFLAGS -m64 -march=x86-64-v3" '
self._write_strip(f'CFLAGS="$CFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} " CXXFLAGS="$CXXFLAGS '
f'{AVX2_CFLAGS} {AVX2_LFLAGS} " LDFLAGS="$LDFLAGS {AVX2_LCFLAGS} " '
'meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
'{1} builddiravx2'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddiravx2')
if self.config.config_opts['use_avx512']:
if self.config.config_opts['pgo'] and self.config.profile_payload != "":
self._write_strip('CFLAGS="$CFLAGS_GENERATE -m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 -O3" CXXFLAGS="$CXXFLAGS_GENERATE '
'-m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 -mprefer-vector-width=512" LDFLAGS="$LDFLAGS_GENERATE -m64 -march=x86-64-v4" '
self._write_strip(f'CFLAGS="$CFLAGS_GENERATE {AVX512_CFLAGS} {AVX512_LFLAGS} " CXXFLAGS="$CXXFLAGS_GENERATE '
f'{AVX512_CFLAGS} {AVX512_LFLAGS} " LDFLAGS="$LDFLAGS_GENERATE {AVX512_LCFLAGS} " '
'meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
'{1} builddiravx512'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddiravx512')
@@ -1634,17 +1804,43 @@ class Specfile(object):
self._write_strip("\n".join(self.config.profile_payload))
self._write_strip('popd')
self._write_strip('rm -rf builddiravx512')
self._write_strip('CFLAGS="$CFLAGS_USE -m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 -O3 -mprefer-vector-width=512" CXXFLAGS="$CXXFLAGS_USE '
'-m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 -mprefer-vector-width=512" LDFLAGS="$LDFLAGS_USE -m64 -march=x86-64-v4" '
self._write_strip(f'CFLAGS="$CFLAGS_USE {AVX512_CFLAGS} {AVX512_LFLAGS} " CXXFLAGS="$CXXFLAGS_USE '
f'{AVX512_CFLAGS} {AVX512_LFLAGS} " LDFLAGS="$LDFLAGS_USE {AVX512_LCFLAGS} " '
'meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
'{1} builddiravx512'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddiravx512')
else:
self._write_strip('CFLAGS="$CFLAGS -m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 -O3 -mprefer-vector-width=512" CXXFLAGS="$CXXFLAGS '
'-m64 -march=x86-64-v4 -Wl,-z,x86-64-v4 -mprefer-vector-width=512" LDFLAGS="$LDFLAGS -m64 -march=x86-64-v4" '
self._write_strip(f'CFLAGS="$CFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} " CXXFLAGS="$CXXFLAGS '
f'{AVX512_CFLAGS} {AVX512_LFLAGS} " LDFLAGS="$LDFLAGS {AVX512_LCFLAGS} " '
'meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
'{1} builddiravx512'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddiravx512')
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip('CC=gcc-14')
if self.config.config_opts['pgo'] and self.config.profile_payload != "":
self._write_strip(f'CFLAGS="$CFLAGS_GENERATE {APX_CFLAGS} {APX_LFLAGS} "'
f' CXXFLAGS="$CXXFLAGS_GENERATE {AVX2_CFLAGS} {AVX2_LFLAGS} "'
f' LDFLAGS="$LDFLAGS_GENERATE {APX_LCFLAGS} " '
' meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
' {1} builddirapx'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddirapx')
self._write_strip('pushd builddirapx')
self._write_strip("\n".join(self.config.profile_payload))
self._write_strip('popd')
self._write_strip('rm -rf builddirapx')
self._write_strip(f'CFLAGS="$CFLAGS_USE {APX_CFLAGS} {APX_LFLAGS} "'
f' CXXFLAGS="$CXXFLAGS_USE {AVX2_CFLAGS} {AVX2_LFLAGS} "'
f' LDFLAGS="$LDFLAGS_USE {APX_LCFLAGS} " '
' meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
' {1} builddirapx'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddirapx')
else:
self._write_strip(f'CFLAGS="$CFLAGS {APX_CFLAGS} {APX_LFLAGS} "'
f' CXXFLAGS="$CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "'
f' LDFLAGS="$LDFLAGS {APX_LCFLAGS} " '
' meson --libdir=lib64 --prefix=/usr --buildtype=plain {0} '
' {1} builddirapx'.format(self.config.extra_configure, self.config.extra_configure64))
self._write_strip('ninja -v -C builddirapx')
if self.config.subdir:
self._write_strip("popd")
if self.config.config_opts['32bit']:
@@ -1686,6 +1882,9 @@ class Specfile(object):
self._write_strip('DESTDIR=%{buildroot}-v3 ninja -C builddiravx2 install')
if self.config.config_opts['use_avx512']:
self._write_strip('DESTDIR=%{buildroot}-v4 ninja -C builddiravx512 install')
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
self._write_strip('CC=gcc-14')
self._write_strip('DESTDIR=%{buildroot}-va ninja -C builddirapx install')
self._write_strip("DESTDIR=%{buildroot} ninja -C builddir install")
if self.config.subdir:
+67
View File
@@ -33,6 +33,7 @@ class TestFiles(unittest.TestCase):
"/opt/two",
"/V3/opt/two",
"/V4/opt/two",
"/VA/opt/two",
"/usr/etc/three",
"/usr/local/four",
"/usr/src/five",
@@ -58,6 +59,7 @@ class TestFiles(unittest.TestCase):
self.fm.push_package_file('/etc/test-fn')
self.fm.push_package_file('/V3/etc/test-fn')
self.fm.push_package_file('/V4/etc/test-fn')
self.fm.push_package_file('/VA/etc/test-fn')
self.assertTrue(self.fm.has_banned)
self.assertFalse(self.fm.newfiles_printed)
@@ -84,6 +86,7 @@ class TestFiles(unittest.TestCase):
self.assertTrue(self.fm.compat_exclude('/usr/lib64/libfoo.so'))
self.assertTrue(self.fm.compat_exclude('/V3/usr/lib64/libfoo.so'))
self.assertTrue(self.fm.compat_exclude('/V4/usr/lib64/libfoo.so'))
self.assertTrue(self.fm.compat_exclude('/VA/usr/lib64/libfoo.so'))
def test_compat_exclude_not_compat_mode(self):
"""
@@ -94,6 +97,7 @@ class TestFiles(unittest.TestCase):
self.assertFalse(self.fm.compat_exclude('/usr/lib64/libfoo.so'))
self.assertFalse(self.fm.compat_exclude('/V3/usr/lib64/libfoo.so'))
self.assertFalse(self.fm.compat_exclude('/V4/usr/lib64/libfoo.so'))
self.assertFalse(self.fm.compat_exclude('/VA/usr/lib64/libfoo.so'))
def test_file_pat_match(self):
"""
@@ -107,6 +111,8 @@ class TestFiles(unittest.TestCase):
self.fm.push_package_file.assert_called_with('/V3/test-fn', 'main')
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main'))
self.fm.push_package_file.assert_called_with('/V4/test-fn', 'main')
self.assertTrue(self.fm.file_pat_match('/VA/test-fn', r'^/test-fn', 'main'))
self.fm.push_package_file.assert_called_with('/VA/test-fn', 'main')
def test_file_pat_match_exclude(self):
"""
@@ -117,6 +123,7 @@ class TestFiles(unittest.TestCase):
self.assertTrue(self.fm.file_pat_match('/test-fn', r'^/test-fn', 'main'))
self.assertTrue(self.fm.file_pat_match('/V3/test-fn', r'^/test-fn', 'main'))
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main'))
self.assertTrue(self.fm.file_pat_match('/VA/test-fn', r'^/test-fn', 'main'))
self.fm.push_package_file.assert_not_called()
def test_file_pat_match_replacement(self):
@@ -130,6 +137,8 @@ class TestFiles(unittest.TestCase):
self.fm.push_package_file.assert_called_with('/V3/testfn', 'main')
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'/test-fn', 'main', '/testfn'))
self.fm.push_package_file.assert_called_with('/V4/testfn', 'main')
self.assertTrue(self.fm.file_pat_match('/VA/test-fn', r'/test-fn', 'main', '/testfn'))
self.fm.push_package_file.assert_called_with('/VA/testfn', 'main')
def test_file_pat_match_replacement_no_glob(self):
"""
@@ -143,6 +152,42 @@ class TestFiles(unittest.TestCase):
self.fm.push_package_file.assert_called_with('/V3/test-fn', 'main')
self.assertTrue(self.fm.file_pat_match('/V4/test-fn', r'^/test-fn', 'main', '/testfn'))
self.fm.push_package_file.assert_called_with('/V4/test-fn', 'main')
self.assertTrue(self.fm.file_pat_match('/VA/test-fn', r'^/test-fn', 'main', '/testfn'))
self.fm.push_package_file.assert_called_with('/VA/test-fn', 'main')
def test_file_windows_exe_not_allowed(self):
"""
Test that Windows exe and dll files are excluded
"""
self.fm.push_package_file = MagicMock()
self.fm.config.config_opts['allow_exe'] = False
self.fm.push_file('/usr/bin/foo.exe', 'test')
self.fm.push_file('/usr/lib64/foo.dll', 'test')
self.fm.push_file('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', 'test')
self.fm.push_file('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', 'test')
self.assertIn('/usr/bin/foo.exe', self.fm.excludes)
self.assertIn('/usr/lib64/foo.dll', self.fm.excludes)
self.assertIn('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', self.fm.excludes)
self.assertIn('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', self.fm.excludes)
def test_file_windows_exe_allowed(self):
"""
Test that Windows exe and dll files are not excluded
"""
self.fm.push_package_file = MagicMock()
self.fm.config.config_opts['allow_exe'] = True
self.fm.push_file('/usr/bin/foo.exe', 'test')
self.fm.push_file('/usr/lib64/foo.dll', 'test')
self.fm.push_file('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', 'test')
self.fm.push_file('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', 'test')
self.assertIn('/usr/bin/foo.exe', self.fm.files)
self.assertIn('/usr/lib64/foo.dll', self.fm.files)
self.assertIn('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', self.fm.files)
self.assertIn('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', self.fm.files)
self.assertNotIn('/usr/bin/foo.exe', self.fm.excludes)
self.assertNotIn('/usr/lib64/foo.dll', self.fm.excludes)
self.assertNotIn('/usr/lib/python3.12/site-packages/nsist/msvcrt/x86/api-ms-win-core-console-l1-1-0.dll', self.fm.excludes)
self.assertNotIn('/usr/lib/python3.12/site-packages/installer/_scripts/t32.exe', self.fm.excludes)
def test_file_pat_match_no_match(self):
"""
@@ -203,6 +248,9 @@ class TestFiles(unittest.TestCase):
self.fm.push_file('/V4/foobar', '')
calls = [call('/V4/foobar', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
self.fm.push_file('/VA/foobar', '')
calls = [call('/VA/foobar', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
def test_push_package_file_glob_empty(self):
"""
@@ -220,6 +268,9 @@ class TestFiles(unittest.TestCase):
self.fm.push_file('/V4/leftglobrightglob', '')
calls = [call('/V4/leftglob*rightglob', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
self.fm.push_file('/VA/leftglobrightglob', '')
calls = [call('/VA/leftglob*rightglob', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
def test_push_package_file_glob_left_match(self):
"""
@@ -237,6 +288,9 @@ class TestFiles(unittest.TestCase):
self.fm.push_file('/V4/leftglobrightglob', '')
calls = [call('/V4/leftglob*', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
self.fm.push_file('/VA/leftglobrightglob', '')
calls = [call('/VA/leftglob*', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
def test_push_package_file_glob_right_match(self):
"""
@@ -254,6 +308,9 @@ class TestFiles(unittest.TestCase):
self.fm.push_file('/V4/leftglobrightglob', '')
calls = [call('/V4/*rightglob', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
self.fm.push_file('/VA/leftglobrightglob', '')
calls = [call('/VA/*rightglob', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
def test_push_package_file_glob_leftright_match(self):
"""
@@ -271,6 +328,9 @@ class TestFiles(unittest.TestCase):
self.fm.push_file('/V4/leftglobstuffrightglob', '')
calls = [call('/V4/leftglob*rightglob', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
self.fm.push_file('/VA/leftglobstuffrightglob', '')
calls = [call('/VA/leftglob*rightglob', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
def test_push_package_file_glob_multi_match(self):
"""
@@ -288,6 +348,9 @@ class TestFiles(unittest.TestCase):
self.fm.push_file('/V4/leftglobstuff/stuffrightglob', '')
calls = [call('/V4/leftglob*/*rightglob', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
self.fm.push_file('/VA/leftglobstuff/stuffrightglob', '')
calls = [call('/VA/leftglob*/*rightglob', 'foobar-extras')]
self.fm.push_package_file.assert_has_calls(calls)
def test_push_file_setuid(self):
"""
@@ -313,6 +376,8 @@ class TestFiles(unittest.TestCase):
self.fm.push_package_file.assert_has_calls([call('/V3/usr/bin/test', 'bin')])
self.fm.push_file('/V4/usr/bin/test', '')
self.fm.push_package_file.assert_has_calls([call('/V4/usr/bin/test', 'bin')])
self.fm.push_file('/VA/usr/bin/test', '')
self.fm.push_package_file.assert_has_calls([call('/VA/usr/bin/test', 'bin')])
def test_push_file_match_pkg_name_dependency(self):
"""
@@ -327,6 +392,8 @@ class TestFiles(unittest.TestCase):
self.fm.push_package_file.assert_has_calls([call('/V3/usr/share/doc/testball/*', 'doc')])
self.fm.push_file('/V4/usr/share/doc/testball/', 'testball')
self.fm.push_package_file.assert_has_calls([call('/V4/usr/share/doc/testball/*', 'doc')])
self.fm.push_file('/VA/usr/share/doc/testball/', 'testball')
self.fm.push_package_file.assert_has_calls([call('/VA/usr/share/doc/testball/*', 'doc')])
def test_push_file_no_match(self):
"""