diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index c8aecc76e2efdc..09567b4f42203a 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -40,17 +40,17 @@ jobs: # 1: Platforms to build for # 2: Base image (e.g. ubuntu:22.04) dockerfile: [[amazon-linux, 'linux/amd64,linux/arm64', 'amazonlinux:2'], - [centos-stream9, 'linux/amd64,linux/arm64,linux/ppc64le', 'centos:stream9'], - [leap15, 'linux/amd64,linux/arm64,linux/ppc64le', 'opensuse/leap:15'], - [ubuntu-focal, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:20.04'], - [ubuntu-jammy, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:22.04'], - [ubuntu-noble, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:24.04'], - [almalinux8, 'linux/amd64,linux/arm64,linux/ppc64le', 'almalinux:8'], - [almalinux9, 'linux/amd64,linux/arm64,linux/ppc64le', 'almalinux:9'], + [centos-stream9, 'linux/amd64,linux/arm64', 'centos:stream9'], + [leap15, 'linux/amd64,linux/arm64', 'opensuse/leap:15'], + [ubuntu-focal, 'linux/amd64,linux/arm64', 'ubuntu:20.04'], + [ubuntu-jammy, 'linux/amd64,linux/arm64', 'ubuntu:22.04'], + [ubuntu-noble, 'linux/amd64,linux/arm64', 'ubuntu:24.04'], + [almalinux8, 'linux/amd64,linux/arm64', 'almalinux:8'], + [almalinux9, 'linux/amd64,linux/arm64', 'almalinux:9'], [rockylinux8, 'linux/amd64,linux/arm64', 'rockylinux:8'], [rockylinux9, 'linux/amd64,linux/arm64', 'rockylinux:9'], - [fedora39, 'linux/amd64,linux/arm64,linux/ppc64le', 'fedora:39'], - [fedora40, 'linux/amd64,linux/arm64,linux/ppc64le', 'fedora:40']] + [fedora39, 'linux/amd64,linux/arm64', 'fedora:39'], + [fedora40, 'linux/amd64,linux/arm64', 'fedora:40']] name: Build ${{ matrix.dockerfile[0] }} if: github.repository == 'spack/spack' steps: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5cb61a7ee9f7b4..4e8b38a6301d2f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -83,6 +83,10 @@ jobs: with: with_coverage: ${{ needs.changes.outputs.core }} + import-check: + needs: [ changes ] + uses: ./.github/workflows/import-check.yaml + all-prechecks: needs: [ prechecks ] if: ${{ always() }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a2c4ea54df01cf..03b32094ea1fd8 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -33,3 +33,4 @@ jobs: with: verbose: true fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/import-check.yaml b/.github/workflows/import-check.yaml new file mode 100644 index 00000000000000..16c73b465afde1 --- /dev/null +++ b/.github/workflows/import-check.yaml @@ -0,0 +1,49 @@ +name: import-check + +on: + workflow_call: + +jobs: + # Check we don't make the situation with circular imports worse + import-check: + runs-on: ubuntu-latest + steps: + - uses: julia-actions/setup-julia@v2 + with: + version: '1.10' + - uses: julia-actions/cache@v2 + + # PR: use the base of the PR as the old commit + - name: Checkout PR base commit + if: github.event_name == 'pull_request' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + ref: ${{ github.event.pull_request.base.sha }} + path: old + # not a PR: use the previous commit as the old commit + - name: Checkout previous commit + if: github.event_name != 'pull_request' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + fetch-depth: 2 + path: old + - name: Checkout previous commit + if: github.event_name != 'pull_request' + run: git -C old reset --hard HEAD^ + + - name: Checkout new commit + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + path: new + - name: Install circular import checker + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + repository: haampie/circular-import-fighter + ref: 4cdb0bf15f04ab6b49041d5ef1bfd9644cce7f33 + path: circular-import-fighter + - name: Install dependencies + working-directory: circular-import-fighter + run: make -j dependencies + - name: Circular import check + working-directory: circular-import-fighter + run: make -j compare "SPACK_ROOT=../old ../new" diff --git a/.github/workflows/requirements/style/requirements.txt b/.github/workflows/requirements/style/requirements.txt index c4a7f11aa1df2e..2a9d852fc13a90 100644 --- a/.github/workflows/requirements/style/requirements.txt +++ b/.github/workflows/requirements/style/requirements.txt @@ -1,7 +1,7 @@ -black==24.10.0 +black==25.1.0 clingo==5.7.1 -flake8==7.1.1 -isort==5.13.2 -mypy==1.11.2 +flake8==7.1.2 +isort==6.0.0 +mypy==1.15.0 types-six==1.17.0.20241205 vermin==1.6.0 diff --git a/.github/workflows/valid-style.yml b/.github/workflows/valid-style.yml index 6b85f5d0c674d3..4553750e8cd0d4 100644 --- a/.github/workflows/valid-style.yml +++ b/.github/workflows/valid-style.yml @@ -86,66 +86,6 @@ jobs: spack -d bootstrap now --dev spack -d style -t black spack unit-test -V - # Check we don't make the situation with circular imports worse - import-check: - runs-on: ubuntu-latest - steps: - - uses: julia-actions/setup-julia@v2 - with: - version: '1.10' - - uses: julia-actions/cache@v2 - - # PR: use the base of the PR as the old commit - - name: Checkout PR base commit - if: github.event_name == 'pull_request' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - with: - ref: ${{ github.event.pull_request.base.sha }} - path: old - # not a PR: use the previous commit as the old commit - - name: Checkout previous commit - if: github.event_name != 'pull_request' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - with: - fetch-depth: 2 - path: old - - name: Checkout previous commit - if: github.event_name != 'pull_request' - run: git -C old reset --hard HEAD^ - - - name: Checkout new commit - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - with: - path: new - - name: Install circular import checker - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - with: - repository: haampie/circular-import-fighter - ref: b5d6ce9be35f602cca7d5a6aa0259fca10639cca - path: circular-import-fighter - - name: Install dependencies - working-directory: circular-import-fighter - run: make -j dependencies - - name: Problematic imports before - working-directory: circular-import-fighter - run: make SPACK_ROOT=../old SUFFIX=.old - - name: Problematic imports after - working-directory: circular-import-fighter - run: make SPACK_ROOT=../new SUFFIX=.new - - name: Compare import cycles - working-directory: circular-import-fighter - run: | - edges_before="$(head -n1 solution.old)" - edges_after="$(head -n1 solution.new)" - if [ "$edges_after" -gt "$edges_before" ]; then - printf '\033[1;31mImport check failed: %s imports need to be deleted, ' "$edges_after" - printf 'previously this was %s\033[0m\n' "$edges_before" - printf 'Compare \033[1;97m"Problematic imports before"\033[0m and ' - printf '\033[1;97m"Problematic imports after"\033[0m.\n' - exit 1 - else - printf '\033[1;32mImport check passed: %s <= %s\033[0m\n' "$edges_after" "$edges_before" - fi # Further style checks from pylint pylint: diff --git a/bin/spack b/bin/spack index a5d48fa20867c7..8347769b2be8cb 100755 --- a/bin/spack +++ b/bin/spack @@ -25,7 +25,6 @@ exit 1 # The code above runs this file with our preferred python interpreter. import os -import os.path import sys min_python3 = (3, 6) diff --git a/etc/spack/defaults/concretizer.yaml b/etc/spack/defaults/concretizer.yaml index eda51c09beefc0..2432fa4867bb26 100644 --- a/etc/spack/defaults/concretizer.yaml +++ b/etc/spack/defaults/concretizer.yaml @@ -43,6 +43,22 @@ concretizer: # (e.g. py-setuptools, cmake etc.) # "full" (experimental): allows separation of the entire build-tool stack (e.g. the entire "cmake" subDAG) strategy: minimal + # Maximum number of duplicates in a DAG, when using a strategy that allows duplicates. "default" is the + # number used if there isn't a more specific alternative + max_dupes: + default: 1 + # Virtuals + c: 2 + cxx: 2 + fortran: 1 + # Regular packages + cmake: 2 + gmake: 2 + py-cython: 2 + py-flit-core: 2 + py-setuptools: 2 + gcc: 2 + llvm: 2 # Option to specify compatibility between operating systems for reuse of compilers and packages # Specified as a key: [list] where the key is the os that is being targeted, and the list contains the OS's # it can reuse. Note this is a directional compatibility so mutual compatibility between two OS's @@ -63,3 +79,7 @@ concretizer: # Setting this to false yields unreproducible results, so we advise to use that value only # for debugging purposes (e.g. check which constraints can help Spack concretize faster). error_on_timeout: true + + # Static analysis may reduce the concretization time by generating smaller ASP problems, in + # cases where there are requirements that prevent part of the search space to be explored. + static_analysis: false diff --git a/etc/spack/defaults/packages.yaml b/etc/spack/defaults/packages.yaml index 3842acd26b2866..3a37a1205c0162 100644 --- a/etc/spack/defaults/packages.yaml +++ b/etc/spack/defaults/packages.yaml @@ -36,7 +36,7 @@ packages: go-or-gccgo-bootstrap: [go-bootstrap, gcc] iconv: [libiconv] ipp: [intel-oneapi-ipp] - java: [openjdk, jdk, ibm-java] + java: [openjdk, jdk] jpeg: [libjpeg-turbo, libjpeg] lapack: [openblas, amdlibflame] libc: [glibc, musl] @@ -1268,15 +1268,27 @@ packages: permissions: read: world write: user + cray-fftw: + buildable: false + cray-libsci: + buildable: false cray-mpich: buildable: false cray-mvapich2: buildable: false + cray-pmi: + buildable: false egl: buildable: false + essl: + buildable: false fujitsu-mpi: buildable: false + fujitsu-ssl2: + buildable: false hpcx-mpi: buildable: false + mpt: + buildable: false spectrum-mpi: buildable: false diff --git a/etc/spack/defaults/windows/config.yaml b/etc/spack/defaults/windows/config.yaml index eaa336dca2b45f..f54febe957553e 100644 --- a/etc/spack/defaults/windows/config.yaml +++ b/etc/spack/defaults/windows/config.yaml @@ -1,5 +1,5 @@ config: locks: false build_stage:: - - '$spack/.staging' + - '$user_cache_path/stage' stage_name: '{name}-{version}-{hash:7}' diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 72dad746b48dee..ea19703c1d4ded 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -1761,19 +1761,24 @@ Verifying installations The ``spack verify`` command can be used to verify the validity of Spack-installed packages any time after installation. + +^^^^^^^^^^^^^^^^^^^^^^^^^ +``spack verify manifest`` +^^^^^^^^^^^^^^^^^^^^^^^^^ + At installation time, Spack creates a manifest of every file in the installation prefix. For links, Spack tracks the mode, ownership, and destination. For directories, Spack tracks the mode, and ownership. For files, Spack tracks the mode, ownership, modification -time, hash, and size. The Spack verify command will check, for every -file in each package, whether any of those attributes have changed. It -will also check for newly added files or deleted files from the -installation prefix. Spack can either check all installed packages +time, hash, and size. The ``spack verify manifest`` command will check, +for every file in each package, whether any of those attributes have +changed. It will also check for newly added files or deleted files from +the installation prefix. Spack can either check all installed packages using the `-a,--all` or accept specs listed on the command line to verify. -The ``spack verify`` command can also verify for individual files that -they haven't been altered since installation time. If the given file +The ``spack verify manifest`` command can also verify for individual files +that they haven't been altered since installation time. If the given file is not in a Spack installation prefix, Spack will report that it is not owned by any package. To check individual files instead of specs, use the ``-f,--files`` option. @@ -1788,6 +1793,22 @@ check only local packages (as opposed to those used transparently from ``upstream`` spack instances) and the ``-j,--json`` option to output machine-readable json data for any errors. +^^^^^^^^^^^^^^^^^^^^^^^^^^ +``spack verify libraries`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``spack verify libraries`` command can be used to verify that packages +do not have accidental system dependencies. This command scans the install +prefixes of packages for executables and shared libraries, and resolves +their needed libraries in their RPATHs. When needed libraries cannot be +located, an error is reported. This typically indicates that a package +was linked against a system library, instead of a library provided by +a Spack package. + +This verification can also be enabled as a post-install hook by setting +``config:shared_linking:missing_library_policy`` to ``error`` or ``warn`` +in :ref:`config.yaml `. + ----------------------- Filesystem requirements ----------------------- diff --git a/lib/spack/docs/bootstrapping.rst b/lib/spack/docs/bootstrapping.rst index b9184eba38044c..8a7bc1569fcaaa 100644 --- a/lib/spack/docs/bootstrapping.rst +++ b/lib/spack/docs/bootstrapping.rst @@ -170,7 +170,7 @@ bootstrapping. To register the mirror on the platform where it's supposed to be used run the following command(s): % spack bootstrap add --trust local-sources /opt/bootstrap/metadata/sources % spack bootstrap add --trust local-binaries /opt/bootstrap/metadata/binaries - + % spack buildcache update-index /opt/bootstrap/bootstrap_cache This command needs to be run on a machine with internet access and the resulting folder has to be moved over to the air-gapped system. Once the local sources are added using the diff --git a/lib/spack/docs/build_systems/autotoolspackage.rst b/lib/spack/docs/build_systems/autotoolspackage.rst index 106192c59ad0e6..d5569e7c73f0e2 100644 --- a/lib/spack/docs/build_systems/autotoolspackage.rst +++ b/lib/spack/docs/build_systems/autotoolspackage.rst @@ -272,9 +272,9 @@ often lists dependencies and the flags needed to locate them. The "environment variables" section lists environment variables that the build system uses to pass flags to the compiler and linker. -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Addings flags to configure -^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^ +Adding flags to configure +^^^^^^^^^^^^^^^^^^^^^^^^^ For most of the flags you encounter, you will want a variant to optionally enable/disable them. You can then optionally pass these @@ -285,7 +285,7 @@ function like so: def configure_args(self): args = [] - + ... if self.spec.satisfies("+mpi"): args.append("--enable-mpi") else: @@ -299,7 +299,10 @@ Alternatively, you can use the :ref:`enable_or_disable ``. This may or may not have +data in it depending on the package that was built and the availability of tests. + +------------- +``user_data`` +------------- + +The directory ``user_data`` is used to store everything else that shouldn't be copied to the ``reproduction`` direcotory. +Users may use this to store additional logs or metrics or other types of files generated by the build job. + ------------------------------------- Using a custom spack in your pipeline ------------------------------------- diff --git a/lib/spack/docs/requirements.txt b/lib/spack/docs/requirements.txt index 14f32c54402205..11eec247a87547 100644 --- a/lib/spack/docs/requirements.txt +++ b/lib/spack/docs/requirements.txt @@ -1,4 +1,4 @@ -sphinx==8.1.3 +sphinx==8.2.1 sphinxcontrib-programoutput==0.18 sphinx_design==0.6.1 sphinx-rtd-theme==3.0.2 @@ -7,7 +7,7 @@ docutils==0.21.2 pygments==2.19.1 urllib3==2.3.0 pytest==8.3.4 -isort==5.13.2 -black==24.10.0 -flake8==7.1.1 -mypy==1.11.2 +isort==6.0.0 +black==25.1.0 +flake8==7.1.2 +mypy==1.11.1 diff --git a/lib/spack/llnl/url.py b/lib/spack/llnl/url.py index cbec1f73e35656..af3eb384959712 100644 --- a/lib/spack/llnl/url.py +++ b/lib/spack/llnl/url.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) """URL primitives that just require Python standard library.""" import itertools -import os.path +import os import re from typing import Optional, Set, Tuple from urllib.parse import urlsplit, urlunsplit diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index 207180727df0a0..c50d7516e27d98 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -75,7 +75,6 @@ "install_tree", "is_exe", "join_path", - "last_modification_time_recursive", "library_extensions", "mkdirp", "partition_path", @@ -669,7 +668,7 @@ def copy(src, dest, _permissions=False): _permissions (bool): for internal use only Raises: - IOError: if *src* does not match any files or directories + OSError: if *src* does not match any files or directories ValueError: if *src* matches multiple files but *dest* is not a directory """ @@ -680,7 +679,7 @@ def copy(src, dest, _permissions=False): files = glob.glob(src) if not files: - raise IOError("No such file or directory: '{0}'".format(src)) + raise OSError("No such file or directory: '{0}'".format(src)) if len(files) > 1 and not os.path.isdir(dest): raise ValueError( "'{0}' matches multiple files but '{1}' is not a directory".format(src, dest) @@ -711,7 +710,7 @@ def install(src, dest): dest (str): the destination file or directory Raises: - IOError: if *src* does not match any files or directories + OSError: if *src* does not match any files or directories ValueError: if *src* matches multiple files but *dest* is not a directory """ @@ -749,7 +748,7 @@ def copy_tree( _permissions (bool): for internal use only Raises: - IOError: if *src* does not match any files or directories + OSError: if *src* does not match any files or directories ValueError: if *src* is a parent directory of *dest* """ if _permissions: @@ -763,7 +762,7 @@ def copy_tree( files = glob.glob(src) if not files: - raise IOError("No such file or directory: '{0}'".format(src)) + raise OSError("No such file or directory: '{0}'".format(src)) # For Windows hard-links and junctions, the source path must exist to make a symlink. Add # all symlinks to this list while traversing the tree, then when finished, make all @@ -844,7 +843,7 @@ def install_tree(src, dest, symlinks=True, ignore=None): ignore (typing.Callable): function indicating which files to ignore Raises: - IOError: if *src* does not match any files or directories + OSError: if *src* does not match any files or directories ValueError: if *src* is a parent directory of *dest* """ copy_tree(src, dest, symlinks=symlinks, ignore=ignore, _permissions=True) @@ -1470,15 +1469,36 @@ def set_executable(path): @system_path_filter -def last_modification_time_recursive(path): - path = os.path.abspath(path) - times = [os.stat(path).st_mtime] - times.extend( - os.lstat(os.path.join(root, name)).st_mtime - for root, dirs, files in os.walk(path) - for name in dirs + files - ) - return max(times) +def recursive_mtime_greater_than(path: str, time: float) -> bool: + """Returns true if any file or dir recursively under `path` has mtime greater than `time`.""" + # use bfs order to increase likelihood of early return + queue: Deque[str] = collections.deque([path]) + + if os.stat(path).st_mtime > time: + return True + + while queue: + current = queue.popleft() + + try: + entries = os.scandir(current) + except OSError: + continue + + with entries: + for entry in entries: + try: + st = entry.stat(follow_symlinks=False) + except OSError: + continue + + if st.st_mtime > time: + return True + + if entry.is_dir(follow_symlinks=False): + queue.append(entry.path) + + return False @system_path_filter @@ -1740,8 +1760,7 @@ def find( def _log_file_access_issue(e: OSError, path: str) -> None: - errno_name = errno.errorcode.get(e.errno, "UNKNOWN") - tty.debug(f"find must skip {path}: {errno_name} {e}") + tty.debug(f"find must skip {path}: {e}") def _file_id(s: os.stat_result) -> Tuple[int, int]: diff --git a/lib/spack/llnl/util/link_tree.py b/lib/spack/llnl/util/link_tree.py index 0d17d866b8209d..e28bd096b12bf5 100644 --- a/lib/spack/llnl/util/link_tree.py +++ b/lib/spack/llnl/util/link_tree.py @@ -41,6 +41,16 @@ def __init__(self, dst, src_a=None, src_b=None): self.src_a = src_a self.src_b = src_b + def __repr__(self) -> str: + return f"MergeConflict(dst={self.dst!r}, src_a={self.src_a!r}, src_b={self.src_b!r})" + + +def _samefile(a: str, b: str): + try: + return os.path.samefile(a, b) + except OSError: + return False + class SourceMergeVisitor(BaseDirectoryVisitor): """ @@ -50,9 +60,14 @@ class SourceMergeVisitor(BaseDirectoryVisitor): - A list of merge conflicts in dst/ """ - def __init__(self, ignore: Optional[Callable[[str], bool]] = None): + def __init__( + self, ignore: Optional[Callable[[str], bool]] = None, normalize_paths: bool = False + ): self.ignore = ignore if ignore is not None else lambda f: False + # On case-insensitive filesystems, normalize paths to detect duplications + self.normalize_paths = normalize_paths + # When mapping to /, we need to prepend the # bit to the relative path in the destination dir. self.projection: str = "" @@ -71,10 +86,88 @@ def __init__(self, ignore: Optional[Callable[[str], bool]] = None): # and can run mkdir in order. self.directories: Dict[str, Tuple[str, str]] = {} + # If the visitor is configured to normalize paths, keep a map of + # normalized path to: original path, root directory + relative path + self._directories_normalized: Dict[str, Tuple[str, str, str]] = {} + # Files to link. Maps dst_rel to (src_root, src_rel). This is an ordered dict, where files # are guaranteed to be grouped by src_root in the order they were visited. self.files: Dict[str, Tuple[str, str]] = {} + # If the visitor is configured to normalize paths, keep a map of + # normalized path to: original path, root directory + relative path + self._files_normalized: Dict[str, Tuple[str, str, str]] = {} + + def _in_directories(self, proj_rel_path: str) -> bool: + """ + Check if a path is already in the directory list + """ + if self.normalize_paths: + return proj_rel_path.lower() in self._directories_normalized + else: + return proj_rel_path in self.directories + + def _directory(self, proj_rel_path: str) -> Tuple[str, str, str]: + """ + Get the directory that is mapped to a path + """ + if self.normalize_paths: + return self._directories_normalized[proj_rel_path.lower()] + else: + return (proj_rel_path, *self.directories[proj_rel_path]) + + def _del_directory(self, proj_rel_path: str): + """ + Remove a directory from the list of directories + """ + del self.directories[proj_rel_path] + if self.normalize_paths: + del self._directories_normalized[proj_rel_path.lower()] + + def _add_directory(self, proj_rel_path: str, root: str, rel_path: str): + """ + Add a directory to the list of directories. + Also stores the normalized version for later lookups + """ + self.directories[proj_rel_path] = (root, rel_path) + if self.normalize_paths: + self._directories_normalized[proj_rel_path.lower()] = (proj_rel_path, root, rel_path) + + def _in_files(self, proj_rel_path: str) -> bool: + """ + Check if a path is already in the files list + """ + if self.normalize_paths: + return proj_rel_path.lower() in self._files_normalized + else: + return proj_rel_path in self.files + + def _file(self, proj_rel_path: str) -> Tuple[str, str, str]: + """ + Get the file that is mapped to a path + """ + if self.normalize_paths: + return self._files_normalized[proj_rel_path.lower()] + else: + return (proj_rel_path, *self.files[proj_rel_path]) + + def _del_file(self, proj_rel_path: str): + """ + Remove a file from the list of files + """ + del self.files[proj_rel_path] + if self.normalize_paths: + del self._files_normalized[proj_rel_path.lower()] + + def _add_file(self, proj_rel_path: str, root: str, rel_path: str): + """ + Add a file to the list of files + Also stores the normalized version for later lookups + """ + self.files[proj_rel_path] = (root, rel_path) + if self.normalize_paths: + self._files_normalized[proj_rel_path.lower()] = (proj_rel_path, root, rel_path) + def before_visit_dir(self, root: str, rel_path: str, depth: int) -> bool: """ Register a directory if dst / rel_path is not blocked by a file or ignored. @@ -84,23 +177,28 @@ def before_visit_dir(self, root: str, rel_path: str, depth: int) -> bool: if self.ignore(rel_path): # Don't recurse when dir is ignored. return False - elif proj_rel_path in self.files: - # Can't create a dir where a file is. - src_a_root, src_a_relpath = self.files[proj_rel_path] - self.fatal_conflicts.append( - MergeConflict( - dst=proj_rel_path, - src_a=os.path.join(src_a_root, src_a_relpath), - src_b=os.path.join(root, rel_path), + elif self._in_files(proj_rel_path): + # A file-dir conflict is fatal except if they're the same file (symlinked dir). + src_a = os.path.join(*self._file(proj_rel_path)) + src_b = os.path.join(root, rel_path) + + if not _samefile(src_a, src_b): + self.fatal_conflicts.append( + MergeConflict(dst=proj_rel_path, src_a=src_a, src_b=src_b) ) - ) - return False - elif proj_rel_path in self.directories: + return False + + # Remove the link in favor of the dir. + existing_proj_rel_path, _, _ = self._file(proj_rel_path) + self._del_file(existing_proj_rel_path) + self._add_directory(proj_rel_path, root, rel_path) + return True + elif self._in_directories(proj_rel_path): # No new directory, carry on. return True else: # Register new directory. - self.directories[proj_rel_path] = (root, rel_path) + self._add_directory(proj_rel_path, root, rel_path) return True def before_visit_symlinked_dir(self, root: str, rel_path: str, depth: int) -> bool: @@ -132,7 +230,7 @@ def before_visit_symlinked_dir(self, root: str, rel_path: str, depth: int) -> bo if handle_as_dir: return self.before_visit_dir(root, rel_path, depth) - self.visit_file(root, rel_path, depth) + self.visit_file(root, rel_path, depth, symlink=True) return False def visit_file(self, root: str, rel_path: str, depth: int, *, symlink: bool = False) -> None: @@ -140,30 +238,23 @@ def visit_file(self, root: str, rel_path: str, depth: int, *, symlink: bool = Fa if self.ignore(rel_path): pass - elif proj_rel_path in self.directories: - # Can't create a file where a dir is; fatal error - self.fatal_conflicts.append( - MergeConflict( - dst=proj_rel_path, - src_a=os.path.join(*self.directories[proj_rel_path]), - src_b=os.path.join(root, rel_path), + elif self._in_directories(proj_rel_path): + # Can't create a file where a dir is, unless they are the same file (symlinked dir), + # in which case we simply drop the symlink in favor of the actual dir. + src_a = os.path.join(*self._directory(proj_rel_path)) + src_b = os.path.join(root, rel_path) + if not symlink or not _samefile(src_a, src_b): + self.fatal_conflicts.append( + MergeConflict(dst=proj_rel_path, src_a=src_a, src_b=src_b) ) - ) - elif proj_rel_path in self.files: + elif self._in_files(proj_rel_path): # When two files project to the same path, they conflict iff they are distinct. # If they are the same (i.e. one links to the other), register regular files rather # than symlinks. The reason is that in copy-type views, we need a copy of the actual # file, not the symlink. - - src_a = os.path.join(*self.files[proj_rel_path]) + src_a = os.path.join(*self._file(proj_rel_path)) src_b = os.path.join(root, rel_path) - - try: - samefile = os.path.samefile(src_a, src_b) - except OSError: - samefile = False - - if not samefile: + if not _samefile(src_a, src_b): # Distinct files produce a conflict. self.file_conflicts.append( MergeConflict(dst=proj_rel_path, src_a=src_a, src_b=src_b) @@ -173,12 +264,12 @@ def visit_file(self, root: str, rel_path: str, depth: int, *, symlink: bool = Fa if not symlink: # Remove the link in favor of the actual file. The del is necessary to maintain the # order of the files dict, which is grouped by root. - del self.files[proj_rel_path] - self.files[proj_rel_path] = (root, rel_path) - + existing_proj_rel_path, _, _ = self._file(proj_rel_path) + self._del_file(existing_proj_rel_path) + self._add_file(proj_rel_path, root, rel_path) else: # Otherwise register this file to be linked. - self.files[proj_rel_path] = (root, rel_path) + self._add_file(proj_rel_path, root, rel_path) def visit_symlinked_file(self, root: str, rel_path: str, depth: int) -> None: # Treat symlinked files as ordinary files (without "dereferencing") @@ -197,11 +288,11 @@ def set_projection(self, projection: str) -> None: path = "" for part in self.projection.split(os.sep): path = os.path.join(path, part) - if path not in self.files: - self.directories[path] = ("", path) + if not self._in_files(path): + self._add_directory(path, "", path) else: # Can't create a dir where a file is. - src_a_root, src_a_relpath = self.files[path] + _, src_a_root, src_a_relpath = self._file(path) self.fatal_conflicts.append( MergeConflict( dst=path, @@ -227,8 +318,8 @@ def __init__(self, source_merge_visitor: SourceMergeVisitor): def before_visit_dir(self, root: str, rel_path: str, depth: int) -> bool: # If destination dir is a file in a src dir, add a conflict, # and don't traverse deeper - if rel_path in self.src.files: - src_a_root, src_a_relpath = self.src.files[rel_path] + if self.src._in_files(rel_path): + _, src_a_root, src_a_relpath = self.src._file(rel_path) self.src.fatal_conflicts.append( MergeConflict( rel_path, os.path.join(src_a_root, src_a_relpath), os.path.join(root, rel_path) @@ -238,8 +329,9 @@ def before_visit_dir(self, root: str, rel_path: str, depth: int) -> bool: # If destination dir was also a src dir, remove the mkdir # action, and traverse deeper. - if rel_path in self.src.directories: - del self.src.directories[rel_path] + if self.src._in_directories(rel_path): + existing_proj_rel_path, _, _ = self.src._directory(rel_path) + self.src._del_directory(existing_proj_rel_path) return True # If the destination dir does not appear in the src dir, @@ -252,38 +344,24 @@ def before_visit_symlinked_dir(self, root: str, rel_path: str, depth: int) -> bo be seen as files; we should not accidentally merge source dir with a symlinked dest dir. """ - # Always conflict - if rel_path in self.src.directories: - src_a_root, src_a_relpath = self.src.directories[rel_path] - self.src.fatal_conflicts.append( - MergeConflict( - rel_path, os.path.join(src_a_root, src_a_relpath), os.path.join(root, rel_path) - ) - ) - if rel_path in self.src.files: - src_a_root, src_a_relpath = self.src.files[rel_path] - self.src.fatal_conflicts.append( - MergeConflict( - rel_path, os.path.join(src_a_root, src_a_relpath), os.path.join(root, rel_path) - ) - ) + self.visit_file(root, rel_path, depth) # Never descend into symlinked target dirs. return False def visit_file(self, root: str, rel_path: str, depth: int) -> None: # Can't merge a file if target already exists - if rel_path in self.src.directories: - src_a_root, src_a_relpath = self.src.directories[rel_path] + if self.src._in_directories(rel_path): + _, src_a_root, src_a_relpath = self.src._directory(rel_path) self.src.fatal_conflicts.append( MergeConflict( rel_path, os.path.join(src_a_root, src_a_relpath), os.path.join(root, rel_path) ) ) - elif rel_path in self.src.files: - src_a_root, src_a_relpath = self.src.files[rel_path] + elif self.src._in_files(rel_path): + _, src_a_root, src_a_relpath = self.src._file(rel_path) self.src.fatal_conflicts.append( MergeConflict( rel_path, os.path.join(src_a_root, src_a_relpath), os.path.join(root, rel_path) @@ -308,7 +386,7 @@ class LinkTree: def __init__(self, source_root): if not os.path.exists(source_root): - raise IOError("No such file or directory: '%s'", source_root) + raise OSError("No such file or directory: '%s'", source_root) self._root = source_root diff --git a/lib/spack/llnl/util/lock.py b/lib/spack/llnl/util/lock.py index 081e88912c77e9..1808b0e98e5769 100644 --- a/lib/spack/llnl/util/lock.py +++ b/lib/spack/llnl/util/lock.py @@ -269,7 +269,7 @@ def __init__( @staticmethod def _poll_interval_generator( - _wait_times: Optional[Tuple[float, float, float]] = None + _wait_times: Optional[Tuple[float, float, float]] = None, ) -> Generator[float, None, None]: """This implements a backoff scheme for polling a contended resource by suggesting a succession of wait times between polls. @@ -391,7 +391,7 @@ def _poll_lock(self, op: int) -> bool: return True - except IOError as e: + except OSError as e: # EAGAIN and EACCES == locked by another process (so try again) if e.errno not in (errno.EAGAIN, errno.EACCES): raise diff --git a/lib/spack/llnl/util/tty/log.py b/lib/spack/llnl/util/tty/log.py index fbdbc9bff4fbff..34a08579ef775b 100644 --- a/lib/spack/llnl/util/tty/log.py +++ b/lib/spack/llnl/util/tty/log.py @@ -2,8 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -"""Utility classes for logging the output of blocks of code. -""" +"""Utility classes for logging the output of blocks of code.""" import atexit import ctypes import errno @@ -344,26 +343,6 @@ def close(self): self.file.close() -@contextmanager -def replace_environment(env): - """Replace the current environment (`os.environ`) with `env`. - - If `env` is empty (or None), this unsets all current environment - variables. - """ - env = env or {} - old_env = os.environ.copy() - try: - os.environ.clear() - for name, val in env.items(): - os.environ[name] = val - yield - finally: - os.environ.clear() - for name, val in old_env.items(): - os.environ[name] = val - - def log_output(*args, **kwargs): """Context manager that logs its output to a file. @@ -447,7 +426,6 @@ def __init__( self.echo = echo self.debug = debug self.buffer = buffer - self.env = env # the environment to use for _writer_daemon self.filter_fn = filter_fn self._active = False # used to prevent re-entry @@ -519,21 +497,20 @@ def __enter__(self): # just don't forward input if this fails pass - with replace_environment(self.env): - self.process = multiprocessing.Process( - target=_writer_daemon, - args=( - input_fd, - read_fd, - self.write_fd, - self.echo, - self.log_file, - child_pipe, - self.filter_fn, - ), - ) - self.process.daemon = True # must set before start() - self.process.start() + self.process = multiprocessing.Process( + target=_writer_daemon, + args=( + input_fd, + read_fd, + self.write_fd, + self.echo, + self.log_file, + child_pipe, + self.filter_fn, + ), + ) + self.process.daemon = True # must set before start() + self.process.start() finally: if input_fd: @@ -729,10 +706,7 @@ class winlog: Does not support the use of 'v' toggling as nixlog does. """ - def __init__( - self, file_like=None, echo=False, debug=0, buffer=False, env=None, filter_fn=None - ): - self.env = env + def __init__(self, file_like=None, echo=False, debug=0, buffer=False, filter_fn=None): self.debug = debug self.echo = echo self.logfile = file_like @@ -789,11 +763,10 @@ def background_reader(reader, echo_writer, _kill): reader.close() self._active = True - with replace_environment(self.env): - self._thread = Thread( - target=background_reader, args=(self.reader, self.echo_writer, self._kill) - ) - self._thread.start() + self._thread = Thread( + target=background_reader, args=(self.reader, self.echo_writer, self._kill) + ) + self._thread.start() return self def __exit__(self, exc_type, exc_val, exc_tb): @@ -918,7 +891,7 @@ def _writer_daemon( try: if stdin_file.read(1) == "v": echo = not echo - except IOError as e: + except OSError as e: # If SIGTTIN is ignored, the system gives EIO # to let the caller know the read failed b/c it # was in the bg. Ignore that too. @@ -1013,7 +986,7 @@ def wrapped(*args, **kwargs): while True: try: return function(*args, **kwargs) - except IOError as e: + except OSError as e: if e.errno == errno.EINTR: continue raise diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index 176835c2102793..7de392cf51ec71 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -10,7 +10,7 @@ import spack.util.git #: PEP440 canonical ... string -__version__ = "0.24.0.dev0" +__version__ = "1.0.0.dev0" spack_version = __version__ diff --git a/lib/spack/spack/audit.py b/lib/spack/spack/audit.py index 28f39dbd416bef..a93e151636eea9 100644 --- a/lib/spack/spack/audit.py +++ b/lib/spack/spack/audit.py @@ -1010,7 +1010,7 @@ def _issues_in_depends_on_directive(pkgs, error_cls): for dep_name, dep in deps_by_name.items(): def check_virtual_with_variants(spec, msg): - if not spec.virtual or not spec.variants: + if not spack.repo.PATH.is_virtual(spec.name) or not spec.variants: return error = error_cls( f"{pkg_name}: {msg}", @@ -1356,14 +1356,8 @@ def _test_detection_by_executable(pkgs, debug_log, error_cls): def _compare_extra_attribute(_expected, _detected, *, _spec): result = [] - # Check items are of the same type - if not isinstance(_detected, type(_expected)): - _summary = f'{pkg_name}: error when trying to detect "{_expected}"' - _details = [f"{_detected} was detected instead"] - return [error_cls(summary=_summary, details=_details)] - # If they are string expected is a regex - if isinstance(_expected, str): + if isinstance(_expected, str) and isinstance(_detected, str): try: _regex = re.compile(_expected) except re.error: @@ -1379,7 +1373,7 @@ def _compare_extra_attribute(_expected, _detected, *, _spec): _details = [f"{_detected} does not match the regex"] return [error_cls(summary=_summary, details=_details)] - if isinstance(_expected, dict): + elif isinstance(_expected, dict) and isinstance(_detected, dict): _not_detected = set(_expected.keys()) - set(_detected.keys()) if _not_detected: _summary = f"{pkg_name}: cannot detect some attributes for spec {_spec}" @@ -1394,6 +1388,10 @@ def _compare_extra_attribute(_expected, _detected, *, _spec): result.extend( _compare_extra_attribute(_expected[_key], _detected[_key], _spec=_spec) ) + else: + _summary = f'{pkg_name}: error when trying to detect "{_expected}"' + _details = [f"{_detected} was detected instead"] + return [error_cls(summary=_summary, details=_details)] return result diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index 4bc6eae7540ad6..53aaa764e6bd32 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -5,6 +5,7 @@ import codecs import collections import concurrent.futures +import contextlib import copy import hashlib import io @@ -91,6 +92,9 @@ CURRENT_BUILD_CACHE_LAYOUT_VERSION = 2 +INDEX_HASH_FILE = "index.json.hash" + + class BuildCacheDatabase(spack_db.Database): """A database for binary buildcaches. @@ -502,7 +506,7 @@ def _fetch_and_cache_index(self, mirror_url, cache_entry={}): scheme = urllib.parse.urlparse(mirror_url).scheme if scheme != "oci" and not web_util.url_exists( - url_util.join(mirror_url, BUILD_CACHE_RELATIVE_PATH, "index.json") + url_util.join(mirror_url, BUILD_CACHE_RELATIVE_PATH, spack_db.INDEX_JSON_FILE) ): return False @@ -704,7 +708,7 @@ def _read_specs_and_push_index( # Now generate the index, compute its hash, and push the two files to # the mirror. - index_json_path = os.path.join(temp_dir, "index.json") + index_json_path = os.path.join(temp_dir, spack_db.INDEX_JSON_FILE) with open(index_json_path, "w", encoding="utf-8") as f: db._write_to_file(f) @@ -714,14 +718,14 @@ def _read_specs_and_push_index( index_hash = compute_hash(index_string) # Write the hash out to a local file - index_hash_path = os.path.join(temp_dir, "index.json.hash") + index_hash_path = os.path.join(temp_dir, INDEX_HASH_FILE) with open(index_hash_path, "w", encoding="utf-8") as f: f.write(index_hash) # Push the index itself web_util.push_to_url( index_json_path, - url_util.join(cache_prefix, "index.json"), + url_util.join(cache_prefix, spack_db.INDEX_JSON_FILE), keep_original=False, extra_args={"ContentType": "application/json", "CacheControl": "no-cache"}, ) @@ -729,7 +733,7 @@ def _read_specs_and_push_index( # Push the hash web_util.push_to_url( index_hash_path, - url_util.join(cache_prefix, "index.json.hash"), + url_util.join(cache_prefix, INDEX_HASH_FILE), keep_original=False, extra_args={"ContentType": "text/plain", "CacheControl": "no-cache"}, ) @@ -798,7 +802,7 @@ def url_read_method(url): try: _, _, spec_file = web_util.read_from_url(url) contents = codecs.getreader("utf-8")(spec_file).read() - except web_util.SpackWebError as e: + except (web_util.SpackWebError, OSError) as e: tty.error(f"Error reading specfile: {url}: {e}") return contents @@ -919,7 +923,7 @@ class FileTypes: UNKNOWN = 2 -NOT_ISO8859_1_TEXT = re.compile(b"[\x00\x7F-\x9F]") +NOT_ISO8859_1_TEXT = re.compile(b"[\x00\x7f-\x9f]") def file_type(f: IO[bytes]) -> int: @@ -1785,7 +1789,7 @@ def _oci_update_index( db.mark(spec, "in_buildcache", True) # Create the index.json file - index_json_path = os.path.join(tmpdir, "index.json") + index_json_path = os.path.join(tmpdir, spack_db.INDEX_JSON_FILE) with open(index_json_path, "w", encoding="utf-8") as f: db._write_to_file(f) @@ -2006,7 +2010,7 @@ def fetch_url_to_mirror(url): # Download the config = spec.json and the relevant tarball try: - manifest = json.loads(response.read()) + manifest = json.load(response) spec_digest = spack.oci.image.Digest.from_string(manifest["config"]["digest"]) tarball_digest = spack.oci.image.Digest.from_string( manifest["layers"][-1]["digest"] @@ -2166,7 +2170,8 @@ def dedupe_hardlinks_if_necessary(root, buildinfo): def relocate_package(spec: spack.spec.Spec) -> None: """Relocate binaries and text files in the given spec prefix, based on its buildinfo file.""" - buildinfo = read_buildinfo_file(spec.prefix) + spec_prefix = str(spec.prefix) + buildinfo = read_buildinfo_file(spec_prefix) old_layout_root = str(buildinfo["buildpath"]) # Warn about old style tarballs created with the --rel flag (removed in Spack v0.20) @@ -2187,7 +2192,7 @@ def relocate_package(spec: spack.spec.Spec) -> None: "and an older buildcache create implementation. It cannot be relocated." ) - prefix_to_prefix = {} + prefix_to_prefix: Dict[str, str] = {} if "sbang_install_path" in buildinfo: old_sbang_install_path = str(buildinfo["sbang_install_path"]) @@ -2239,12 +2244,12 @@ def relocate_package(spec: spack.spec.Spec) -> None: tty.debug(f"Relocating: {old} => {new}.") # Old archives may have hardlinks repeated. - dedupe_hardlinks_if_necessary(spec.prefix, buildinfo) + dedupe_hardlinks_if_necessary(spec_prefix, buildinfo) # Text files containing the prefix text - textfiles = [os.path.join(spec.prefix, f) for f in buildinfo["relocate_textfiles"]] - binaries = [os.path.join(spec.prefix, f) for f in buildinfo.get("relocate_binaries")] - links = [os.path.join(spec.prefix, f) for f in buildinfo.get("relocate_links", [])] + textfiles = [os.path.join(spec_prefix, f) for f in buildinfo["relocate_textfiles"]] + binaries = [os.path.join(spec_prefix, f) for f in buildinfo.get("relocate_binaries")] + links = [os.path.join(spec_prefix, f) for f in buildinfo.get("relocate_links", [])] platform = spack.platforms.by_name(spec.platform) if "macho" in platform.binary_formats: @@ -2266,6 +2271,24 @@ def relocate_package(spec: spack.spec.Spec) -> None: with fsys.edit_in_place_through_temporary_file(binary) as tmp_binary: codesign("-fs-", tmp_binary) + install_manifest = os.path.join( + spec.prefix, + spack.store.STORE.layout.metadata_dir, + spack.store.STORE.layout.manifest_file_name, + ) + if not os.path.exists(install_manifest): + spec_id = spec.format("{name}/{hash:7}") + tty.warn("No manifest file in tarball for spec %s" % spec_id) + + # overwrite old metadata with new + if spec.spliced: + # rewrite spec on disk + spack.store.STORE.layout.write_spec(spec, spack.store.STORE.layout.spec_file_path(spec)) + + # de-cache the install manifest + with contextlib.suppress(FileNotFoundError): + os.unlink(install_manifest) + def _extract_inner_tarball(spec, filename, extract_to, signature_required: bool, remote_checksum): stagepath = os.path.dirname(filename) @@ -2432,15 +2455,6 @@ def extract_tarball(spec, download_result, force=False, timer=timer.NULL_TIMER): except Exception as e: shutil.rmtree(spec.prefix, ignore_errors=True) raise e - else: - manifest_file = os.path.join( - spec.prefix, - spack.store.STORE.layout.metadata_dir, - spack.store.STORE.layout.manifest_file_name, - ) - if not os.path.exists(manifest_file): - spec_id = spec.format("{name}/{hash:7}") - tty.warn("No manifest file in tarball for spec %s" % spec_id) finally: if tmpdir: shutil.rmtree(tmpdir, ignore_errors=True) @@ -2515,10 +2529,10 @@ def install_root_node( allow_missing: when true, allows installing a node with missing dependencies """ # Early termination - if spec.external or spec.virtual: - warnings.warn("Skipping external or virtual package {0}".format(spec.format())) + if spec.external or not spec.concrete: + warnings.warn("Skipping external or abstract spec {0}".format(spec.format())) return - elif spec.concrete and spec.installed and not force: + elif spec.installed and not force: warnings.warn("Package for spec {0} already installed.".format(spec.format())) return @@ -2545,10 +2559,6 @@ def install_root_node( tty.msg('Installing "{0}" from a buildcache'.format(spec.format())) extract_tarball(spec, download_result, force) spec.package.windows_establish_runtime_linkage() - if spec.spliced: # overwrite old metadata with new - spack.store.STORE.layout.write_spec( - spec, spack.store.STORE.layout.spec_file_path(spec) - ) spack.hooks.post_install(spec, False) spack.store.STORE.db.add(spec, allow_missing=allow_missing) @@ -2586,11 +2596,14 @@ def try_direct_fetch(spec, mirrors=None): ) try: _, _, fs = web_util.read_from_url(buildcache_fetch_url_signed_json) + specfile_contents = codecs.getreader("utf-8")(fs).read() specfile_is_signed = True - except web_util.SpackWebError as e1: + except (web_util.SpackWebError, OSError) as e1: try: _, _, fs = web_util.read_from_url(buildcache_fetch_url_json) - except web_util.SpackWebError as e2: + specfile_contents = codecs.getreader("utf-8")(fs).read() + specfile_is_signed = False + except (web_util.SpackWebError, OSError) as e2: tty.debug( f"Did not find {specfile_name} on {buildcache_fetch_url_signed_json}", e1, @@ -2600,7 +2613,6 @@ def try_direct_fetch(spec, mirrors=None): f"Did not find {specfile_name} on {buildcache_fetch_url_json}", e2, level=2 ) continue - specfile_contents = codecs.getreader("utf-8")(fs).read() # read the spec from the build cache file. All specs in build caches # are concrete (as they are built) so we need to mark this spec @@ -2694,8 +2706,9 @@ def get_keys(install=False, trust=False, force=False, mirrors=None): try: _, _, json_file = web_util.read_from_url(keys_index) - json_index = sjson.load(codecs.getreader("utf-8")(json_file)) - except web_util.SpackWebError as url_err: + json_index = sjson.load(json_file) + except (web_util.SpackWebError, OSError, ValueError) as url_err: + # TODO: avoid repeated request if web_util.url_exists(keys_index): tty.error( f"Unable to find public keys in {url_util.format(fetch_url)}," @@ -2942,14 +2955,14 @@ def __init__(self, url, local_hash, urlopen=web_util.urlopen): def get_remote_hash(self): # Failure to fetch index.json.hash is not fatal - url_index_hash = url_util.join(self.url, BUILD_CACHE_RELATIVE_PATH, "index.json.hash") + url_index_hash = url_util.join(self.url, BUILD_CACHE_RELATIVE_PATH, INDEX_HASH_FILE) try: response = self.urlopen(urllib.request.Request(url_index_hash, headers=self.headers)) - except (TimeoutError, urllib.error.URLError): + remote_hash = response.read(64) + except OSError: return None # Validate the hash - remote_hash = response.read(64) if not re.match(rb"[a-f\d]{64}$", remote_hash): return None return remote_hash.decode("utf-8") @@ -2963,17 +2976,17 @@ def conditional_fetch(self) -> FetchIndexResult: return FetchIndexResult(etag=None, hash=None, data=None, fresh=True) # Otherwise, download index.json - url_index = url_util.join(self.url, BUILD_CACHE_RELATIVE_PATH, "index.json") + url_index = url_util.join(self.url, BUILD_CACHE_RELATIVE_PATH, spack_db.INDEX_JSON_FILE) try: response = self.urlopen(urllib.request.Request(url_index, headers=self.headers)) - except (TimeoutError, urllib.error.URLError) as e: - raise FetchIndexError("Could not fetch index from {}".format(url_index), e) from e + except OSError as e: + raise FetchIndexError(f"Could not fetch index from {url_index}", e) from e try: result = codecs.getreader("utf-8")(response).read() - except ValueError as e: - raise FetchIndexError("Remote index {} is invalid".format(url_index), e) from e + except (ValueError, OSError) as e: + raise FetchIndexError(f"Remote index {url_index} is invalid") from e computed_hash = compute_hash(result) @@ -3007,7 +3020,7 @@ def __init__(self, url, etag, urlopen=web_util.urlopen): def conditional_fetch(self) -> FetchIndexResult: # Just do a conditional fetch immediately - url = url_util.join(self.url, BUILD_CACHE_RELATIVE_PATH, "index.json") + url = url_util.join(self.url, BUILD_CACHE_RELATIVE_PATH, spack_db.INDEX_JSON_FILE) headers = {"User-Agent": web_util.SPACK_USER_AGENT, "If-None-Match": f'"{self.etag}"'} try: @@ -3017,12 +3030,12 @@ def conditional_fetch(self) -> FetchIndexResult: # Not modified; that means fresh. return FetchIndexResult(etag=None, hash=None, data=None, fresh=True) raise FetchIndexError(f"Could not fetch index {url}", e) from e - except (TimeoutError, urllib.error.URLError) as e: + except OSError as e: # URLError, socket.timeout, etc. raise FetchIndexError(f"Could not fetch index {url}", e) from e try: result = codecs.getreader("utf-8")(response).read() - except ValueError as e: + except (ValueError, OSError) as e: raise FetchIndexError(f"Remote index {url} is invalid", e) from e headers = response.headers @@ -3054,11 +3067,11 @@ def conditional_fetch(self) -> FetchIndexResult: headers={"Accept": "application/vnd.oci.image.manifest.v1+json"}, ) ) - except (TimeoutError, urllib.error.URLError) as e: + except OSError as e: raise FetchIndexError(f"Could not fetch manifest from {url_manifest}", e) from e try: - manifest = json.loads(response.read()) + manifest = json.load(response) except Exception as e: raise FetchIndexError(f"Remote index {url_manifest} is invalid", e) from e @@ -3073,14 +3086,16 @@ def conditional_fetch(self) -> FetchIndexResult: return FetchIndexResult(etag=None, hash=None, data=None, fresh=True) # Otherwise fetch the blob / index.json - response = self.urlopen( - urllib.request.Request( - url=self.ref.blob_url(index_digest), - headers={"Accept": "application/vnd.oci.image.layer.v1.tar+gzip"}, + try: + response = self.urlopen( + urllib.request.Request( + url=self.ref.blob_url(index_digest), + headers={"Accept": "application/vnd.oci.image.layer.v1.tar+gzip"}, + ) ) - ) - - result = codecs.getreader("utf-8")(response).read() + result = codecs.getreader("utf-8")(response).read() + except (OSError, ValueError) as e: + raise FetchIndexError(f"Remote index {url_manifest} is invalid", e) from e # Make sure the blob we download has the advertised hash if compute_hash(result) != index_digest.digest: diff --git a/lib/spack/spack/bootstrap/_common.py b/lib/spack/spack/bootstrap/_common.py index e0120777415f83..2002f51339e66b 100644 --- a/lib/spack/spack/bootstrap/_common.py +++ b/lib/spack/spack/bootstrap/_common.py @@ -5,12 +5,14 @@ import fnmatch import glob import importlib -import os.path +import os import re import sys import sysconfig import warnings -from typing import Dict, Optional, Sequence, Union +from typing import Optional, Sequence, Union + +from typing_extensions import TypedDict import archspec.cpu @@ -18,13 +20,17 @@ from llnl.util import tty import spack.platforms +import spack.spec import spack.store import spack.util.environment import spack.util.executable from .config import spec_for_current_python -QueryInfo = Dict[str, "spack.spec.Spec"] + +class QueryInfo(TypedDict, total=False): + spec: spack.spec.Spec + command: spack.util.executable.Executable def _python_import(module: str) -> bool: @@ -211,7 +217,9 @@ def _executables_in_store( ): spack.util.environment.path_put_first("PATH", [bin_dir]) if query_info is not None: - query_info["command"] = spack.util.executable.which(*executables, path=bin_dir) + query_info["command"] = spack.util.executable.which( + *executables, path=bin_dir, required=True + ) query_info["spec"] = concrete_spec return True return False diff --git a/lib/spack/spack/bootstrap/clingo.py b/lib/spack/spack/bootstrap/clingo.py index c55addf12f21c8..17a86baf39d08e 100644 --- a/lib/spack/spack/bootstrap/clingo.py +++ b/lib/spack/spack/bootstrap/clingo.py @@ -27,9 +27,9 @@ class ClingoBootstrapConcretizer: def __init__(self, configuration): self.host_platform = spack.platforms.host() - self.host_os = self.host_platform.operating_system("frontend") + self.host_os = self.host_platform.default_operating_system() self.host_target = archspec.cpu.host().family - self.host_architecture = spack.spec.ArchSpec.frontend_arch() + self.host_architecture = spack.spec.ArchSpec.default_arch() self.host_architecture.target = str(self.host_target) self.host_compiler = self._valid_compiler_or_raise() self.host_python = self.python_external_spec() diff --git a/lib/spack/spack/bootstrap/config.py b/lib/spack/spack/bootstrap/config.py index c6050550e04c69..43dd6dc51f6c4d 100644 --- a/lib/spack/spack/bootstrap/config.py +++ b/lib/spack/spack/bootstrap/config.py @@ -4,7 +4,7 @@ """Manage configuration swapping for bootstrapping purposes""" import contextlib -import os.path +import os import sys from typing import Any, Dict, Generator, MutableSequence, Sequence @@ -139,7 +139,7 @@ def _bootstrap_config_scopes() -> Sequence["spack.config.ConfigScope"]: def _add_compilers_if_missing() -> None: - arch = spack.spec.ArchSpec.frontend_arch() + arch = spack.spec.ArchSpec.default_arch() if not spack.compilers.compilers_for_arch(arch): spack.compilers.find_compilers() diff --git a/lib/spack/spack/bootstrap/core.py b/lib/spack/spack/bootstrap/core.py index 022dbc384934bc..5f40159a8c93bf 100644 --- a/lib/spack/spack/bootstrap/core.py +++ b/lib/spack/spack/bootstrap/core.py @@ -25,7 +25,6 @@ import functools import json import os -import os.path import sys import uuid from typing import Any, Callable, Dict, List, Optional, Tuple @@ -34,8 +33,10 @@ from llnl.util.lang import GroupedExceptionHandler import spack.binary_distribution +import spack.concretize import spack.config import spack.detection +import spack.error import spack.mirrors.mirror import spack.platforms import spack.spec @@ -44,10 +45,17 @@ import spack.util.executable import spack.util.path import spack.util.spack_yaml +import spack.util.url import spack.version from spack.installer import PackageInstaller -from ._common import _executables_in_store, _python_import, _root_spec, _try_import_from_store +from ._common import ( + QueryInfo, + _executables_in_store, + _python_import, + _root_spec, + _try_import_from_store, +) from .clingo import ClingoBootstrapConcretizer from .config import spack_python_interpreter, spec_for_current_python @@ -89,8 +97,12 @@ def __init__(self, conf: ConfigDictionary) -> None: self.name = conf["name"] self.metadata_dir = spack.util.path.canonicalize_path(conf["metadata"]) - # Promote (relative) paths to file urls - self.url = spack.mirrors.mirror.Mirror(conf["info"]["url"]).fetch_url + # Check for relative paths, and turn them into absolute paths + # root is the metadata_dir + maybe_url = conf["info"]["url"] + if spack.util.url.is_path_instead_of_url(maybe_url) and not os.path.isabs(maybe_url): + maybe_url = os.path.join(self.metadata_dir, maybe_url) + self.url = spack.mirrors.mirror.Mirror(maybe_url).fetch_url @property def mirror_scope(self) -> spack.config.InternalConfigScope: @@ -134,7 +146,7 @@ class BuildcacheBootstrapper(Bootstrapper): def __init__(self, conf) -> None: super().__init__(conf) - self.last_search: Optional[ConfigDictionary] = None + self.last_search: Optional[QueryInfo] = None self.config_scope_name = f"bootstrap_buildcache-{uuid.uuid4()}" @staticmethod @@ -211,14 +223,14 @@ def _install_and_test( for _, pkg_hash, pkg_sha256 in item["binaries"]: self._install_by_hash(pkg_hash, pkg_sha256, bincache_platform) - info: ConfigDictionary = {} + info: QueryInfo = {} if test_fn(query_spec=abstract_spec, query_info=info): self.last_search = info return True return False def try_import(self, module: str, abstract_spec_str: str) -> bool: - info: ConfigDictionary + info: QueryInfo test_fn, info = functools.partial(_try_import_from_store, module), {} if test_fn(query_spec=abstract_spec_str, query_info=info): return True @@ -231,7 +243,7 @@ def try_import(self, module: str, abstract_spec_str: str) -> bool: return self._install_and_test(abstract_spec, bincache_platform, data, test_fn) def try_search_path(self, executables: Tuple[str], abstract_spec_str: str) -> bool: - info: ConfigDictionary + info: QueryInfo test_fn, info = functools.partial(_executables_in_store, executables), {} if test_fn(query_spec=abstract_spec_str, query_info=info): self.last_search = info @@ -249,11 +261,11 @@ class SourceBootstrapper(Bootstrapper): def __init__(self, conf) -> None: super().__init__(conf) - self.last_search: Optional[ConfigDictionary] = None + self.last_search: Optional[QueryInfo] = None self.config_scope_name = f"bootstrap_source-{uuid.uuid4()}" def try_import(self, module: str, abstract_spec_str: str) -> bool: - info: ConfigDictionary = {} + info: QueryInfo = {} if _try_import_from_store(module, abstract_spec_str, query_info=info): self.last_search = info return True @@ -270,17 +282,22 @@ def try_import(self, module: str, abstract_spec_str: str) -> bool: bootstrapper = ClingoBootstrapConcretizer(configuration=spack.config.CONFIG) concrete_spec = bootstrapper.concretize() else: - concrete_spec = spack.spec.Spec( + abstract_spec = spack.spec.Spec( abstract_spec_str + " ^" + spec_for_current_python() ) - concrete_spec.concretize() + concrete_spec = spack.concretize.concretize_one(abstract_spec) msg = "[BOOTSTRAP MODULE {0}] Try installing '{1}' from sources" tty.debug(msg.format(module, abstract_spec_str)) # Install the spec that should make the module importable with spack.config.override(self.mirror_scope): - PackageInstaller([concrete_spec.package], fail_fast=True).install() + PackageInstaller( + [concrete_spec.package], + fail_fast=True, + package_use_cache=False, + dependencies_use_cache=False, + ).install() if _try_import_from_store(module, query_spec=concrete_spec, query_info=info): self.last_search = info @@ -288,7 +305,7 @@ def try_import(self, module: str, abstract_spec_str: str) -> bool: return False def try_search_path(self, executables: Tuple[str], abstract_spec_str: str) -> bool: - info: ConfigDictionary = {} + info: QueryInfo = {} if _executables_in_store(executables, abstract_spec_str, query_info=info): self.last_search = info return True @@ -299,7 +316,7 @@ def try_search_path(self, executables: Tuple[str], abstract_spec_str: str) -> bo # might reduce compilation time by a fair amount _add_externals_if_missing() - concrete_spec = spack.spec.Spec(abstract_spec_str).concretized() + concrete_spec = spack.concretize.concretize_one(abstract_spec_str) msg = "[BOOTSTRAP] Try installing '{0}' from sources" tty.debug(msg.format(abstract_spec_str)) with spack.config.override(self.mirror_scope): @@ -316,11 +333,9 @@ def create_bootstrapper(conf: ConfigDictionary): return _bootstrap_methods[btype](conf) -def source_is_enabled_or_raise(conf: ConfigDictionary): - """Raise ValueError if the source is not enabled for bootstrapping""" - trusted, name = spack.config.get("bootstrap:trusted"), conf["name"] - if not trusted.get(name, False): - raise ValueError("source is not trusted") +def source_is_enabled(conf: ConfigDictionary) -> bool: + """Returns true if the source is not enabled for bootstrapping""" + return spack.config.get("bootstrap:trusted").get(conf["name"], False) def ensure_module_importable_or_raise(module: str, abstract_spec: Optional[str] = None): @@ -350,24 +365,24 @@ def ensure_module_importable_or_raise(module: str, abstract_spec: Optional[str] exception_handler = GroupedExceptionHandler() for current_config in bootstrapping_sources(): + if not source_is_enabled(current_config): + continue + with exception_handler.forward(current_config["name"], Exception): - source_is_enabled_or_raise(current_config) - current_bootstrapper = create_bootstrapper(current_config) - if current_bootstrapper.try_import(module, abstract_spec): + if create_bootstrapper(current_config).try_import(module, abstract_spec): return - assert exception_handler, ( - f"expected at least one exception to have been raised at this point: " - f"while bootstrapping {module}" - ) msg = f'cannot bootstrap the "{module}" Python module ' if abstract_spec: msg += f'from spec "{abstract_spec}" ' - if tty.is_debug(): + + if not exception_handler: + msg += ": no bootstrapping sources are enabled" + elif spack.error.debug or spack.error.SHOW_BACKTRACE: msg += exception_handler.grouped_message(with_tracebacks=True) else: msg += exception_handler.grouped_message(with_tracebacks=False) - msg += "\nRun `spack --debug ...` for more detailed errors" + msg += "\nRun `spack --backtrace ...` for more detailed errors" raise ImportError(msg) @@ -405,8 +420,9 @@ def ensure_executables_in_path_or_raise( exception_handler = GroupedExceptionHandler() for current_config in bootstrapping_sources(): + if not source_is_enabled(current_config): + continue with exception_handler.forward(current_config["name"], Exception): - source_is_enabled_or_raise(current_config) current_bootstrapper = create_bootstrapper(current_config) if current_bootstrapper.try_search_path(executables, abstract_spec): # Additional environment variables needed @@ -414,6 +430,7 @@ def ensure_executables_in_path_or_raise( current_bootstrapper.last_search["spec"], current_bootstrapper.last_search["command"], ) + assert cmd is not None, "expected an Executable" cmd.add_default_envmod( spack.user_environment.environment_modifications_for_specs( concrete_spec, set_package_py_globals=False @@ -421,18 +438,17 @@ def ensure_executables_in_path_or_raise( ) return cmd - assert exception_handler, ( - f"expected at least one exception to have been raised at this point: " - f"while bootstrapping {executables_str}" - ) msg = f"cannot bootstrap any of the {executables_str} executables " if abstract_spec: msg += f'from spec "{abstract_spec}" ' - if tty.is_debug(): + + if not exception_handler: + msg += ": no bootstrapping sources are enabled" + elif spack.error.debug or spack.error.SHOW_BACKTRACE: msg += exception_handler.grouped_message(with_tracebacks=True) else: msg += exception_handler.grouped_message(with_tracebacks=False) - msg += "\nRun `spack --debug ...` for more detailed errors" + msg += "\nRun `spack --backtrace ...` for more detailed errors" raise RuntimeError(msg) diff --git a/lib/spack/spack/bootstrap/status.py b/lib/spack/spack/bootstrap/status.py index 27d1366dcea5e5..1626fe8115832d 100644 --- a/lib/spack/spack/bootstrap/status.py +++ b/lib/spack/spack/bootstrap/status.py @@ -63,7 +63,6 @@ def _missing(name: str, purpose: str, system_only: bool = True) -> str: def _core_requirements() -> List[RequiredResponseType]: _core_system_exes = { - "make": _missing("make", "required to build software from sources"), "patch": _missing("patch", "required to patch source code before building"), "tar": _missing("tar", "required to manage code archives"), "gzip": _missing("gzip", "required to compress/decompress code archives"), diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index e240c996defd56..3e1663131c00fb 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -301,11 +301,13 @@ def clean_environment(): env.unset("CPLUS_INCLUDE_PATH") env.unset("OBJC_INCLUDE_PATH") + # prevent configure scripts from sourcing variables from config site file (AC_SITE_LOAD). + env.set("CONFIG_SITE", os.devnull) env.unset("CMAKE_PREFIX_PATH") + env.unset("PYTHONPATH") env.unset("R_HOME") env.unset("R_ENVIRON") - env.unset("LUA_PATH") env.unset("LUA_CPATH") diff --git a/lib/spack/spack/build_systems/aspell_dict.py b/lib/spack/spack/build_systems/aspell_dict.py index fcaa2c0cb5e72d..50ad140d29c1d6 100644 --- a/lib/spack/spack/build_systems/aspell_dict.py +++ b/lib/spack/spack/build_systems/aspell_dict.py @@ -6,7 +6,9 @@ import llnl.util.filesystem as fs import spack.directives +import spack.spec import spack.util.executable +import spack.util.prefix from .autotools import AutotoolsBuilder, AutotoolsPackage @@ -17,19 +19,18 @@ class AspellBuilder(AutotoolsBuilder): to the Aspell extensions. """ - def configure(self, pkg, spec, prefix): + def configure( + self, + pkg: "AspellDictPackage", # type: ignore[override] + spec: spack.spec.Spec, + prefix: spack.util.prefix.Prefix, + ): aspell = spec["aspell"].prefix.bin.aspell prezip = spec["aspell"].prefix.bin.prezip destdir = prefix - sh = spack.util.executable.which("sh") - sh( - "./configure", - "--vars", - "ASPELL={0}".format(aspell), - "PREZIP={0}".format(prezip), - "DESTDIR={0}".format(destdir), - ) + sh = spack.util.executable.Executable("/bin/sh") + sh("./configure", "--vars", f"ASPELL={aspell}", f"PREZIP={prezip}", f"DESTDIR={destdir}") # Aspell dictionaries install their bits into their prefix.lib diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index 83630cf7a7ba18..75b7a2f984d760 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import stat import subprocess from typing import Callable, List, Optional, Set, Tuple, Union @@ -356,6 +355,13 @@ def _do_patch_libtool_configure(self) -> None: ) # Support Libtool 2.4.2 and older: x.filter(regex=r'^(\s*test \$p = "-R")(; then\s*)$', repl=r'\1 || test x-l = x"$p"\2') + # Configure scripts generated with libtool < 2.5.4 have a faulty test for the + # -single_module linker flag. A deprecation warning makes it think the default is + # -multi_module, triggering it to use problematic linker flags (such as ld -r). The + # linker default is `-single_module` from (ancient) macOS 10.4, so override by setting + # `lt_cv_apple_cc_single_mod=yes`. See the fix in libtool commit + # 82f7f52123e4e7e50721049f7fa6f9b870e09c9d. + x.filter("lt_cv_apple_cc_single_mod=no", "lt_cv_apple_cc_single_mod=yes", string=True) @spack.phase_callbacks.run_after("configure") def _do_patch_libtool(self) -> None: @@ -527,7 +533,7 @@ def build_directory(self) -> str: return build_dir @spack.phase_callbacks.run_before("autoreconf") - def delete_configure_to_force_update(self) -> None: + def _delete_configure_to_force_update(self) -> None: if self.force_autoreconf: fs.force_remove(self.configure_abs_path) @@ -540,7 +546,7 @@ def autoreconf_search_path_args(self) -> List[str]: return _autoreconf_search_path_args(self.spec) @spack.phase_callbacks.run_after("autoreconf") - def set_configure_or_die(self) -> None: + def _set_configure_or_die(self) -> None: """Ensure the presence of a "configure" script, or raise. If the "configure" is found, a module level attribute is set. @@ -564,10 +570,7 @@ def configure_args(self) -> List[str]: return [] def autoreconf( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: AutotoolsPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Not needed usually, configure should be already there""" @@ -596,10 +599,7 @@ def autoreconf( self.pkg.module.autoreconf(*autoreconf_args) def configure( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: AutotoolsPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Run "configure", with the arguments specified by the builder and an appropriately set prefix. @@ -612,10 +612,7 @@ def configure( pkg.module.configure(*options) def build( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: AutotoolsPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Run "make" on the build targets specified by the builder.""" # See https://autotools.io/automake/silent.html @@ -625,10 +622,7 @@ def build( pkg.module.make(*params) def install( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: AutotoolsPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Run "make" on the install targets specified by the builder.""" with fs.working_dir(self.build_directory): @@ -825,7 +819,7 @@ def installcheck(self) -> None: self.pkg._if_make_target_execute("installcheck") @spack.phase_callbacks.run_after("install") - def remove_libtool_archives(self) -> None: + def _remove_libtool_archives(self) -> None: """Remove all .la files in prefix sub-folders if the package sets ``install_libtool_archives`` to be False. """ diff --git a/lib/spack/spack/build_systems/cached_cmake.py b/lib/spack/spack/build_systems/cached_cmake.py index 5d14693817fe71..eb9bfb1d511211 100644 --- a/lib/spack/spack/build_systems/cached_cmake.py +++ b/lib/spack/spack/build_systems/cached_cmake.py @@ -10,6 +10,9 @@ import llnl.util.tty as tty import spack.phase_callbacks +import spack.spec +import spack.util.prefix +from spack.directives import depends_on from .cmake import CMakeBuilder, CMakePackage @@ -293,6 +296,13 @@ def initconfig_hardware_entries(self): entries.append(cmake_cache_string("AMDGPU_TARGETS", arch_str)) entries.append(cmake_cache_string("GPU_TARGETS", arch_str)) + if spec.satisfies("%gcc"): + entries.append( + cmake_cache_string( + "CMAKE_HIP_FLAGS", f"--gcc-toolchain={self.pkg.compiler.prefix}" + ) + ) + return entries def std_initconfig_entries(self): @@ -323,7 +333,9 @@ def initconfig_package_entries(self): """This method is to be overwritten by the package""" return [] - def initconfig(self, pkg, spec, prefix): + def initconfig( + self, pkg: "CachedCMakePackage", spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: cache_entries = ( self.std_initconfig_entries() + self.initconfig_compiler_entries() @@ -360,6 +372,10 @@ class CachedCMakePackage(CMakePackage): CMakeBuilder = CachedCMakeBuilder + # These dependencies are assumed in the builder + depends_on("c", type="build") + depends_on("cxx", type="build") + def flag_handler(self, name, flags): if name in ("cflags", "cxxflags", "cppflags", "fflags"): return None, None, None # handled in the cmake cache diff --git a/lib/spack/spack/build_systems/cargo.py b/lib/spack/spack/build_systems/cargo.py index 2e5c6e4ffc0f4d..b94d1e87b2544b 100644 --- a/lib/spack/spack/build_systems/cargo.py +++ b/lib/spack/spack/build_systems/cargo.py @@ -7,6 +7,8 @@ import spack.builder import spack.package_base import spack.phase_callbacks +import spack.spec +import spack.util.prefix from spack.directives import build_system, depends_on from spack.multimethod import when @@ -68,10 +70,16 @@ def build_directory(self): """Return the directory containing the main Cargo.toml.""" return self.pkg.stage.source_path + @property + def std_build_args(self): + """Standard arguments for ``cargo build`` provided as a property for + convenience of package writers.""" + return ["-j", str(self.pkg.module.make_jobs)] + @property def build_args(self): """Arguments for ``cargo build``.""" - return ["-j", str(self.pkg.module.make_jobs)] + return [] @property def check_args(self): @@ -81,12 +89,18 @@ def check_args(self): def setup_build_environment(self, env): env.set("CARGO_HOME", self.stage.path) - def build(self, pkg, spec, prefix): + def build( + self, pkg: CargoPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Runs ``cargo install`` in the source directory""" with fs.working_dir(self.build_directory): - pkg.module.cargo("install", "--root", "out", "--path", ".", *self.build_args) + pkg.module.cargo( + "install", "--root", "out", "--path", ".", *self.std_build_args, *self.build_args + ) - def install(self, pkg, spec, prefix): + def install( + self, pkg: CargoPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Copy build files into package prefix.""" with fs.working_dir(self.build_directory): fs.install_tree("out", prefix) diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index 698ed45ae1d517..6391158ed38c96 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -13,6 +13,7 @@ import archspec.cpu import llnl.util.filesystem as fs +from llnl.util import tty from llnl.util.lang import stable_partition import spack.builder @@ -460,18 +461,27 @@ def cmake_args(self) -> List[str]: return [] def cmake( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: CMakePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Runs ``cmake`` in the build directory""" - # skip cmake phase if it is an incremental develop build - if spec.is_develop and os.path.isfile( - os.path.join(self.build_directory, "CMakeCache.txt") - ): - return + if spec.is_develop: + # skip cmake phase if it is an incremental develop build + + # Determine the files that will re-run CMake that are generated from a successful + # configure step based on state + primary_generator = _extract_primary_generator(self.generator) + configure_artifact = "Makefile" + if primary_generator == "Ninja": + configure_artifact = "ninja.build" + + if os.path.isfile(os.path.join(self.build_directory, configure_artifact)): + tty.msg( + "Incremental build criteria satisfied." + "Skipping CMake configure step. To force configuration run" + f" `spack clean {pkg.name}`" + ) + return options = self.std_cmake_args options += self.cmake_args() @@ -480,10 +490,7 @@ def cmake( pkg.module.cmake(*options) def build( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: CMakePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Make the build targets""" with fs.working_dir(self.build_directory): @@ -494,10 +501,7 @@ def build( pkg.module.ninja(*self.build_targets) def install( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: CMakePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Make the install targets""" with fs.working_dir(self.build_directory): diff --git a/lib/spack/spack/build_systems/cuda.py b/lib/spack/spack/build_systems/cuda.py index 1c8bc5b244f657..b6e7e81868fce6 100644 --- a/lib/spack/spack/build_systems/cuda.py +++ b/lib/spack/spack/build_systems/cuda.py @@ -15,7 +15,7 @@ class CudaPackage(PackageBase): """Auxiliary class which contains CUDA variant, dependencies and conflicts and is meant to unify and facilitate its usage. - Maintainers: ax3l, Rombur, davidbeckingsale + Maintainers: ax3l, Rombur, davidbeckingsale, pauleonix """ # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list @@ -47,6 +47,12 @@ class CudaPackage(PackageBase): "89", "90", "90a", + "100", + "100a", + "101", + "101a", + "120", + "120a", ) # FIXME: keep cuda and cuda_arch separate to make usage easier until @@ -99,39 +105,56 @@ def compute_capabilities(arch_list: Iterable[str]) -> List[str]: # CUDA version vs Architecture # https://en.wikipedia.org/wiki/CUDA#GPUs_supported # https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#deprecated-features + # Tesla support: depends_on("cuda@:6.0", when="cuda_arch=10") depends_on("cuda@:6.5", when="cuda_arch=11") depends_on("cuda@2.1:6.5", when="cuda_arch=12") depends_on("cuda@2.1:6.5", when="cuda_arch=13") + # Fermi support: depends_on("cuda@3.0:8.0", when="cuda_arch=20") depends_on("cuda@3.2:8.0", when="cuda_arch=21") + # Kepler support: depends_on("cuda@5.0:10.2", when="cuda_arch=30") depends_on("cuda@5.0:10.2", when="cuda_arch=32") depends_on("cuda@5.0:11.8", when="cuda_arch=35") depends_on("cuda@6.5:11.8", when="cuda_arch=37") + # Maxwell support: depends_on("cuda@6.0:", when="cuda_arch=50") depends_on("cuda@6.5:", when="cuda_arch=52") depends_on("cuda@6.5:", when="cuda_arch=53") + # Pascal support: depends_on("cuda@8.0:", when="cuda_arch=60") depends_on("cuda@8.0:", when="cuda_arch=61") depends_on("cuda@8.0:", when="cuda_arch=62") + # Volta support: depends_on("cuda@9.0:", when="cuda_arch=70") + # Turing support: depends_on("cuda@9.0:", when="cuda_arch=72") depends_on("cuda@10.0:", when="cuda_arch=75") + # Ampere support: depends_on("cuda@11.0:", when="cuda_arch=80") depends_on("cuda@11.1:", when="cuda_arch=86") depends_on("cuda@11.4:", when="cuda_arch=87") + # Ada support: depends_on("cuda@11.8:", when="cuda_arch=89") + # Hopper support: depends_on("cuda@12.0:", when="cuda_arch=90") depends_on("cuda@12.0:", when="cuda_arch=90a") + # Blackwell support: + depends_on("cuda@12.8:", when="cuda_arch=100") + depends_on("cuda@12.8:", when="cuda_arch=100a") + depends_on("cuda@12.8:", when="cuda_arch=101") + depends_on("cuda@12.8:", when="cuda_arch=101a") + depends_on("cuda@12.8:", when="cuda_arch=120") + depends_on("cuda@12.8:", when="cuda_arch=120a") # From the NVIDIA install guide we know of conflicts for particular # platforms (linux, darwin), architectures (x86, powerpc) and compilers # (gcc, clang). We don't restrict %gcc and %clang conflicts to @@ -163,6 +186,7 @@ def compute_capabilities(arch_list: Iterable[str]) -> List[str]: conflicts("%gcc@12:", when="+cuda ^cuda@:11.8") conflicts("%gcc@13:", when="+cuda ^cuda@:12.3") conflicts("%gcc@14:", when="+cuda ^cuda@:12.6") + conflicts("%gcc@15:", when="+cuda ^cuda@:12.8") conflicts("%clang@12:", when="+cuda ^cuda@:11.4.0") conflicts("%clang@13:", when="+cuda ^cuda@:11.5") conflicts("%clang@14:", when="+cuda ^cuda@:11.7") @@ -171,6 +195,7 @@ def compute_capabilities(arch_list: Iterable[str]) -> List[str]: conflicts("%clang@17:", when="+cuda ^cuda@:12.3") conflicts("%clang@18:", when="+cuda ^cuda@:12.5") conflicts("%clang@19:", when="+cuda ^cuda@:12.6") + conflicts("%clang@20:", when="+cuda ^cuda@:12.8") # https://gist.github.com/ax3l/9489132#gistcomment-3860114 conflicts("%gcc@10", when="+cuda ^cuda@:11.4.0") diff --git a/lib/spack/spack/build_systems/generic.py b/lib/spack/spack/build_systems/generic.py index 01105045ba33b0..ef00dfca41f147 100644 --- a/lib/spack/spack/build_systems/generic.py +++ b/lib/spack/spack/build_systems/generic.py @@ -7,6 +7,8 @@ import spack.directives import spack.package_base import spack.phase_callbacks +import spack.spec +import spack.util.prefix from ._checks import BuilderWithDefaults, apply_macos_rpath_fixups, execute_install_time_tests @@ -48,3 +50,8 @@ class GenericBuilder(BuilderWithDefaults): # unconditionally perform any post-install phase tests spack.phase_callbacks.run_after("install")(execute_install_time_tests) + + def install( + self, pkg: Package, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: + raise NotImplementedError diff --git a/lib/spack/spack/build_systems/go.py b/lib/spack/spack/build_systems/go.py index b9b32f229994ce..981b548d4f8207 100644 --- a/lib/spack/spack/build_systems/go.py +++ b/lib/spack/spack/build_systems/go.py @@ -7,7 +7,9 @@ import spack.builder import spack.package_base import spack.phase_callbacks -from spack.directives import build_system, extends +import spack.spec +import spack.util.prefix +from spack.directives import build_system, depends_on from spack.multimethod import when from ._checks import BuilderWithDefaults, execute_install_time_tests @@ -26,9 +28,7 @@ class GoPackage(spack.package_base.PackageBase): build_system("go") with when("build_system=go"): - # TODO: this seems like it should be depends_on, see - # setup_dependent_build_environment in go for why I kept it like this - extends("go@1.14:", type="build") + depends_on("go", type="build") @spack.builder.builder("go") @@ -71,6 +71,7 @@ class GoBuilder(BuilderWithDefaults): def setup_build_environment(self, env): env.set("GO111MODULE", "on") env.set("GOTOOLCHAIN", "local") + env.set("GOPATH", fs.join_path(self.pkg.stage.path, "go")) @property def build_directory(self): @@ -81,19 +82,31 @@ def build_directory(self): def build_args(self): """Arguments for ``go build``.""" # Pass ldflags -s = --strip-all and -w = --no-warnings by default - return ["-modcacherw", "-ldflags", "-s -w", "-o", f"{self.pkg.name}"] + return [ + "-p", + str(self.pkg.module.make_jobs), + "-modcacherw", + "-ldflags", + "-s -w", + "-o", + f"{self.pkg.name}", + ] @property def check_args(self): """Argument for ``go test`` during check phase""" return [] - def build(self, pkg, spec, prefix): + def build( + self, pkg: GoPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Runs ``go build`` in the source directory""" with fs.working_dir(self.build_directory): pkg.module.go("build", *self.build_args) - def install(self, pkg, spec, prefix): + def install( + self, pkg: GoPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Install built binaries into prefix bin.""" with fs.working_dir(self.build_directory): fs.mkdirp(prefix.bin) diff --git a/lib/spack/spack/build_systems/lua.py b/lib/spack/spack/build_systems/lua.py index c02678dc299ab5..e8b1698f2979a9 100644 --- a/lib/spack/spack/build_systems/lua.py +++ b/lib/spack/spack/build_systems/lua.py @@ -7,7 +7,9 @@ import spack.builder import spack.package_base +import spack.spec import spack.util.executable +import spack.util.prefix from spack.directives import build_system, depends_on, extends from spack.multimethod import when @@ -55,7 +57,9 @@ class LuaBuilder(spack.builder.Builder): #: Names associated with package attributes in the old build-system format legacy_attributes = () - def unpack(self, pkg, spec, prefix): + def unpack( + self, pkg: LuaPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: if os.path.splitext(pkg.stage.archive_file)[1] == ".rock": directory = pkg.luarocks("unpack", pkg.stage.archive_file, output=str) dirlines = directory.split("\n") @@ -66,15 +70,16 @@ def unpack(self, pkg, spec, prefix): def _generate_tree_line(name, prefix): return """{{ name = "{name}", root = "{prefix}" }};""".format(name=name, prefix=prefix) - def generate_luarocks_config(self, pkg, spec, prefix): + def generate_luarocks_config( + self, pkg: LuaPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: spec = self.pkg.spec table_entries = [] for d in spec.traverse(deptype=("build", "run")): if d.package.extends(self.pkg.extendee_spec): table_entries.append(self._generate_tree_line(d.name, d.prefix)) - path = self._luarocks_config_path() - with open(path, "w", encoding="utf-8") as config: + with open(self._luarocks_config_path(), "w", encoding="utf-8") as config: config.write( """ deps_mode="all" @@ -85,23 +90,26 @@ def generate_luarocks_config(self, pkg, spec, prefix): "\n".join(table_entries) ) ) - return path - def preprocess(self, pkg, spec, prefix): + def preprocess( + self, pkg: LuaPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Override this to preprocess source before building with luarocks""" pass def luarocks_args(self): return [] - def install(self, pkg, spec, prefix): + def install( + self, pkg: LuaPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: rock = "." specs = find(".", "*.rockspec", recursive=False) if specs: rock = specs[0] rocks_args = self.luarocks_args() rocks_args.append(rock) - self.pkg.luarocks("--tree=" + prefix, "make", *rocks_args) + pkg.luarocks("--tree=" + prefix, "make", *rocks_args) def _luarocks_config_path(self): return os.path.join(self.pkg.stage.source_path, "spack_luarocks.lua") diff --git a/lib/spack/spack/build_systems/makefile.py b/lib/spack/spack/build_systems/makefile.py index d9040f19271e3a..017e8e9decf476 100644 --- a/lib/spack/spack/build_systems/makefile.py +++ b/lib/spack/spack/build_systems/makefile.py @@ -98,29 +98,20 @@ def build_directory(self) -> str: return self.pkg.stage.source_path def edit( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: MakefilePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Edit the Makefile before calling make. The default is a no-op.""" pass def build( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: MakefilePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Run "make" on the build targets specified by the builder.""" with fs.working_dir(self.build_directory): pkg.module.make(*self.build_targets) def install( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: MakefilePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Run "make" on the install targets specified by the builder.""" with fs.working_dir(self.build_directory): diff --git a/lib/spack/spack/build_systems/maven.py b/lib/spack/spack/build_systems/maven.py index e9f119a9592e78..4713d20e04637a 100644 --- a/lib/spack/spack/build_systems/maven.py +++ b/lib/spack/spack/build_systems/maven.py @@ -5,6 +5,8 @@ import spack.builder import spack.package_base +import spack.spec +import spack.util.prefix from spack.directives import build_system, depends_on from spack.multimethod import when from spack.util.executable import which @@ -58,16 +60,20 @@ def build_args(self): """List of args to pass to build phase.""" return [] - def build(self, pkg, spec, prefix): + def build( + self, pkg: MavenPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Compile code and package into a JAR file.""" with fs.working_dir(self.build_directory): - mvn = which("mvn") + mvn = which("mvn", required=True) if self.pkg.run_tests: mvn("verify", *self.build_args()) else: mvn("package", "-DskipTests", *self.build_args()) - def install(self, pkg, spec, prefix): + def install( + self, pkg: MavenPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Copy to installation prefix.""" with fs.working_dir(self.build_directory): fs.install_tree(".", prefix) diff --git a/lib/spack/spack/build_systems/meson.py b/lib/spack/spack/build_systems/meson.py index b4e9d92c0f4632..675623e4f4df22 100644 --- a/lib/spack/spack/build_systems/meson.py +++ b/lib/spack/spack/build_systems/meson.py @@ -48,6 +48,9 @@ class MesonPackage(spack.package_base.PackageBase): variant("strip", default=False, description="Strip targets on install") depends_on("meson", type="build") depends_on("ninja", type="build") + # Meson uses pkg-config for dependency detection, and this dependency is + # often overlooked by packages that use meson as a build system. + depends_on("pkgconfig", type="build") # Python detection in meson requires distutils to be importable, but distutils no longer # exists in Python 3.12. In Spack, we can't use setuptools as distutils replacement, # because the distutils-precedence.pth startup file that setuptools ships with is not run @@ -188,10 +191,7 @@ def meson_args(self) -> List[str]: return [] def meson( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: MesonPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Run ``meson`` in the build directory""" options = [] @@ -204,10 +204,7 @@ def meson( pkg.module.meson(*options) def build( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: MesonPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Make the build targets""" options = ["-v"] @@ -216,10 +213,7 @@ def build( pkg.module.ninja(*options) def install( - self, - pkg: spack.package_base.PackageBase, - spec: spack.spec.Spec, - prefix: spack.util.prefix.Prefix, + self, pkg: MesonPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix ) -> None: """Make the install targets""" with fs.working_dir(self.build_directory): diff --git a/lib/spack/spack/build_systems/msbuild.py b/lib/spack/spack/build_systems/msbuild.py index 8002222b9e4af6..f83057c39c456c 100644 --- a/lib/spack/spack/build_systems/msbuild.py +++ b/lib/spack/spack/build_systems/msbuild.py @@ -7,6 +7,8 @@ import spack.builder import spack.package_base +import spack.spec +import spack.util.prefix from spack.directives import build_system, conflicts from ._checks import BuilderWithDefaults @@ -99,7 +101,9 @@ def msbuild_install_args(self): as `msbuild_args` by default.""" return self.msbuild_args() - def build(self, pkg, spec, prefix): + def build( + self, pkg: MSBuildPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Run "msbuild" on the build targets specified by the builder.""" with fs.working_dir(self.build_directory): pkg.module.msbuild( @@ -108,7 +112,9 @@ def build(self, pkg, spec, prefix): self.define_targets(*self.build_targets), ) - def install(self, pkg, spec, prefix): + def install( + self, pkg: MSBuildPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Run "msbuild" on the install targets specified by the builder. This is INSTALL by default""" with fs.working_dir(self.build_directory): diff --git a/lib/spack/spack/build_systems/nmake.py b/lib/spack/spack/build_systems/nmake.py index d6b715b9c07dba..8362a0e5b5b1fa 100644 --- a/lib/spack/spack/build_systems/nmake.py +++ b/lib/spack/spack/build_systems/nmake.py @@ -7,6 +7,8 @@ import spack.builder import spack.package_base +import spack.spec +import spack.util.prefix from spack.directives import build_system, conflicts from ._checks import BuilderWithDefaults @@ -123,7 +125,9 @@ def nmake_install_args(self): Individual packages should override to specify NMake args to command line""" return [] - def build(self, pkg, spec, prefix): + def build( + self, pkg: NMakePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Run "nmake" on the build targets specified by the builder.""" opts = self.std_nmake_args opts += self.nmake_args() @@ -132,7 +136,9 @@ def build(self, pkg, spec, prefix): with fs.working_dir(self.build_directory): pkg.module.nmake(*opts, *self.build_targets, ignore_quotes=self.ignore_quotes) - def install(self, pkg, spec, prefix): + def install( + self, pkg: NMakePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Run "nmake" on the install targets specified by the builder. This is INSTALL by default""" opts = self.std_nmake_args diff --git a/lib/spack/spack/build_systems/octave.py b/lib/spack/spack/build_systems/octave.py index 4570e51a034b89..9e5eabe5dec57c 100644 --- a/lib/spack/spack/build_systems/octave.py +++ b/lib/spack/spack/build_systems/octave.py @@ -3,6 +3,8 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import spack.builder import spack.package_base +import spack.spec +import spack.util.prefix from spack.directives import build_system, extends from spack.multimethod import when @@ -42,7 +44,9 @@ class OctaveBuilder(BuilderWithDefaults): #: Names associated with package attributes in the old build-system format legacy_attributes = () - def install(self, pkg, spec, prefix): + def install( + self, pkg: OctavePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Install the package from the archive file""" pkg.module.octave( "--quiet", diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py index c6c32fa5a6b710..bc567adf5b7ddc 100644 --- a/lib/spack/spack/build_systems/oneapi.py +++ b/lib/spack/spack/build_systems/oneapi.py @@ -142,7 +142,7 @@ def setup_run_environment(self, env): $ source {prefix}/{component}/{version}/env/vars.sh """ # Only if environment modifications are desired (default is +envmods) - if "~envmods" not in self.spec: + if "+envmods" in self.spec: env.extend( EnvironmentModifications.from_sourcing_file( self.component_prefix.env.join("vars.sh"), *self.env_script_args diff --git a/lib/spack/spack/build_systems/perl.py b/lib/spack/spack/build_systems/perl.py index 4539f92485de1b..8f1f86dbd9b308 100644 --- a/lib/spack/spack/build_systems/perl.py +++ b/lib/spack/spack/build_systems/perl.py @@ -11,6 +11,8 @@ import spack.builder import spack.package_base import spack.phase_callbacks +import spack.spec +import spack.util.prefix from spack.directives import build_system, depends_on, extends from spack.hooks.sbang import filter_shebang from spack.install_test import SkipTest, test_part @@ -152,7 +154,9 @@ def configure_args(self): """ return [] - def configure(self, pkg, spec, prefix): + def configure( + self, pkg: PerlPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Run Makefile.PL or Build.PL with arguments consisting of an appropriate installation base directory followed by the list returned by :py:meth:`~.PerlBuilder.configure_args`. @@ -193,7 +197,9 @@ def fix_shebang(self): if self.build_method == "Build.PL": filter_shebang("Build") - def build(self, pkg, spec, prefix): + def build( + self, pkg: PerlPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Builds a Perl package.""" self.build_executable() @@ -204,6 +210,8 @@ def check(self): """Runs built-in tests of a Perl package.""" self.build_executable("test") - def install(self, pkg, spec, prefix): + def install( + self, pkg: PerlPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Installs a Perl package.""" self.build_executable("install") diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py index 4484620d1f5e1f..557fca15d4b306 100644 --- a/lib/spack/spack/build_systems/python.py +++ b/lib/spack/spack/build_systems/python.py @@ -28,6 +28,7 @@ import spack.repo import spack.spec import spack.store +import spack.util.prefix from spack.directives import build_system, depends_on, extends from spack.error import NoHeadersError, NoLibrariesError from spack.install_test import test_part @@ -263,16 +264,17 @@ def update_external_dependencies(self, extendee_spec=None): # Ensure architecture information is present if not python.architecture: host_platform = spack.platforms.host() - host_os = host_platform.operating_system("default_os") - host_target = host_platform.target("default_target") + host_os = host_platform.default_operating_system() + host_target = host_platform.default_target() python.architecture = spack.spec.ArchSpec( (str(host_platform), str(host_os), str(host_target)) ) else: if not python.architecture.platform: python.architecture.platform = spack.platforms.host() + platform = spack.platforms.by_name(python.architecture.platform) if not python.architecture.os: - python.architecture.os = "default_os" + python.architecture.os = platform.default_operating_system() if not python.architecture.target: python.architecture.target = archspec.cpu.host().family.name diff --git a/lib/spack/spack/build_systems/qmake.py b/lib/spack/spack/build_systems/qmake.py index 4bf6b994d1ec27..7d95db4d8e01ae 100644 --- a/lib/spack/spack/build_systems/qmake.py +++ b/lib/spack/spack/build_systems/qmake.py @@ -6,6 +6,8 @@ import spack.builder import spack.package_base import spack.phase_callbacks +import spack.spec +import spack.util.prefix from spack.directives import build_system, depends_on from ._checks import BuilderWithDefaults, execute_build_time_tests @@ -62,17 +64,23 @@ def qmake_args(self): """List of arguments passed to qmake.""" return [] - def qmake(self, pkg, spec, prefix): + def qmake( + self, pkg: QMakePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Run ``qmake`` to configure the project and generate a Makefile.""" with working_dir(self.build_directory): pkg.module.qmake(*self.qmake_args()) - def build(self, pkg, spec, prefix): + def build( + self, pkg: QMakePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Make the build targets""" with working_dir(self.build_directory): pkg.module.make() - def install(self, pkg, spec, prefix): + def install( + self, pkg: QMakePackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Make the install targets""" with working_dir(self.build_directory): pkg.module.make("install") diff --git a/lib/spack/spack/build_systems/racket.py b/lib/spack/spack/build_systems/racket.py index 99338767f8063e..bd3988073e282d 100644 --- a/lib/spack/spack/build_systems/racket.py +++ b/lib/spack/spack/build_systems/racket.py @@ -9,6 +9,8 @@ import llnl.util.tty as tty import spack.builder +import spack.spec +import spack.util.prefix from spack.build_environment import SPACK_NO_PARALLEL_MAKE from spack.config import determine_number_of_jobs from spack.directives import build_system, extends, maintainers @@ -74,18 +76,22 @@ def build_directory(self): ret = os.path.join(ret, self.subdirectory) return ret - def install(self, pkg, spec, prefix): + def install( + self, pkg: RacketPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Install everything from build directory.""" raco = Executable("raco") with fs.working_dir(self.build_directory): - parallel = self.pkg.parallel and (not env_flag(SPACK_NO_PARALLEL_MAKE)) + parallel = pkg.parallel and (not env_flag(SPACK_NO_PARALLEL_MAKE)) + name = pkg.racket_name + assert name is not None, "Racket package name is not set" args = [ "pkg", "install", "-t", "dir", "-n", - self.pkg.racket_name, + name, "--deps", "fail", "--ignore-implies", @@ -101,8 +107,7 @@ def install(self, pkg, spec, prefix): except ProcessError: args.insert(-2, "--skip-installed") raco(*args) - msg = ( - "Racket package {0} was already installed, uninstalling via " + tty.warn( + f"Racket package {name} was already installed, uninstalling via " "Spack may make someone unhappy!" ) - tty.warn(msg.format(self.pkg.racket_name)) diff --git a/lib/spack/spack/build_systems/rocm.py b/lib/spack/spack/build_systems/rocm.py index 6eb1a2e058297d..5ff569502aafb6 100644 --- a/lib/spack/spack/build_systems/rocm.py +++ b/lib/spack/spack/build_systems/rocm.py @@ -140,7 +140,7 @@ class ROCmPackage(PackageBase): when="+rocm", ) - depends_on("llvm-amdgpu", when="+rocm") + depends_on("llvm-amdgpu", type="build", when="+rocm") depends_on("hsa-rocr-dev", when="+rocm") depends_on("hip +rocm", when="+rocm") diff --git a/lib/spack/spack/build_systems/ruby.py b/lib/spack/spack/build_systems/ruby.py index 5b8d0c6be58792..f1263396c3ee18 100644 --- a/lib/spack/spack/build_systems/ruby.py +++ b/lib/spack/spack/build_systems/ruby.py @@ -5,6 +5,8 @@ import spack.builder import spack.package_base +import spack.spec +import spack.util.prefix from spack.directives import build_system, extends, maintainers from ._checks import BuilderWithDefaults @@ -42,7 +44,9 @@ class RubyBuilder(BuilderWithDefaults): #: Names associated with package attributes in the old build-system format legacy_attributes = () - def build(self, pkg, spec, prefix): + def build( + self, pkg: RubyPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Build a Ruby gem.""" # ruby-rake provides both rake.gemspec and Rakefile, but only @@ -58,7 +62,9 @@ def build(self, pkg, spec, prefix): # Some Ruby packages only ship `*.gem` files, so nothing to build pass - def install(self, pkg, spec, prefix): + def install( + self, pkg: RubyPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Install a Ruby gem. The ruby package sets ``GEM_HOME`` to tell gem where to install to.""" diff --git a/lib/spack/spack/build_systems/scons.py b/lib/spack/spack/build_systems/scons.py index b9b2f572019a91..d47f0a428a3b2f 100644 --- a/lib/spack/spack/build_systems/scons.py +++ b/lib/spack/spack/build_systems/scons.py @@ -4,6 +4,8 @@ import spack.builder import spack.package_base import spack.phase_callbacks +import spack.spec +import spack.util.prefix from spack.directives import build_system, depends_on from ._checks import BuilderWithDefaults, execute_build_time_tests @@ -59,7 +61,9 @@ def build_args(self, spec, prefix): """Arguments to pass to build.""" return [] - def build(self, pkg, spec, prefix): + def build( + self, pkg: SConsPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Build the package.""" pkg.module.scons(*self.build_args(spec, prefix)) @@ -67,7 +71,9 @@ def install_args(self, spec, prefix): """Arguments to pass to install.""" return [] - def install(self, pkg, spec, prefix): + def install( + self, pkg: SConsPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Install the package.""" pkg.module.scons("install", *self.install_args(spec, prefix)) diff --git a/lib/spack/spack/build_systems/sip.py b/lib/spack/spack/build_systems/sip.py index fac53704eef49d..691e06605db6b2 100644 --- a/lib/spack/spack/build_systems/sip.py +++ b/lib/spack/spack/build_systems/sip.py @@ -11,6 +11,8 @@ import spack.install_test import spack.package_base import spack.phase_callbacks +import spack.spec +import spack.util.prefix from spack.directives import build_system, depends_on, extends from spack.multimethod import when from spack.util.executable import Executable @@ -41,6 +43,7 @@ class SIPPackage(spack.package_base.PackageBase): with when("build_system=sip"): extends("python", type=("build", "link", "run")) depends_on("py-sip", type="build") + depends_on("gmake", type="build") @property def import_modules(self): @@ -130,7 +133,9 @@ class SIPBuilder(BuilderWithDefaults): build_directory = "build" - def configure(self, pkg, spec, prefix): + def configure( + self, pkg: SIPPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Configure the package.""" # https://www.riverbankcomputing.com/static/Docs/sip/command_line_tools.html @@ -148,7 +153,9 @@ def configure_args(self): """Arguments to pass to configure.""" return [] - def build(self, pkg, spec, prefix): + def build( + self, pkg: SIPPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Build the package.""" args = self.build_args() @@ -159,7 +166,9 @@ def build_args(self): """Arguments to pass to build.""" return [] - def install(self, pkg, spec, prefix): + def install( + self, pkg: SIPPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Install the package.""" args = self.install_args() diff --git a/lib/spack/spack/build_systems/waf.py b/lib/spack/spack/build_systems/waf.py index d9667aeccb8c30..7bc7c8897888fd 100644 --- a/lib/spack/spack/build_systems/waf.py +++ b/lib/spack/spack/build_systems/waf.py @@ -6,6 +6,8 @@ import spack.builder import spack.package_base import spack.phase_callbacks +import spack.spec +import spack.util.prefix from spack.directives import build_system, depends_on from ._checks import BuilderWithDefaults, execute_build_time_tests, execute_install_time_tests @@ -97,7 +99,9 @@ def waf(self, *args, **kwargs): with working_dir(self.build_directory): self.python("waf", "-j{0}".format(jobs), *args, **kwargs) - def configure(self, pkg, spec, prefix): + def configure( + self, pkg: WafPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Configures the project.""" args = ["--prefix={0}".format(self.pkg.prefix)] args += self.configure_args() @@ -108,7 +112,9 @@ def configure_args(self): """Arguments to pass to configure.""" return [] - def build(self, pkg, spec, prefix): + def build( + self, pkg: WafPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Executes the build.""" args = self.build_args() @@ -118,7 +124,9 @@ def build_args(self): """Arguments to pass to build.""" return [] - def install(self, pkg, spec, prefix): + def install( + self, pkg: WafPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix + ) -> None: """Installs the targets on the system.""" args = self.install_args() diff --git a/lib/spack/spack/ci/__init__.py b/lib/spack/spack/ci/__init__.py index 408abc851875ef..c084989ab010a6 100644 --- a/lib/spack/spack/ci/__init__.py +++ b/lib/spack/spack/ci/__init__.py @@ -14,9 +14,9 @@ import zipfile from collections import namedtuple from typing import Callable, Dict, List, Set -from urllib.error import HTTPError, URLError -from urllib.request import HTTPHandler, Request, build_opener +from urllib.request import Request +import llnl.path import llnl.util.filesystem as fs import llnl.util.tty as tty from llnl.util.tty.color import cescape, colorize @@ -63,6 +63,8 @@ PushResult = namedtuple("PushResult", "success url") +urlopen = web_util.urlopen # alias for mocking in tests + def get_change_revisions(): """If this is a git repo get the revisions to use when checking @@ -82,6 +84,9 @@ def get_stack_changed(env_path, rev1="HEAD^", rev2="HEAD"): whether or not the stack was changed. Returns True if the environment manifest changed between the provided revisions (or additionally if the `.gitlab-ci.yml` file itself changed). Returns False otherwise.""" + # git returns posix paths always, normalize input to be comptaible + # with that + env_path = llnl.path.convert_to_posix_path(env_path) git = spack.util.git.git() if git: with fs.working_dir(spack.paths.prefix): @@ -472,12 +477,9 @@ def generate_pipeline(env: ev.Environment, args) -> None: # Use all unpruned specs to populate the build group for this set cdash_config = cfg.get("cdash") if options.cdash_handler and options.cdash_handler.auth_token: - try: - options.cdash_handler.populate_buildgroup( - [options.cdash_handler.build_name(s) for s in pipeline_specs] - ) - except (SpackError, HTTPError, URLError, TimeoutError) as err: - tty.warn(f"Problem populating buildgroup: {err}") + options.cdash_handler.populate_buildgroup( + [options.cdash_handler.build_name(s) for s in pipeline_specs] + ) elif cdash_config: # warn only if there was actually a CDash configuration. tty.warn("Unable to populate buildgroup without CDash credentials") @@ -614,7 +616,7 @@ def copy_test_logs_to_artifacts(test_stage, job_test_dir): copy_files_to_artifacts(os.path.join(test_stage, "*", "*.txt"), job_test_dir) -def download_and_extract_artifacts(url, work_dir): +def download_and_extract_artifacts(url, work_dir) -> str: """Look for gitlab artifacts.zip at the given url, and attempt to download and extract the contents into the given work_dir @@ -622,6 +624,10 @@ def download_and_extract_artifacts(url, work_dir): url (str): Complete url to artifacts.zip file work_dir (str): Path to destination where artifacts should be extracted + + Output: + + Artifacts root path relative to the archive root """ tty.msg(f"Fetching artifacts from: {url}") @@ -631,31 +637,33 @@ def download_and_extract_artifacts(url, work_dir): if token: headers["PRIVATE-TOKEN"] = token - opener = build_opener(HTTPHandler) - - request = Request(url, headers=headers) - request.get_method = lambda: "GET" - - response = opener.open(request, timeout=SPACK_CDASH_TIMEOUT) - response_code = response.getcode() - - if response_code != 200: - msg = f"Error response code ({response_code}) in reproduce_ci_job" - raise SpackError(msg) - + request = Request(url, headers=headers, method="GET") artifacts_zip_path = os.path.join(work_dir, "artifacts.zip") + os.makedirs(work_dir, exist_ok=True) - if not os.path.exists(work_dir): - os.makedirs(work_dir) - - with open(artifacts_zip_path, "wb") as out_file: - shutil.copyfileobj(response, out_file) - - zip_file = zipfile.ZipFile(artifacts_zip_path) - zip_file.extractall(work_dir) - zip_file.close() + try: + response = urlopen(request, timeout=SPACK_CDASH_TIMEOUT) + with open(artifacts_zip_path, "wb") as out_file: + shutil.copyfileobj(response, out_file) + + with zipfile.ZipFile(artifacts_zip_path) as zip_file: + zip_file.extractall(work_dir) + # Get the artifact root + artifact_root = "" + for f in zip_file.filelist: + if "spack.lock" in f.filename: + artifact_root = os.path.dirname(os.path.dirname(f.filename)) + break + except OSError as e: + raise SpackError(f"Error fetching artifacts: {e}") + finally: + try: + os.remove(artifacts_zip_path) + except FileNotFoundError: + # If the file doesn't exist we are already raising + pass - os.remove(artifacts_zip_path) + return artifact_root def get_spack_info(): @@ -769,7 +777,7 @@ def setup_spack_repro_version(repro_dir, checkout_commit, merge_commit=None): return True -def reproduce_ci_job(url, work_dir, autostart, gpg_url, runtime): +def reproduce_ci_job(url, work_dir, autostart, gpg_url, runtime, use_local_head): """Given a url to gitlab artifacts.zip from a failed 'spack ci rebuild' job, attempt to setup an environment in which the failure can be reproduced locally. This entails the following: @@ -783,8 +791,11 @@ def reproduce_ci_job(url, work_dir, autostart, gpg_url, runtime): commands to run to reproduce the build once inside the container. """ work_dir = os.path.realpath(work_dir) + if os.path.exists(work_dir) and os.listdir(work_dir): + raise SpackError(f"Cannot run reproducer in non-emptry working dir:\n {work_dir}") + platform_script_ext = "ps1" if IS_WINDOWS else "sh" - download_and_extract_artifacts(url, work_dir) + artifact_root = download_and_extract_artifacts(url, work_dir) gpg_path = None if gpg_url: @@ -846,6 +857,9 @@ def reproduce_ci_job(url, work_dir, autostart, gpg_url, runtime): with open(repro_file, encoding="utf-8") as fd: repro_details = json.load(fd) + spec_file = fs.find(work_dir, repro_details["job_spec_json"])[0] + reproducer_spec = spack.spec.Spec.from_specfile(spec_file) + repro_dir = os.path.dirname(repro_file) rel_repro_dir = repro_dir.replace(work_dir, "").lstrip(os.path.sep) @@ -906,17 +920,20 @@ def reproduce_ci_job(url, work_dir, autostart, gpg_url, runtime): commit_regex = re.compile(r"commit\s+([^\s]+)") merge_commit_regex = re.compile(r"Merge\s+([^\s]+)\s+into\s+([^\s]+)") - # Try the more specific merge commit regex first - m = merge_commit_regex.search(spack_info) - if m: - # This was a merge commit and we captured the parents - commit_1 = m.group(1) - commit_2 = m.group(2) + if use_local_head: + commit_1 = "HEAD" else: - # Not a merge commit, just get the commit sha - m = commit_regex.search(spack_info) + # Try the more specific merge commit regex first + m = merge_commit_regex.search(spack_info) if m: + # This was a merge commit and we captured the parents commit_1 = m.group(1) + commit_2 = m.group(2) + else: + # Not a merge commit, just get the commit sha + m = commit_regex.search(spack_info) + if m: + commit_1 = m.group(1) setup_result = False if commit_1: @@ -991,6 +1008,8 @@ def reproduce_ci_job(url, work_dir, autostart, gpg_url, runtime): "entrypoint", entrypoint_script, work_dir, run=False, exit_on_failure=False ) + # Attempt to create a unique name for the reproducer container + container_suffix = "_" + reproducer_spec.dag_hash() if reproducer_spec else "" docker_command = [ runtime, "run", @@ -998,14 +1017,14 @@ def reproduce_ci_job(url, work_dir, autostart, gpg_url, runtime): "-t", "--rm", "--name", - "spack_reproducer", + f"spack_reproducer{container_suffix}", "-v", ":".join([work_dir, mounted_workdir, "Z"]), "-v", ":".join( [ - os.path.join(work_dir, "jobs_scratch_dir"), - os.path.join(mount_as_dir, "jobs_scratch_dir"), + os.path.join(work_dir, artifact_root), + os.path.join(mount_as_dir, artifact_root), "Z", ] ), diff --git a/lib/spack/spack/ci/common.py b/lib/spack/spack/ci/common.py index ca2bffd753c0d1..43481679c66e51 100644 --- a/lib/spack/spack/ci/common.py +++ b/lib/spack/spack/ci/common.py @@ -1,23 +1,21 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import codecs import copy import json import os import re -import ssl import sys import time from collections import deque from enum import Enum from typing import Dict, Generator, List, Optional, Set, Tuple from urllib.parse import quote, urlencode, urlparse -from urllib.request import HTTPHandler, HTTPSHandler, Request, build_opener +from urllib.request import Request import llnl.util.filesystem as fs import llnl.util.tty as tty -from llnl.util.lang import Singleton, memoized +from llnl.util.lang import memoized import spack.binary_distribution as bindist import spack.config as cfg @@ -35,32 +33,11 @@ from spack.reporters.cdash import SPACK_CDASH_TIMEOUT from spack.reporters.cdash import build_stamp as cdash_build_stamp - -def _urlopen(): - error_handler = web_util.SpackHTTPDefaultErrorHandler() - - # One opener with HTTPS ssl enabled - with_ssl = build_opener( - HTTPHandler(), HTTPSHandler(context=web_util.ssl_create_default_context()), error_handler - ) - - # One opener with HTTPS ssl disabled - without_ssl = build_opener( - HTTPHandler(), HTTPSHandler(context=ssl._create_unverified_context()), error_handler - ) - - # And dynamically dispatch based on the config:verify_ssl. - def dispatch_open(fullurl, data=None, timeout=None, verify_ssl=True): - opener = with_ssl if verify_ssl else without_ssl - timeout = timeout or cfg.get("config:connect_timeout", 1) - return opener.open(fullurl, data, timeout) - - return dispatch_open - - IS_WINDOWS = sys.platform == "win32" SPACK_RESERVED_TAGS = ["public", "protected", "notary"] -_dyn_mapping_urlopener = Singleton(_urlopen) + +# this exists purely for testing purposes +_urlopen = web_util.urlopen def copy_files_to_artifacts(src, artifacts_dir): @@ -279,26 +256,25 @@ def copy_test_results(self, source, dest): reports = fs.join_path(source, "*_Test*.xml") copy_files_to_artifacts(reports, dest) - def create_buildgroup(self, opener, headers, url, group_name, group_type): + def create_buildgroup(self, headers, url, group_name, group_type): data = {"newbuildgroup": group_name, "project": self.project, "type": group_type} enc_data = json.dumps(data).encode("utf-8") request = Request(url, data=enc_data, headers=headers) - response = opener.open(request, timeout=SPACK_CDASH_TIMEOUT) - response_code = response.getcode() - - if response_code not in [200, 201]: - msg = f"Creating buildgroup failed (response code = {response_code})" - tty.warn(msg) + try: + response_text = _urlopen(request, timeout=SPACK_CDASH_TIMEOUT).read() + except OSError as e: + tty.warn(f"Failed to create CDash buildgroup: {e}") return None - response_text = response.read() - response_json = json.loads(response_text) - build_group_id = response_json["id"] - - return build_group_id + try: + response_json = json.loads(response_text) + return response_json["id"] + except (json.JSONDecodeError, KeyError) as e: + tty.warn(f"Failed to parse CDash response: {e}") + return None def populate_buildgroup(self, job_names): url = f"{self.url}/api/v1/buildgroup.php" @@ -308,16 +284,11 @@ def populate_buildgroup(self, job_names): "Content-Type": "application/json", } - opener = build_opener(HTTPHandler) - - parent_group_id = self.create_buildgroup(opener, headers, url, self.build_group, "Daily") - group_id = self.create_buildgroup( - opener, headers, url, f"Latest {self.build_group}", "Latest" - ) + parent_group_id = self.create_buildgroup(headers, url, self.build_group, "Daily") + group_id = self.create_buildgroup(headers, url, f"Latest {self.build_group}", "Latest") if not parent_group_id or not group_id: - msg = f"Failed to create or retrieve buildgroups for {self.build_group}" - tty.warn(msg) + tty.warn(f"Failed to create or retrieve buildgroups for {self.build_group}") return data = { @@ -329,15 +300,12 @@ def populate_buildgroup(self, job_names): enc_data = json.dumps(data).encode("utf-8") - request = Request(url, data=enc_data, headers=headers) - request.get_method = lambda: "PUT" + request = Request(url, data=enc_data, headers=headers, method="PUT") - response = opener.open(request, timeout=SPACK_CDASH_TIMEOUT) - response_code = response.getcode() - - if response_code != 200: - msg = f"Error response code ({response_code}) in populate_buildgroup" - tty.warn(msg) + try: + _urlopen(request, timeout=SPACK_CDASH_TIMEOUT) + except OSError as e: + tty.warn(f"Failed to populate CDash buildgroup: {e}") def report_skipped(self, spec: spack.spec.Spec, report_dir: str, reason: Optional[str]): """Explicitly report skipping testing of a spec (e.g., it's CI @@ -735,9 +703,6 @@ def _apply_section(dest, src): for value in header.values(): value = os.path.expandvars(value) - verify_ssl = mapping.get("verify_ssl", spack.config.get("config:verify_ssl", True)) - timeout = mapping.get("timeout", spack.config.get("config:connect_timeout", 1)) - required = mapping.get("require", []) allowed = mapping.get("allow", []) ignored = mapping.get("ignore", []) @@ -771,19 +736,15 @@ def job_query(job): endpoint_url._replace(query=query).geturl(), headers=header, method="GET" ) try: - response = _dyn_mapping_urlopener( - request, verify_ssl=verify_ssl, timeout=timeout - ) + response = _urlopen(request) + config = json.load(response) except Exception as e: # For now just ignore any errors from dynamic mapping and continue # This is still experimental, and failures should not stop CI # from running normally - tty.warn(f"Failed to fetch dynamic mapping for query:\n\t{query}") - tty.warn(f"{e}") + tty.warn(f"Failed to fetch dynamic mapping for query:\n\t{query}: {e}") continue - config = json.load(codecs.getreader("utf-8")(response)) - # Strip ignore keys if ignored: for key in ignored: diff --git a/lib/spack/spack/cmd/__init__.py b/lib/spack/spack/cmd/__init__.py index 5cee932504b2d6..221b6c60b768b1 100644 --- a/lib/spack/spack/cmd/__init__.py +++ b/lib/spack/spack/cmd/__init__.py @@ -202,7 +202,7 @@ def _concretize_spec_pairs( # Special case for concretizing a single spec if len(to_concretize) == 1: abstract, concrete = to_concretize[0] - return [concrete or abstract.concretized(tests=tests)] + return [concrete or spack.concretize.concretize_one(abstract, tests=tests)] # Special case if every spec is either concrete or has an abstract hash if all( @@ -254,9 +254,9 @@ def matching_spec_from_env(spec): """ env = ev.active_environment() if env: - return env.matching_spec(spec) or spec.concretized() + return env.matching_spec(spec) or spack.concretize.concretize_one(spec) else: - return spec.concretized() + return spack.concretize.concretize_one(spec) def matching_specs_from_env(specs): @@ -297,7 +297,7 @@ def disambiguate_spec( def disambiguate_spec_from_hashes( spec: spack.spec.Spec, - hashes: List[str], + hashes: Optional[List[str]], local: bool = False, installed: Union[bool, InstallRecordStatus] = True, first: bool = False, diff --git a/lib/spack/spack/cmd/arch.py b/lib/spack/spack/cmd/arch.py index 683fd01450d3a8..8f810bc98401f8 100644 --- a/lib/spack/spack/cmd/arch.py +++ b/lib/spack/spack/cmd/arch.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import collections +import warnings import archspec.cpu @@ -51,10 +52,10 @@ def setup_parser(subparser): "-t", "--target", action="store_true", default=False, help="print only the target" ) parts2.add_argument( - "-f", "--frontend", action="store_true", default=False, help="print frontend" + "-f", "--frontend", action="store_true", default=False, help="print frontend (DEPRECATED)" ) parts2.add_argument( - "-b", "--backend", action="store_true", default=False, help="print backend" + "-b", "--backend", action="store_true", default=False, help="print backend (DEPRECATED)" ) @@ -98,15 +99,14 @@ def arch(parser, args): display_targets(archspec.cpu.TARGETS) return - os_args, target_args = "default_os", "default_target" if args.frontend: - os_args, target_args = "frontend", "frontend" + warnings.warn("the argument --frontend is deprecated, and will be removed in Spack v1.0") elif args.backend: - os_args, target_args = "backend", "backend" + warnings.warn("the argument --backend is deprecated, and will be removed in Spack v1.0") host_platform = spack.platforms.host() - host_os = host_platform.operating_system(os_args) - host_target = host_platform.target(target_args) + host_os = host_platform.default_operating_system() + host_target = host_platform.default_target() if args.family: host_target = host_target.family elif args.generic: diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py index d1f85c59a33c35..84aec74328ffe9 100644 --- a/lib/spack/spack/cmd/bootstrap.py +++ b/lib/spack/spack/cmd/bootstrap.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import shutil import sys import tempfile @@ -14,9 +14,9 @@ import spack.bootstrap import spack.bootstrap.config import spack.bootstrap.core +import spack.concretize import spack.config import spack.mirrors.utils -import spack.spec import spack.stage import spack.util.path import spack.util.spack_yaml @@ -397,7 +397,7 @@ def _mirror(args): llnl.util.tty.msg(msg.format(spec_str, mirror_dir)) # Suppress tty from the call below for terser messages llnl.util.tty.set_msg_enabled(False) - spec = spack.spec.Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) for node in spec.traverse(): spack.mirrors.utils.create(mirror_dir, [node]) llnl.util.tty.set_msg_enabled(True) @@ -436,6 +436,7 @@ def write_metadata(subdir, metadata): shutil.copy(spack.util.path.canonicalize_path(GNUPG_JSON), abs_directory) shutil.copy(spack.util.path.canonicalize_path(PATCHELF_JSON), abs_directory) instructions += cmd.format("local-binaries", rel_directory) + instructions += " % spack buildcache update-index /bootstrap_cache\n" print(instructions) diff --git a/lib/spack/spack/cmd/buildcache.py b/lib/spack/spack/cmd/buildcache.py index eb09d19ff66cc6..a76cfa767f66f7 100644 --- a/lib/spack/spack/cmd/buildcache.py +++ b/lib/spack/spack/cmd/buildcache.py @@ -16,6 +16,7 @@ import spack.binary_distribution as bindist import spack.cmd +import spack.concretize import spack.config import spack.deptypes as dt import spack.environment as ev @@ -554,8 +555,7 @@ def check_fn(args: argparse.Namespace): tty.msg("No specs provided, exiting.") return - for spec in specs: - spec.concretize() + specs = [spack.concretize.concretize_one(s) for s in specs] # Next see if there are any configured binary mirrors configured_mirrors = spack.config.get("mirrors", scope=args.scope) @@ -623,7 +623,7 @@ def save_specfile_fn(args): root = specs[0] if not root.concrete: - root.concretize() + root = spack.concretize.concretize_one(root) save_dependency_specfiles( root, args.specfile_dir, dependencies=spack.cmd.parse_specs(args.specs) diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py index b62f901503ef8b..47e546288281dd 100644 --- a/lib/spack/spack/cmd/checksum.py +++ b/lib/spack/spack/cmd/checksum.py @@ -4,7 +4,7 @@ import re import sys -from typing import Dict, Optional +from typing import Dict, Optional, Tuple import llnl.string import llnl.util.lang @@ -181,7 +181,11 @@ def checksum(parser, args): print() if args.add_to_package: - add_versions_to_package(pkg, version_lines, args.batch) + path = spack.repo.PATH.filename_for_package_name(pkg.name) + num_versions_added = add_versions_to_pkg(path, version_lines) + tty.msg(f"Added {num_versions_added} new versions to {pkg.name} in {path}") + if not args.batch and sys.stdin.isatty(): + editor(path) def print_checksum_status(pkg: PackageBase, version_hashes: dict): @@ -227,20 +231,9 @@ def print_checksum_status(pkg: PackageBase, version_hashes: dict): tty.die("Invalid checksums found.") -def add_versions_to_package(pkg: PackageBase, version_lines: str, is_batch: bool): - """ - Add checksumed versions to a package's instructions and open a user's - editor so they may double check the work of the function. - - Args: - pkg (spack.package_base.PackageBase): A package class for a given package in Spack. - version_lines (str): A string of rendered version lines. - - """ - # Get filename and path for package - filename = spack.repo.PATH.filename_for_package_name(pkg.name) +def _update_version_statements(package_src: str, version_lines: str) -> Tuple[int, str]: + """Returns a tuple of number of versions added and the package's modified contents.""" num_versions_added = 0 - version_statement_re = re.compile(r"([\t ]+version\([^\)]*\))") version_re = re.compile(r'[\t ]+version\(\s*"([^"]+)"[^\)]*\)') @@ -252,33 +245,34 @@ def add_versions_to_package(pkg: PackageBase, version_lines: str, is_batch: bool if match: new_versions.append((Version(match.group(1)), ver_line)) - with open(filename, "r+", encoding="utf-8") as f: - contents = f.read() - split_contents = version_statement_re.split(contents) + split_contents = version_statement_re.split(package_src) - for i, subsection in enumerate(split_contents): - # If there are no more versions to add we should exit - if len(new_versions) <= 0: - break + for i, subsection in enumerate(split_contents): + # If there are no more versions to add we should exit + if len(new_versions) <= 0: + break - # Check if the section contains a version - contents_version = version_re.match(subsection) - if contents_version is not None: - parsed_version = Version(contents_version.group(1)) + # Check if the section contains a version + contents_version = version_re.match(subsection) + if contents_version is not None: + parsed_version = Version(contents_version.group(1)) - if parsed_version < new_versions[0][0]: - split_contents[i:i] = [new_versions.pop(0)[1], " # FIXME", "\n"] - num_versions_added += 1 + if parsed_version < new_versions[0][0]: + split_contents[i:i] = [new_versions.pop(0)[1], " # FIXME", "\n"] + num_versions_added += 1 - elif parsed_version == new_versions[0][0]: - new_versions.pop(0) + elif parsed_version == new_versions[0][0]: + new_versions.pop(0) - # Seek back to the start of the file so we can rewrite the file contents. - f.seek(0) - f.writelines("".join(split_contents)) + return num_versions_added, "".join(split_contents) - tty.msg(f"Added {num_versions_added} new versions to {pkg.name}") - tty.msg(f"Open {filename} to review the additions.") - if sys.stdout.isatty() and not is_batch: - editor(filename) +def add_versions_to_pkg(path: str, version_lines: str) -> int: + """Add new versions to a package.py file. Returns the number of versions added.""" + with open(path, "r", encoding="utf-8") as f: + package_src = f.read() + num_versions_added, package_src = _update_version_statements(package_src, version_lines) + if num_versions_added > 0: + with open(path, "w", encoding="utf-8") as f: + f.write(package_src) + return num_versions_added diff --git a/lib/spack/spack/cmd/ci.py b/lib/spack/spack/cmd/ci.py index ce438348f56902..d0d04b95ee6ced 100644 --- a/lib/spack/spack/cmd/ci.py +++ b/lib/spack/spack/cmd/ci.py @@ -176,6 +176,11 @@ def setup_parser(subparser): reproduce.add_argument( "-s", "--autostart", help="Run docker reproducer automatically", action="store_true" ) + reproduce.add_argument( + "--use-local-head", + help="Use the HEAD of the local Spack instead of reproducing a commit", + action="store_true", + ) gpg_group = reproduce.add_mutually_exclusive_group(required=False) gpg_group.add_argument( "--gpg-file", help="Path to public GPG key for validating binary cache installs" @@ -608,7 +613,12 @@ def ci_reproduce(args): gpg_key_url = None return spack_ci.reproduce_ci_job( - args.job_url, args.working_dir, args.autostart, gpg_key_url, args.runtime + args.job_url, + args.working_dir, + args.autostart, + gpg_key_url, + args.runtime, + args.use_local_head, ) diff --git a/lib/spack/spack/cmd/common/arguments.py b/lib/spack/spack/cmd/common/arguments.py index 26a11943db9ecb..41a7024d285652 100644 --- a/lib/spack/spack/cmd/common/arguments.py +++ b/lib/spack/spack/cmd/common/arguments.py @@ -4,7 +4,7 @@ import argparse -import os.path +import os import textwrap from llnl.util.lang import stable_partition diff --git a/lib/spack/spack/cmd/containerize.py b/lib/spack/spack/cmd/containerize.py index fd8dc35f34750a..27399710808ad5 100644 --- a/lib/spack/spack/cmd/containerize.py +++ b/lib/spack/spack/cmd/containerize.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import llnl.util.tty diff --git a/lib/spack/spack/cmd/debug.py b/lib/spack/spack/cmd/debug.py index e03479955a40ae..c4eeb373e644c4 100644 --- a/lib/spack/spack/cmd/debug.py +++ b/lib/spack/spack/cmd/debug.py @@ -2,23 +2,11 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os import platform -import re -import sys -from datetime import datetime -from glob import glob - -import llnl.util.tty as tty -from llnl.util.filesystem import working_dir import spack -import spack.paths import spack.platforms import spack.spec -import spack.store -import spack.util.git -from spack.util.executable import which description = "debugging commands for troubleshooting Spack" section = "developer" @@ -27,67 +15,13 @@ def setup_parser(subparser): sp = subparser.add_subparsers(metavar="SUBCOMMAND", dest="debug_command") - sp.add_parser("create-db-tarball", help="create a tarball of Spack's installation metadata") sp.add_parser("report", help="print information useful for bug reports") -def _debug_tarball_suffix(): - now = datetime.now() - suffix = now.strftime("%Y-%m-%d-%H%M%S") - - git = spack.util.git.git() - if not git: - return "nobranch-nogit-%s" % suffix - - with working_dir(spack.paths.prefix): - if not os.path.isdir(".git"): - return "nobranch.nogit.%s" % suffix - - # Get symbolic branch name and strip any special chars (mainly '/') - symbolic = git("rev-parse", "--abbrev-ref", "--short", "HEAD", output=str).strip() - symbolic = re.sub(r"[^\w.-]", "-", symbolic) - - # Get the commit hash too. - commit = git("rev-parse", "--short", "HEAD", output=str).strip() - - if symbolic == commit: - return "nobranch.%s.%s" % (commit, suffix) - else: - return "%s.%s.%s" % (symbolic, commit, suffix) - - -def create_db_tarball(args): - tar = which("tar") - tarball_name = "spack-db.%s.tar.gz" % _debug_tarball_suffix() - tarball_path = os.path.abspath(tarball_name) - - base = os.path.basename(str(spack.store.STORE.root)) - transform_args = [] - # Currently --transform and -s are not supported by Windows native tar - if "GNU" in tar("--version", output=str): - transform_args = ["--transform", "s/^%s/%s/" % (base, tarball_name)] - elif sys.platform != "win32": - transform_args = ["-s", "/^%s/%s/" % (base, tarball_name)] - - wd = os.path.dirname(str(spack.store.STORE.root)) - with working_dir(wd): - files = [spack.store.STORE.db._index_path] - files += glob("%s/*/*/*/.spack/spec.json" % base) - files += glob("%s/*/*/*/.spack/spec.yaml" % base) - files = [os.path.relpath(f) for f in files] - - args = ["-czf", tarball_path] - args += transform_args - args += files - tar(*args) - - tty.msg("Created %s" % tarball_name) - - def report(args): host_platform = spack.platforms.host() - host_os = host_platform.operating_system("frontend") - host_target = host_platform.target("frontend") + host_os = host_platform.default_operating_system() + host_target = host_platform.default_target() architecture = spack.spec.ArchSpec((str(host_platform), str(host_os), str(host_target))) print("* **Spack:**", spack.get_version()) print("* **Python:**", platform.python_version()) @@ -95,5 +29,5 @@ def report(args): def debug(parser, args): - action = {"create-db-tarball": create_db_tarball, "report": report} - action[args.debug_command](args) + if args.debug_command == "report": + report(args) diff --git a/lib/spack/spack/cmd/dependencies.py b/lib/spack/spack/cmd/dependencies.py index 1f89ebffc06f2c..6c15020da4b2c7 100644 --- a/lib/spack/spack/cmd/dependencies.py +++ b/lib/spack/spack/cmd/dependencies.py @@ -9,9 +9,9 @@ import spack.cmd import spack.environment as ev -import spack.package_base import spack.store from spack.cmd.common import arguments +from spack.solver.input_analysis import create_graph_analyzer description = "show dependencies of a package" section = "basic" @@ -68,15 +68,17 @@ def dependencies(parser, args): else: spec = specs[0] - dependencies = spack.package_base.possible_dependencies( + dependencies, virtuals, _ = create_graph_analyzer().possible_dependencies( spec, transitive=args.transitive, expand_virtuals=args.expand_virtuals, - depflag=args.deptype, + allowed_deps=args.deptype, ) + if not args.expand_virtuals: + dependencies.update(virtuals) if spec.name in dependencies: - del dependencies[spec.name] + dependencies.remove(spec.name) if dependencies: colify(sorted(dependencies)) diff --git a/lib/spack/spack/cmd/deprecate.py b/lib/spack/spack/cmd/deprecate.py index c3dcc752adf199..3468314cfbb4d7 100644 --- a/lib/spack/spack/cmd/deprecate.py +++ b/lib/spack/spack/cmd/deprecate.py @@ -18,6 +18,7 @@ from llnl.util.symlink import symlink import spack.cmd +import spack.concretize import spack.environment as ev import spack.installer import spack.store @@ -103,7 +104,7 @@ def deprecate(parser, args): ) if args.install: - deprecator = specs[1].concretized() + deprecator = spack.concretize.concretize_one(specs[1]) else: deprecator = spack.cmd.disambiguate_spec(specs[1], env, local=True) diff --git a/lib/spack/spack/cmd/dev_build.py b/lib/spack/spack/cmd/dev_build.py index 26bc011672f5a1..abd380b20f22ce 100644 --- a/lib/spack/spack/cmd/dev_build.py +++ b/lib/spack/spack/cmd/dev_build.py @@ -10,6 +10,7 @@ import spack.build_environment import spack.cmd import spack.cmd.common.arguments +import spack.concretize import spack.config import spack.repo from spack.cmd.common import arguments @@ -113,8 +114,8 @@ def dev_build(self, args): source_path = os.path.abspath(source_path) # Forces the build to run out of the source directory. - spec.constrain("dev_path=%s" % source_path) - spec.concretize() + spec.constrain(f'dev_path="{source_path}"') + spec = spack.concretize.concretize_one(spec) if spec.installed: tty.error("Already installed in %s" % spec.prefix) diff --git a/lib/spack/spack/cmd/develop.py b/lib/spack/spack/cmd/develop.py index 390810065bf515..3f3e2c12dc286b 100644 --- a/lib/spack/spack/cmd/develop.py +++ b/lib/spack/spack/cmd/develop.py @@ -125,7 +125,7 @@ def develop(parser, args): version = spec.versions.concrete_range_as_version if not version: # look up the maximum version so infintiy versions are preferred for develop - version = max(spec.package_class.versions.keys()) + version = max(spack.repo.PATH.get_pkg_class(spec.fullname).versions.keys()) tty.msg(f"Defaulting to highest version: {spec.name}@{version}") spec.versions = spack.version.VersionList([version]) diff --git a/lib/spack/spack/cmd/external.py b/lib/spack/spack/cmd/external.py index d481933b28385a..a877e71f981237 100644 --- a/lib/spack/spack/cmd/external.py +++ b/lib/spack/spack/cmd/external.py @@ -110,10 +110,7 @@ def external_find(args): # Note that KeyboardInterrupt does not subclass Exception # (so CTRL-C will terminate the program as expected). skip_msg = "Skipping manifest and continuing with other external checks" - if (isinstance(e, IOError) or isinstance(e, OSError)) and e.errno in [ - errno.EPERM, - errno.EACCES, - ]: + if isinstance(e, OSError) and e.errno in (errno.EPERM, errno.EACCES): # The manifest file does not have sufficient permissions enabled: # print a warning and keep going tty.warn("Unable to read manifest due to insufficient permissions.", skip_msg) diff --git a/lib/spack/spack/cmd/help.py b/lib/spack/spack/cmd/help.py index 3b754cd6ef2ef2..ace7ef224d0bd4 100644 --- a/lib/spack/spack/cmd/help.py +++ b/lib/spack/spack/cmd/help.py @@ -54,10 +54,6 @@ @m{target=target} specific processor @m{arch=platform-os-target} shortcut for all three above - cross-compiling: - @m{os=backend} or @m{os=be} build for compute node (backend) - @m{os=frontend} or @m{os=fe} build for login node (frontend) - dependencies: ^dependency [constraints] specify constraints on dependencies ^@K{/hash} build with a specific installed diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py index bb731d3317625d..d71f67d8865391 100644 --- a/lib/spack/spack/cmd/install.py +++ b/lib/spack/spack/cmd/install.py @@ -13,6 +13,7 @@ from llnl.util import lang, tty import spack.cmd +import spack.concretize import spack.config import spack.environment as ev import spack.paths @@ -450,7 +451,7 @@ def concrete_specs_from_file(args): else: s = spack.spec.Spec.from_json(f) - concretized = s.concretized() + concretized = spack.concretize.concretize_one(s) if concretized.dag_hash() != s.dag_hash(): msg = 'skipped invalid file "{0}". ' msg += "The file does not contain a concrete spec." diff --git a/lib/spack/spack/cmd/make_installer.py b/lib/spack/spack/cmd/make_installer.py index 6e96601d0fc60b..5cc0ff29d4bb47 100644 --- a/lib/spack/spack/cmd/make_installer.py +++ b/lib/spack/spack/cmd/make_installer.py @@ -7,9 +7,9 @@ from llnl.path import convert_to_posix_path +import spack.concretize import spack.paths import spack.util.executable -from spack.spec import Spec description = "generate Windows installer" section = "admin" @@ -65,8 +65,7 @@ def make_installer(parser, args): """ if sys.platform == "win32": output_dir = args.output_dir - cmake_spec = Spec("cmake") - cmake_spec.concretize() + cmake_spec = spack.concretize.concretize_one("cmake") cmake_path = os.path.join(cmake_spec.prefix, "bin", "cmake.exe") cpack_path = os.path.join(cmake_spec.prefix, "bin", "cpack.exe") spack_source = args.spack_source diff --git a/lib/spack/spack/cmd/mirror.py b/lib/spack/spack/cmd/mirror.py index 677549ef454e17..b13a9ee8b52a93 100644 --- a/lib/spack/spack/cmd/mirror.py +++ b/lib/spack/spack/cmd/mirror.py @@ -492,7 +492,7 @@ def extend_with_additional_versions(specs, num_versions): mirror_specs = spack.mirrors.utils.get_all_versions(specs) else: mirror_specs = spack.mirrors.utils.get_matching_versions(specs, num_versions=num_versions) - mirror_specs = [x.concretized() for x in mirror_specs] + mirror_specs = [spack.concretize.concretize_one(x) for x in mirror_specs] return mirror_specs @@ -545,7 +545,7 @@ def _not_license_excluded(self, x): package does not explicitly forbid redistributing source.""" if self.private: return True - elif x.package_class.redistribute_source(x): + elif spack.repo.PATH.get_pkg_class(x.fullname).redistribute_source(x): return True else: tty.debug( diff --git a/lib/spack/spack/cmd/modules/__init__.py b/lib/spack/spack/cmd/modules/__init__.py index caa5c93664ffd9..aaeab96af258b5 100644 --- a/lib/spack/spack/cmd/modules/__init__.py +++ b/lib/spack/spack/cmd/modules/__init__.py @@ -5,7 +5,7 @@ """Implementation details of the ``spack module`` command.""" import collections -import os.path +import os import shutil import sys diff --git a/lib/spack/spack/cmd/providers.py b/lib/spack/spack/cmd/providers.py index 8ae3cd40af7d5f..80ece18e8d89d8 100644 --- a/lib/spack/spack/cmd/providers.py +++ b/lib/spack/spack/cmd/providers.py @@ -41,7 +41,11 @@ def providers(parser, args): specs = spack.cmd.parse_specs(args.virtual_package) # Check prerequisites - non_virtual = [str(s) for s in specs if not s.virtual or s.name not in valid_virtuals] + non_virtual = [ + str(s) + for s in specs + if not spack.repo.PATH.is_virtual(s.name) or s.name not in valid_virtuals + ] if non_virtual: msg = "non-virtual specs cannot be part of the query " msg += "[{0}]\n".format(", ".join(non_virtual)) diff --git a/lib/spack/spack/cmd/style.py b/lib/spack/spack/cmd/style.py index 82df6ad0f80637..887698ddd75d2b 100644 --- a/lib/spack/spack/cmd/style.py +++ b/lib/spack/spack/cmd/style.py @@ -6,7 +6,7 @@ import os import re import sys -from itertools import zip_longest +from itertools import islice, zip_longest from typing import Dict, List, Optional import llnl.util.tty as tty @@ -423,7 +423,8 @@ def _run_import_check( continue for m in is_abs_import.finditer(contents): - if contents.count(m.group(1)) == 1: + # Find at most two occurences: the first is the import itself, the second is its usage. + if len(list(islice(re.finditer(rf"{re.escape(m.group(1))}(?!\w)", contents), 2))) == 1: to_remove.append(m.group(0)) exit_code = 1 print(f"{pretty_path}: redundant import: {m.group(1)}", file=out) @@ -438,7 +439,7 @@ def _run_import_check( module = _module_part(root, m.group(0)) if not module or module in to_add: continue - if re.search(rf"import {re.escape(module)}\b(?!\.)", contents): + if re.search(rf"import {re.escape(module)}(?!\w|\.)", contents): continue to_add.add(module) exit_code = 1 diff --git a/lib/spack/spack/cmd/test.py b/lib/spack/spack/cmd/test.py index 90e78cb123627c..a1425bb92cbaed 100644 --- a/lib/spack/spack/cmd/test.py +++ b/lib/spack/spack/cmd/test.py @@ -177,16 +177,15 @@ def test_run(args): matching = spack.store.STORE.db.query_local(spec, hashes=hashes, explicit=explicit) if spec and not matching: tty.warn("No {0}installed packages match spec {1}".format(explicit_str, spec)) - """ - TODO: Need to write out a log message and/or CDASH Testing - output that package not installed IF continue to process - these issues here. - if args.log_format: - # Proceed with the spec assuming the test process - # to ensure report package as skipped (e.g., for CI) - specs_to_test.append(spec) - """ + # TODO: Need to write out a log message and/or CDASH Testing + # output that package not installed IF continue to process + # these issues here. + + # if args.log_format: + # # Proceed with the spec assuming the test process + # # to ensure report package as skipped (e.g., for CI) + # specs_to_test.append(spec) specs_to_test.extend(matching) @@ -253,7 +252,9 @@ def has_test_and_tags(pkg_class): hashes = env.all_hashes() if env else None specs = spack.store.STORE.db.query(hashes=hashes) - specs = list(filter(lambda s: has_test_and_tags(s.package_class), specs)) + specs = list( + filter(lambda s: has_test_and_tags(spack.repo.PATH.get_pkg_class(s.fullname)), specs) + ) spack.cmd.display_specs(specs, long=True) diff --git a/lib/spack/spack/cmd/tutorial.py b/lib/spack/spack/cmd/tutorial.py index b6d65863dc6913..16b974b4b8b879 100644 --- a/lib/spack/spack/cmd/tutorial.py +++ b/lib/spack/spack/cmd/tutorial.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import shutil import llnl.util.tty as tty diff --git a/lib/spack/spack/cmd/unit_test.py b/lib/spack/spack/cmd/unit_test.py index be03de7496eb05..eadd45ba824e8a 100644 --- a/lib/spack/spack/cmd/unit_test.py +++ b/lib/spack/spack/cmd/unit_test.py @@ -5,7 +5,7 @@ import argparse import collections import io -import os.path +import os import re import sys @@ -216,7 +216,7 @@ def unit_test(parser, args, unknown_args): # Ensure clingo is available before switching to the # mock configuration used by unit tests with spack.bootstrap.ensure_bootstrap_configuration(): - spack.bootstrap.ensure_core_dependencies() + spack.bootstrap.ensure_clingo_importable_or_raise() if pytest is None: spack.bootstrap.ensure_environment_dependencies() import pytest diff --git a/lib/spack/spack/cmd/verify.py b/lib/spack/spack/cmd/verify.py index c2c4b599bb8a88..8f23168677c645 100644 --- a/lib/spack/spack/cmd/verify.py +++ b/lib/spack/spack/cmd/verify.py @@ -2,35 +2,48 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import argparse +import io +from typing import List, Optional import llnl.util.tty as tty +from llnl.string import plural +from llnl.util.filesystem import visit_directory_tree import spack.cmd import spack.environment as ev +import spack.spec import spack.store import spack.verify +import spack.verify_libraries +from spack.cmd.common import arguments -description = "check that all spack packages are on disk as installed" +description = "verify spack installations on disk" section = "admin" level = "long" +MANIFEST_SUBPARSER: Optional[argparse.ArgumentParser] = None -def setup_parser(subparser): - setup_parser.parser = subparser - subparser.add_argument( +def setup_parser(subparser: argparse.ArgumentParser): + global MANIFEST_SUBPARSER + sp = subparser.add_subparsers(metavar="SUBCOMMAND", dest="verify_command") + + MANIFEST_SUBPARSER = sp.add_parser( + "manifest", help=verify_manifest.__doc__, description=verify_manifest.__doc__ + ) + MANIFEST_SUBPARSER.add_argument( "-l", "--local", action="store_true", help="verify only locally installed packages" ) - subparser.add_argument( + MANIFEST_SUBPARSER.add_argument( "-j", "--json", action="store_true", help="ouptut json-formatted errors" ) - subparser.add_argument("-a", "--all", action="store_true", help="verify all packages") - subparser.add_argument( + MANIFEST_SUBPARSER.add_argument("-a", "--all", action="store_true", help="verify all packages") + MANIFEST_SUBPARSER.add_argument( "specs_or_files", nargs=argparse.REMAINDER, help="specs or files to verify" ) - type = subparser.add_mutually_exclusive_group() - type.add_argument( + manifest_sp_type = MANIFEST_SUBPARSER.add_mutually_exclusive_group() + manifest_sp_type.add_argument( "-s", "--specs", action="store_const", @@ -39,7 +52,7 @@ def setup_parser(subparser): default="specs", help="treat entries as specs (default)", ) - type.add_argument( + manifest_sp_type.add_argument( "-f", "--files", action="store_const", @@ -49,14 +62,67 @@ def setup_parser(subparser): help="treat entries as absolute filenames\n\ncannot be used with '-a'", ) + libraries_subparser = sp.add_parser( + "libraries", help=verify_libraries.__doc__, description=verify_libraries.__doc__ + ) + + arguments.add_common_arguments(libraries_subparser, ["constraint"]) + def verify(parser, args): + cmd = args.verify_command + if cmd == "libraries": + return verify_libraries(args) + elif cmd == "manifest": + return verify_manifest(args) + parser.error("invalid verify subcommand") + + +def verify_libraries(args): + """verify that shared libraries of install packages can be located in rpaths (Linux only)""" + specs_from_db = [s for s in args.specs(installed=True) if not s.external] + + tty.info(f"Checking {len(specs_from_db)} packages for shared library resolution") + + errors = 0 + for spec in specs_from_db: + try: + pkg = spec.package + except Exception: + tty.warn(f"Skipping {spec.cformat('{name}{@version}{/hash}')} due to missing package") + error_msg = _verify_libraries(spec, pkg.unresolved_libraries) + if error_msg is not None: + errors += 1 + tty.error(error_msg) + + if errors: + tty.error(f"Cannot resolve shared libraries in {plural(errors, 'package')}") + return 1 + + +def _verify_libraries(spec: spack.spec.Spec, unresolved_libraries: List[str]) -> Optional[str]: + """Go over the prefix of the installed spec and verify its shared libraries can be resolved.""" + visitor = spack.verify_libraries.ResolveSharedElfLibDepsVisitor( + [*spack.verify_libraries.ALLOW_UNRESOLVED, *unresolved_libraries] + ) + visit_directory_tree(spec.prefix, visitor) + + if not visitor.problems: + return None + + output = io.StringIO() + visitor.write(output, indent=4, brief=True) + message = output.getvalue().rstrip() + return f"{spec.cformat('{name}{@version}{/hash}')}: {spec.prefix}:\n{message}" + + +def verify_manifest(args): + """verify that install directories have not been modified since installation""" local = args.local if args.type == "files": if args.all: - setup_parser.parser.print_help() - return 1 + MANIFEST_SUBPARSER.error("cannot use --all with --files") for file in args.specs_or_files: results = spack.verify.check_file_manifest(file) @@ -87,8 +153,7 @@ def verify(parser, args): env = ev.active_environment() specs = list(map(lambda x: spack.cmd.disambiguate_spec(x, env, local=local), spec_args)) else: - setup_parser.parser.print_help() - return 1 + MANIFEST_SUBPARSER.error("use --all or specify specs to verify") for spec in specs: tty.debug("Verifying package %s") diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index af40945c373d54..4ca2aa3bb081cc 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -801,17 +801,17 @@ def _extract_compiler_paths(spec: "spack.spec.Spec") -> Optional[Dict[str, str]] def _extract_os_and_target(spec: "spack.spec.Spec"): if not spec.architecture: host_platform = spack.platforms.host() - operating_system = host_platform.operating_system("default_os") - target = host_platform.target("default_target") + operating_system = host_platform.default_operating_system() + target = host_platform.default_target() else: target = spec.architecture.target if not target: - target = spack.platforms.host().target("default_target") + target = spack.platforms.host().default_target() operating_system = spec.os if not operating_system: host_platform = spack.platforms.host() - operating_system = host_platform.operating_system("default_os") + operating_system = host_platform.default_operating_system() return operating_system, target diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 468e0309ecfd59..ae7cd7cd93929d 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -37,13 +37,12 @@ def enable_compiler_existence_check(): SpecPairInput = Tuple[Spec, Optional[Spec]] SpecPair = Tuple[Spec, Spec] -SpecLike = Union[Spec, str] TestsType = Union[bool, Iterable[str]] -def concretize_specs_together( - abstract_specs: Sequence[SpecLike], tests: TestsType = False -) -> Sequence[Spec]: +def _concretize_specs_together( + abstract_specs: Sequence[Spec], tests: TestsType = False +) -> List[Spec]: """Given a number of specs as input, tries to concretize them together. Args: @@ -51,11 +50,10 @@ def concretize_specs_together( tests: list of package names for which to consider tests dependencies. If True, all nodes will have test dependencies. If False, test dependencies will be disregarded. """ - import spack.solver.asp + from spack.solver.asp import Solver allow_deprecated = spack.config.get("config:deprecated", False) - solver = spack.solver.asp.Solver() - result = solver.solve(abstract_specs, tests=tests, allow_deprecated=allow_deprecated) + result = Solver().solve(abstract_specs, tests=tests, allow_deprecated=allow_deprecated) return [s.copy() for s in result.specs] @@ -72,7 +70,7 @@ def concretize_together( """ to_concretize = [concrete if concrete else abstract for abstract, concrete in spec_list] abstract_specs = [abstract for abstract, _ in spec_list] - concrete_specs = concretize_specs_together(to_concretize, tests=tests) + concrete_specs = _concretize_specs_together(to_concretize, tests=tests) return list(zip(abstract_specs, concrete_specs)) @@ -90,7 +88,7 @@ def concretize_together_when_possible( tests: list of package names for which to consider tests dependencies. If True, all nodes will have test dependencies. If False, test dependencies will be disregarded. """ - import spack.solver.asp + from spack.solver.asp import Solver to_concretize = [concrete if concrete else abstract for abstract, concrete in spec_list] old_concrete_to_abstract = { @@ -98,9 +96,8 @@ def concretize_together_when_possible( } result_by_user_spec = {} - solver = spack.solver.asp.Solver() allow_deprecated = spack.config.get("config:deprecated", False) - for result in solver.solve_in_rounds( + for result in Solver().solve_in_rounds( to_concretize, tests=tests, allow_deprecated=allow_deprecated ): result_by_user_spec.update(result.specs_by_input) @@ -124,7 +121,7 @@ def concretize_separately( tests: list of package names for which to consider tests dependencies. If True, all nodes will have test dependencies. If False, test dependencies will be disregarded. """ - import spack.bootstrap + from spack.bootstrap import ensure_bootstrap_configuration, ensure_clingo_importable_or_raise to_concretize = [abstract for abstract, concrete in spec_list if not concrete] args = [ @@ -134,8 +131,8 @@ def concretize_separately( ] ret = [(i, abstract) for i, abstract in enumerate(to_concretize) if abstract.concrete] # Ensure we don't try to bootstrap clingo in parallel - with spack.bootstrap.ensure_bootstrap_configuration(): - spack.bootstrap.ensure_clingo_importable_or_raise() + with ensure_bootstrap_configuration(): + ensure_clingo_importable_or_raise() # Ensure all the indexes have been built or updated, since # otherwise the processes in the pool may timeout on waiting @@ -190,10 +187,52 @@ def _concretize_task(packed_arguments: Tuple[int, str, TestsType]) -> Tuple[int, index, spec_str, tests = packed_arguments with tty.SuppressOutput(msg_enabled=False): start = time.time() - spec = Spec(spec_str).concretized(tests=tests) + spec = concretize_one(Spec(spec_str), tests=tests) return index, spec, time.time() - start +def concretize_one(spec: Union[str, Spec], tests: TestsType = False) -> Spec: + """Return a concretized copy of the given spec. + + Args: + tests: if False disregard 'test' dependencies, if a list of names activate them for + the packages in the list, if True activate 'test' dependencies for all packages. + """ + from spack.solver.asp import Solver, SpecBuilder + + if isinstance(spec, str): + spec = Spec(spec) + spec = spec.lookup_hash() + + if spec.concrete: + return spec.copy() + + for node in spec.traverse(): + if not node.name: + raise spack.error.SpecError( + f"Spec {node} has no name; cannot concretize an anonymous spec" + ) + + allow_deprecated = spack.config.get("config:deprecated", False) + result = Solver().solve([spec], tests=tests, allow_deprecated=allow_deprecated) + + # take the best answer + opt, i, answer = min(result.answers) + name = spec.name + # TODO: Consolidate this code with similar code in solve.py + if spack.repo.PATH.is_virtual(spec.name): + providers = [s.name for s in answer.values() if s.package.provides(name)] + name = providers[0] + + node = SpecBuilder.make_node(pkg=name) + assert ( + node in answer + ), f"cannot find {name} in the list of specs {','.join([n.pkg for n in answer.keys()])}" + + concretized = answer[node] + return concretized + + class UnavailableCompilerVersionError(spack.error.SpackError): """Raised when there is no available compiler that satisfies a compiler spec.""" diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index a6719ff5689df9..6eddac23b03761 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -36,6 +36,8 @@ import sys from typing import Any, Callable, Dict, Generator, List, Optional, Sequence, Tuple, Union +import jsonschema + from llnl.util import filesystem, lang, tty import spack.error @@ -51,6 +53,7 @@ import spack.schema.definitions import spack.schema.develop import spack.schema.env +import spack.schema.env_vars import spack.schema.mirrors import spack.schema.modules import spack.schema.packages @@ -68,6 +71,7 @@ "compilers": spack.schema.compilers.schema, "concretizer": spack.schema.concretizer.schema, "definitions": spack.schema.definitions.schema, + "env_vars": spack.schema.env_vars.schema, "view": spack.schema.view.schema, "develop": spack.schema.develop.schema, "mirrors": spack.schema.mirrors.schema, @@ -1061,8 +1065,6 @@ def validate( This leverages the line information (start_mark, end_mark) stored on Spack YAML structures. """ - import jsonschema - try: spack.schema.Validator(schema).validate(data) except jsonschema.ValidationError as e: diff --git a/lib/spack/spack/container/__init__.py b/lib/spack/spack/container/__init__.py index cbeb5974a97c4b..b134aea05d0234 100644 --- a/lib/spack/spack/container/__init__.py +++ b/lib/spack/spack/container/__init__.py @@ -6,6 +6,8 @@ """ import warnings +import jsonschema + import spack.environment as ev import spack.schema.env as env import spack.util.spack_yaml as syaml @@ -30,8 +32,6 @@ def validate(configuration_file): Returns: A sanitized copy of the configuration stored in the input file """ - import jsonschema - with open(configuration_file, encoding="utf-8") as f: config = syaml.load(f) @@ -57,7 +57,7 @@ def validate(configuration_file): # Set the default value of the concretization strategy to unify and # warn if the user explicitly set another value env_dict.setdefault("concretizer", {"unify": True}) - if not env_dict["concretizer"]["unify"] is True: + if env_dict["concretizer"]["unify"] is not True: warnings.warn( '"concretizer:unify" is not set to "true", which means the ' "generated image may contain different variants of the same " diff --git a/lib/spack/spack/container/images.py b/lib/spack/spack/container/images.py index 86b8c0bec72979..ad00090ee77bf9 100644 --- a/lib/spack/spack/container/images.py +++ b/lib/spack/spack/container/images.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Manages the details on the images used in the various stages.""" import json -import os.path +import os import shlex import sys diff --git a/lib/spack/spack/container/writers.py b/lib/spack/spack/container/writers.py index 92fddd7b86f956..e521527be6cae9 100644 --- a/lib/spack/spack/container/writers.py +++ b/lib/spack/spack/container/writers.py @@ -9,6 +9,8 @@ from collections import namedtuple from typing import Optional +import jsonschema + import spack.environment as ev import spack.error import spack.schema.env @@ -188,8 +190,6 @@ def paths(self): @tengine.context_property def manifest(self): """The spack.yaml file that should be used in the image""" - import jsonschema - # Copy in the part of spack.yaml prescribed in the configuration file manifest = copy.deepcopy(self.config) manifest.pop("container") diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index 2ebf77d9c4fcca..76596e3c7711aa 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -41,6 +41,8 @@ Union, ) +import spack.repo + try: import uuid @@ -123,6 +125,15 @@ "deprecated_for", ) +#: File where the database is written +INDEX_JSON_FILE = "index.json" + +# Verifier file to check last modification of the DB +_INDEX_VERIFIER_FILE = "index_verifier" + +# Lockfile for the database +_LOCK_FILE = "lock" + @llnl.util.lang.memoized def _getfqdn(): @@ -260,7 +271,7 @@ class ForbiddenLockError(SpackError): class ForbiddenLock: def __getattr__(self, name): - raise ForbiddenLockError("Cannot access attribute '{0}' of lock".format(name)) + raise ForbiddenLockError(f"Cannot access attribute '{name}' of lock") def __reduce__(self): return ForbiddenLock, tuple() @@ -589,9 +600,9 @@ def __init__( self.layout = layout # Set up layout of database files within the db dir - self._index_path = self.database_directory / "index.json" - self._verifier_path = self.database_directory / "index_verifier" - self._lock_path = self.database_directory / "lock" + self._index_path = self.database_directory / INDEX_JSON_FILE + self._verifier_path = self.database_directory / _INDEX_VERIFIER_FILE + self._lock_path = self.database_directory / _LOCK_FILE self.is_upstream = is_upstream self.last_seen_verifier = "" @@ -606,7 +617,7 @@ def __init__( # initialize rest of state. self.db_lock_timeout = lock_cfg.database_timeout - tty.debug("DATABASE LOCK TIMEOUT: {0}s".format(str(self.db_lock_timeout))) + tty.debug(f"DATABASE LOCK TIMEOUT: {str(self.db_lock_timeout)}s") self.lock: Union[ForbiddenLock, lk.Lock] if self.is_upstream: @@ -1090,7 +1101,7 @@ def _read(self): self._state_is_inconsistent = False return elif self.is_upstream: - tty.warn("upstream not found: {0}".format(self._index_path)) + tty.warn(f"upstream not found: {self._index_path}") def _add( self, @@ -1547,7 +1558,12 @@ def _query( # If we did fine something, the query spec can't be virtual b/c we matched an actual # package installation, so skip the virtual check entirely. If we *didn't* find anything, # check all the deferred specs *if* the query is virtual. - if not results and query_spec is not None and deferred and query_spec.virtual: + if ( + not results + and query_spec is not None + and deferred + and spack.repo.PATH.is_virtual(query_spec.name) + ): results = [spec for spec in deferred if spec.satisfies(query_spec)] return results @@ -1706,7 +1722,7 @@ def query( ) results = list(local_results) + list(x for x in upstream_results if x not in local_results) - results.sort() + results.sort() # type: ignore[call-overload] return results def query_one( diff --git a/lib/spack/spack/detection/common.py b/lib/spack/spack/detection/common.py index ffa1e8fb680f23..d472ec45861d90 100644 --- a/lib/spack/spack/detection/common.py +++ b/lib/spack/spack/detection/common.py @@ -15,7 +15,6 @@ import glob import itertools import os -import os.path import pathlib import re import sys @@ -311,7 +310,7 @@ def find_windows_kit_roots() -> List[str]: @staticmethod def find_windows_kit_bin_paths( - kit_base: Union[Optional[str], Optional[list]] = None + kit_base: Union[Optional[str], Optional[list]] = None, ) -> List[str]: """Returns Windows kit bin directory per version""" kit_base = WindowsKitExternalPaths.find_windows_kit_roots() if not kit_base else kit_base @@ -326,7 +325,7 @@ def find_windows_kit_bin_paths( @staticmethod def find_windows_kit_lib_paths( - kit_base: Union[Optional[str], Optional[list]] = None + kit_base: Union[Optional[str], Optional[list]] = None, ) -> List[str]: """Returns Windows kit lib directory per version""" kit_base = WindowsKitExternalPaths.find_windows_kit_roots() if not kit_base else kit_base diff --git a/lib/spack/spack/detection/path.py b/lib/spack/spack/detection/path.py index 0f72f8da4d55c9..f96a0276a35342 100644 --- a/lib/spack/spack/detection/path.py +++ b/lib/spack/spack/detection/path.py @@ -7,7 +7,6 @@ import collections import concurrent.futures import os -import os.path import re import sys import traceback @@ -244,7 +243,7 @@ def prefix_from_path(self, *, path: str) -> str: raise NotImplementedError("must be implemented by derived classes") def detect_specs( - self, *, pkg: Type["spack.package_base.PackageBase"], paths: List[str] + self, *, pkg: Type["spack.package_base.PackageBase"], paths: Iterable[str] ) -> List["spack.spec.Spec"]: """Given a list of files matching the search patterns, returns a list of detected specs. @@ -260,6 +259,8 @@ def detect_specs( ) return [] + from spack.repo import PATH as repo_path + result = [] for candidate_path, items_in_prefix in _group_by_prefix( llnl.util.lang.dedupe(paths) @@ -306,7 +307,10 @@ def detect_specs( resolved_specs[spec] = candidate_path try: - spec.validate_detection() + # Validate the spec calling a package specific method + pkg_cls = repo_path.get_pkg_class(spec.name) + validate_fn = getattr(pkg_cls, "validate_detected_spec", lambda x, y: None) + validate_fn(spec, spec.extra_attributes) except Exception as e: msg = ( f'"{spec}" has been detected on the system but will ' diff --git a/lib/spack/spack/directives.py b/lib/spack/spack/directives.py index 7b4937b5099b71..bac466ed213560 100644 --- a/lib/spack/spack/directives.py +++ b/lib/spack/spack/directives.py @@ -32,7 +32,7 @@ class OpenMpi(Package): """ import collections import collections.abc -import os.path +import os import re from typing import Any, Callable, List, Optional, Tuple, Type, Union @@ -568,7 +568,7 @@ def patch( """ def _execute_patch( - pkg_or_dep: Union[Type[spack.package_base.PackageBase], Dependency] + pkg_or_dep: Union[Type[spack.package_base.PackageBase], Dependency], ) -> None: pkg = pkg_or_dep.pkg if isinstance(pkg_or_dep, Dependency) else pkg_or_dep diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index 13643a8962b05f..8c2381cf653e0b 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -25,7 +25,7 @@ } -def _check_concrete(spec): +def _check_concrete(spec: "spack.spec.Spec") -> None: """If the spec is not concrete, raise a ValueError""" if not spec.concrete: raise ValueError("Specs passed to a DirectoryLayout must be concrete!") @@ -51,7 +51,7 @@ def specs_from_metadata_dirs(root: str) -> List["spack.spec.Spec"]: spec = _get_spec(prefix) if spec: - spec.prefix = prefix + spec.set_prefix(prefix) specs.append(spec) continue @@ -84,7 +84,7 @@ class DirectoryLayout: def __init__( self, - root, + root: str, *, projections: Optional[Dict[str, str]] = None, hash_length: Optional[int] = None, @@ -120,17 +120,17 @@ def __init__( self.manifest_file_name = "install_manifest.json" @property - def hidden_file_regexes(self): + def hidden_file_regexes(self) -> Tuple[str]: return ("^{0}$".format(re.escape(self.metadata_dir)),) - def relative_path_for_spec(self, spec): + def relative_path_for_spec(self, spec: "spack.spec.Spec") -> str: _check_concrete(spec) projection = spack.projections.get_projection(self.projections, spec) path = spec.format_path(projection) return str(Path(path)) - def write_spec(self, spec, path): + def write_spec(self, spec: "spack.spec.Spec", path: str) -> None: """Write a spec out to a file.""" _check_concrete(spec) with open(path, "w", encoding="utf-8") as f: @@ -138,7 +138,7 @@ def write_spec(self, spec, path): # the full provenance, so it's availabe if we want it later spec.to_json(f, hash=ht.dag_hash) - def write_host_environment(self, spec): + def write_host_environment(self, spec: "spack.spec.Spec") -> None: """The host environment is a json file with os, kernel, and spack versioning. We use it in the case that an analysis later needs to easily access this information. @@ -148,7 +148,7 @@ def write_host_environment(self, spec): with open(env_file, "w", encoding="utf-8") as fd: sjson.dump(environ, fd) - def read_spec(self, path): + def read_spec(self, path: str) -> "spack.spec.Spec": """Read the contents of a file and parse them as a spec""" try: with open(path, encoding="utf-8") as f: @@ -159,26 +159,28 @@ def read_spec(self, path): # Too late for conversion; spec_file_path() already called. spec = spack.spec.Spec.from_yaml(f) else: - raise SpecReadError( - "Did not recognize spec file extension:" " {0}".format(extension) - ) + raise SpecReadError(f"Did not recognize spec file extension: {extension}") except Exception as e: if spack.config.get("config:debug"): raise - raise SpecReadError("Unable to read file: %s" % path, "Cause: " + str(e)) + raise SpecReadError(f"Unable to read file: {path}", f"Cause: {e}") # Specs read from actual installations are always concrete spec._mark_concrete() return spec - def spec_file_path(self, spec): + def spec_file_path(self, spec: "spack.spec.Spec") -> str: """Gets full path to spec file""" _check_concrete(spec) yaml_path = os.path.join(self.metadata_path(spec), self._spec_file_name_yaml) json_path = os.path.join(self.metadata_path(spec), self.spec_file_name) return yaml_path if os.path.exists(yaml_path) else json_path - def deprecated_file_path(self, deprecated_spec, deprecator_spec=None): + def deprecated_file_path( + self, + deprecated_spec: "spack.spec.Spec", + deprecator_spec: Optional["spack.spec.Spec"] = None, + ) -> str: """Gets full path to spec file for deprecated spec If the deprecator_spec is provided, use that. Otherwise, assume @@ -212,16 +214,16 @@ def deprecated_file_path(self, deprecated_spec, deprecator_spec=None): return yaml_path if os.path.exists(yaml_path) else json_path - def metadata_path(self, spec): + def metadata_path(self, spec: "spack.spec.Spec") -> str: return os.path.join(spec.prefix, self.metadata_dir) - def env_metadata_path(self, spec): + def env_metadata_path(self, spec: "spack.spec.Spec") -> str: return os.path.join(self.metadata_path(spec), "install_environment.json") - def build_packages_path(self, spec): + def build_packages_path(self, spec: "spack.spec.Spec") -> str: return os.path.join(self.metadata_path(spec), self.packages_dir) - def create_install_directory(self, spec): + def create_install_directory(self, spec: "spack.spec.Spec") -> None: _check_concrete(spec) # Create install directory with properly configured permissions @@ -239,7 +241,7 @@ def create_install_directory(self, spec): self.write_spec(spec, self.spec_file_path(spec)) - def ensure_installed(self, spec): + def ensure_installed(self, spec: "spack.spec.Spec") -> None: """ Throws InconsistentInstallDirectoryError if: 1. spec prefix does not exist @@ -266,7 +268,7 @@ def ensure_installed(self, spec): "Spec file in %s does not match hash!" % spec_file_path ) - def path_for_spec(self, spec): + def path_for_spec(self, spec: "spack.spec.Spec") -> str: """Return absolute path from the root to a directory for the spec.""" _check_concrete(spec) @@ -277,23 +279,13 @@ def path_for_spec(self, spec): assert not path.startswith(self.root) return os.path.join(self.root, path) - def remove_install_directory(self, spec, deprecated=False): + def remove_install_directory(self, spec: "spack.spec.Spec", deprecated: bool = False) -> None: """Removes a prefix and any empty parent directories from the root. Raised RemoveFailedError if something goes wrong. """ path = self.path_for_spec(spec) assert path.startswith(self.root) - # Windows readonly files cannot be removed by Python - # directly, change permissions before attempting to remove - if sys.platform == "win32": - kwargs = { - "ignore_errors": False, - "onerror": fs.readonly_file_handler(ignore_errors=False), - } - else: - kwargs = {} # the default value for ignore_errors is false - if deprecated: if os.path.exists(path): try: @@ -304,7 +296,16 @@ def remove_install_directory(self, spec, deprecated=False): raise RemoveFailedError(spec, path, e) from e elif os.path.exists(path): try: - shutil.rmtree(path, **kwargs) + if sys.platform == "win32": + # Windows readonly files cannot be removed by Python + # directly, change permissions before attempting to remove + shutil.rmtree( + path, + ignore_errors=False, + onerror=fs.readonly_file_handler(ignore_errors=False), + ) + else: + shutil.rmtree(path) except OSError as e: raise RemoveFailedError(spec, path, e) from e diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py index 7877a847645d55..92bdc6871fe863 100644 --- a/lib/spack/spack/environment/environment.py +++ b/lib/spack/spack/environment/environment.py @@ -581,7 +581,7 @@ def _error_on_nonempty_view_dir(new_root): # Check if the target path lexists try: st = os.lstat(new_root) - except (IOError, OSError): + except OSError: return # Empty directories are fine @@ -861,7 +861,7 @@ def regenerate(self, concrete_roots: List[Spec]) -> None: ): try: shutil.rmtree(old_root) - except (IOError, OSError) as e: + except OSError as e: msg = "Failed to remove old view at %s\n" % old_root msg += str(e) tty.warn(msg) @@ -2554,7 +2554,7 @@ def is_latest_format(manifest): try: with open(manifest, encoding="utf-8") as f: data = syaml.load(f) - except (OSError, IOError): + except OSError: return True top_level_key = _top_level_key(data) changed = spack.schema.env.update(data[top_level_key]) @@ -2634,6 +2634,32 @@ def _ensure_env_dir(): shutil.copy(envfile, target_manifest) + # Copy relative path includes that live inside the environment dir + try: + manifest = EnvironmentManifestFile(environment_dir) + except Exception: + # error handling for bad manifests is handled on other code paths + return + + includes = manifest[TOP_LEVEL_KEY].get("include", []) + for include in includes: + if os.path.isabs(include): + continue + + abspath = pathlib.Path(os.path.normpath(environment_dir / include)) + common_path = pathlib.Path(os.path.commonpath([environment_dir, abspath])) + if common_path != environment_dir: + tty.debug(f"Will not copy relative include from outside environment: {include}") + continue + + orig_abspath = os.path.normpath(envfile.parent / include) + if not os.path.exists(orig_abspath): + tty.warn(f"Included file does not exist; will not copy: '{include}'") + continue + + fs.touchp(abspath) + shutil.copy(orig_abspath, abspath) + class EnvironmentManifestFile(collections.abc.Mapping): """Manages the in-memory representation of a manifest file, and its synchronization diff --git a/lib/spack/spack/environment/shell.py b/lib/spack/spack/environment/shell.py index cb2b541e9ed14c..534ced56ea4a51 100644 --- a/lib/spack/spack/environment/shell.py +++ b/lib/spack/spack/environment/shell.py @@ -10,6 +10,7 @@ import spack.environment as ev import spack.repo +import spack.schema.environment import spack.store from spack.util.environment import EnvironmentModifications @@ -156,6 +157,11 @@ def activate( # MANPATH, PYTHONPATH, etc. All variables that end in PATH (case-sensitive) # become PATH variables. # + + env_vars_yaml = env.manifest.configuration.get("env_vars", None) + if env_vars_yaml: + env_mods.extend(spack.schema.environment.parse(env_vars_yaml)) + try: if view and env.has_view(view): with spack.store.STORE.db.read_transaction(): @@ -189,6 +195,10 @@ def deactivate() -> EnvironmentModifications: if active is None: return env_mods + env_vars_yaml = active.manifest.configuration.get("env_vars", None) + if env_vars_yaml: + env_mods.extend(spack.schema.environment.parse(env_vars_yaml).reversed()) + active_view = os.getenv(ev.spack_env_view_var) if active_view and active.has_view(active_view): diff --git a/lib/spack/spack/extensions.py b/lib/spack/spack/extensions.py index 4cface72f88f73..76626d93a97744 100644 --- a/lib/spack/spack/extensions.py +++ b/lib/spack/spack/extensions.py @@ -187,7 +187,7 @@ def path_for_extension(target_name: str, *, paths: List[str]) -> str: if name == target_name: return path else: - raise IOError('extension "{0}" not found'.format(target_name)) + raise OSError('extension "{0}" not found'.format(target_name)) def get_module(cmd_name): diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index a9a9e1d059a0a5..a7cfaaf2930798 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -25,7 +25,6 @@ import functools import http.client import os -import os.path import re import shutil import urllib.error @@ -321,9 +320,15 @@ def _fetch_urllib(self, url): request = urllib.request.Request(url, headers={"User-Agent": web_util.SPACK_USER_AGENT}) + if os.path.lexists(save_file): + os.remove(save_file) + try: response = web_util.urlopen(request) - except (TimeoutError, urllib.error.URLError) as e: + tty.msg(f"Fetching {url}") + with open(save_file, "wb") as f: + shutil.copyfileobj(response, f) + except OSError as e: # clean up archive on failure. if self.archive_file: os.remove(self.archive_file) @@ -331,14 +336,6 @@ def _fetch_urllib(self, url): os.remove(save_file) raise FailedDownloadError(e) from e - tty.msg(f"Fetching {url}") - - if os.path.lexists(save_file): - os.remove(save_file) - - with open(save_file, "wb") as f: - shutil.copyfileobj(response, f) - # Save the redirected URL for error messages. Sometimes we're redirected to an arbitrary # mirror that is broken, leading to spurious download failures. In that case it's helpful # for users to know which URL was actually fetched. @@ -535,11 +532,16 @@ def __init__(self, *, url: str, checksum: Optional[str] = None, **kwargs): @_needs_stage def fetch(self): file = self.stage.save_filename - tty.msg(f"Fetching {self.url}") + + if os.path.lexists(file): + os.remove(file) try: response = self._urlopen(self.url) - except (TimeoutError, urllib.error.URLError) as e: + tty.msg(f"Fetching {self.url}") + with open(file, "wb") as f: + shutil.copyfileobj(response, f) + except OSError as e: # clean up archive on failure. if self.archive_file: os.remove(self.archive_file) @@ -547,12 +549,6 @@ def fetch(self): os.remove(file) raise FailedDownloadError(e) from e - if os.path.lexists(file): - os.remove(file) - - with open(file, "wb") as f: - shutil.copyfileobj(response, f) - class VCSFetchStrategy(FetchStrategy): """Superclass for version control system fetch strategies. diff --git a/lib/spack/spack/filesystem_view.py b/lib/spack/spack/filesystem_view.py index 1b3ac455a25101..855d7384e4aa19 100644 --- a/lib/spack/spack/filesystem_view.py +++ b/lib/spack/spack/filesystem_view.py @@ -9,7 +9,8 @@ import shutil import stat import sys -from typing import Callable, Dict, Optional +import tempfile +from typing import Callable, Dict, List, Optional from typing_extensions import Literal @@ -77,7 +78,7 @@ def view_copy( # Order of this dict is somewhat irrelevant prefix_to_projection = { - s.prefix: view.get_projection_for_spec(s) + str(s.prefix): view.get_projection_for_spec(s) for s in spec.traverse(root=True, order="breadth") if not s.external } @@ -89,10 +90,10 @@ def view_copy( if stat.S_ISLNK(src_stat.st_mode): spack.relocate.relocate_links(links=[dst], prefix_to_prefix=prefix_to_projection) elif spack.relocate.is_binary(dst): - spack.relocate.relocate_text_bin(binaries=[dst], prefixes=prefix_to_projection) + spack.relocate.relocate_text_bin(binaries=[dst], prefix_to_prefix=prefix_to_projection) else: prefix_to_projection[spack.store.STORE.layout.root] = view._root - spack.relocate.relocate_text(files=[dst], prefixes=prefix_to_projection) + spack.relocate.relocate_text(files=[dst], prefix_to_prefix=prefix_to_projection) # The os module on Windows does not have a chown function. if sys.platform != "win32": @@ -184,7 +185,7 @@ def __init__( def link(self, src: str, dst: str, spec: Optional[spack.spec.Spec] = None) -> None: self._link(src, dst, self, spec) - def add_specs(self, *specs, **kwargs): + def add_specs(self, *specs: spack.spec.Spec, **kwargs) -> None: """ Add given specs to view. @@ -199,19 +200,19 @@ def add_specs(self, *specs, **kwargs): """ raise NotImplementedError - def add_standalone(self, spec): + def add_standalone(self, spec: spack.spec.Spec) -> bool: """ Add (link) a standalone package into this view. """ raise NotImplementedError - def check_added(self, spec): + def check_added(self, spec: spack.spec.Spec) -> bool: """ Check if the given concrete spec is active in this view. """ raise NotImplementedError - def remove_specs(self, *specs, **kwargs): + def remove_specs(self, *specs: spack.spec.Spec, **kwargs) -> None: """ Removes given specs from view. @@ -230,25 +231,25 @@ def remove_specs(self, *specs, **kwargs): """ raise NotImplementedError - def remove_standalone(self, spec): + def remove_standalone(self, spec: spack.spec.Spec) -> None: """ Remove (unlink) a standalone package from this view. """ raise NotImplementedError - def get_projection_for_spec(self, spec): + def get_projection_for_spec(self, spec: spack.spec.Spec) -> str: """ Get the projection in this view for a spec. """ raise NotImplementedError - def get_all_specs(self): + def get_all_specs(self) -> List[spack.spec.Spec]: """ Get all specs currently active in this view. """ raise NotImplementedError - def get_spec(self, spec): + def get_spec(self, spec: spack.spec.Spec) -> Optional[spack.spec.Spec]: """ Return the actual spec linked in this view (i.e. do not look it up in the database by name). @@ -262,7 +263,7 @@ def get_spec(self, spec): """ raise NotImplementedError - def print_status(self, *specs, **kwargs): + def print_status(self, *specs: spack.spec.Spec, **kwargs) -> None: """ Print a short summary about the given specs, detailing whether.. * ..they are active in the view. @@ -427,7 +428,7 @@ def needs_file(spec, file): try: with open(manifest_file, "r", encoding="utf-8") as f: manifest = s_json.load(f) - except (OSError, IOError): + except OSError: # if we can't load it, assume it doesn't know about the file. manifest = {} return test_path in manifest @@ -693,7 +694,7 @@ def _sanity_check_view_projection(self, specs): raise ConflictingSpecsError(current_spec, conflicting_spec) seen[metadata_dir] = current_spec - def add_specs(self, *specs: spack.spec.Spec) -> None: + def add_specs(self, *specs, **kwargs) -> None: """Link a root-to-leaf topologically ordered list of specs into the view.""" assert all((s.concrete for s in specs)) if len(specs) == 0: @@ -708,7 +709,10 @@ def add_specs(self, *specs: spack.spec.Spec) -> None: def skip_list(file): return os.path.basename(file) == spack.store.STORE.layout.metadata_dir - visitor = SourceMergeVisitor(ignore=skip_list) + # Determine if the root is on a case-insensitive filesystem + normalize_paths = is_folder_on_case_insensitive_filesystem(self._root) + + visitor = SourceMergeVisitor(ignore=skip_list, normalize_paths=normalize_paths) # Gather all the directories to be made and files to be linked for spec in specs: @@ -827,11 +831,11 @@ def get_projection_for_spec(self, spec): ##################### # utility functions # ##################### -def get_spec_from_file(filename): +def get_spec_from_file(filename) -> Optional[spack.spec.Spec]: try: with open(filename, "r", encoding="utf-8") as f: return spack.spec.Spec.from_yaml(f) - except IOError: + except OSError: return None @@ -884,3 +888,8 @@ def get_dependencies(specs): class ConflictingProjectionsError(SpackError): """Raised when a view has a projections file and is given one manually.""" + + +def is_folder_on_case_insensitive_filesystem(path: str) -> bool: + with tempfile.NamedTemporaryFile(dir=path, prefix=".sentinel") as sentinel: + return os.path.exists(os.path.join(path, os.path.basename(sentinel.name).upper())) diff --git a/lib/spack/spack/graph.py b/lib/spack/spack/graph.py index cc3918ae1de024..558950686bc2a5 100644 --- a/lib/spack/spack/graph.py +++ b/lib/spack/spack/graph.py @@ -42,10 +42,10 @@ import llnl.util.tty.color import spack.deptypes as dt -import spack.repo import spack.spec import spack.tengine import spack.traverse +from spack.solver.input_analysis import create_graph_analyzer def find(seq, predicate): @@ -537,10 +537,11 @@ def edge_entry(self, edge): def _static_edges(specs, depflag): for spec in specs: - pkg_cls = spack.repo.PATH.get_pkg_class(spec.name) - possible = pkg_cls.possible_dependencies(expand_virtuals=True, depflag=depflag) + *_, edges = create_graph_analyzer().possible_dependencies( + spec.name, expand_virtuals=True, allowed_deps=depflag + ) - for parent_name, dependencies in possible.items(): + for parent_name, dependencies in edges.items(): for dependency_name in dependencies: yield spack.spec.DependencySpec( spack.spec.Spec(parent_name), diff --git a/lib/spack/spack/hooks/absolutify_elf_sonames.py b/lib/spack/spack/hooks/absolutify_elf_sonames.py index 32277bfc44c103..aaf8194510c373 100644 --- a/lib/spack/spack/hooks/absolutify_elf_sonames.py +++ b/lib/spack/spack/hooks/absolutify_elf_sonames.py @@ -26,7 +26,7 @@ def is_shared_library_elf(filepath): with open(filepath, "rb") as f: elf = parse_elf(f, interpreter=True, dynamic_section=True) return elf.has_pt_dynamic and (elf.has_soname or not elf.has_pt_interp) - except (IOError, OSError, ElfParsingError): + except (OSError, ElfParsingError): return False diff --git a/lib/spack/spack/hooks/resolve_shared_libraries.py b/lib/spack/spack/hooks/resolve_shared_libraries.py index c10fe3ca7882b7..62500cead186d6 100644 --- a/lib/spack/spack/hooks/resolve_shared_libraries.py +++ b/lib/spack/spack/hooks/resolve_shared_libraries.py @@ -2,198 +2,14 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import fnmatch import io -import os -import re -from typing import Dict, List, Union import llnl.util.tty as tty -from llnl.util.filesystem import BaseDirectoryVisitor, visit_directory_tree -from llnl.util.lang import stable_partition +from llnl.util.filesystem import visit_directory_tree import spack.config import spack.error -import spack.util.elf as elf - -#: Patterns for names of libraries that are allowed to be unresolved when *just* looking at RPATHs -#: added by Spack. These are libraries outside of Spack's control, and assumed to be located in -#: default search paths of the dynamic linker. -ALLOW_UNRESOLVED = [ - # kernel - "linux-vdso.so.*", - "libselinux.so.*", - # musl libc - "ld-musl-*.so.*", - # glibc - "ld-linux*.so.*", - "ld64.so.*", - "libanl.so.*", - "libc.so.*", - "libdl.so.*", - "libm.so.*", - "libmemusage.so.*", - "libmvec.so.*", - "libnsl.so.*", - "libnss_compat.so.*", - "libnss_db.so.*", - "libnss_dns.so.*", - "libnss_files.so.*", - "libnss_hesiod.so.*", - "libpcprofile.so.*", - "libpthread.so.*", - "libresolv.so.*", - "librt.so.*", - "libSegFault.so.*", - "libthread_db.so.*", - "libutil.so.*", - # gcc -- this is required even with gcc-runtime, because e.g. libstdc++ depends on libgcc_s, - # but the binaries we copy from the compiler don't have an $ORIGIN rpath. - "libasan.so.*", - "libatomic.so.*", - "libcc1.so.*", - "libgcc_s.so.*", - "libgfortran.so.*", - "libgomp.so.*", - "libitm.so.*", - "liblsan.so.*", - "libquadmath.so.*", - "libssp.so.*", - "libstdc++.so.*", - "libtsan.so.*", - "libubsan.so.*", - # systemd - "libudev.so.*", - # cuda driver - "libcuda.so.*", -] - - -def is_compatible(parent: elf.ElfFile, child: elf.ElfFile) -> bool: - return ( - child.elf_hdr.e_type == elf.ELF_CONSTANTS.ET_DYN - and parent.is_little_endian == child.is_little_endian - and parent.is_64_bit == child.is_64_bit - and parent.elf_hdr.e_machine == child.elf_hdr.e_machine - ) - - -def candidate_matches(current_elf: elf.ElfFile, candidate_path: bytes) -> bool: - try: - with open(candidate_path, "rb") as g: - return is_compatible(current_elf, elf.parse_elf(g)) - except (OSError, elf.ElfParsingError): - return False - - -class Problem: - def __init__( - self, resolved: Dict[bytes, bytes], unresolved: List[bytes], relative_rpaths: List[bytes] - ) -> None: - self.resolved = resolved - self.unresolved = unresolved - self.relative_rpaths = relative_rpaths - - -class ResolveSharedElfLibDepsVisitor(BaseDirectoryVisitor): - def __init__(self, allow_unresolved_patterns: List[str]) -> None: - self.problems: Dict[str, Problem] = {} - self._allow_unresolved_regex = re.compile( - "|".join(fnmatch.translate(x) for x in allow_unresolved_patterns) - ) - - def allow_unresolved(self, needed: bytes) -> bool: - try: - name = needed.decode("utf-8") - except UnicodeDecodeError: - return False - return bool(self._allow_unresolved_regex.match(name)) - - def visit_file(self, root: str, rel_path: str, depth: int) -> None: - # We work with byte strings for paths. - path = os.path.join(root, rel_path).encode("utf-8") - - # For $ORIGIN interpolation: should not have trailing dir seperator. - origin = os.path.dirname(path) - - # Retrieve the needed libs + rpaths. - try: - with open(path, "rb") as f: - parsed_elf = elf.parse_elf(f, interpreter=False, dynamic_section=True) - except (OSError, elf.ElfParsingError): - # Not dealing with an invalid ELF file. - return - - # If there's no needed libs all is good - if not parsed_elf.has_needed: - return - - # Get the needed libs and rpaths (notice: byte strings) - # Don't force an encoding cause paths are just a bag of bytes. - needed_libs = parsed_elf.dt_needed_strs - - rpaths = parsed_elf.dt_rpath_str.split(b":") if parsed_elf.has_rpath else [] - - # We only interpolate $ORIGIN, not $LIB and $PLATFORM, they're not really - # supported in general. Also remove empty paths. - rpaths = [x.replace(b"$ORIGIN", origin) for x in rpaths if x] - - # Do not allow relative rpaths (they are relative to the current working directory) - rpaths, relative_rpaths = stable_partition(rpaths, os.path.isabs) - - # If there's a / in the needed lib, it's opened directly, otherwise it needs - # a search. - direct_libs, search_libs = stable_partition(needed_libs, lambda x: b"/" in x) - - # Do not allow relative paths in direct libs (they are relative to the current working - # directory) - direct_libs, unresolved = stable_partition(direct_libs, os.path.isabs) - - resolved: Dict[bytes, bytes] = {} - - for lib in search_libs: - if self.allow_unresolved(lib): - continue - for rpath in rpaths: - candidate = os.path.join(rpath, lib) - if candidate_matches(parsed_elf, candidate): - resolved[lib] = candidate - break - else: - unresolved.append(lib) - - # Check if directly opened libs are compatible - for lib in direct_libs: - if candidate_matches(parsed_elf, lib): - resolved[lib] = lib - else: - unresolved.append(lib) - - if unresolved or relative_rpaths: - self.problems[rel_path] = Problem(resolved, unresolved, relative_rpaths) - - def visit_symlinked_file(self, root: str, rel_path: str, depth: int) -> None: - pass - - def before_visit_dir(self, root: str, rel_path: str, depth: int) -> bool: - # There can be binaries in .spack/test which shouldn't be checked. - if rel_path == ".spack": - return False - return True - - def before_visit_symlinked_dir(self, root: str, rel_path: str, depth: int) -> bool: - return False - - -class CannotLocateSharedLibraries(spack.error.SpackError): - pass - - -def maybe_decode(byte_str: bytes) -> Union[str, bytes]: - try: - return byte_str.decode("utf-8") - except UnicodeDecodeError: - return byte_str +import spack.verify_libraries def post_install(spec, explicit): @@ -204,36 +20,23 @@ def post_install(spec, explicit): if policy == "ignore" or spec.external or spec.platform not in ("linux", "freebsd"): return - visitor = ResolveSharedElfLibDepsVisitor( - [*ALLOW_UNRESOLVED, *spec.package.unresolved_libraries] + visitor = spack.verify_libraries.ResolveSharedElfLibDepsVisitor( + [*spack.verify_libraries.ALLOW_UNRESOLVED, *spec.package.unresolved_libraries] ) visit_directory_tree(spec.prefix, visitor) - # All good? if not visitor.problems: return - # For now just list the issues (print it in ldd style, except we don't recurse) - output = io.StringIO() - output.write("not all executables and libraries can resolve their dependencies:\n") - for path, problem in visitor.problems.items(): - output.write(path) - output.write("\n") - for needed, full_path in problem.resolved.items(): - output.write(" ") - if needed == full_path: - output.write(maybe_decode(needed)) - else: - output.write(f"{maybe_decode(needed)} => {maybe_decode(full_path)}") - output.write("\n") - for not_found in problem.unresolved: - output.write(f" {maybe_decode(not_found)} => not found\n") - for relative_rpath in problem.relative_rpaths: - output.write(f" {maybe_decode(relative_rpath)} => relative rpath\n") - + output = io.StringIO("not all executables and libraries can resolve their dependencies:\n") + visitor.write(output) message = output.getvalue().strip() if policy == "error": raise CannotLocateSharedLibraries(message) tty.warn(message) + + +class CannotLocateSharedLibraries(spack.error.SpackError): + pass diff --git a/lib/spack/spack/hooks/sbang.py b/lib/spack/spack/hooks/sbang.py index b8b3683d8b2e3b..5c0a3ac8561b63 100644 --- a/lib/spack/spack/hooks/sbang.py +++ b/lib/spack/spack/hooks/sbang.py @@ -166,7 +166,7 @@ def filter_shebangs_in_directory(directory, filenames=None): # Only look at executable, non-symlink files. try: st = os.lstat(path) - except (IOError, OSError): + except OSError: continue if stat.S_ISLNK(st.st_mode) or stat.S_ISDIR(st.st_mode) or not st.st_mode & is_exe: diff --git a/lib/spack/spack/install_test.py b/lib/spack/spack/install_test.py index cf7dc0076210da..f84f22bbe8e49a 100644 --- a/lib/spack/spack/install_test.py +++ b/lib/spack/spack/install_test.py @@ -566,7 +566,7 @@ def copy_test_files(pkg: Pb, test_spec: spack.spec.Spec): # copy test data into test stage data dir try: - pkg_cls = test_spec.package_class + pkg_cls = spack.repo.PATH.get_pkg_class(test_spec.fullname) except spack.repo.UnknownPackageError: tty.debug(f"{test_spec.name}: skipping test data copy since no package class found") return @@ -623,7 +623,7 @@ def test_functions( vpkgs = virtuals(pkg) for vname in vpkgs: try: - classes.append((Spec(vname)).package_class) + classes.append(spack.repo.PATH.get_pkg_class(vname)) except spack.repo.UnknownPackageError: tty.debug(f"{vname}: virtual does not appear to have a package file") @@ -668,7 +668,7 @@ def process_test_parts(pkg: Pb, test_specs: List[spack.spec.Spec], verbose: bool # grab test functions associated with the spec, which may be virtual try: - tests = test_functions(spec.package_class) + tests = test_functions(spack.repo.PATH.get_pkg_class(spec.fullname)) except spack.repo.UnknownPackageError: # Some virtuals don't have a package so we don't want to report # them as not having tests when that isn't appropriate. diff --git a/lib/spack/spack/installer.py b/lib/spack/spack/installer.py index 4fc0b73477202e..37a1301733a306 100644 --- a/lib/spack/spack/installer.py +++ b/lib/spack/spack/installer.py @@ -275,7 +275,7 @@ def _do_fake_install(pkg: "spack.package_base.PackageBase") -> None: fs.mkdirp(pkg.prefix.bin) fs.touch(os.path.join(pkg.prefix.bin, command)) if sys.platform != "win32": - chmod = which("chmod") + chmod = which("chmod", required=True) chmod("+x", os.path.join(pkg.prefix.bin, command)) # Install fake header file @@ -814,7 +814,7 @@ def get_depflags(self, pkg: "spack.package_base.PackageBase") -> int: # Include build dependencies if pkg is going to be built from sources, or # if build deps are explicitly requested. if include_build_deps or not ( - cache_only or pkg.spec.installed and not pkg.spec.dag_hash() in self.overwrite + cache_only or pkg.spec.installed and pkg.spec.dag_hash() not in self.overwrite ): depflag |= dt.BUILD if self.run_tests(pkg): @@ -2436,11 +2436,7 @@ def _real_install(self) -> None: # DEBUGGING TIP - to debug this section, insert an IPython # embed here, and run the sections below without log capture log_contextmanager = log_output( - log_file, - self.echo, - True, - env=self.unmodified_env, - filter_fn=self.filter_fn, + log_file, self.echo, True, filter_fn=self.filter_fn ) with log_contextmanager as logger: diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py index 389ab0e4b3e22b..36dc547254d813 100644 --- a/lib/spack/spack/main.py +++ b/lib/spack/spack/main.py @@ -14,7 +14,6 @@ import io import operator import os -import os.path import pstats import re import shlex @@ -164,7 +163,7 @@ def format_help_sections(self, level): # lazily add all commands to the parser when needed. add_all_commands(self) - """Print help on subcommands in neatly formatted sections.""" + # Print help on subcommands in neatly formatted sections. formatter = self._get_formatter() # Create a list of subcommand actions. Argparse internals are nasty! @@ -729,7 +728,7 @@ def _compatible_sys_types(): with the current host. """ host_platform = spack.platforms.host() - host_os = str(host_platform.operating_system("default_os")) + host_os = str(host_platform.default_operating_system()) host_target = archspec.cpu.host() compatible_targets = [host_target] + host_target.ancestors diff --git a/lib/spack/spack/mirrors/layout.py b/lib/spack/spack/mirrors/layout.py index 96867832e02bf7..9b899762179b46 100644 --- a/lib/spack/spack/mirrors/layout.py +++ b/lib/spack/spack/mirrors/layout.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path from typing import Optional import llnl.url diff --git a/lib/spack/spack/mirrors/mirror.py b/lib/spack/spack/mirrors/mirror.py index 1629cc9f759be4..7f3527a28c2d9e 100644 --- a/lib/spack/spack/mirrors/mirror.py +++ b/lib/spack/spack/mirrors/mirror.py @@ -64,7 +64,7 @@ def from_local_path(path: str): @staticmethod def from_url(url: str): """Create an anonymous mirror by URL. This method validates the URL.""" - if not urllib.parse.urlparse(url).scheme in supported_url_schemes: + if urllib.parse.urlparse(url).scheme not in supported_url_schemes: raise ValueError( f'"{url}" is not a valid mirror URL. ' f"Scheme must be one of {supported_url_schemes}." diff --git a/lib/spack/spack/mirrors/utils.py b/lib/spack/spack/mirrors/utils.py index 8fadd211fd713b..7e3a62b05133ae 100644 --- a/lib/spack/spack/mirrors/utils.py +++ b/lib/spack/spack/mirrors/utils.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import traceback import llnl.util.tty as tty diff --git a/lib/spack/spack/modules/common.py b/lib/spack/spack/modules/common.py index 0d1ef70127e9e2..702d473c556ce3 100644 --- a/lib/spack/spack/modules/common.py +++ b/lib/spack/spack/modules/common.py @@ -31,7 +31,7 @@ import copy import datetime import inspect -import os.path +import os import re import string from typing import List, Optional @@ -330,18 +330,17 @@ class BaseConfiguration: default_projections = {"all": "{name}/{version}-{compiler.name}-{compiler.version}"} def __init__(self, spec: spack.spec.Spec, module_set_name: str, explicit: bool) -> None: - # Module where type(self) is defined - m = inspect.getmodule(self) - assert m is not None # make mypy happy - self.module = m # Spec for which we want to generate a module file self.spec = spec self.name = module_set_name self.explicit = explicit - # Dictionary of configuration options that should be applied - # to the spec + # Dictionary of configuration options that should be applied to the spec self.conf = merge_config_rules(self.module.configuration(self.name), self.spec) + @property + def module(self): + return inspect.getmodule(self) + @property def projections(self): """Projection from specs to module names""" @@ -775,10 +774,6 @@ def __init__( ) -> None: self.spec = spec - # This class is meant to be derived. Get the module of the - # actual writer. - self.module = inspect.getmodule(self) - assert self.module is not None # make mypy happy m = self.module # Create the triplet of configuration/layout/context @@ -816,6 +811,10 @@ def __init__( name = type(self).__name__ raise ModulercHeaderNotDefined(msg.format(name)) + @property + def module(self): + return inspect.getmodule(self) + def _get_template(self): """Gets the template that will be rendered for this spec.""" # Get templates and put them in the order of importance: diff --git a/lib/spack/spack/modules/lmod.py b/lib/spack/spack/modules/lmod.py index 7373b3c7d1fa3a..13db094c787208 100644 --- a/lib/spack/spack/modules/lmod.py +++ b/lib/spack/spack/modules/lmod.py @@ -4,7 +4,7 @@ import collections import itertools -import os.path +import os from typing import Dict, List, Optional, Tuple import llnl.util.filesystem as fs @@ -209,7 +209,7 @@ def provides(self): # All the other tokens in the hierarchy must be virtual dependencies for x in self.hierarchy_tokens: if self.spec.package.provides(x): - provides[x] = self.spec[x] + provides[x] = self.spec return provides @property diff --git a/lib/spack/spack/modules/tcl.py b/lib/spack/spack/modules/tcl.py index b40f14dfcd39c6..78542b2568ccbe 100644 --- a/lib/spack/spack/modules/tcl.py +++ b/lib/spack/spack/modules/tcl.py @@ -5,7 +5,7 @@ """This module implements the classes necessary to generate Tcl non-hierarchical modules. """ -import os.path +import os from typing import Dict, Optional, Tuple import spack.config diff --git a/lib/spack/spack/oci/opener.py b/lib/spack/spack/oci/opener.py index dd4fdce17bc65a..eb79c216901c90 100644 --- a/lib/spack/spack/oci/opener.py +++ b/lib/spack/spack/oci/opener.py @@ -7,6 +7,7 @@ import base64 import json import re +import socket import time import urllib.error import urllib.parse @@ -382,6 +383,7 @@ def create_opener(): """Create an opener that can handle OCI authentication.""" opener = urllib.request.OpenerDirector() for handler in [ + urllib.request.ProxyHandler(), urllib.request.UnknownHandler(), urllib.request.HTTPSHandler(context=spack.util.web.ssl_create_default_context()), spack.util.web.SpackHTTPDefaultErrorHandler(), @@ -410,7 +412,7 @@ def wrapper(*args, **kwargs): for i in range(retries): try: return f(*args, **kwargs) - except (urllib.error.URLError, TimeoutError) as e: + except OSError as e: # Retry on internal server errors, and rate limit errors # Potentially this could take into account the Retry-After header # if registries support it @@ -420,9 +422,10 @@ def wrapper(*args, **kwargs): and (500 <= e.code < 600 or e.code == 429) ) or ( - isinstance(e, urllib.error.URLError) and isinstance(e.reason, TimeoutError) + isinstance(e, urllib.error.URLError) + and isinstance(e.reason, socket.timeout) ) - or isinstance(e, TimeoutError) + or isinstance(e, socket.timeout) ): # Exponential backoff sleep(2**i) diff --git a/lib/spack/spack/operating_systems/_operating_system.py b/lib/spack/spack/operating_systems/_operating_system.py index 8cdf1bad8ad264..734faa1d8ddd12 100644 --- a/lib/spack/spack/operating_systems/_operating_system.py +++ b/lib/spack/spack/operating_systems/_operating_system.py @@ -3,8 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import llnl.util.lang -import spack.util.spack_yaml as syaml - @llnl.util.lang.lazy_lexicographic_ordering class OperatingSystem: @@ -42,4 +40,4 @@ def _cmp_iter(self): yield self.version def to_dict(self): - return syaml.syaml_dict([("name", self.name), ("version", self.version)]) + return {"name": self.name, "version": self.version} diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 23254815c19c5f..bf2056d826d88e 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -2,31 +2,64 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -# flake8: noqa: F401 -"""spack.util.package is a set of useful build tools and directives for packages. +# flake8: noqa: F401, E402 +"""spack.package defines the public API for Spack packages, by re-exporting useful symbols from +other modules. Packages should import this module, instead of importing from spack.* directly +to ensure forward compatibility with future versions of Spack.""" -Everything in this module is automatically imported into Spack package files. -""" from os import chdir, environ, getcwd, makedirs, mkdir, remove, removedirs from shutil import move, rmtree -from spack.error import InstallError, NoHeadersError, NoLibrariesError - -# Emulate some shell commands for convenience -env = environ -cd = chdir -pwd = getcwd - # import most common types used in packages from typing import Dict, List, Optional -import llnl.util.filesystem -from llnl.util.filesystem import * -from llnl.util.symlink import symlink -import spack.util.executable +class tty: + import llnl.util.tty as _tty + + debug = _tty.debug + error = _tty.error + info = _tty.info + msg = _tty.msg + warn = _tty.warn + + +from llnl.util.filesystem import ( + FileFilter, + FileList, + HeaderList, + LibraryList, + ancestor, + can_access, + change_sed_delimiter, + copy, + copy_tree, + filter_file, + find, + find_all_headers, + find_first, + find_headers, + find_libraries, + find_system_libraries, + force_remove, + force_symlink, + install, + install_tree, + is_exe, + join_path, + keep_modification_time, + library_extensions, + mkdirp, + remove_directory_contents, + remove_linked_tree, + rename, + set_executable, + set_install_permissions, + touch, + working_dir, +) +from llnl.util.symlink import symlink -# These props will be overridden when the build env is set up. from spack.build_environment import MakeExecutable from spack.build_systems.aspell_dict import AspellDictPackage from spack.build_systems.autotools import AutotoolsPackage @@ -76,7 +109,24 @@ from spack.builder import BaseBuilder from spack.config import determine_number_of_jobs from spack.deptypes import ALL_TYPES as all_deptypes -from spack.directives import * +from spack.directives import ( + build_system, + can_splice, + conditional, + conflicts, + depends_on, + extends, + license, + maintainers, + patch, + provides, + redistribute, + requires, + resource, + variant, + version, +) +from spack.error import InstallError, NoHeadersError, NoLibrariesError from spack.install_test import ( SkipTest, cache_extra_test_sources, @@ -86,28 +136,38 @@ install_test_root, test_part, ) -from spack.installer import ExternalPackageError, InstallLockError, UpstreamPackageError from spack.mixins import filter_compiler_wrappers from spack.multimethod import default_args, when -from spack.package_base import ( - DependencyConflictError, - build_system_flags, - env_flags, - flatten_dependencies, - inject_flags, - install_dependency_symlinks, - on_package_attributes, +from spack.package_base import build_system_flags, env_flags, inject_flags, on_package_attributes +from spack.package_completions import ( + bash_completion_path, + fish_completion_path, + zsh_completion_path, ) -from spack.package_completions import * from spack.phase_callbacks import run_after, run_before -from spack.spec import InvalidSpecDetected, Spec -from spack.util.executable import * +from spack.spec import Spec +from spack.util.environment import EnvironmentModifications +from spack.util.executable import Executable, ProcessError, which, which_string from spack.util.filesystem import fix_darwin_install_name +from spack.util.prefix import Prefix from spack.variant import any_combination_of, auto_or_any_combination_of, disjoint_sets from spack.version import Version, ver -# These are just here for editor support; they will be replaced when the build env -# is set up. -make = MakeExecutable("make", jobs=1) -ninja = MakeExecutable("ninja", jobs=1) -configure = Executable(join_path(".", "configure")) +# Emulate some shell commands for convenience +env = environ +cd = chdir +pwd = getcwd + +# These are just here for editor support; they may be set when the build env is set up. +configure: Executable +make_jobs: int +make: MakeExecutable +ninja: MakeExecutable +python_include: str +python_platlib: str +python_purelib: str +python: Executable +spack_cc: str +spack_cxx: str +spack_f77: str +spack_fc: str diff --git a/lib/spack/spack/package_base.py b/lib/spack/spack/package_base.py index 797d204624844b..06a62cadf34956 100644 --- a/lib/spack/spack/package_base.py +++ b/lib/spack/spack/package_base.py @@ -22,7 +22,6 @@ import textwrap import time import traceback -import typing from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, TypeVar, Union from typing_extensions import Literal @@ -30,7 +29,6 @@ import llnl.util.filesystem as fsys import llnl.util.tty as tty from llnl.util.lang import classproperty, memoized -from llnl.util.link_tree import LinkTree import spack.compilers import spack.config @@ -67,10 +65,6 @@ ] FLAG_HANDLER_TYPE = Callable[[str, Iterable[str]], FLAG_HANDLER_RETURN_TYPE] -"""Allowed URL schemes for spack packages.""" -_ALLOWED_URL_SCHEMES = ["http", "https", "ftp", "file", "git"] - - #: Filename for the Spack build/install log. _spack_build_logfile = "spack-build-out.txt" @@ -702,9 +696,6 @@ class PackageBase(WindowsRPath, PackageViewMixin, metaclass=PackageMeta): #: Verbosity level, preserved across installs. _verbose = None - #: index of patches by sha256 sum, built lazily - _patches_by_hash = None - #: Package homepage where users can find more information about the package homepage: Optional[str] = None @@ -718,19 +709,6 @@ class PackageBase(WindowsRPath, PackageViewMixin, metaclass=PackageMeta): #: Do not include @ here in order not to unnecessarily ping the users. maintainers: List[str] = [] - #: List of attributes to be excluded from a package's hash. - metadata_attrs = [ - "homepage", - "url", - "urls", - "list_url", - "extendable", - "parallel", - "make_jobs", - "maintainers", - "tags", - ] - #: Set to ``True`` to indicate the stand-alone test requires a compiler. #: It is used to ensure a compiler and build dependencies like 'cmake' #: are available to build a custom test code. @@ -830,104 +808,6 @@ def get_variant(self, name: str) -> spack.variant.Variant: except StopIteration: raise ValueError(f"No variant '{name}' on spec: {self.spec}") - @classmethod - def possible_dependencies( - cls, - transitive: bool = True, - expand_virtuals: bool = True, - depflag: dt.DepFlag = dt.ALL, - visited: Optional[dict] = None, - missing: Optional[dict] = None, - virtuals: Optional[set] = None, - ) -> Dict[str, Set[str]]: - """Return dict of possible dependencies of this package. - - Args: - transitive (bool or None): return all transitive dependencies if - True, only direct dependencies if False (default True).. - expand_virtuals (bool or None): expand virtual dependencies into - all possible implementations (default True) - depflag: dependency types to consider - visited (dict or None): dict of names of dependencies visited so - far, mapped to their immediate dependencies' names. - missing (dict or None): dict to populate with packages and their - *missing* dependencies. - virtuals (set): if provided, populate with virtuals seen so far. - - Returns: - (dict): dictionary mapping dependency names to *their* - immediate dependencies - - Each item in the returned dictionary maps a (potentially - transitive) dependency of this package to its possible - *immediate* dependencies. If ``expand_virtuals`` is ``False``, - virtual package names wil be inserted as keys mapped to empty - sets of dependencies. Virtuals, if not expanded, are treated as - though they have no immediate dependencies. - - Missing dependencies by default are ignored, but if a - missing dict is provided, it will be populated with package names - mapped to any dependencies they have that are in no - repositories. This is only populated if transitive is True. - - Note: the returned dict *includes* the package itself. - - """ - visited = {} if visited is None else visited - missing = {} if missing is None else missing - - visited.setdefault(cls.name, set()) - - for name, conditions in cls.dependencies_by_name(when=True).items(): - # check whether this dependency could be of the type asked for - depflag_union = 0 - for deplist in conditions.values(): - for dep in deplist: - depflag_union |= dep.depflag - if not (depflag & depflag_union): - continue - - # expand virtuals if enabled, otherwise just stop at virtuals - if spack.repo.PATH.is_virtual(name): - if virtuals is not None: - virtuals.add(name) - if expand_virtuals: - providers = spack.repo.PATH.providers_for(name) - dep_names = [spec.name for spec in providers] - else: - visited.setdefault(cls.name, set()).add(name) - visited.setdefault(name, set()) - continue - else: - dep_names = [name] - - # add the dependency names to the visited dict - visited.setdefault(cls.name, set()).update(set(dep_names)) - - # recursively traverse dependencies - for dep_name in dep_names: - if dep_name in visited: - continue - - visited.setdefault(dep_name, set()) - - # skip the rest if not transitive - if not transitive: - continue - - try: - dep_cls = spack.repo.PATH.get_pkg_class(dep_name) - except spack.repo.UnknownPackageError: - # log unknown packages - missing.setdefault(cls.name, set()).add(dep_name) - continue - - dep_cls.possible_dependencies( - transitive, expand_virtuals, depflag, visited, missing, virtuals - ) - - return visited - @classproperty def package_dir(cls): """Directory where the package.py file lives.""" @@ -1099,14 +979,14 @@ def update_external_dependencies(self, extendee_spec=None): """ pass - def detect_dev_src_change(self): + def detect_dev_src_change(self) -> bool: """ Method for checking for source code changes to trigger rebuild/reinstall """ dev_path_var = self.spec.variants.get("dev_path", None) _, record = spack.store.STORE.db.query_by_spec_hash(self.spec.dag_hash()) - mtime = fsys.last_modification_time_recursive(dev_path_var.value) - return mtime > record.installation_time + assert dev_path_var and record, "dev_path variant and record must be present" + return fsys.recursive_mtime_greater_than(dev_path_var.value, record.installation_time) def all_urls_for_version(self, version: StandardVersion) -> List[str]: """Return all URLs derived from version_urls(), url, urls, and @@ -2297,85 +2177,6 @@ def rpath_args(self): build_system_flags = PackageBase.build_system_flags -def install_dependency_symlinks(pkg, spec, prefix): - """ - Execute a dummy install and flatten dependencies. - - This routine can be used in a ``package.py`` definition by setting - ``install = install_dependency_symlinks``. - - This feature comes in handy for creating a common location for the - the installation of third-party libraries. - """ - flatten_dependencies(spec, prefix) - - -def use_cray_compiler_names(): - """Compiler names for builds that rely on cray compiler names.""" - os.environ["CC"] = "cc" - os.environ["CXX"] = "CC" - os.environ["FC"] = "ftn" - os.environ["F77"] = "ftn" - - -def flatten_dependencies(spec, flat_dir): - """Make each dependency of spec present in dir via symlink.""" - for dep in spec.traverse(root=False): - name = dep.name - - dep_path = spack.store.STORE.layout.path_for_spec(dep) - dep_files = LinkTree(dep_path) - - os.mkdir(flat_dir + "/" + name) - - conflict = dep_files.find_conflict(flat_dir + "/" + name) - if conflict: - raise DependencyConflictError(conflict) - - dep_files.merge(flat_dir + "/" + name) - - -def possible_dependencies( - *pkg_or_spec: Union[str, spack.spec.Spec, typing.Type[PackageBase]], - transitive: bool = True, - expand_virtuals: bool = True, - depflag: dt.DepFlag = dt.ALL, - missing: Optional[dict] = None, - virtuals: Optional[set] = None, -) -> Dict[str, Set[str]]: - """Get the possible dependencies of a number of packages. - - See ``PackageBase.possible_dependencies`` for details. - """ - packages = [] - for pos in pkg_or_spec: - if isinstance(pos, PackageMeta) and issubclass(pos, PackageBase): - packages.append(pos) - continue - - if not isinstance(pos, spack.spec.Spec): - pos = spack.spec.Spec(pos) - - if spack.repo.PATH.is_virtual(pos.name): - packages.extend(p.package_class for p in spack.repo.PATH.providers_for(pos.name)) - continue - else: - packages.append(pos.package_class) - - visited: Dict[str, Set[str]] = {} - for pkg in packages: - pkg.possible_dependencies( - visited=visited, - transitive=transitive, - expand_virtuals=expand_virtuals, - depflag=depflag, - missing=missing, - virtuals=virtuals, - ) - - return visited - - def deprecated_version(pkg: PackageBase, version: Union[str, StandardVersion]) -> bool: """Return True iff the version is deprecated. diff --git a/lib/spack/spack/patch.py b/lib/spack/spack/patch.py index 7affdaba2fe160..4579f122d671c5 100644 --- a/lib/spack/spack/patch.py +++ b/lib/spack/spack/patch.py @@ -4,7 +4,6 @@ import hashlib import os -import os.path import pathlib import sys from typing import Any, Dict, Optional, Tuple, Type, Union @@ -84,6 +83,7 @@ def __init__( level: int, working_dir: str, reverse: bool = False, + ordering_key: Optional[Tuple[str, int]] = None, ) -> None: """Initialize a new Patch instance. @@ -93,6 +93,7 @@ def __init__( level: patch level working_dir: relative path *within* the stage to change to reverse: reverse the patch + ordering_key: key used to ensure patches are applied in a consistent order """ # validate level (must be an integer >= 0) if not isinstance(level, int) or not level >= 0: @@ -106,6 +107,13 @@ def __init__( self.working_dir = working_dir self.reverse = reverse + # The ordering key is passed when executing package.py directives, and is only relevant + # after a solve to build concrete specs with consistently ordered patches. For concrete + # specs read from a file, we add patches in the order of its patches variants and the + # ordering_key is irrelevant. In that case, use a default value so we don't need to branch + # on whether ordering_key is None where it's used, just to make static analysis happy. + self.ordering_key: Tuple[str, int] = ordering_key or ("", 0) + def apply(self, stage: "spack.stage.Stage") -> None: """Apply a patch to source in a stage. @@ -203,9 +211,8 @@ def __init__( msg += "package %s.%s does not exist." % (pkg.namespace, pkg.name) raise ValueError(msg) - super().__init__(pkg, abs_path, level, working_dir, reverse) + super().__init__(pkg, abs_path, level, working_dir, reverse, ordering_key) self.path = abs_path - self.ordering_key = ordering_key @property def sha256(self) -> str: @@ -267,13 +274,11 @@ def __init__( archive_sha256: sha256 sum of the *archive*, if the patch is compressed (only required for compressed URL patches) """ - super().__init__(pkg, url, level, working_dir, reverse) + super().__init__(pkg, url, level, working_dir, reverse, ordering_key) self.url = url self._stage: Optional["spack.stage.Stage"] = None - self.ordering_key = ordering_key - if allowed_archive(self.url) and not archive_sha256: raise spack.error.PatchDirectiveError( "Compressed patches require 'archive_sha256' " diff --git a/lib/spack/spack/platforms/__init__.py b/lib/spack/spack/platforms/__init__.py index 04a44db5163c1e..f38fa6049714be 100644 --- a/lib/spack/spack/platforms/__init__.py +++ b/lib/spack/spack/platforms/__init__.py @@ -52,8 +52,7 @@ def use_platform(new_platform): import spack.config - msg = '"{0}" must be an instance of Platform' - assert isinstance(new_platform, Platform), msg.format(new_platform) + assert isinstance(new_platform, Platform), f'"{new_platform}" must be an instance of Platform' original_host_fn = host diff --git a/lib/spack/spack/platforms/_platform.py b/lib/spack/spack/platforms/_platform.py index fd91bac91d2b5c..a219198c3fb5ba 100644 --- a/lib/spack/spack/platforms/_platform.py +++ b/lib/spack/spack/platforms/_platform.py @@ -1,42 +1,22 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import warnings from typing import Optional import archspec.cpu import llnl.util.lang -import spack.error - - -class NoPlatformError(spack.error.SpackError): - def __init__(self): - msg = "Could not determine a platform for this machine" - super().__init__(msg) - @llnl.util.lang.lazy_lexicographic_ordering class Platform: """Platform is an abstract class extended by subclasses. - To add a new type of platform (such as cray_xe), create a subclass and set all the - class attributes such as priority, front_target, back_target, front_os, back_os. - Platform also contain a priority class attribute. A lower number signifies higher priority. These numbers are arbitrarily set and can be changed though often there isn't much need unless a new platform is added and the user wants that to be detected first. - - Targets are created inside the platform subclasses. Most architecture (like linux, - and darwin) will have only one target family (x86_64) but in the case of Cray - machines, there is both a frontend and backend processor. The user can specify - which targets are present on front-end and back-end architecture. - - Depending on the platform, operating systems are either autodetected or are - set. The user can set the frontend and backend operating setting by the class - attributes front_os and back_os. The operating system will be responsible for - compiler detection. """ # Subclass sets number. Controls detection order @@ -45,82 +25,72 @@ class attributes such as priority, front_target, back_target, front_os, back_os. #: binary formats used on this platform; used by relocation logic binary_formats = ["elf"] - front_end: Optional[str] = None - back_end: Optional[str] = None - default: Optional[str] = None # The default back end target. - - front_os: Optional[str] = None - back_os: Optional[str] = None - default_os: Optional[str] = None + default: str + default_os: str reserved_targets = ["default_target", "frontend", "fe", "backend", "be"] reserved_oss = ["default_os", "frontend", "fe", "backend", "be"] + deprecated_names = ["frontend", "fe", "backend", "be"] def __init__(self, name): self.targets = {} self.operating_sys = {} self.name = name + self._init_targets() def add_target(self, name: str, target: archspec.cpu.Microarchitecture) -> None: - """Used by the platform specific subclass to list available targets. - Raises an error if the platform specifies a name - that is reserved by spack as an alias. - """ if name in Platform.reserved_targets: - msg = "{0} is a spack reserved alias and cannot be the name of a target" - raise ValueError(msg.format(name)) + msg = f"{name} is a spack reserved alias and cannot be the name of a target" + raise ValueError(msg) self.targets[name] = target - def _add_archspec_targets(self): + def _init_targets(self): + self.default = archspec.cpu.host().name for name, microarchitecture in archspec.cpu.TARGETS.items(): self.add_target(name, microarchitecture) def target(self, name): - """This is a getter method for the target dictionary - that handles defaulting based on the values provided by default, - front-end, and back-end. This can be overwritten - by a subclass for which we want to provide further aliasing options. - """ - # TODO: Check if we can avoid using strings here name = str(name) - if name == "default_target": + if name in Platform.deprecated_names: + warnings.warn(f"target={name} is deprecated, use target={self.default} instead") + + if name in Platform.reserved_targets: name = self.default - elif name == "frontend" or name == "fe": - name = self.front_end - elif name == "backend" or name == "be": - name = self.back_end return self.targets.get(name, None) def add_operating_system(self, name, os_class): - """Add the operating_system class object into the - platform.operating_sys dictionary. - """ - if name in Platform.reserved_oss: - msg = "{0} is a spack reserved alias and cannot be the name of an OS" - raise ValueError(msg.format(name)) + if name in Platform.reserved_oss + Platform.deprecated_names: + msg = f"{name} is a spack reserved alias and cannot be the name of an OS" + raise ValueError(msg) self.operating_sys[name] = os_class + def default_target(self): + return self.target(self.default) + + def default_operating_system(self): + return self.operating_system(self.default_os) + def operating_system(self, name): - if name == "default_os": + if name in Platform.deprecated_names: + warnings.warn(f"os={name} is deprecated, use os={self.default_os} instead") + + if name in Platform.reserved_oss: name = self.default_os - if name == "frontend" or name == "fe": - name = self.front_os - if name == "backend" or name == "be": - name = self.back_os return self.operating_sys.get(name, None) def setup_platform_environment(self, pkg, env): - """Subclass can override this method if it requires any - platform-specific build environment modifications. + """Platform-specific build environment modifications. + + This method is meant toi be overridden by subclasses, when needed. """ pass @classmethod def detect(cls): - """Return True if the the host platform is detected to be the current - Platform class, False otherwise. + """Returns True if the host platform is detected to be the current Platform class, + False otherwise. Derived classes are responsible for implementing this method. """ @@ -135,11 +105,7 @@ def __str__(self): def _cmp_iter(self): yield self.name yield self.default - yield self.front_end - yield self.back_end yield self.default_os - yield self.front_os - yield self.back_os def targets(): for t in sorted(self.targets.values()): diff --git a/lib/spack/spack/platforms/cray.py b/lib/spack/spack/platforms/cray.py index f47ae448a8c322..fc907b4d6e5db6 100644 --- a/lib/spack/spack/platforms/cray.py +++ b/lib/spack/spack/platforms/cray.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os def slingshot_network(): diff --git a/lib/spack/spack/platforms/darwin.py b/lib/spack/spack/platforms/darwin.py index a1259445562734..f6264e291a9c45 100644 --- a/lib/spack/spack/platforms/darwin.py +++ b/lib/spack/spack/platforms/darwin.py @@ -4,8 +4,6 @@ import platform as py_platform -import archspec.cpu - from spack.operating_systems.mac_os import MacOs from spack.version import Version @@ -19,18 +17,8 @@ class Darwin(Platform): def __init__(self): super().__init__("darwin") - self._add_archspec_targets() - - self.default = archspec.cpu.host().name - self.front_end = self.default - self.back_end = self.default - mac_os = MacOs() - self.default_os = str(mac_os) - self.front_os = str(mac_os) - self.back_os = str(mac_os) - self.add_operating_system(str(mac_os), mac_os) @classmethod diff --git a/lib/spack/spack/platforms/freebsd.py b/lib/spack/spack/platforms/freebsd.py index 8ef84e8a12eb90..c2b2d0d96cd3d1 100644 --- a/lib/spack/spack/platforms/freebsd.py +++ b/lib/spack/spack/platforms/freebsd.py @@ -3,8 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import platform -import archspec.cpu - from spack.operating_systems.freebsd import FreeBSDOs from ._platform import Platform @@ -15,18 +13,8 @@ class FreeBSD(Platform): def __init__(self): super().__init__("freebsd") - - self._add_archspec_targets() - - # Get specific default - self.default = archspec.cpu.host().name - self.front_end = self.default - self.back_end = self.default - os = FreeBSDOs() self.default_os = str(os) - self.front_os = self.default_os - self.back_os = self.default_os self.add_operating_system(str(os), os) @classmethod diff --git a/lib/spack/spack/platforms/linux.py b/lib/spack/spack/platforms/linux.py index dda925d0933c4f..8a30d5e21a7c51 100644 --- a/lib/spack/spack/platforms/linux.py +++ b/lib/spack/spack/platforms/linux.py @@ -3,8 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import platform -import archspec.cpu - from spack.operating_systems.linux_distro import LinuxDistro from ._platform import Platform @@ -15,18 +13,8 @@ class Linux(Platform): def __init__(self): super().__init__("linux") - - self._add_archspec_targets() - - # Get specific default - self.default = archspec.cpu.host().name - self.front_end = self.default - self.back_end = self.default - linux_dist = LinuxDistro() self.default_os = str(linux_dist) - self.front_os = self.default_os - self.back_os = self.default_os self.add_operating_system(str(linux_dist), linux_dist) @classmethod diff --git a/lib/spack/spack/platforms/test.py b/lib/spack/spack/platforms/test.py index e6aa85089583ec..e4246bf4461ce0 100644 --- a/lib/spack/spack/platforms/test.py +++ b/lib/spack/spack/platforms/test.py @@ -16,31 +16,19 @@ class Test(Platform): if platform.system().lower() == "darwin": binary_formats = ["macho"] - if platform.machine() == "arm64": - front_end = "aarch64" - back_end = "m1" - default = "m1" - else: - front_end = "x86_64" - back_end = "core2" - default = "core2" - - front_os = "redhat6" - back_os = "debian6" default_os = "debian6" + default = "m1" if platform.machine() == "arm64" else "core2" def __init__(self, name=None): name = name or "test" super().__init__(name) - self.add_target(self.default, archspec.cpu.TARGETS[self.default]) - self.add_target(self.front_end, archspec.cpu.TARGETS[self.front_end]) - - self.add_operating_system( - self.default_os, spack.operating_systems.OperatingSystem("debian", 6) - ) - self.add_operating_system( - self.front_os, spack.operating_systems.OperatingSystem("redhat", 6) - ) + self.add_operating_system("debian6", spack.operating_systems.OperatingSystem("debian", 6)) + self.add_operating_system("redhat6", spack.operating_systems.OperatingSystem("redhat", 6)) + + def _init_targets(self): + targets = ("aarch64", "m1") if platform.machine() == "arm64" else ("x86_64", "core2") + for t in targets: + self.add_target(t, archspec.cpu.TARGETS[t]) @classmethod def detect(cls): diff --git a/lib/spack/spack/platforms/windows.py b/lib/spack/spack/platforms/windows.py index edfb68b074bca6..f50d3fe4dd0a41 100755 --- a/lib/spack/spack/platforms/windows.py +++ b/lib/spack/spack/platforms/windows.py @@ -4,8 +4,6 @@ import platform -import archspec.cpu - from spack.operating_systems.windows_os import WindowsOs from ._platform import Platform @@ -16,18 +14,8 @@ class Windows(Platform): def __init__(self): super().__init__("windows") - self._add_archspec_targets() - - self.default = archspec.cpu.host().name - self.front_end = self.default - self.back_end = self.default - windows_os = WindowsOs() - self.default_os = str(windows_os) - self.front_os = str(windows_os) - self.back_os = str(windows_os) - self.add_operating_system(str(windows_os), windows_os) @classmethod diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 9ba36ab5610c4a..2e1481ee4cbdaa 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -6,8 +6,7 @@ import os import re import sys -from collections import OrderedDict -from typing import List, Optional +from typing import Dict, Iterable, List, Optional import macholib.mach_o import macholib.MachO @@ -18,28 +17,11 @@ from llnl.util.lang import memoized from llnl.util.symlink import readlink, symlink -import spack.error import spack.store import spack.util.elf as elf import spack.util.executable as executable -from .relocate_text import BinaryFilePrefixReplacer, TextFilePrefixReplacer - - -class InstallRootStringError(spack.error.SpackError): - def __init__(self, file_path, root_path): - """Signal that the relocated binary still has the original - Spack's store root string - - Args: - file_path (str): path of the binary - root_path (str): original Spack's store root string - """ - super().__init__( - "\n %s \ncontains string\n %s \n" - "after replacing it in rpaths.\n" - "Package should not be relocated.\n Use -a to override." % (file_path, root_path) - ) +from .relocate_text import BinaryFilePrefixReplacer, PrefixToPrefix, TextFilePrefixReplacer @memoized @@ -58,7 +40,7 @@ def _decode_macho_data(bytestring): return bytestring.rstrip(b"\x00").decode("ascii") -def macho_find_paths(orig_rpaths, deps, idpath, prefix_to_prefix): +def _macho_find_paths(orig_rpaths, deps, idpath, prefix_to_prefix): """ Inputs original rpaths from mach-o binaries @@ -103,7 +85,7 @@ def macho_find_paths(orig_rpaths, deps, idpath, prefix_to_prefix): return paths_to_paths -def modify_macho_object(cur_path, rpaths, deps, idpath, paths_to_paths): +def _modify_macho_object(cur_path, rpaths, deps, idpath, paths_to_paths): """ This function is used to make machO buildcaches on macOS by replacing old paths with new paths using install_name_tool @@ -146,7 +128,7 @@ def modify_macho_object(cur_path, rpaths, deps, idpath, paths_to_paths): install_name_tool(*args, temp_path) -def macholib_get_paths(cur_path): +def _macholib_get_paths(cur_path): """Get rpaths, dependent libraries, and library id of mach-o objects.""" headers = [] try: @@ -228,25 +210,25 @@ def relocate_macho_binaries(path_names, prefix_to_prefix): if path_name.endswith(".o"): continue # get the paths in the old prefix - rpaths, deps, idpath = macholib_get_paths(path_name) + rpaths, deps, idpath = _macholib_get_paths(path_name) # get the mapping of paths in the old prerix to the new prefix - paths_to_paths = macho_find_paths(rpaths, deps, idpath, prefix_to_prefix) + paths_to_paths = _macho_find_paths(rpaths, deps, idpath, prefix_to_prefix) # replace the old paths with new paths - modify_macho_object(path_name, rpaths, deps, idpath, paths_to_paths) + _modify_macho_object(path_name, rpaths, deps, idpath, paths_to_paths) -def relocate_elf_binaries(binaries, prefix_to_prefix): - """Take a list of binaries, and an ordered dictionary of - prefix to prefix mapping, and update the rpaths accordingly.""" +def relocate_elf_binaries(binaries: Iterable[str], prefix_to_prefix: Dict[str, str]) -> None: + """Take a list of binaries, and an ordered prefix to prefix mapping, and update the rpaths + accordingly.""" # Transform to binary string - prefix_to_prefix = OrderedDict( - (k.encode("utf-8"), v.encode("utf-8")) for (k, v) in prefix_to_prefix.items() - ) + prefix_to_prefix_bin = { + k.encode("utf-8"): v.encode("utf-8") for k, v in prefix_to_prefix.items() + } for path in binaries: try: - elf.substitute_rpath_and_pt_interp_in_place_or_raise(path, prefix_to_prefix) + elf.substitute_rpath_and_pt_interp_in_place_or_raise(path, prefix_to_prefix_bin) except elf.ElfCStringUpdatesFailed as e: # Fall back to `patchelf --set-rpath ... --set-interpreter ...` rpaths = e.rpath.new_value.decode("utf-8").split(":") if e.rpath else [] @@ -254,22 +236,15 @@ def relocate_elf_binaries(binaries, prefix_to_prefix): _set_elf_rpaths_and_interpreter(path, rpaths=rpaths, interpreter=interpreter) -def warn_if_link_cant_be_relocated(link, target): - if not os.path.isabs(target): - return - tty.warn('Symbolic link at "{}" to "{}" cannot be relocated'.format(link, target)) - - -def relocate_links(links, prefix_to_prefix): +def relocate_links(links: Iterable[str], prefix_to_prefix: Dict[str, str]) -> None: """Relocate links to a new install prefix.""" regex = re.compile("|".join(re.escape(p) for p in prefix_to_prefix.keys())) for link in links: old_target = readlink(link) + if not os.path.isabs(old_target): + continue match = regex.match(old_target) - - # No match. if match is None: - warn_if_link_cant_be_relocated(link, old_target) continue new_target = prefix_to_prefix[match.group()] + old_target[match.end() :] @@ -277,52 +252,52 @@ def relocate_links(links, prefix_to_prefix): symlink(new_target, link) -def relocate_text(files, prefixes): +def relocate_text(files: Iterable[str], prefix_to_prefix: PrefixToPrefix) -> None: """Relocate text file from the original installation prefix to the new prefix. Relocation also affects the the path in Spack's sbang script. Args: - files (list): Text files to be relocated - prefixes (OrderedDict): String prefixes which need to be changed + files: Text files to be relocated + prefix_to_prefix: ordered prefix to prefix mapping """ - TextFilePrefixReplacer.from_strings_or_bytes(prefixes).apply(files) + TextFilePrefixReplacer.from_strings_or_bytes(prefix_to_prefix).apply(files) -def relocate_text_bin(binaries, prefixes): +def relocate_text_bin(binaries: Iterable[str], prefix_to_prefix: PrefixToPrefix) -> List[str]: """Replace null terminated path strings hard-coded into binaries. The new install prefix must be shorter than the original one. Args: - binaries (list): binaries to be relocated - prefixes (OrderedDict): String prefixes which need to be changed. + binaries: paths to binaries to be relocated + prefix_to_prefix: ordered prefix to prefix mapping Raises: spack.relocate_text.BinaryTextReplaceError: when the new path is longer than the old path """ - return BinaryFilePrefixReplacer.from_strings_or_bytes(prefixes).apply(binaries) + return BinaryFilePrefixReplacer.from_strings_or_bytes(prefix_to_prefix).apply(binaries) def is_macho_magic(magic: bytes) -> bool: return ( # In order of popularity: 64-bit mach-o le/be, 32-bit mach-o le/be. - magic.startswith(b"\xCF\xFA\xED\xFE") - or magic.startswith(b"\xFE\xED\xFA\xCF") - or magic.startswith(b"\xCE\xFA\xED\xFE") - or magic.startswith(b"\xFE\xED\xFA\xCE") + magic.startswith(b"\xcf\xfa\xed\xfe") + or magic.startswith(b"\xfe\xed\xfa\xcf") + or magic.startswith(b"\xce\xfa\xed\xfe") + or magic.startswith(b"\xfe\xed\xfa\xce") # universal binaries: 0xcafebabe be (most common?) or 0xbebafeca le (not sure if exists). # Here we need to disambiguate mach-o and JVM class files. In mach-o the next 4 bytes are # the number of binaries; in JVM class files it's the java version number. We assume there # are less than 10 binaries in a universal binary. - or (magic.startswith(b"\xCA\xFE\xBA\xBE") and int.from_bytes(magic[4:8], "big") < 10) - or (magic.startswith(b"\xBE\xBA\xFE\xCA") and int.from_bytes(magic[4:8], "little") < 10) + or (magic.startswith(b"\xca\xfe\xba\xbe") and int.from_bytes(magic[4:8], "big") < 10) + or (magic.startswith(b"\xbe\xba\xfe\xca") and int.from_bytes(magic[4:8], "little") < 10) ) def is_elf_magic(magic: bytes) -> bool: - return magic.startswith(b"\x7FELF") + return magic.startswith(b"\x7fELF") def is_binary(filename: str) -> bool: @@ -339,7 +314,7 @@ def _exists_dir(dirname): return os.path.isdir(dirname) -def is_macho_binary(path): +def is_macho_binary(path: str) -> bool: try: with open(path, "rb") as f: return is_macho_magic(f.read(4)) @@ -363,7 +338,7 @@ def fixup_macos_rpath(root, filename): return False # Get Mach-O header commands - (rpath_list, deps, id_dylib) = macholib_get_paths(abspath) + (rpath_list, deps, id_dylib) = _macholib_get_paths(abspath) # Convert rpaths list to (name -> number of occurrences) add_rpaths = set() @@ -431,8 +406,8 @@ def fixup_macos_rpaths(spec): entries which makes it harder to adjust with ``install_name_tool -delete_rpath``. """ - if spec.external or spec.virtual: - tty.warn("external or virtual package cannot be fixed up: {0!s}".format(spec)) + if spec.external or not spec.concrete: + tty.warn("external/abstract spec cannot be fixed up: {0!s}".format(spec)) return False if "platform=darwin" not in spec: diff --git a/lib/spack/spack/relocate_text.py b/lib/spack/spack/relocate_text.py index 731f85c26db108..b24dd412cb8219 100644 --- a/lib/spack/spack/relocate_text.py +++ b/lib/spack/spack/relocate_text.py @@ -6,66 +6,61 @@ paths inside text files and binaries.""" import re -from collections import OrderedDict -from typing import Dict, Union +from typing import IO, Dict, Iterable, List, Union + +from llnl.util.lang import PatternBytes import spack.error Prefix = Union[str, bytes] +PrefixToPrefix = Union[Dict[str, str], Dict[bytes, bytes]] def encode_path(p: Prefix) -> bytes: return p if isinstance(p, bytes) else p.encode("utf-8") -def _prefix_to_prefix_as_bytes(prefix_to_prefix) -> Dict[bytes, bytes]: - return OrderedDict( - (encode_path(k), encode_path(v)) for (k, v) in prefix_to_prefix.items() if k and v - ) +def _prefix_to_prefix_as_bytes(prefix_to_prefix: PrefixToPrefix) -> Dict[bytes, bytes]: + return {encode_path(k): encode_path(v) for (k, v) in prefix_to_prefix.items()} -def utf8_path_to_binary_regex(prefix: str): +def utf8_path_to_binary_regex(prefix: str) -> PatternBytes: """Create a binary regex that matches the input path in utf8""" prefix_bytes = re.escape(prefix).encode("utf-8") return re.compile(b"(? PatternBytes: all_prefixes = b"|".join(re.escape(p) for p in prefixes) return re.compile(b"(? PatternBytes: """Create a (binary) regex that matches any input path in utf8""" return _byte_strings_to_single_binary_regex(p.encode("utf-8") for p in prefixes) -def filter_identity_mappings(prefix_to_prefix): +def filter_identity_mappings(prefix_to_prefix: Dict[bytes, bytes]) -> Dict[bytes, bytes]: """Drop mappings that are not changed.""" # NOTE: we don't guard against the following case: # [/abc/def -> /abc/def, /abc -> /x] *will* be simplified to # [/abc -> /x], meaning that after this simplification /abc/def will be # mapped to /x/def instead of /abc/def. This should not be a problem. - return OrderedDict((k, v) for (k, v) in prefix_to_prefix.items() if k != v) + return {k: v for k, v in prefix_to_prefix.items() if k != v} class PrefixReplacer: - """Base class for applying a prefix to prefix map - to a list of binaries or text files. - Child classes implement _apply_to_file to do the - actual work, which is different when it comes to + """Base class for applying a prefix to prefix map to a list of binaries or text files. Derived + classes implement _apply_to_file to do the actual work, which is different when it comes to binaries and text files.""" - def __init__(self, prefix_to_prefix: Dict[bytes, bytes]): + def __init__(self, prefix_to_prefix: Dict[bytes, bytes]) -> None: """ Arguments: - - prefix_to_prefix (OrderedDict): - - A ordered mapping from prefix to prefix. The order is - relevant to support substring fallbacks, for example - [("/first/sub", "/x"), ("/first", "/y")] will ensure - /first/sub is matched and replaced before /first. + prefix_to_prefix: An ordered mapping from prefix to prefix. The order is relevant to + support substring fallbacks, for example + ``[("/first/sub", "/x"), ("/first", "/y")]`` will ensure /first/sub is matched and + replaced before /first. """ self.prefix_to_prefix = filter_identity_mappings(prefix_to_prefix) @@ -76,7 +71,7 @@ def is_noop(self) -> bool: or there are no prefixes to replace.""" return not self.prefix_to_prefix - def apply(self, filenames: list): + def apply(self, filenames: Iterable[str]) -> List[str]: """Returns a list of files that were modified""" changed_files = [] if self.is_noop: @@ -86,17 +81,20 @@ def apply(self, filenames: list): changed_files.append(filename) return changed_files - def apply_to_filename(self, filename): + def apply_to_filename(self, filename: str) -> bool: if self.is_noop: return False with open(filename, "rb+") as f: return self.apply_to_file(f) - def apply_to_file(self, f): + def apply_to_file(self, f: IO[bytes]) -> bool: if self.is_noop: return False return self._apply_to_file(f) + def _apply_to_file(self, f: IO) -> bool: + raise NotImplementedError("Derived classes must implement this method") + class TextFilePrefixReplacer(PrefixReplacer): """This class applies prefix to prefix mappings for relocation @@ -114,13 +112,11 @@ def __init__(self, prefix_to_prefix: Dict[bytes, bytes]): self.regex = _byte_strings_to_single_binary_regex(self.prefix_to_prefix.keys()) @classmethod - def from_strings_or_bytes( - cls, prefix_to_prefix: Dict[Prefix, Prefix] - ) -> "TextFilePrefixReplacer": + def from_strings_or_bytes(cls, prefix_to_prefix: PrefixToPrefix) -> "TextFilePrefixReplacer": """Create a TextFilePrefixReplacer from an ordered prefix to prefix map.""" return cls(_prefix_to_prefix_as_bytes(prefix_to_prefix)) - def _apply_to_file(self, f): + def _apply_to_file(self, f: IO) -> bool: """Text replacement implementation simply reads the entire file in memory and applies the combined regex.""" replacement = lambda m: m.group(1) + self.prefix_to_prefix[m.group(2)] + m.group(3) @@ -135,12 +131,12 @@ def _apply_to_file(self, f): class BinaryFilePrefixReplacer(PrefixReplacer): - def __init__(self, prefix_to_prefix, suffix_safety_size=7): + def __init__(self, prefix_to_prefix: Dict[bytes, bytes], suffix_safety_size: int = 7) -> None: """ - prefix_to_prefix (OrderedDict): OrderedDictionary where the keys are - bytes representing the old prefixes and the values are the new - suffix_safety_size (int): in case of null terminated strings, what size - of the suffix should remain to avoid aliasing issues? + prefix_to_prefix: Ordered dictionary where the keys are bytes representing the old prefixes + and the values are the new + suffix_safety_size: in case of null terminated strings, what size of the suffix should + remain to avoid aliasing issues? """ assert suffix_safety_size >= 0 super().__init__(prefix_to_prefix) @@ -148,17 +144,18 @@ def __init__(self, prefix_to_prefix, suffix_safety_size=7): self.regex = self.binary_text_regex(self.prefix_to_prefix.keys(), suffix_safety_size) @classmethod - def binary_text_regex(cls, binary_prefixes, suffix_safety_size=7): - """ - Create a regex that looks for exact matches of prefixes, and also tries to - match a C-string type null terminator in a small lookahead window. + def binary_text_regex( + cls, binary_prefixes: Iterable[bytes], suffix_safety_size: int = 7 + ) -> PatternBytes: + """Create a regex that looks for exact matches of prefixes, and also tries to match a + C-string type null terminator in a small lookahead window. Arguments: - binary_prefixes (list): List of byte strings of prefixes to match - suffix_safety_size (int): Sizeof the lookahed for null-terminated string. - - Returns: compiled regex + binary_prefixes: Iterable of byte strings of prefixes to match + suffix_safety_size: Sizeof the lookahed for null-terminated string. """ + # Note: it's important not to use capture groups for the prefix, since it destroys + # performance due to common prefix optimization. return re.compile( b"(" + b"|".join(re.escape(p) for p in binary_prefixes) @@ -167,36 +164,34 @@ def binary_text_regex(cls, binary_prefixes, suffix_safety_size=7): @classmethod def from_strings_or_bytes( - cls, prefix_to_prefix: Dict[Prefix, Prefix], suffix_safety_size: int = 7 + cls, prefix_to_prefix: PrefixToPrefix, suffix_safety_size: int = 7 ) -> "BinaryFilePrefixReplacer": """Create a BinaryFilePrefixReplacer from an ordered prefix to prefix map. Arguments: - prefix_to_prefix (OrderedDict): Ordered mapping of prefix to prefix. - suffix_safety_size (int): Number of bytes to retain at the end of a C-string - to avoid binary string-aliasing issues. + prefix_to_prefix: Ordered mapping of prefix to prefix. + suffix_safety_size: Number of bytes to retain at the end of a C-string to avoid binary + string-aliasing issues. """ return cls(_prefix_to_prefix_as_bytes(prefix_to_prefix), suffix_safety_size) - def _apply_to_file(self, f): + def _apply_to_file(self, f: IO[bytes]) -> bool: """ - Given a file opened in rb+ mode, apply the string replacements as - specified by an ordered dictionary of prefix to prefix mappings. This - method takes special care of null-terminated C-strings. C-string constants - are problematic because compilers and linkers optimize readonly strings for - space by aliasing those that share a common suffix (only suffix since all - of them are null terminated). See https://github.com/spack/spack/pull/31739 - and https://github.com/spack/spack/pull/32253 for details. Our logic matches - the original prefix with a ``suffix_safety_size + 1`` lookahead for null bytes. - If no null terminator is found, we simply pad with leading /, assuming that - it's a long C-string; the full C-string after replacement has a large suffix - in common with its original value. - If there *is* a null terminator we can do the same as long as the replacement - has a sufficiently long common suffix with the original prefix. - As a last resort when the replacement does not have a long enough common suffix, - we can try to shorten the string, but this only works if the new length is - sufficiently short (typically the case when going from large padding -> normal path) - If the replacement string is longer, or all of the above fails, we error out. + Given a file opened in rb+ mode, apply the string replacements as specified by an ordered + dictionary of prefix to prefix mappings. This method takes special care of null-terminated + C-strings. C-string constants are problematic because compilers and linkers optimize + readonly strings for space by aliasing those that share a common suffix (only suffix since + all of them are null terminated). See https://github.com/spack/spack/pull/31739 and + https://github.com/spack/spack/pull/32253 for details. Our logic matches the original + prefix with a ``suffix_safety_size + 1`` lookahead for null bytes. If no null terminator + is found, we simply pad with leading /, assuming that it's a long C-string; the full + C-string after replacement has a large suffix in common with its original value. If there + *is* a null terminator we can do the same as long as the replacement has a sufficiently + long common suffix with the original prefix. As a last resort when the replacement does + not have a long enough common suffix, we can try to shorten the string, but this only + works if the new length is sufficiently short (typically the case when going from large + padding -> normal path) If the replacement string is longer, or all of the above fails, + we error out. Arguments: f: file opened in rb+ mode @@ -206,9 +201,8 @@ def _apply_to_file(self, f): """ assert f.tell() == 0 - # We *could* read binary data in chunks to avoid loading all in memory, - # but it's nasty to deal with matches across boundaries, so let's stick to - # something simple. + # We *could* read binary data in chunks to avoid loading all in memory, but it's nasty to + # deal with matches across boundaries, so let's stick to something simple. modified = False @@ -220,8 +214,7 @@ def _apply_to_file(self, f): # Did we find a trailing null within a N + 1 bytes window after the prefix? null_terminated = match.end(0) > match.end(1) - # Suffix string length, excluding the null byte - # Only makes sense if null_terminated + # Suffix string length, excluding the null byte. Only makes sense if null_terminated suffix_strlen = match.end(0) - match.end(1) - 1 # How many bytes are we shrinking our string? @@ -231,9 +224,9 @@ def _apply_to_file(self, f): if bytes_shorter < 0: raise CannotGrowString(old, new) - # If we don't know whether this is a null terminated C-string (we're looking - # only N + 1 bytes ahead), or if it is and we have a common suffix, we can - # simply pad with leading dir separators. + # If we don't know whether this is a null terminated C-string (we're looking only N + 1 + # bytes ahead), or if it is and we have a common suffix, we can simply pad with leading + # dir separators. elif ( not null_terminated or suffix_strlen >= self.suffix_safety_size # == is enough, but let's be defensive @@ -242,9 +235,9 @@ def _apply_to_file(self, f): ): replacement = b"/" * bytes_shorter + new - # If it *was* null terminated, all that matters is that we can leave N bytes - # of old suffix in place. Note that > is required since we also insert an - # additional null terminator. + # If it *was* null terminated, all that matters is that we can leave N bytes of old + # suffix in place. Note that > is required since we also insert an additional null + # terminator. elif bytes_shorter > self.suffix_safety_size: replacement = new + match.group(2) # includes the trailing null @@ -259,22 +252,6 @@ def _apply_to_file(self, f): return modified -class BinaryStringReplacementError(spack.error.SpackError): - def __init__(self, file_path, old_len, new_len): - """The size of the file changed after binary path substitution - - Args: - file_path (str): file with changing size - old_len (str): original length of the file - new_len (str): length of the file after substitution - """ - super().__init__( - "Doing a binary string replacement in %s failed.\n" - "The size of the file changed from %s to %s\n" - "when it should have remanined the same." % (file_path, old_len, new_len) - ) - - class BinaryTextReplaceError(spack.error.SpackError): def __init__(self, msg): msg += ( @@ -286,17 +263,16 @@ def __init__(self, msg): class CannotGrowString(BinaryTextReplaceError): def __init__(self, old, new): - msg = "Cannot replace {!r} with {!r} because the new prefix is longer.".format(old, new) - super().__init__(msg) + return super().__init__( + f"Cannot replace {old!r} with {new!r} because the new prefix is longer." + ) class CannotShrinkCString(BinaryTextReplaceError): def __init__(self, old, new, full_old_string): - # Just interpolate binary string to not risk issues with invalid - # unicode, which would be really bad user experience: error in error. - # We have no clue if we actually deal with a real C-string nor what - # encoding it has. - msg = "Cannot replace {!r} with {!r} in the C-string {!r}.".format( - old, new, full_old_string + # Just interpolate binary string to not risk issues with invalid unicode, which would be + # really bad user experience: error in error. We have no clue if we actually deal with a + # real C-string nor what encoding it has. + super().__init__( + f"Cannot replace {old!r} with {new!r} in the C-string {full_old_string!r}." ) - super().__init__(msg) diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py index 0924dcad05ff2f..e4a945f0bfe236 100644 --- a/lib/spack/spack/repo.py +++ b/lib/spack/spack/repo.py @@ -14,7 +14,6 @@ import inspect import itertools import os -import os.path import random import re import shutil @@ -1042,7 +1041,7 @@ def _read_config(self) -> Dict[str, str]: return yaml_data["repo"] - except IOError: + except OSError: tty.die(f"Error reading {self.config_file} when opening {self.root}") def get(self, spec: "spack.spec.Spec") -> "spack.package_base.PackageBase": @@ -1370,7 +1369,7 @@ def create_repo(root, namespace=None, subdir=packages_dir_name): if subdir != packages_dir_name: config.write(f" subdirectory: '{subdir}'\n") - except (IOError, OSError) as e: + except OSError as e: # try to clean up. if existed: shutil.rmtree(config_path, ignore_errors=True) diff --git a/lib/spack/spack/reporters/cdash.py b/lib/spack/spack/reporters/cdash.py index a01634fd831d79..802e96f00bc2cb 100644 --- a/lib/spack/spack/reporters/cdash.py +++ b/lib/spack/spack/reporters/cdash.py @@ -1,9 +1,10 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import codecs import collections import hashlib -import os.path +import os import platform import posixpath import re @@ -13,7 +14,7 @@ import xml.sax.saxutils from typing import Dict, Optional from urllib.parse import urlencode -from urllib.request import HTTPSHandler, Request, build_opener +from urllib.request import Request import llnl.util.tty as tty from llnl.util.filesystem import working_dir @@ -24,10 +25,10 @@ import spack.spec import spack.tengine import spack.util.git +import spack.util.web as web_util from spack.error import SpackError from spack.util.crypto import checksum from spack.util.log_parse import parse_log_events -from spack.util.web import ssl_create_default_context from .base import Reporter from .extract import extract_test_parts @@ -106,7 +107,7 @@ def __init__(self, configuration: CDashConfiguration): self.site = configuration.site or socket.gethostname() self.osname = platform.system() self.osrelease = platform.release() - self.target = spack.platforms.host().target("default_target") + self.target = spack.platforms.host().default_target() self.starttime = int(time.time()) self.endtime = self.starttime self.buildstamp = ( @@ -176,7 +177,7 @@ def build_report_for_package(self, report_dir, package, duration): # something went wrong pre-cdash "configure" phase b/c we have an exception and only # "update" was encounterd. # dump the report in the configure line so teams can see what the issue is - if len(phases_encountered) == 1 and package["exception"]: + if len(phases_encountered) == 1 and package.get("exception"): # TODO this mapping is not ideal since these are pre-configure errors # we need to determine if a more appropriate cdash phase can be utilized # for now we will add a message to the log explaining this @@ -433,7 +434,6 @@ def upload(self, filename): # Compute md5 checksum for the contents of this file. md5sum = checksum(hashlib.md5, filename, block_size=8192) - opener = build_opener(HTTPSHandler(context=ssl_create_default_context())) with open(filename, "rb") as f: params_dict = { "build": self.buildname, @@ -443,26 +443,21 @@ def upload(self, filename): } encoded_params = urlencode(params_dict) url = "{0}&{1}".format(self.cdash_upload_url, encoded_params) - request = Request(url, data=f) + request = Request(url, data=f, method="PUT") request.add_header("Content-Type", "text/xml") request.add_header("Content-Length", os.path.getsize(filename)) if self.authtoken: request.add_header("Authorization", "Bearer {0}".format(self.authtoken)) try: - # By default, urllib2 only support GET and POST. - # CDash expects this file to be uploaded via PUT. - request.get_method = lambda: "PUT" - response = opener.open(request, timeout=SPACK_CDASH_TIMEOUT) + response = web_util.urlopen(request, timeout=SPACK_CDASH_TIMEOUT) if self.current_package_name not in self.buildIds: - resp_value = response.read() - if isinstance(resp_value, bytes): - resp_value = resp_value.decode("utf-8") + resp_value = codecs.getreader("utf-8")(response).read() match = self.buildid_regexp.search(resp_value) if match: buildid = match.group(1) self.buildIds[self.current_package_name] = buildid except Exception as e: - print("Upload to CDash failed: {0}".format(e)) + print(f"Upload to CDash failed: {e}") def finalize_report(self): if self.buildIds: diff --git a/lib/spack/spack/reporters/junit.py b/lib/spack/spack/reporters/junit.py index 9d6f6197cfb8f7..968726dc643ec3 100644 --- a/lib/spack/spack/reporters/junit.py +++ b/lib/spack/spack/reporters/junit.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import spack.tengine diff --git a/lib/spack/spack/rewiring.py b/lib/spack/spack/rewiring.py index 67881aa3562044..ba3ba2344913f8 100644 --- a/lib/spack/spack/rewiring.py +++ b/lib/spack/spack/rewiring.py @@ -3,15 +3,11 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import shutil import tempfile import spack.binary_distribution as bindist -import spack.deptypes as dt import spack.error import spack.hooks -import spack.platforms -import spack.relocate as relocate import spack.store @@ -42,63 +38,11 @@ def rewire_node(spec, explicit): spack.hooks.pre_install(spec) bindist.extract_buildcache_tarball(tarball, destination=spec.prefix) - buildinfo = bindist.read_buildinfo_file(spec.prefix) + bindist.relocate_package(spec) - # compute prefix-to-prefix for every node from the build spec to the spliced - # spec - prefix_to_prefix = {spec.build_spec.prefix: spec.prefix} - build_spec_ids = set(id(s) for s in spec.build_spec.traverse(deptype=dt.ALL & ~dt.BUILD)) - for s in bindist.specs_to_relocate(spec): - analog = s - if id(s) not in build_spec_ids: - analogs = [ - d - for d in spec.build_spec.traverse(deptype=dt.ALL & ~dt.BUILD) - if s._splice_match(d, self_root=spec, other_root=spec.build_spec) - ] - if analogs: - # Prefer same-name analogs and prefer higher versions - # This matches the preferences in Spec.splice, so we will find same node - analog = max(analogs, key=lambda a: (a.name == s.name, a.version)) - - prefix_to_prefix[analog.prefix] = s.prefix - - platform = spack.platforms.by_name(spec.platform) - - text_to_relocate = [ - os.path.join(spec.prefix, rel_path) for rel_path in buildinfo["relocate_textfiles"] - ] - if text_to_relocate: - relocate.relocate_text(files=text_to_relocate, prefixes=prefix_to_prefix) - links = [os.path.join(spec.prefix, f) for f in buildinfo["relocate_links"]] - relocate.relocate_links(links, prefix_to_prefix) - bins_to_relocate = [ - os.path.join(spec.prefix, rel_path) for rel_path in buildinfo["relocate_binaries"] - ] - if bins_to_relocate: - if "macho" in platform.binary_formats: - relocate.relocate_macho_binaries(bins_to_relocate, prefix_to_prefix) - if "elf" in platform.binary_formats: - relocate.relocate_elf_binaries(bins_to_relocate, prefix_to_prefix) - relocate.relocate_text_bin(binaries=bins_to_relocate, prefixes=prefix_to_prefix) - shutil.rmtree(tempdir) - install_manifest = os.path.join( - spec.prefix, - spack.store.STORE.layout.metadata_dir, - spack.store.STORE.layout.manifest_file_name, - ) - try: - os.unlink(install_manifest) - except FileNotFoundError: - pass - # Write the spliced spec into spec.json. Without this, Database.add would fail because it - # checks the spec.json in the prefix against the spec being added to look for mismatches - spack.store.STORE.layout.write_spec(spec, spack.store.STORE.layout.spec_file_path(spec)) - # add to database, not sure about explicit - spack.store.STORE.db.add(spec, explicit=explicit) - - # run post install hooks + # run post install hooks and add to db spack.hooks.post_install(spec, explicit) + spack.store.STORE.db.add(spec, explicit=explicit) class RewireError(spack.error.SpackError): diff --git a/lib/spack/spack/schema/__init__.py b/lib/spack/spack/schema/__init__.py index 298d4ef7c52ab4..83e8c06b24676d 100644 --- a/lib/spack/spack/schema/__init__.py +++ b/lib/spack/spack/schema/__init__.py @@ -6,6 +6,8 @@ import typing import warnings +import jsonschema + import llnl.util.lang from spack.error import SpecSyntaxError @@ -19,12 +21,8 @@ class DeprecationMessage(typing.NamedTuple): # jsonschema is imported lazily as it is heavy to import # and increases the start-up time def _make_validator(): - import jsonschema - def _validate_spec(validator, is_spec, instance, schema): """Check if the attributes on instance are valid specs.""" - import jsonschema - import spack.spec_parser if not validator.is_type(instance, "object"): @@ -33,8 +31,8 @@ def _validate_spec(validator, is_spec, instance, schema): for spec_str in instance: try: spack.spec_parser.parse(spec_str) - except SpecSyntaxError as e: - yield jsonschema.ValidationError(str(e)) + except SpecSyntaxError: + yield jsonschema.ValidationError(f"the key '{spec_str}' is not a valid spec") def _deprecated_properties(validator, deprecated, instance, schema): if not (validator.is_type(instance, "object") or validator.is_type(instance, "array")): @@ -67,7 +65,7 @@ def _deprecated_properties(validator, deprecated, instance, schema): yield jsonschema.ValidationError("\n".join(errors)) return jsonschema.validators.extend( - jsonschema.Draft4Validator, + jsonschema.Draft7Validator, {"validate_spec": _validate_spec, "deprecatedProperties": _deprecated_properties}, ) diff --git a/lib/spack/spack/schema/concretizer.py b/lib/spack/spack/schema/concretizer.py index 7a866dfbbd7d6f..32c8367f5485c9 100644 --- a/lib/spack/spack/schema/concretizer.py +++ b/lib/spack/spack/schema/concretizer.py @@ -84,9 +84,14 @@ "duplicates": { "type": "object", "properties": { - "strategy": {"type": "string", "enum": ["none", "minimal", "full"]} + "strategy": {"type": "string", "enum": ["none", "minimal", "full"]}, + "max_dupes": { + "type": "object", + "additional_properties": {"type": "integer", "minimum": 1}, + }, }, }, + "static_analysis": {"type": "boolean"}, "timeout": {"type": "integer", "minimum": 0}, "error_on_timeout": {"type": "boolean"}, "os_compatible": {"type": "object", "additionalProperties": {"type": "array"}}, diff --git a/lib/spack/spack/schema/cray_manifest.py b/lib/spack/spack/schema/cray_manifest.py index 3ac9b759a7439c..86098f16a06ad8 100644 --- a/lib/spack/spack/schema/cray_manifest.py +++ b/lib/spack/spack/schema/cray_manifest.py @@ -3,12 +3,12 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Schema for Cray descriptive manifest: this describes a set of - installed packages on the system and also specifies dependency - relationships between them (so this provides more information than - external entries in packages configuration). +installed packages on the system and also specifies dependency +relationships between them (so this provides more information than +external entries in packages configuration). - This does not specify a configuration - it is an input format - that is consumed and transformed into Spack DB records. +This does not specify a configuration - it is an input format +that is consumed and transformed into Spack DB records. """ from typing import Any, Dict diff --git a/lib/spack/spack/schema/definitions.py b/lib/spack/spack/schema/definitions.py index 504284b04ba6cd..e4d65cd9b8e686 100644 --- a/lib/spack/spack/schema/definitions.py +++ b/lib/spack/spack/schema/definitions.py @@ -19,7 +19,7 @@ "items": { "type": "object", "properties": {"when": {"type": "string"}}, - "patternProperties": {r"^(?!when$)\w*": spec_list_schema}, + "additionalProperties": spec_list_schema, }, } } diff --git a/lib/spack/spack/schema/env_vars.py b/lib/spack/spack/schema/env_vars.py new file mode 100644 index 00000000000000..009961cf5a063c --- /dev/null +++ b/lib/spack/spack/schema/env_vars.py @@ -0,0 +1,22 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +"""Schema for env_vars.yaml configuration file. + +.. literalinclude:: _spack_root/lib/spack/spack/schema/env_vars.py + :lines: 15- +""" +from typing import Any, Dict + +import spack.schema.environment + +properties: Dict[str, Any] = {"env_vars": spack.schema.environment.definition} + +#: Full schema with metadata +schema = { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Spack env_vars configuration file schema", + "type": "object", + "additionalProperties": False, + "properties": properties, +} diff --git a/lib/spack/spack/schema/merged.py b/lib/spack/spack/schema/merged.py index ec921152500df7..9d1c88465b27c8 100644 --- a/lib/spack/spack/schema/merged.py +++ b/lib/spack/spack/schema/merged.py @@ -20,6 +20,7 @@ import spack.schema.container import spack.schema.definitions import spack.schema.develop +import spack.schema.env_vars import spack.schema.mirrors import spack.schema.modules import spack.schema.packages @@ -38,6 +39,7 @@ spack.schema.ci.properties, spack.schema.definitions.properties, spack.schema.develop.properties, + spack.schema.env_vars.properties, spack.schema.mirrors.properties, spack.schema.modules.properties, spack.schema.packages.properties, diff --git a/lib/spack/spack/schema/mirrors.py b/lib/spack/spack/schema/mirrors.py index b0844ed87b2234..45e1f5adbf9bf7 100644 --- a/lib/spack/spack/schema/mirrors.py +++ b/lib/spack/spack/schema/mirrors.py @@ -9,6 +9,8 @@ """ from typing import Any, Dict +import jsonschema + #: Common properties for connection specification connection = { "url": {"type": "string"}, @@ -102,8 +104,6 @@ def update(data): - import jsonschema - errors = [] def check_access_pair(name, section): diff --git a/lib/spack/spack/schema/modules.py b/lib/spack/spack/schema/modules.py index 415273b40b0489..2ea8d0184a9acc 100644 --- a/lib/spack/spack/schema/modules.py +++ b/lib/spack/spack/schema/modules.py @@ -12,22 +12,6 @@ import spack.schema.environment import spack.schema.projections -#: Matches a spec or a multi-valued variant but not another -#: valid keyword. -#: -#: THIS NEEDS TO BE UPDATED FOR EVERY NEW KEYWORD THAT -#: IS ADDED IMMEDIATELY BELOW THE MODULE TYPE ATTRIBUTE -spec_regex = ( - r"(?!hierarchy|core_specs|verbose|hash_length|defaults|filter_hierarchy_specs|hide|" - r"include|exclude|projections|naming_scheme|core_compilers|all)(^\w[\w-]*)" -) - -#: Matches a valid name for a module set -valid_module_set_name = r"^(?!prefix_inspections$)\w[\w-]*$" - -#: Matches an anonymous spec, i.e. a spec without a root name -anonymous_spec_regex = r"^[\^@%+~]" - #: Definitions for parts of module schema array_of_strings = {"type": "array", "default": [], "items": {"type": "string"}} @@ -56,7 +40,7 @@ "suffixes": { "type": "object", "validate_spec": True, - "patternProperties": {r"\w[\w-]*": {"type": "string"}}, # key + "additionalProperties": {"type": "string"}, # key }, "environment": spack.schema.environment.definition, }, @@ -64,34 +48,40 @@ projections_scheme = spack.schema.projections.properties["projections"] -module_type_configuration = { +module_type_configuration: Dict = { "type": "object", "default": {}, - "allOf": [ - { - "properties": { - "verbose": {"type": "boolean", "default": False}, - "hash_length": {"type": "integer", "minimum": 0, "default": 7}, - "include": array_of_strings, - "exclude": array_of_strings, - "exclude_implicits": {"type": "boolean", "default": False}, - "defaults": array_of_strings, - "hide_implicits": {"type": "boolean", "default": False}, - "naming_scheme": {"type": "string"}, # Can we be more specific here? - "projections": projections_scheme, - "all": module_file_configuration, - } - }, - { - "validate_spec": True, - "patternProperties": { - spec_regex: module_file_configuration, - anonymous_spec_regex: module_file_configuration, - }, - }, - ], + "validate_spec": True, + "properties": { + "verbose": {"type": "boolean", "default": False}, + "hash_length": {"type": "integer", "minimum": 0, "default": 7}, + "include": array_of_strings, + "exclude": array_of_strings, + "exclude_implicits": {"type": "boolean", "default": False}, + "defaults": array_of_strings, + "hide_implicits": {"type": "boolean", "default": False}, + "naming_scheme": {"type": "string"}, + "projections": projections_scheme, + "all": module_file_configuration, + }, + "additionalProperties": module_file_configuration, } +tcl_configuration = module_type_configuration.copy() + +lmod_configuration = module_type_configuration.copy() +lmod_configuration["properties"].update( + { + "core_compilers": array_of_strings, + "hierarchy": array_of_strings, + "core_specs": array_of_strings, + "filter_hierarchy_specs": { + "type": "object", + "validate_spec": True, + "additionalProperties": array_of_strings, + }, + } +) module_config_properties = { "use_view": {"anyOf": [{"type": "string"}, {"type": "boolean"}]}, @@ -105,31 +95,8 @@ "default": [], "items": {"type": "string", "enum": ["tcl", "lmod"]}, }, - "lmod": { - "allOf": [ - # Base configuration - module_type_configuration, - { - "type": "object", - "properties": { - "core_compilers": array_of_strings, - "hierarchy": array_of_strings, - "core_specs": array_of_strings, - "filter_hierarchy_specs": { - "type": "object", - "patternProperties": {spec_regex: array_of_strings}, - }, - }, - }, # Specific lmod extensions - ] - }, - "tcl": { - "allOf": [ - # Base configuration - module_type_configuration, - {}, # Specific tcl extensions - ] - }, + "lmod": lmod_configuration, + "tcl": tcl_configuration, "prefix_inspections": { "type": "object", "additionalProperties": False, @@ -145,7 +112,6 @@ properties: Dict[str, Any] = { "modules": { "type": "object", - "additionalProperties": False, "properties": { "prefix_inspections": { "type": "object", @@ -156,13 +122,11 @@ }, } }, - "patternProperties": { - valid_module_set_name: { - "type": "object", - "default": {}, - "additionalProperties": False, - "properties": module_config_properties, - } + "additionalProperties": { + "type": "object", + "default": {}, + "additionalProperties": False, + "properties": module_config_properties, }, } } diff --git a/lib/spack/spack/schema/packages.py b/lib/spack/spack/schema/packages.py index e16ba1f14bb4d4..8c92b1f89eb9b9 100644 --- a/lib/spack/spack/schema/packages.py +++ b/lib/spack/spack/schema/packages.py @@ -98,7 +98,6 @@ "packages": { "type": "object", "default": {}, - "additionalProperties": False, "properties": { "all": { # package name "type": "object", @@ -140,58 +139,54 @@ }, } }, - "patternProperties": { - r"(?!^all$)(^\w[\w-]*)": { # package name - "type": "object", - "default": {}, - "additionalProperties": False, - "properties": { - "require": requirements, - "prefer": prefer_and_conflict, - "conflict": prefer_and_conflict, - "version": { - "type": "array", - "default": [], - # version strings - "items": {"anyOf": [{"type": "string"}, {"type": "number"}]}, - }, - "buildable": {"type": "boolean", "default": True}, - "permissions": permissions, - # If 'get_full_repo' is promoted to a Package-level - # attribute, it could be useful to set it here - "package_attributes": package_attributes, - "variants": variants, - "externals": { - "type": "array", - "items": { - "type": "object", - "properties": { - "spec": {"type": "string"}, - "prefix": {"type": "string"}, - "modules": {"type": "array", "items": {"type": "string"}}, - "extra_attributes": { - "type": "object", - "additionalProperties": True, - "properties": { - "compilers": { - "type": "object", - "patternProperties": { - r"(^\w[\w-]*)": {"type": "string"} - }, - }, - "environment": spack.schema.environment.definition, - "extra_rpaths": extra_rpaths, - "implicit_rpaths": implicit_rpaths, - "flags": flags, + "additionalProperties": { # package name + "type": "object", + "default": {}, + "additionalProperties": False, + "properties": { + "require": requirements, + "prefer": prefer_and_conflict, + "conflict": prefer_and_conflict, + "version": { + "type": "array", + "default": [], + # version strings + "items": {"anyOf": [{"type": "string"}, {"type": "number"}]}, + }, + "buildable": {"type": "boolean", "default": True}, + "permissions": permissions, + # If 'get_full_repo' is promoted to a Package-level + # attribute, it could be useful to set it here + "package_attributes": package_attributes, + "variants": variants, + "externals": { + "type": "array", + "items": { + "type": "object", + "properties": { + "spec": {"type": "string"}, + "prefix": {"type": "string"}, + "modules": {"type": "array", "items": {"type": "string"}}, + "extra_attributes": { + "type": "object", + "additionalProperties": {"type": "string"}, + "properties": { + "compilers": { + "type": "object", + "patternProperties": {r"(^\w[\w-]*)": {"type": "string"}}, }, + "environment": spack.schema.environment.definition, + "extra_rpaths": extra_rpaths, + "implicit_rpaths": implicit_rpaths, + "flags": flags, }, }, - "additionalProperties": True, - "required": ["spec"], }, + "additionalProperties": True, + "required": ["spec"], }, }, - } + }, }, } } diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index cca1ad4262fb1f..b44c56d1fd0788 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -6,6 +6,7 @@ import copy import enum import functools +import io import itertools import os import pathlib @@ -35,12 +36,15 @@ import spack.error import spack.package_base import spack.package_prefs +import spack.patch import spack.platforms import spack.repo +import spack.solver.splicing import spack.spec import spack.store import spack.util.crypto import spack.util.libc +import spack.util.module_cmd as md import spack.util.path import spack.util.timer import spack.variant as vt @@ -61,28 +65,30 @@ parse_files, parse_term, ) -from .counter import FullDuplicatesCounter, MinimalDuplicatesCounter, NoDuplicatesCounter +from .input_analysis import create_counter, create_graph_analyzer from .requirements import RequirementKind, RequirementParser, RequirementRule from .version_order import concretization_version_order GitOrStandardVersion = Union[spack.version.GitVersion, spack.version.StandardVersion] -TransformFunction = Callable[["spack.spec.Spec", List[AspFunction]], List[AspFunction]] +TransformFunction = Callable[[spack.spec.Spec, List[AspFunction]], List[AspFunction]] #: Enable the addition of a runtime node WITH_RUNTIME = sys.platform != "win32" -#: Data class that contain configuration on what a -#: clingo solve should output. -#: -#: Args: -#: timers (bool): Print out coarse timers for different solve phases. -#: stats (bool): Whether to output Clingo's internal solver statistics. -#: out: Optional output stream for the generated ASP program. -#: setup_only (bool): if True, stop after setup and don't solve (default False). -OutputConfiguration = collections.namedtuple( - "OutputConfiguration", ["timers", "stats", "out", "setup_only"] -) + +class OutputConfiguration(NamedTuple): + """Data class that contains configuration on what a clingo solve should output.""" + + #: Print out coarse timers for different solve phases + timers: bool + #: Whether to output Clingo's internal solver statistics + stats: bool + #: Optional output stream for the generated ASP program + out: Optional[io.IOBase] + #: If True, stop after setup and don't solve + setup_only: bool + #: Default output configuration for a solve DEFAULT_OUTPUT_CONFIGURATION = OutputConfiguration( @@ -127,8 +133,8 @@ def __str__(self): @contextmanager def named_spec( - spec: Optional["spack.spec.Spec"], name: Optional[str] -) -> Iterator[Optional["spack.spec.Spec"]]: + spec: Optional[spack.spec.Spec], name: Optional[str] +) -> Iterator[Optional[spack.spec.Spec]]: """Context manager to temporarily set the name of a spec""" if spec is None or name is None: yield spec @@ -270,15 +276,6 @@ def remove_node(spec: spack.spec.Spec, facts: List[AspFunction]) -> List[AspFunc return list(filter(lambda x: x.args[0] not in ("node", "virtual_node"), facts)) -def _create_counter(specs: List[spack.spec.Spec], tests: bool): - strategy = spack.config.CONFIG.get("concretizer:duplicates:strategy", "none") - if strategy == "full": - return FullDuplicatesCounter(specs, tests=tests) - if strategy == "minimal": - return MinimalDuplicatesCounter(specs, tests=tests) - return NoDuplicatesCounter(specs, tests=tests) - - def all_libcs() -> Set[spack.spec.Spec]: """Return a set of all libc specs targeted by any configured compiler. If none, fall back to libc determined from the current Python process if dynamically linked.""" @@ -506,7 +503,7 @@ def _compute_specs_from_answer_set(self): # The specs must be unified to get here, so it is safe to associate any satisfying spec # with the input. Multiple inputs may be matched to the same concrete spec node = SpecBuilder.make_node(pkg=input_spec.name) - if input_spec.virtual: + if spack.repo.PATH.is_virtual(input_spec.name): providers = [ spec.name for spec in answer.values() if spec.package.provides(input_spec.name) ] @@ -747,11 +744,11 @@ def on_model(model): class KnownCompiler(NamedTuple): """Data class to collect information on compilers""" - spec: "spack.spec.Spec" + spec: spack.spec.Spec os: str - target: str + target: Optional[str] available: bool - compiler_obj: Optional["spack.compiler.Compiler"] + compiler_obj: Optional[spack.compiler.Compiler] def _key(self): return self.spec, self.os, self.target @@ -1120,6 +1117,8 @@ class SpackSolverSetup: """Class to set up and run a Spack concretization solve.""" def __init__(self, tests: bool = False): + self.possible_graph = create_graph_analyzer() + # these are all initialized in setup() self.gen: "ProblemInstanceBuilder" = ProblemInstanceBuilder() self.requirement_parser = RequirementParser(spack.config.CONFIG) @@ -1132,7 +1131,7 @@ def __init__(self, tests: bool = False): set ) - self.possible_compilers: List = [] + self.possible_compilers: List[KnownCompiler] = [] self.possible_oses: Set = set() self.variant_values_from_specs: Set = set() self.version_constraints: Set = set() @@ -1386,7 +1385,7 @@ def effect_rules(self): def define_variant( self, - pkg: "Type[spack.package_base.PackageBase]", + pkg: Type[spack.package_base.PackageBase], name: str, when: spack.spec.Spec, variant_def: vt.Variant, @@ -1490,7 +1489,7 @@ def define_auto_variant(self, name: str, multi: bool): ) ) - def variant_rules(self, pkg: "Type[spack.package_base.PackageBase]"): + def variant_rules(self, pkg: Type[spack.package_base.PackageBase]): for name in pkg.variant_names(): self.gen.h3(f"Variant {name} in package {pkg.name}") for when, variant_def in pkg.variant_definitions(name): @@ -1681,8 +1680,8 @@ def dependency_holds(input_spec, requirements): def _gen_match_variant_splice_constraints( self, pkg, - cond_spec: "spack.spec.Spec", - splice_spec: "spack.spec.Spec", + cond_spec: spack.spec.Spec, + splice_spec: spack.spec.Spec, hash_asp_var: "AspVar", splice_node, match_variants: List[str], @@ -1740,7 +1739,7 @@ def package_splice_rules(self, pkg): if any( v in cond.variants or v in spec_to_splice.variants for v in match_variants ): - raise Exception( + raise spack.error.PackageError( "Overlap between match_variants and explicitly set variants" ) variant_constraints = self._gen_match_variant_splice_constraints( @@ -2086,7 +2085,11 @@ def _spec_clauses( f: Union[Type[_Head], Type[_Body]] = _Body if body else _Head if spec.name: - clauses.append(f.node(spec.name) if not spec.virtual else f.virtual_node(spec.name)) + clauses.append( + f.node(spec.name) + if not spack.repo.PATH.is_virtual(spec.name) + else f.virtual_node(spec.name) + ) if spec.namespace: clauses.append(f.namespace(spec.name, spec.namespace)) @@ -2113,7 +2116,7 @@ def _spec_clauses( for value in variant.value_as_tuple: # ensure that the value *can* be valid for the spec - if spec.name and not spec.concrete and not spec.virtual: + if spec.name and not spec.concrete and not spack.repo.PATH.is_virtual(spec.name): variant_defs = vt.prevalidate_variant_value( self.pkg_class(spec.name), variant, spec ) @@ -2396,38 +2399,20 @@ def keyfun(os): def target_defaults(self, specs): """Add facts about targets and target compatibility.""" - self.gen.h2("Default target") - - platform = spack.platforms.host() - uarch = archspec.cpu.TARGETS.get(platform.default) - self.gen.h2("Target compatibility") - # Construct the list of targets which are compatible with the host - candidate_targets = [uarch] + uarch.ancestors - - # Get configuration options - granularity = spack.config.get("concretizer:targets:granularity") - host_compatible = spack.config.get("concretizer:targets:host_compatible") - - # Add targets which are not compatible with the current host - if not host_compatible: - additional_targets_in_family = sorted( - [ - t - for t in archspec.cpu.TARGETS.values() - if (t.family.name == uarch.family.name and t not in candidate_targets) - ], - key=lambda x: len(x.ancestors), - reverse=True, - ) - candidate_targets += additional_targets_in_family - - # Check if we want only generic architecture - if granularity == "generic": - candidate_targets = [t for t in candidate_targets if t.vendor == "generic"] - # Add targets explicitly requested from specs + candidate_targets = [] + for x in self.possible_graph.candidate_targets(): + if all( + self.possible_graph.unreachable(pkg_name=pkg_name, when_spec=f"target={x}") + for pkg_name in self.pkgs + ): + tty.debug(f"[{__name__}] excluding target={x}, cause no package can use it") + continue + candidate_targets.append(x) + + host_compatible = spack.config.CONFIG.get("concretizer:targets:host_compatible") for spec in specs: if not spec.architecture or not spec.architecture.target: continue @@ -2443,6 +2428,8 @@ def target_defaults(self, specs): if ancestor not in candidate_targets: candidate_targets.append(ancestor) + platform = spack.platforms.host() + uarch = archspec.cpu.TARGETS.get(platform.default) best_targets = {uarch.family.name} for compiler_id, known_compiler in enumerate(self.possible_compilers): if not known_compiler.available: @@ -2500,7 +2487,6 @@ def target_defaults(self, specs): self.gen.newline() self.default_targets = list(sorted(set(self.default_targets))) - self.target_preferences() def virtual_providers(self): @@ -2604,7 +2590,14 @@ def define_variant_values(self): # Tell the concretizer about possible values from specs seen in spec_clauses(). # We might want to order these facts by pkg and name if we are debugging. for pkg_name, variant_def_id, value in self.variant_values_from_specs: - vid = self.variant_ids_by_def_id[variant_def_id] + try: + vid = self.variant_ids_by_def_id[variant_def_id] + except KeyError: + tty.debug( + f"[{__name__}] cannot retrieve id of the {value} variant from {pkg_name}" + ) + continue + self.gen.fact(fn.pkg_fact(pkg_name, fn.variant_possible_value(vid, value))) def register_concrete_spec(self, spec, possible): @@ -2675,7 +2668,7 @@ def setup( """ check_packages_exist(specs) - node_counter = _create_counter(specs, tests=self.tests) + node_counter = create_counter(specs, tests=self.tests, possible_graph=self.possible_graph) self.possible_virtuals = node_counter.possible_virtuals() self.pkgs = node_counter.possible_dependencies() self.libcs = sorted(all_libcs()) # type: ignore[type-var] @@ -2683,7 +2676,9 @@ def setup( # Fail if we already know an unreachable node is requested for spec in specs: missing_deps = [ - str(d) for d in spec.traverse() if d.name not in self.pkgs and not d.virtual + str(d) + for d in spec.traverse() + if d.name not in self.pkgs and not spack.repo.PATH.is_virtual(d.name) ] if missing_deps: raise spack.spec.InvalidDependencyError(spec.name, missing_deps) @@ -2710,7 +2705,7 @@ def setup( if env: dev_specs = tuple( spack.spec.Spec(info["spec"]).constrained( - "dev_path=%s" + 'dev_path="%s"' % spack.util.path.canonicalize_path(info["path"], default_wd=env.path) ) for name, info in env.dev_specs.items() @@ -2900,7 +2895,11 @@ def literal_specs(self, specs): pkg_name = clause.args[1] self.gen.fact(fn.mentioned_in_literal(trigger_id, root_name, pkg_name)) - requirements.append(fn.attr("virtual_root" if spec.virtual else "root", spec.name)) + requirements.append( + fn.attr( + "virtual_root" if spack.repo.PATH.is_virtual(spec.name) else "root", spec.name + ) + ) cache[imposed_spec_key] = (effect_id, requirements) self.gen.fact(fn.pkg_fact(spec.name, fn.condition_effect(condition_id, effect_id))) @@ -2977,7 +2976,7 @@ def _specs_from_requires(self, pkg_name, section): for s in spec_group[key]: yield _spec_with_default_name(s, pkg_name) - def pkg_class(self, pkg_name: str) -> typing.Type["spack.package_base.PackageBase"]: + def pkg_class(self, pkg_name: str) -> typing.Type[spack.package_base.PackageBase]: request = pkg_name if pkg_name in self.explicitly_required_namespaces: namespace = self.explicitly_required_namespaces[pkg_name] @@ -3096,7 +3095,7 @@ def __init__(self, configuration) -> None: self.compilers.add(candidate) - def with_input_specs(self, input_specs: List["spack.spec.Spec"]) -> "CompilerParser": + def with_input_specs(self, input_specs: List[spack.spec.Spec]) -> "CompilerParser": """Accounts for input specs when building the list of possible compilers. Args: @@ -3136,7 +3135,7 @@ def with_input_specs(self, input_specs: List["spack.spec.Spec"]) -> "CompilerPar return self - def add_compiler_from_concrete_spec(self, spec: "spack.spec.Spec") -> None: + def add_compiler_from_concrete_spec(self, spec: spack.spec.Spec) -> None: """Account for compilers that are coming from concrete specs, through reuse. Args: @@ -3374,14 +3373,6 @@ def consume_facts(self): self._setup.effect_rules() -# This should be a dataclass, but dataclasses don't work on Python 3.6 -class Splice: - def __init__(self, splice_node: NodeArgument, child_name: str, child_hash: str): - self.splice_node = splice_node - self.child_name = child_name - self.child_hash = child_hash - - class SpecBuilder: """Class with actions to rebuild a spec from ASP results.""" @@ -3421,7 +3412,7 @@ def __init__(self, specs, hash_lookup=None): self._specs: Dict[NodeArgument, spack.spec.Spec] = {} # Matches parent nodes to splice node - self._splices: Dict[NodeArgument, List[Splice]] = {} + self._splices: Dict[spack.spec.Spec, List[spack.solver.splicing.Splice]] = {} self._result = None self._command_line_specs = specs self._flag_sources: Dict[Tuple[NodeArgument, str], Set[str]] = collections.defaultdict( @@ -3496,7 +3487,7 @@ def external_spec_selected(self, node, idx): self._specs[node].extra_attributes = spec_info.get("extra_attributes", {}) # If this is an extension, update the dependencies to include the extendee - package = self._specs[node].package_class(self._specs[node]) + package = spack.repo.PATH.get_pkg_class(self._specs[node].fullname)(self._specs[node]) extendee_spec = package.extendee_spec if extendee_spec: @@ -3540,15 +3531,13 @@ def reorder_flags(self): ) cmd_specs = dict((s.name, s) for spec in self._command_line_specs for s in spec.traverse()) - for spec in self._specs.values(): + for node, spec in self._specs.items(): # if bootstrapping, compiler is not in config and has no flags flagmap_from_compiler = {} if spec.compiler in compilers: flagmap_from_compiler = compilers[spec.compiler].flags for flag_type in spec.compiler_flags.valid_compiler_flags(): - node = SpecBuilder.make_node(pkg=spec.name) - ordered_flags = [] # 1. Put compiler flags first @@ -3630,49 +3619,12 @@ def splice_at_hash( child_name: str, child_hash: str, ): - splice = Splice(splice_node, child_name=child_name, child_hash=child_hash) - self._splices.setdefault(parent_node, []).append(splice) - - def _resolve_automatic_splices(self): - """After all of the specs have been concretized, apply all immediate splices. - - Use reverse topological order to ensure that all dependencies are resolved - before their parents, allowing for maximal sharing and minimal copying. - - """ - fixed_specs = {} - - # create a mapping from dag hash to an integer representing position in reverse topo order. - specs = self._specs.values() - topo_order = list(traverse.traverse_nodes(specs, order="topo", key=traverse.by_dag_hash)) - topo_lookup = {spec.dag_hash(): index for index, spec in enumerate(reversed(topo_order))} - - # iterate over specs, children before parents - for node, spec in sorted(self._specs.items(), key=lambda x: topo_lookup[x[1].dag_hash()]): - immediate = self._splices.get(node, []) - if not immediate and not any( - edge.spec in fixed_specs for edge in spec.edges_to_dependencies() - ): - continue - new_spec = spec.copy(deps=False) - new_spec.build_spec = spec - for edge in spec.edges_to_dependencies(): - depflag = edge.depflag & ~dt.BUILD - if any(edge.spec.dag_hash() == splice.child_hash for splice in immediate): - splice = [s for s in immediate if s.child_hash == edge.spec.dag_hash()][0] - new_spec.add_dependency_edge( - self._specs[splice.splice_node], depflag=depflag, virtuals=edge.virtuals - ) - elif edge.spec in fixed_specs: - new_spec.add_dependency_edge( - fixed_specs[edge.spec], depflag=depflag, virtuals=edge.virtuals - ) - else: - new_spec.add_dependency_edge( - edge.spec, depflag=depflag, virtuals=edge.virtuals - ) - self._specs[node] = new_spec - fixed_specs[spec] = new_spec + parent_spec = self._specs[parent_node] + splice_spec = self._specs[splice_node] + splice = spack.solver.splicing.Splice( + splice_spec, child_name=child_name, child_hash=child_hash + ) + self._splices.setdefault(parent_spec, []).append(splice) @staticmethod def sort_fn(function_tuple) -> Tuple[int, int]: @@ -3752,11 +3704,11 @@ def build_specs(self, function_tuples): roots = [spec.root for spec in self._specs.values()] roots = dict((id(r), r) for r in roots) for root in roots.values(): - spack.spec.Spec.inject_patches_variant(root) + _inject_patches_variant(root) # Add external paths to specs with just external modules for s in self._specs.values(): - spack.spec.Spec.ensure_external_path_if_external(s) + _ensure_external_path_if_external(s) for s in self._specs.values(): _develop_specs_from_env(s, ev.active_environment()) @@ -3765,7 +3717,15 @@ def build_specs(self, function_tuples): for root in roots.values(): root._finalize_concretization() - self._resolve_automatic_splices() + # Only attempt to resolve automatic splices if the solver produced any + if self._splices: + resolved_splices = spack.solver.splicing._resolve_collected_splices( + list(self._specs.values()), self._splices + ) + new_specs = {} + for node, spec in self._specs.items(): + new_specs[node] = resolved_splices.get(spec, spec) + self._specs = new_specs for s in self._specs.values(): spack.spec.Spec.ensure_no_deprecated(s) @@ -3820,6 +3780,92 @@ def execute_explicit_splices(self): return specs +def _inject_patches_variant(root: spack.spec.Spec) -> None: + # This dictionary will store object IDs rather than Specs as keys + # since the Spec __hash__ will change as patches are added to them + spec_to_patches: Dict[int, Set[spack.patch.Patch]] = {} + for s in root.traverse(): + # After concretizing, assign namespaces to anything left. + # Note that this doesn't count as a "change". The repository + # configuration is constant throughout a spack run, and + # normalize and concretize evaluate Packages using Repo.get(), + # which respects precedence. So, a namespace assignment isn't + # changing how a package name would have been interpreted and + # we can do it as late as possible to allow as much + # compatibility across repositories as possible. + if s.namespace is None: + s.namespace = spack.repo.PATH.repo_for_pkg(s.name).namespace + + if s.concrete: + continue + + # Add any patches from the package to the spec. + node_patches = { + patch + for cond, patch_list in spack.repo.PATH.get_pkg_class(s.fullname).patches.items() + if s.satisfies(cond) + for patch in patch_list + } + if node_patches: + spec_to_patches[id(s)] = node_patches + + # Also record all patches required on dependencies by depends_on(..., patch=...) + for dspec in root.traverse_edges(deptype=dt.ALL, cover="edges", root=False): + if dspec.spec.concrete: + continue + + pkg_deps = spack.repo.PATH.get_pkg_class(dspec.parent.fullname).dependencies + + edge_patches: List[spack.patch.Patch] = [] + for cond, deps_by_name in pkg_deps.items(): + if not dspec.parent.satisfies(cond): + continue + + dependency = deps_by_name.get(dspec.spec.name) + if not dependency: + continue + + for pcond, patch_list in dependency.patches.items(): + if dspec.spec.satisfies(pcond): + edge_patches.extend(patch_list) + + if edge_patches: + spec_to_patches.setdefault(id(dspec.spec), set()).update(edge_patches) + + for spec in root.traverse(): + if id(spec) not in spec_to_patches: + continue + + patches = list(spec_to_patches[id(spec)]) + variant: vt.MultiValuedVariant = spec.variants.setdefault( + "patches", vt.MultiValuedVariant("patches", ()) + ) + variant.value = tuple(p.sha256 for p in patches) + # FIXME: Monkey patches variant to store patches order + ordered_hashes = [(*p.ordering_key, p.sha256) for p in patches if p.ordering_key] + ordered_hashes.sort() + tty.debug( + f"Ordered hashes [{spec.name}]: " + + ", ".join("/".join(str(e) for e in t) for t in ordered_hashes) + ) + setattr( + variant, "_patches_in_order_of_appearance", [sha256 for _, _, sha256 in ordered_hashes] + ) + + +def _ensure_external_path_if_external(spec: spack.spec.Spec) -> None: + if not spec.external_modules or spec.external_path: + return + + # Get the path from the module the package can override the default + # (this is mostly needed for Cray) + pkg_cls = spack.repo.PATH.get_pkg_class(spec.name) + package = pkg_cls(spec) + spec.external_path = getattr(package, "external_prefix", None) or md.path_from_modules( + spec.external_modules + ) + + def _develop_specs_from_env(spec, env): dev_info = env.dev_specs.get(spec.name, {}) if env else {} if not dev_info: @@ -4140,10 +4186,10 @@ def _check_input_and_extract_concrete_specs(specs): reusable = [] for root in specs: for s in root.traverse(): - if s.virtual: - continue if s.concrete: reusable.append(s) + elif spack.repo.PATH.is_virtual(s.name): + continue spack.spec.Spec.ensure_valid_variants(s) return reusable diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index c47e84a83db19b..24c7502e53e682 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -265,6 +265,7 @@ error(100, "Cannot select a single version for virtual '{0}'", Virtual) % If we select a deprecated version, mark the package as deprecated attr("deprecated", node(ID, Package), Version) :- attr("version", node(ID, Package), Version), + not external(node(ID, Package)), pkg_fact(Package, deprecated_version(Version)). error(100, "Package '{0}' needs the deprecated version '{1}', and this is not allowed", Package, Version) diff --git a/lib/spack/spack/solver/counter.py b/lib/spack/spack/solver/counter.py deleted file mode 100644 index 4e3150cb4a0ce3..00000000000000 --- a/lib/spack/spack/solver/counter.py +++ /dev/null @@ -1,179 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) -import collections -from typing import List, Set - -from llnl.util import lang - -import spack.deptypes as dt -import spack.package_base -import spack.repo -import spack.spec - -PossibleDependencies = Set[str] - - -class Counter: - """Computes the possible packages and the maximum number of duplicates - allowed for each of them. - - Args: - specs: abstract specs to concretize - tests: if True, add test dependencies to the list of possible packages - """ - - def __init__(self, specs: List["spack.spec.Spec"], tests: bool) -> None: - runtime_pkgs = spack.repo.PATH.packages_with_tags("runtime") - runtime_virtuals = set() - for x in runtime_pkgs: - pkg_class = spack.repo.PATH.get_pkg_class(x) - runtime_virtuals.update(pkg_class.provided_virtual_names()) - - self.specs = specs + [spack.spec.Spec(x) for x in runtime_pkgs] - - self.link_run_types: dt.DepFlag = dt.LINK | dt.RUN | dt.TEST - self.all_types: dt.DepFlag = dt.ALL - if not tests: - self.link_run_types = dt.LINK | dt.RUN - self.all_types = dt.LINK | dt.RUN | dt.BUILD - - self._possible_dependencies: PossibleDependencies = set() - self._possible_virtuals: Set[str] = ( - set(x.name for x in specs if x.virtual) | runtime_virtuals - ) - - def possible_dependencies(self) -> PossibleDependencies: - """Returns the list of possible dependencies""" - self.ensure_cache_values() - return self._possible_dependencies - - def possible_virtuals(self) -> Set[str]: - """Returns the list of possible virtuals""" - self.ensure_cache_values() - return self._possible_virtuals - - def ensure_cache_values(self) -> None: - """Ensure the cache values have been computed""" - if self._possible_dependencies: - return - self._compute_cache_values() - - def possible_packages_facts(self, gen: "spack.solver.asp.PyclingoDriver", fn) -> None: - """Emit facts associated with the possible packages""" - raise NotImplementedError("must be implemented by derived classes") - - def _compute_cache_values(self): - raise NotImplementedError("must be implemented by derived classes") - - -class NoDuplicatesCounter(Counter): - def _compute_cache_values(self): - result = spack.package_base.possible_dependencies( - *self.specs, virtuals=self._possible_virtuals, depflag=self.all_types - ) - self._possible_dependencies = set(result) - - def possible_packages_facts(self, gen, fn): - gen.h2("Maximum number of nodes (packages)") - for package_name in sorted(self.possible_dependencies()): - gen.fact(fn.max_dupes(package_name, 1)) - gen.newline() - gen.h2("Maximum number of nodes (virtual packages)") - for package_name in sorted(self.possible_virtuals()): - gen.fact(fn.max_dupes(package_name, 1)) - gen.newline() - gen.h2("Possible package in link-run subDAG") - for name in sorted(self.possible_dependencies()): - gen.fact(fn.possible_in_link_run(name)) - gen.newline() - - -class MinimalDuplicatesCounter(NoDuplicatesCounter): - def __init__(self, specs, tests): - super().__init__(specs, tests) - self._link_run: PossibleDependencies = set() - self._direct_build: PossibleDependencies = set() - self._total_build: PossibleDependencies = set() - self._link_run_virtuals: Set[str] = set() - - def _compute_cache_values(self): - self._link_run = set( - spack.package_base.possible_dependencies( - *self.specs, virtuals=self._possible_virtuals, depflag=self.link_run_types - ) - ) - self._link_run_virtuals.update(self._possible_virtuals) - for x in self._link_run: - build_dependencies = spack.repo.PATH.get_pkg_class(x).dependencies_of_type(dt.BUILD) - virtuals, reals = lang.stable_partition( - build_dependencies, spack.repo.PATH.is_virtual_safe - ) - - self._possible_virtuals.update(virtuals) - for virtual_dep in virtuals: - providers = spack.repo.PATH.providers_for(virtual_dep) - self._direct_build.update(str(x) for x in providers) - - self._direct_build.update(reals) - - self._total_build = set( - spack.package_base.possible_dependencies( - *self._direct_build, virtuals=self._possible_virtuals, depflag=self.all_types - ) - ) - self._possible_dependencies = set(self._link_run) | set(self._total_build) - - def possible_packages_facts(self, gen, fn): - build_tools = spack.repo.PATH.packages_with_tags("build-tools") - gen.h2("Packages with at most a single node") - for package_name in sorted(self.possible_dependencies() - build_tools): - gen.fact(fn.max_dupes(package_name, 1)) - gen.newline() - - gen.h2("Packages with at multiple possible nodes (build-tools)") - for package_name in sorted(self.possible_dependencies() & build_tools): - gen.fact(fn.max_dupes(package_name, 2)) - gen.fact(fn.multiple_unification_sets(package_name)) - gen.newline() - - gen.h2("Maximum number of nodes (virtual packages)") - for package_name in sorted(self.possible_virtuals()): - gen.fact(fn.max_dupes(package_name, 1)) - gen.newline() - - gen.h2("Possible package in link-run subDAG") - for name in sorted(self._link_run): - gen.fact(fn.possible_in_link_run(name)) - gen.newline() - - -class FullDuplicatesCounter(MinimalDuplicatesCounter): - def possible_packages_facts(self, gen, fn): - build_tools = spack.repo.PATH.packages_with_tags("build-tools") - counter = collections.Counter( - list(self._link_run) + list(self._total_build) + list(self._direct_build) - ) - gen.h2("Maximum number of nodes") - for pkg, count in sorted(counter.items(), key=lambda x: (x[1], x[0])): - count = min(count, 2) - gen.fact(fn.max_dupes(pkg, count)) - gen.newline() - - gen.h2("Build unification sets ") - for name in sorted(self.possible_dependencies() & build_tools): - gen.fact(fn.multiple_unification_sets(name)) - gen.newline() - - gen.h2("Possible package in link-run subDAG") - for name in sorted(self._link_run): - gen.fact(fn.possible_in_link_run(name)) - gen.newline() - - counter = collections.Counter( - list(self._link_run_virtuals) + list(self._possible_virtuals) - ) - gen.h2("Maximum number of virtual nodes") - for pkg, count in sorted(counter.items(), key=lambda x: (x[1], x[0])): - gen.fact(fn.max_dupes(pkg, count)) - gen.newline() diff --git a/lib/spack/spack/solver/input_analysis.py b/lib/spack/spack/solver/input_analysis.py new file mode 100644 index 00000000000000..260f2a1e292625 --- /dev/null +++ b/lib/spack/spack/solver/input_analysis.py @@ -0,0 +1,539 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +"""Classes to analyze the input of a solve, and provide information to set up the ASP problem""" +import collections +from typing import Dict, List, NamedTuple, Set, Tuple, Union + +import archspec.cpu + +from llnl.util import lang, tty + +import spack.binary_distribution +import spack.config +import spack.deptypes as dt +import spack.platforms +import spack.repo +import spack.spec +import spack.store +from spack.error import SpackError + +RUNTIME_TAG = "runtime" + + +class PossibleGraph(NamedTuple): + real_pkgs: Set[str] + virtuals: Set[str] + edges: Dict[str, Set[str]] + + +class PossibleDependencyGraph: + """Returns information needed to set up an ASP problem""" + + def unreachable(self, *, pkg_name: str, when_spec: spack.spec.Spec) -> bool: + """Returns true if the context can determine that the condition cannot ever + be met on pkg_name. + """ + raise NotImplementedError + + def candidate_targets(self) -> List[archspec.cpu.Microarchitecture]: + """Returns a list of targets that are candidate for concretization""" + raise NotImplementedError + + def possible_dependencies( + self, + *specs: Union[spack.spec.Spec, str], + allowed_deps: dt.DepFlag, + transitive: bool = True, + strict_depflag: bool = False, + expand_virtuals: bool = True, + ) -> PossibleGraph: + """Returns the set of possible dependencies, and the set of possible virtuals. + + Both sets always include runtime packages, which may be injected by compilers. + + Args: + transitive: return transitive dependencies if True, only direct dependencies if False + allowed_deps: dependency types to consider + strict_depflag: if True, only the specific dep type is considered, if False any + deptype that intersects with allowed deptype is considered + expand_virtuals: expand virtual dependencies into all possible implementations + """ + raise NotImplementedError + + +class NoStaticAnalysis(PossibleDependencyGraph): + """Implementation that tries to minimize the setup time (i.e. defaults to give fast + answers), rather than trying to reduce the ASP problem size with more complex analysis. + """ + + def __init__(self, *, configuration: spack.config.Configuration, repo: spack.repo.RepoPath): + self.configuration = configuration + self.repo = repo + self.runtime_pkgs = set(self.repo.packages_with_tags(RUNTIME_TAG)) + self.runtime_virtuals = set() + self._platform_condition = spack.spec.Spec( + f"platform={spack.platforms.host()} target={archspec.cpu.host().family}:" + ) + for x in self.runtime_pkgs: + pkg_class = self.repo.get_pkg_class(x) + self.runtime_virtuals.update(pkg_class.provided_virtual_names()) + + try: + self.libc_pkgs = [x.name for x in self.providers_for("libc")] + except spack.repo.UnknownPackageError: + self.libc_pkgs = [] + + def is_virtual(self, name: str) -> bool: + return self.repo.is_virtual(name) + + @lang.memoized + def is_allowed_on_this_platform(self, *, pkg_name: str) -> bool: + """Returns true if a package is allowed on the current host""" + pkg_cls = self.repo.get_pkg_class(pkg_name) + for when_spec, conditions in pkg_cls.requirements.items(): + if not when_spec.intersects(self._platform_condition): + continue + for requirements, _, _ in conditions: + if not any(x.intersects(self._platform_condition) for x in requirements): + tty.debug(f"[{__name__}] {pkg_name} is not for this platform") + return False + return True + + def providers_for(self, virtual_str: str) -> List[spack.spec.Spec]: + """Returns a list of possible providers for the virtual string in input.""" + return self.repo.providers_for(virtual_str) + + def can_be_installed(self, *, pkg_name) -> bool: + """Returns True if a package can be installed, False otherwise.""" + return True + + def unreachable(self, *, pkg_name: str, when_spec: spack.spec.Spec) -> bool: + """Returns true if the context can determine that the condition cannot ever + be met on pkg_name. + """ + return False + + def candidate_targets(self) -> List[archspec.cpu.Microarchitecture]: + """Returns a list of targets that are candidate for concretization""" + platform = spack.platforms.host() + default_target = archspec.cpu.TARGETS[platform.default] + + # Construct the list of targets which are compatible with the host + candidate_targets = [default_target] + default_target.ancestors + granularity = self.configuration.get("concretizer:targets:granularity") + host_compatible = self.configuration.get("concretizer:targets:host_compatible") + + # Add targets which are not compatible with the current host + if not host_compatible: + additional_targets_in_family = sorted( + [ + t + for t in archspec.cpu.TARGETS.values() + if (t.family.name == default_target.family.name and t not in candidate_targets) + ], + key=lambda x: len(x.ancestors), + reverse=True, + ) + candidate_targets += additional_targets_in_family + + # Check if we want only generic architecture + if granularity == "generic": + candidate_targets = [t for t in candidate_targets if t.vendor == "generic"] + + return candidate_targets + + def possible_dependencies( + self, + *specs: Union[spack.spec.Spec, str], + allowed_deps: dt.DepFlag, + transitive: bool = True, + strict_depflag: bool = False, + expand_virtuals: bool = True, + ) -> PossibleGraph: + stack = [x for x in self._package_list(specs)] + virtuals: Set[str] = set() + edges: Dict[str, Set[str]] = {} + + while stack: + pkg_name = stack.pop() + + if pkg_name in edges: + continue + + edges[pkg_name] = set() + + # Since libc is not buildable, there is no need to extend the + # search space with libc dependencies. + if pkg_name in self.libc_pkgs: + continue + + pkg_cls = self.repo.get_pkg_class(pkg_name=pkg_name) + for name, conditions in pkg_cls.dependencies_by_name(when=True).items(): + if all(self.unreachable(pkg_name=pkg_name, when_spec=x) for x in conditions): + tty.debug( + f"[{__name__}] Not adding {name} as a dep of {pkg_name}, because " + f"conditions cannot be met" + ) + continue + + if not self._has_deptypes( + conditions, allowed_deps=allowed_deps, strict=strict_depflag + ): + continue + + if name in virtuals: + continue + + dep_names = set() + if self.is_virtual(name): + virtuals.add(name) + if expand_virtuals: + providers = self.providers_for(name) + dep_names = {spec.name for spec in providers} + else: + dep_names = {name} + + edges[pkg_name].update(dep_names) + + if not transitive: + continue + + for dep_name in dep_names: + if dep_name in edges: + continue + + if not self._is_possible(pkg_name=dep_name): + continue + + stack.append(dep_name) + + real_packages = set(edges) + if not transitive: + # We exit early, so add children from the edges information + for root, children in edges.items(): + real_packages.update(x for x in children if self._is_possible(pkg_name=x)) + + virtuals.update(self.runtime_virtuals) + real_packages = real_packages | self.runtime_pkgs + return PossibleGraph(real_pkgs=real_packages, virtuals=virtuals, edges=edges) + + def _package_list(self, specs: Tuple[Union[spack.spec.Spec, str], ...]) -> List[str]: + stack = [] + for current_spec in specs: + if isinstance(current_spec, str): + current_spec = spack.spec.Spec(current_spec) + + if self.repo.is_virtual(current_spec.name): + stack.extend([p.name for p in self.providers_for(current_spec.name)]) + continue + + stack.append(current_spec.name) + return sorted(set(stack)) + + def _has_deptypes(self, dependencies, *, allowed_deps: dt.DepFlag, strict: bool) -> bool: + if strict is True: + return any( + dep.depflag == allowed_deps for deplist in dependencies.values() for dep in deplist + ) + return any( + dep.depflag & allowed_deps for deplist in dependencies.values() for dep in deplist + ) + + def _is_possible(self, *, pkg_name): + try: + return self.is_allowed_on_this_platform(pkg_name=pkg_name) and self.can_be_installed( + pkg_name=pkg_name + ) + except spack.repo.UnknownPackageError: + return False + + +class StaticAnalysis(NoStaticAnalysis): + """Performs some static analysis of the configuration, store, etc. to provide more precise + answers on whether some packages can be installed, or used as a provider. + + It increases the setup time, but might decrease the grounding and solve time considerably, + especially when requirements restrict the possible choices for providers. + """ + + def __init__( + self, + *, + configuration: spack.config.Configuration, + repo: spack.repo.RepoPath, + store: spack.store.Store, + binary_index: spack.binary_distribution.BinaryCacheIndex, + ): + super().__init__(configuration=configuration, repo=repo) + self.store = store + self.binary_index = binary_index + + @lang.memoized + def providers_for(self, virtual_str: str) -> List[spack.spec.Spec]: + candidates = super().providers_for(virtual_str) + result = [] + for spec in candidates: + if not self._is_provider_candidate(pkg_name=spec.name, virtual=virtual_str): + continue + result.append(spec) + return result + + @lang.memoized + def buildcache_specs(self) -> List[spack.spec.Spec]: + self.binary_index.update() + return self.binary_index.get_all_built_specs() + + @lang.memoized + def can_be_installed(self, *, pkg_name) -> bool: + if self.configuration.get(f"packages:{pkg_name}:buildable", True): + return True + + if self.configuration.get(f"packages:{pkg_name}:externals", []): + return True + + reuse = self.configuration.get("concretizer:reuse") + if reuse is not False and self.store.db.query(pkg_name): + return True + + if reuse is not False and any(x.name == pkg_name for x in self.buildcache_specs()): + return True + + tty.debug(f"[{__name__}] {pkg_name} cannot be installed") + return False + + @lang.memoized + def _is_provider_candidate(self, *, pkg_name: str, virtual: str) -> bool: + if not self.is_allowed_on_this_platform(pkg_name=pkg_name): + return False + + if not self.can_be_installed(pkg_name=pkg_name): + return False + + virtual_spec = spack.spec.Spec(virtual) + if self.unreachable(pkg_name=virtual_spec.name, when_spec=pkg_name): + tty.debug(f"[{__name__}] {pkg_name} cannot be a provider for {virtual}") + return False + + return True + + @lang.memoized + def unreachable(self, *, pkg_name: str, when_spec: spack.spec.Spec) -> bool: + """Returns true if the context can determine that the condition cannot ever + be met on pkg_name. + """ + candidates = self.configuration.get(f"packages:{pkg_name}:require", []) + if not candidates and pkg_name != "all": + return self.unreachable(pkg_name="all", when_spec=when_spec) + + if not candidates: + return False + + if isinstance(candidates, str): + candidates = [candidates] + + union_requirement = spack.spec.Spec() + for c in candidates: + if not isinstance(c, str): + continue + try: + union_requirement.constrain(c) + except SpackError: + # Less optimized, but shouldn't fail + pass + + if not union_requirement.intersects(when_spec): + return True + + return False + + +def create_graph_analyzer() -> PossibleDependencyGraph: + static_analysis = spack.config.CONFIG.get("concretizer:static_analysis", False) + if static_analysis: + return StaticAnalysis( + configuration=spack.config.CONFIG, + repo=spack.repo.PATH, + store=spack.store.STORE, + binary_index=spack.binary_distribution.BINARY_INDEX, + ) + return NoStaticAnalysis(configuration=spack.config.CONFIG, repo=spack.repo.PATH) + + +class Counter: + """Computes the possible packages and the maximum number of duplicates + allowed for each of them. + + Args: + specs: abstract specs to concretize + tests: if True, add test dependencies to the list of possible packages + """ + + def __init__( + self, specs: List["spack.spec.Spec"], tests: bool, possible_graph: PossibleDependencyGraph + ) -> None: + self.possible_graph = possible_graph + self.specs = specs + self.link_run_types: dt.DepFlag = dt.LINK | dt.RUN | dt.TEST + self.all_types: dt.DepFlag = dt.ALL + if not tests: + self.link_run_types = dt.LINK | dt.RUN + self.all_types = dt.LINK | dt.RUN | dt.BUILD + + self._possible_dependencies: Set[str] = set() + self._possible_virtuals: Set[str] = { + x.name for x in specs if spack.repo.PATH.is_virtual(x.name) + } + + def possible_dependencies(self) -> Set[str]: + """Returns the list of possible dependencies""" + self.ensure_cache_values() + return self._possible_dependencies + + def possible_virtuals(self) -> Set[str]: + """Returns the list of possible virtuals""" + self.ensure_cache_values() + return self._possible_virtuals + + def ensure_cache_values(self) -> None: + """Ensure the cache values have been computed""" + if self._possible_dependencies: + return + self._compute_cache_values() + + def possible_packages_facts(self, gen: "spack.solver.asp.ProblemInstanceBuilder", fn) -> None: + """Emit facts associated with the possible packages""" + raise NotImplementedError("must be implemented by derived classes") + + def _compute_cache_values(self) -> None: + raise NotImplementedError("must be implemented by derived classes") + + +class NoDuplicatesCounter(Counter): + def _compute_cache_values(self) -> None: + self._possible_dependencies, virtuals, _ = self.possible_graph.possible_dependencies( + *self.specs, allowed_deps=self.all_types + ) + self._possible_virtuals.update(virtuals) + + def possible_packages_facts(self, gen: "spack.solver.asp.ProblemInstanceBuilder", fn) -> None: + gen.h2("Maximum number of nodes (packages)") + for package_name in sorted(self.possible_dependencies()): + gen.fact(fn.max_dupes(package_name, 1)) + gen.newline() + gen.h2("Maximum number of nodes (virtual packages)") + for package_name in sorted(self.possible_virtuals()): + gen.fact(fn.max_dupes(package_name, 1)) + gen.newline() + gen.h2("Possible package in link-run subDAG") + for name in sorted(self.possible_dependencies()): + gen.fact(fn.possible_in_link_run(name)) + gen.newline() + + +class MinimalDuplicatesCounter(NoDuplicatesCounter): + def __init__( + self, specs: List["spack.spec.Spec"], tests: bool, possible_graph: PossibleDependencyGraph + ) -> None: + super().__init__(specs, tests, possible_graph) + self._link_run: Set[str] = set() + self._direct_build: Set[str] = set() + self._total_build: Set[str] = set() + self._link_run_virtuals: Set[str] = set() + + def _compute_cache_values(self) -> None: + self._link_run, virtuals, _ = self.possible_graph.possible_dependencies( + *self.specs, allowed_deps=self.link_run_types + ) + self._possible_virtuals.update(virtuals) + self._link_run_virtuals.update(virtuals) + for x in self._link_run: + reals, virtuals, _ = self.possible_graph.possible_dependencies( + x, allowed_deps=dt.BUILD, transitive=False, strict_depflag=True + ) + self._possible_virtuals.update(virtuals) + self._direct_build.update(reals) + + self._total_build, virtuals, _ = self.possible_graph.possible_dependencies( + *self._direct_build, allowed_deps=self.all_types + ) + self._possible_virtuals.update(virtuals) + self._possible_dependencies = set(self._link_run) | set(self._total_build) + + def possible_packages_facts(self, gen, fn): + build_tools = spack.repo.PATH.packages_with_tags("build-tools") + gen.h2("Packages with at most a single node") + for package_name in sorted(self.possible_dependencies() - build_tools): + gen.fact(fn.max_dupes(package_name, 1)) + gen.newline() + + gen.h2("Packages with at multiple possible nodes (build-tools)") + default = spack.config.CONFIG.get("concretizer:duplicates:max_dupes:default", 2) + for package_name in sorted(self.possible_dependencies() & build_tools): + max_dupes = spack.config.CONFIG.get( + f"concretizer:duplicates:max_dupes:{package_name}", default + ) + gen.fact(fn.max_dupes(package_name, max_dupes)) + if max_dupes > 1: + gen.fact(fn.multiple_unification_sets(package_name)) + gen.newline() + + gen.h2("Maximum number of nodes (link-run virtuals)") + for package_name in sorted(self._link_run_virtuals): + gen.fact(fn.max_dupes(package_name, 1)) + gen.newline() + + gen.h2("Maximum number of nodes (other virtuals)") + for package_name in sorted(self.possible_virtuals() - self._link_run_virtuals): + max_dupes = spack.config.CONFIG.get( + f"concretizer:duplicates:max_dupes:{package_name}", default + ) + gen.fact(fn.max_dupes(package_name, max_dupes)) + gen.newline() + + gen.h2("Possible package in link-run subDAG") + for name in sorted(self._link_run): + gen.fact(fn.possible_in_link_run(name)) + gen.newline() + + +class FullDuplicatesCounter(MinimalDuplicatesCounter): + def possible_packages_facts(self, gen, fn): + build_tools = spack.repo.PATH.packages_with_tags("build-tools") + counter = collections.Counter( + list(self._link_run) + list(self._total_build) + list(self._direct_build) + ) + gen.h2("Maximum number of nodes") + for pkg, count in sorted(counter.items(), key=lambda x: (x[1], x[0])): + count = min(count, 2) + gen.fact(fn.max_dupes(pkg, count)) + gen.newline() + + gen.h2("Build unification sets ") + for name in sorted(self.possible_dependencies() & build_tools): + gen.fact(fn.multiple_unification_sets(name)) + gen.newline() + + gen.h2("Possible package in link-run subDAG") + for name in sorted(self._link_run): + gen.fact(fn.possible_in_link_run(name)) + gen.newline() + + counter = collections.Counter( + list(self._link_run_virtuals) + list(self._possible_virtuals) + ) + gen.h2("Maximum number of virtual nodes") + for pkg, count in sorted(counter.items(), key=lambda x: (x[1], x[0])): + gen.fact(fn.max_dupes(pkg, count)) + gen.newline() + + +def create_counter( + specs: List[spack.spec.Spec], tests: bool, possible_graph: PossibleDependencyGraph +) -> Counter: + strategy = spack.config.CONFIG.get("concretizer:duplicates:strategy", "none") + if strategy == "full": + return FullDuplicatesCounter(specs, tests=tests, possible_graph=possible_graph) + if strategy == "minimal": + return MinimalDuplicatesCounter(specs, tests=tests, possible_graph=possible_graph) + return NoDuplicatesCounter(specs, tests=tests, possible_graph=possible_graph) diff --git a/lib/spack/spack/solver/splicing.py b/lib/spack/spack/solver/splicing.py new file mode 100644 index 00000000000000..b29bca1b6eca62 --- /dev/null +++ b/lib/spack/spack/solver/splicing.py @@ -0,0 +1,73 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +from functools import cmp_to_key +from typing import Dict, List, NamedTuple + +import spack.deptypes as dt +from spack.spec import Spec +from spack.traverse import by_dag_hash, traverse_nodes + + +class Splice(NamedTuple): + #: The spec being spliced into a parent + splice_spec: Spec + #: The name of the child that splice spec is replacing + child_name: str + #: The hash of the child that `splice_spec` is replacing + child_hash: str + + +def _resolve_collected_splices( + specs: List[Spec], splices: Dict[Spec, List[Splice]] +) -> Dict[Spec, Spec]: + """After all of the specs have been concretized, apply all immediate splices. + Returns a dict mapping original specs to their resolved counterparts + """ + + def splice_cmp(s1: Spec, s2: Spec): + """This function can be used to sort a list of specs such that that any + spec which will be spliced into a parent comes after the parent it will + be spliced into. This order ensures that transitive splices will be + executed in the correct order. + """ + + s1_splices = splices.get(s1, []) + s2_splices = splices.get(s2, []) + if any([s2.dag_hash() == splice.splice_spec.dag_hash() for splice in s1_splices]): + return -1 + elif any([s1.dag_hash() == splice.splice_spec.dag_hash() for splice in s2_splices]): + return 1 + else: + return 0 + + splice_order = sorted(specs, key=cmp_to_key(splice_cmp)) + reverse_topo_order = reversed( + [x for x in traverse_nodes(splice_order, order="topo", key=by_dag_hash) if x in specs] + ) + + already_resolved: Dict[Spec, Spec] = {} + for spec in reverse_topo_order: + immediate = splices.get(spec, []) + if not immediate and not any( + edge.spec in already_resolved for edge in spec.edges_to_dependencies() + ): + continue + new_spec = spec.copy(deps=False) + new_spec.clear_caches(ignore=("package_hash",)) + new_spec.build_spec = spec + for edge in spec.edges_to_dependencies(): + depflag = edge.depflag & ~dt.BUILD + if any(edge.spec.dag_hash() == splice.child_hash for splice in immediate): + splice = [s for s in immediate if s.child_hash == edge.spec.dag_hash()][0] + # If the spec being splice in is also spliced + splice_spec = already_resolved.get(splice.splice_spec, splice.splice_spec) + new_spec.add_dependency_edge(splice_spec, depflag=depflag, virtuals=edge.virtuals) + elif edge.spec in already_resolved: + new_spec.add_dependency_edge( + already_resolved[edge.spec], depflag=depflag, virtuals=edge.virtuals + ) + else: + new_spec.add_dependency_edge(edge.spec, depflag=depflag, virtuals=edge.virtuals) + already_resolved[spec] = new_spec + return already_resolved diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 731ed343441ea6..89a79070d39bf8 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -52,6 +52,7 @@ import enum import io import itertools +import json import os import pathlib import platform @@ -86,7 +87,6 @@ import spack import spack.compiler import spack.compilers -import spack.config import spack.deptypes as dt import spack.error import spack.hash_types as ht @@ -94,13 +94,11 @@ import spack.platforms import spack.provider_index import spack.repo -import spack.solver import spack.spec_parser import spack.store import spack.traverse import spack.util.executable import spack.util.hash -import spack.util.module_cmd as md import spack.util.prefix import spack.util.spack_json as sjson import spack.util.spack_yaml as syaml @@ -240,23 +238,14 @@ class ArchSpec: """Aggregate the target platform, the operating system and the target microarchitecture.""" @staticmethod - def _return_arch(os_tag, target_tag): + def default_arch(): + """Return the default architecture""" platform = spack.platforms.host() - default_os = platform.operating_system(os_tag) - default_target = platform.target(target_tag) + default_os = platform.default_operating_system() + default_target = platform.default_target() arch_tuple = str(platform), str(default_os), str(default_target) return ArchSpec(arch_tuple) - @staticmethod - def default_arch(): - """Return the default architecture""" - return ArchSpec._return_arch("default_os", "default_target") - - @staticmethod - def frontend_arch(): - """Return the frontend architecture""" - return ArchSpec._return_arch("frontend", "frontend") - __slots__ = "_platform", "_os", "_target" def __init__(self, spec_or_platform_tuple=(None, None, None)): @@ -463,6 +452,9 @@ def _target_satisfies(self, other: "ArchSpec", strict: bool) -> bool: return bool(self._target_intersection(other)) def _target_constrain(self, other: "ArchSpec") -> bool: + if self.target is None and other.target is None: + return False + if not other._target_satisfies(self, strict=False): raise UnsatisfiableArchitectureSpecError(self, other) @@ -511,21 +503,56 @@ def _target_intersection(self, other): if (not s_min or o_comp >= s_min) and (not s_max or o_comp <= s_max): results.append(o_min) else: - # Take intersection of two ranges - # Lots of comparisons needed - _s_min = _make_microarchitecture(s_min) - _s_max = _make_microarchitecture(s_max) - _o_min = _make_microarchitecture(o_min) - _o_max = _make_microarchitecture(o_max) - - n_min = s_min if _s_min >= _o_min else o_min - n_max = s_max if _s_max <= _o_max else o_max - _n_min = _make_microarchitecture(n_min) - _n_max = _make_microarchitecture(n_max) - if _n_min == _n_max: - results.append(n_min) - elif not n_min or not n_max or _n_min < _n_max: - results.append("%s:%s" % (n_min, n_max)) + # Take the "min" of the two max, if there is a partial ordering. + n_max = "" + if s_max and o_max: + _s_max = _make_microarchitecture(s_max) + _o_max = _make_microarchitecture(o_max) + if _s_max.family != _o_max.family: + continue + if _s_max <= _o_max: + n_max = s_max + elif _o_max < _s_max: + n_max = o_max + else: + continue + elif s_max: + n_max = s_max + elif o_max: + n_max = o_max + + # Take the "max" of the two min. + n_min = "" + if s_min and o_min: + _s_min = _make_microarchitecture(s_min) + _o_min = _make_microarchitecture(o_min) + if _s_min.family != _o_min.family: + continue + if _s_min >= _o_min: + n_min = s_min + elif _o_min > _s_min: + n_min = o_min + else: + continue + elif s_min: + n_min = s_min + elif o_min: + n_min = o_min + + if n_min and n_max: + _n_min = _make_microarchitecture(n_min) + _n_max = _make_microarchitecture(n_max) + if _n_min.family != _n_max.family or not _n_min <= _n_max: + continue + if n_min == n_max: + results.append(n_min) + else: + results.append(f"{n_min}:{n_max}") + elif n_min: + results.append(f"{n_min}:") + elif n_max: + results.append(f":{n_max}") + return results def constrain(self, other: "ArchSpec") -> bool: @@ -580,14 +607,9 @@ def to_dict(self): target_data = str(self.target) else: # Get rid of compiler flag information before turning the uarch into a dict - uarch_dict = self.target.to_dict() - uarch_dict.pop("compilers", None) - target_data = syaml.syaml_dict(uarch_dict.items()) - - d = syaml.syaml_dict( - [("platform", self.platform), ("platform_os", self.os), ("target", target_data)] - ) - return syaml.syaml_dict([("arch", d)]) + target_data = self.target.to_dict() + target_data.pop("compilers", None) + return {"arch": {"platform": self.platform, "platform_os": self.os, "target": target_data}} @staticmethod def from_dict(d): @@ -712,10 +734,7 @@ def _cmp_iter(self): yield self.versions def to_dict(self): - d = syaml.syaml_dict([("name", self.name)]) - d.update(self.versions.to_dict()) - - return syaml.syaml_dict([("compiler", d)]) + return {"compiler": {"name": self.name, **self.versions.to_dict()}} @staticmethod def from_dict(d): @@ -779,7 +798,7 @@ def update_deptypes(self, depflag: dt.DepFlag) -> bool: self.depflag = new return True - def update_virtuals(self, virtuals: Tuple[str, ...]) -> bool: + def update_virtuals(self, virtuals: Iterable[str]) -> bool: """Update the list of provided virtuals""" old = self.virtuals self.virtuals = tuple(sorted(set(virtuals).union(self.virtuals))) @@ -1318,14 +1337,20 @@ class SpecBuildInterface(lang.ObjectWrapper): "command", default_handler=_command_default_handler, _indirect=True ) - def __init__(self, spec: "Spec", name: str, query_parameters: List[str], _parent: "Spec"): + def __init__( + self, + spec: "Spec", + name: str, + query_parameters: List[str], + _parent: "Spec", + is_virtual: bool, + ): super().__init__(spec) # Adding new attributes goes after super() call since the ObjectWrapper # resets __dict__ to behave like the passed object original_spec = getattr(spec, "wrapped_obj", spec) self.wrapped_obj = original_spec - self.token = original_spec, name, query_parameters, _parent - is_virtual = spack.repo.PATH.is_virtual(name) + self.token = original_spec, name, query_parameters, _parent, is_virtual self.last_query = QueryState( name=name, extra_parameters=query_parameters, isvirtual=is_virtual ) @@ -1508,9 +1533,8 @@ def __init__(self, spec_like=None, *, external_path=None, external_modules=None) self._external_path = external_path self.external_modules = Spec._format_module_list(external_modules) - # This attribute is used to store custom information for - # external specs. None signal that it was not set yet. - self.extra_attributes = None + # This attribute is used to store custom information for external specs. + self.extra_attributes: dict = {} # This attribute holds the original build copy of the spec if it is # deployed differently than it was built. None signals that the spec @@ -1887,10 +1911,22 @@ def package_class(self): """Internal package call gets only the class object for a package. Use this to just get package metadata. """ + warnings.warn( + "`Spec.package_class` is deprecated and will be removed in version 1.0.0. Use " + "`spack.repo.PATH.get_pkg_class(spec.fullname) instead.", + category=spack.error.SpackAPIWarning, + stacklevel=2, + ) return spack.repo.PATH.get_pkg_class(self.fullname) @property def virtual(self): + warnings.warn( + "`Spec.virtual` is deprecated and will be removed in version 1.0.0. Use " + "`spack.repo.PATH.is_virtual(spec.name)` instead.", + category=spack.error.SpackAPIWarning, + stacklevel=2, + ) return spack.repo.PATH.is_virtual(self.name) @property @@ -2082,20 +2118,20 @@ def cshort_spec(self): return self.cformat(spec_format) @property - def prefix(self): + def prefix(self) -> spack.util.prefix.Prefix: if not self._concrete: - raise spack.error.SpecError("Spec is not concrete: " + str(self)) + raise spack.error.SpecError(f"Spec is not concrete: {self}") if self._prefix is None: - upstream, record = spack.store.STORE.db.query_by_spec_hash(self.dag_hash()) + _, record = spack.store.STORE.db.query_by_spec_hash(self.dag_hash()) if record and record.path: - self.prefix = record.path + self.set_prefix(record.path) else: - self.prefix = spack.store.STORE.layout.path_for_spec(self) + self.set_prefix(spack.store.STORE.layout.path_for_spec(self)) + assert self._prefix is not None return self._prefix - @prefix.setter - def prefix(self, value): + def set_prefix(self, value: str) -> None: self._prefix = spack.util.prefix.Prefix(llnl.path.convert_to_platform_path(value)) def spec_hash(self, hash): @@ -2109,7 +2145,9 @@ def spec_hash(self, hash): if hash.override is not None: return hash.override(self) node_dict = self.to_node_dict(hash=hash) - json_text = sjson.dump(node_dict) + json_text = json.dumps( + node_dict, ensure_ascii=True, indent=None, separators=(",", ":"), sort_keys=False + ) # This implements "frankenhashes", preserving the last 7 characters of the # original hash when splicing so that we can avoid relocation issues out = spack.util.hash.b32_hash(json_text) @@ -2292,9 +2330,7 @@ def to_node_dict(self, hash=ht.dag_hash): Arguments: hash (spack.hash_types.SpecHashDescriptor) type of hash to generate. """ - d = syaml.syaml_dict() - - d["name"] = self.name + d = {"name": self.name} if self.versions: d.update(self.versions.to_dict()) @@ -2308,7 +2344,7 @@ def to_node_dict(self, hash=ht.dag_hash): if self.namespace: d["namespace"] = self.namespace - params = syaml.syaml_dict(sorted(v.yaml_entry() for _, v in self.variants.items())) + params = dict(sorted(v.yaml_entry() for v in self.variants.values())) # Only need the string compiler flag for yaml file params.update( @@ -2334,13 +2370,11 @@ def to_node_dict(self, hash=ht.dag_hash): ) if self.external: - d["external"] = syaml.syaml_dict( - [ - ("path", self.external_path), - ("module", self.external_modules), - ("extra_attributes", self.extra_attributes), - ] - ) + d["external"] = { + "path": self.external_path, + "module": self.external_modules or None, + "extra_attributes": syaml.sorted_dict(self.extra_attributes), + } if not self._concrete: d["concrete"] = False @@ -2371,29 +2405,25 @@ def to_node_dict(self, hash=ht.dag_hash): # Note: Relies on sorting dict by keys later in algorithm. deps = self._dependencies_dict(depflag=hash.depflag) if deps: - deps_list = [] - for name, edges_for_name in sorted(deps.items()): - name_tuple = ("name", name) - for dspec in edges_for_name: - hash_tuple = (hash.name, dspec.spec._cached_hash(hash)) - parameters_tuple = ( - "parameters", - syaml.syaml_dict( - ( - ("deptypes", dt.flag_to_tuple(dspec.depflag)), - ("virtuals", dspec.virtuals), - ) - ), - ) - ordered_entries = [name_tuple, hash_tuple, parameters_tuple] - deps_list.append(syaml.syaml_dict(ordered_entries)) - d["dependencies"] = deps_list + d["dependencies"] = [ + { + "name": name, + hash.name: dspec.spec._cached_hash(hash), + "parameters": { + "deptypes": dt.flag_to_tuple(dspec.depflag), + "virtuals": dspec.virtuals, + }, + } + for name, edges_for_name in sorted(deps.items()) + for dspec in edges_for_name + ] # Name is included in case this is replacing a virtual. if self._build_spec: - d["build_spec"] = syaml.syaml_dict( - [("name", self.build_spec.name), (hash.name, self.build_spec._cached_hash(hash))] - ) + d["build_spec"] = { + "name": self.build_spec.name, + hash.name: self.build_spec._cached_hash(hash), + } return d def to_dict(self, hash=ht.dag_hash): @@ -2495,10 +2525,7 @@ def to_dict(self, hash=ht.dag_hash): node_list.append(node) hash_set.add(node_hash) - meta_dict = syaml.syaml_dict([("version", SPECFILE_FORMAT_VERSION)]) - inner_dict = syaml.syaml_dict([("_meta", meta_dict), ("nodes", node_list)]) - spec_dict = syaml.syaml_dict([("spec", inner_dict)]) - return spec_dict + return {"spec": {"_meta": {"version": SPECFILE_FORMAT_VERSION}, "nodes": node_list}} def node_dict_with_hashes(self, hash=ht.dag_hash): """Returns a node_dict of this spec with the dag hash added. If this @@ -2681,7 +2708,7 @@ def name_and_dependency_types(s: str) -> Tuple[str, dt.DepFlag]: return name, depflag def spec_and_dependency_types( - s: Union[Spec, Tuple[Spec, str]] + s: Union[Spec, Tuple[Spec, str]], ) -> Tuple[Spec, dt.DepFlag]: """Given a non-string key in the literal, extracts the spec and its dependency types. @@ -2710,7 +2737,7 @@ def spec_and_dependency_types( return spec_builder(spec_dict) @staticmethod - def from_dict(data): + def from_dict(data) -> "Spec": """Construct a spec from JSON/YAML. Args: @@ -2733,7 +2760,7 @@ def from_dict(data): return spec @staticmethod - def from_yaml(stream): + def from_yaml(stream) -> "Spec": """Construct a spec from YAML. Args: @@ -2743,7 +2770,7 @@ def from_yaml(stream): return Spec.from_dict(data) @staticmethod - def from_json(stream): + def from_json(stream) -> "Spec": """Construct a spec from JSON. Args: @@ -2753,7 +2780,7 @@ def from_json(stream): data = sjson.load(stream) return Spec.from_dict(data) except Exception as e: - raise sjson.SpackJSONError("error parsing JSON spec:", str(e)) from e + raise sjson.SpackJSONError("error parsing JSON spec:", e) from e @staticmethod def extract_json_from_clearsig(data): @@ -2801,24 +2828,6 @@ def from_detection( s.extra_attributes = extra_attributes return s - def validate_detection(self): - """Validate the detection of an external spec. - - This method is used as part of Spack's detection protocol, and is - not meant for client code use. - """ - # Assert that _extra_attributes is a Mapping and not None, - # which likely means the spec was created with Spec.from_detection - msg = 'cannot validate "{0}" since it was not created ' "using Spec.from_detection".format( - self - ) - assert isinstance(self.extra_attributes, collections.abc.Mapping), msg - - # Validate the spec calling a package specific method - pkg_cls = spack.repo.PATH.get_pkg_class(self.name) - validate_fn = getattr(pkg_cls, "validate_detected_spec", lambda x, y: None) - validate_fn(self, self.extra_attributes) - def _patches_assigned(self): """Whether patches have been assigned to this spec by the concretizer.""" # FIXME: _patches_in_order_of_appearance is attached after concretization @@ -2835,94 +2844,6 @@ def _patches_assigned(self): return True - @staticmethod - def inject_patches_variant(root): - # This dictionary will store object IDs rather than Specs as keys - # since the Spec __hash__ will change as patches are added to them - spec_to_patches = {} - for s in root.traverse(): - # After concretizing, assign namespaces to anything left. - # Note that this doesn't count as a "change". The repository - # configuration is constant throughout a spack run, and - # normalize and concretize evaluate Packages using Repo.get(), - # which respects precedence. So, a namespace assignment isn't - # changing how a package name would have been interpreted and - # we can do it as late as possible to allow as much - # compatibility across repositories as possible. - if s.namespace is None: - s.namespace = spack.repo.PATH.repo_for_pkg(s.name).namespace - - if s.concrete: - continue - - # Add any patches from the package to the spec. - patches = set() - for cond, patch_list in s.package_class.patches.items(): - if s.satisfies(cond): - for patch in patch_list: - patches.add(patch) - if patches: - spec_to_patches[id(s)] = patches - - # Also record all patches required on dependencies by - # depends_on(..., patch=...) - for dspec in root.traverse_edges(deptype=all, cover="edges", root=False): - if dspec.spec.concrete: - continue - - pkg_deps = dspec.parent.package_class.dependencies - - patches = [] - for cond, deps_by_name in pkg_deps.items(): - if not dspec.parent.satisfies(cond): - continue - - dependency = deps_by_name.get(dspec.spec.name) - if not dependency: - continue - - for pcond, patch_list in dependency.patches.items(): - if dspec.spec.satisfies(pcond): - patches.extend(patch_list) - - if patches: - all_patches = spec_to_patches.setdefault(id(dspec.spec), set()) - for patch in patches: - all_patches.add(patch) - - for spec in root.traverse(): - if id(spec) not in spec_to_patches: - continue - - patches = list(lang.dedupe(spec_to_patches[id(spec)])) - mvar = spec.variants.setdefault("patches", vt.MultiValuedVariant("patches", ())) - mvar.value = tuple(p.sha256 for p in patches) - # FIXME: Monkey patches mvar to store patches order - full_order_keys = list(tuple(p.ordering_key) + (p.sha256,) for p in patches) - ordered_hashes = sorted(full_order_keys) - tty.debug( - "Ordered hashes [{0}]: ".format(spec.name) - + ", ".join("/".join(str(e) for e in t) for t in ordered_hashes) - ) - mvar._patches_in_order_of_appearance = list(t[-1] for t in ordered_hashes) - - @staticmethod - def ensure_external_path_if_external(external_spec): - if external_spec.external_modules and not external_spec.external_path: - compiler = spack.compilers.compiler_for_spec( - external_spec.compiler, external_spec.architecture - ) - for mod in compiler.modules: - md.load_module(mod) - - # Get the path from the module the package can override the default - # (this is mostly needed for Cray) - pkg_cls = spack.repo.PATH.get_pkg_class(external_spec.name) - package = pkg_cls(external_spec) - external_spec.external_path = getattr( - package, "external_prefix", md.path_from_modules(external_spec.external_modules) - ) - @staticmethod def ensure_no_deprecated(root): """Raise if a deprecated spec is in the dag. @@ -2949,44 +2870,16 @@ def ensure_no_deprecated(root): raise SpecDeprecatedError(msg) def concretize(self, tests: Union[bool, Iterable[str]] = False) -> None: - """Concretize the current spec. - - Args: - tests: if False disregard 'test' dependencies, if a list of names activate them for - the packages in the list, if True activate 'test' dependencies for all packages. - """ - import spack.solver.asp + from spack.concretize import concretize_one - self.replace_hash() - - for node in self.traverse(): - if not node.name: - raise spack.error.SpecError( - f"Spec {node} has no name; cannot concretize an anonymous spec" - ) - - if self._concrete: - return - - allow_deprecated = spack.config.get("config:deprecated", False) - solver = spack.solver.asp.Solver() - result = solver.solve([self], tests=tests, allow_deprecated=allow_deprecated) - - # take the best answer - opt, i, answer = min(result.answers) - name = self.name - # TODO: Consolidate this code with similar code in solve.py - if self.virtual: - providers = [spec.name for spec in answer.values() if spec.package.provides(name)] - name = providers[0] - - node = spack.solver.asp.SpecBuilder.make_node(pkg=name) - assert ( - node in answer - ), f"cannot find {name} in the list of specs {','.join([n.pkg for n in answer.keys()])}" + warnings.warn( + "`Spec.concretize` is deprecated and will be removed in version 1.0.0. Use " + "`spack.concretize.concretize_one` instead.", + category=spack.error.SpackAPIWarning, + stacklevel=2, + ) - concretized = answer[node] - self._dup(concretized) + self._dup(concretize_one(self, tests)) def _mark_root_concrete(self, value=True): """Mark just this spec (not dependencies) concrete.""" @@ -3076,19 +2969,16 @@ def _finalize_concretization(self): spec._cached_hash(ht.dag_hash) def concretized(self, tests: Union[bool, Iterable[str]] = False) -> "Spec": - """This is a non-destructive version of concretize(). + from spack.concretize import concretize_one - First clones, then returns a concrete version of this package - without modifying this package. + warnings.warn( + "`Spec.concretized` is deprecated and will be removed in version 1.0.0. Use " + "`spack.concretize.concretize_one` instead.", + category=spack.error.SpackAPIWarning, + stacklevel=2, + ) - Args: - tests (bool or list): if False disregard 'test' dependencies, - if a list of names activate them for the packages in the list, - if True activate 'test' dependencies for all packages. - """ - clone = self.copy() - clone.concretize(tests=tests) - return clone + return concretize_one(self, tests) def index(self, deptype="all"): """Return a dictionary that points to all the dependencies in this @@ -3108,7 +2998,7 @@ def validate_or_raise(self): # FIXME: raise just the first one encountered for spec in self.traverse(): # raise an UnknownPackageError if the spec's package isn't real. - if (not spec.virtual) and spec.name: + if spec.name and not spack.repo.PATH.is_virtual(spec.name): spack.repo.PATH.get_pkg_class(spec.fullname) # validate compiler in addition to the package name. @@ -3117,7 +3007,7 @@ def validate_or_raise(self): raise UnsupportedCompilerError(spec.compiler.name) # Ensure correctness of variants (if the spec is not virtual) - if not spec.virtual: + if not spack.repo.PATH.is_virtual(spec.name): Spec.ensure_valid_variants(spec) substitute_abstract_variants(spec) @@ -3135,7 +3025,7 @@ def ensure_valid_variants(spec): if spec.concrete: return - pkg_cls = spec.package_class + pkg_cls = spack.repo.PATH.get_pkg_class(spec.fullname) pkg_variants = pkg_cls.variant_names() # reserved names are variants that may be set on any package # but are not necessarily recorded by the package's class @@ -3198,18 +3088,13 @@ def constrain(self, other, deps=True): if not self.variants[v].compatible(other.variants[v]): raise vt.UnsatisfiableVariantSpecError(self.variants[v], other.variants[v]) - # TODO: Check out the logic here sarch, oarch = self.architecture, other.architecture - if sarch is not None and oarch is not None: - if sarch.platform is not None and oarch.platform is not None: - if sarch.platform != oarch.platform: - raise UnsatisfiableArchitectureSpecError(sarch, oarch) - if sarch.os is not None and oarch.os is not None: - if sarch.os != oarch.os: - raise UnsatisfiableArchitectureSpecError(sarch, oarch) - if sarch.target is not None and oarch.target is not None: - if sarch.target != oarch.target: - raise UnsatisfiableArchitectureSpecError(sarch, oarch) + if ( + sarch is not None + and oarch is not None + and not self.architecture.intersects(other.architecture) + ): + raise UnsatisfiableArchitectureSpecError(sarch, oarch) changed = False @@ -3232,18 +3117,12 @@ def constrain(self, other, deps=True): changed |= self.compiler_flags.constrain(other.compiler_flags) - old = str(self.architecture) sarch, oarch = self.architecture, other.architecture - if sarch is None or other.architecture is None: - self.architecture = sarch or oarch - else: - if sarch.platform is None or oarch.platform is None: - self.architecture.platform = sarch.platform or oarch.platform - if sarch.os is None or oarch.os is None: - sarch.os = sarch.os or oarch.os - if sarch.target is None or oarch.target is None: - sarch.target = sarch.target or oarch.target - changed |= str(self.architecture) != old + if sarch is not None and oarch is not None: + changed |= self.architecture.constrain(other.architecture) + elif oarch is not None: + self.architecture = oarch + changed = True if deps: changed |= self._constrain_dependencies(other) @@ -3363,7 +3242,9 @@ def intersects(self, other: Union[str, "Spec"], deps: bool = True) -> bool: # If the names are different, we need to consider virtuals if self.name != other.name and self.name and other.name: - if self.virtual and other.virtual: + self_virtual = spack.repo.PATH.is_virtual(self.name) + other_virtual = spack.repo.PATH.is_virtual(other.name) + if self_virtual and other_virtual: # Two virtual specs intersect only if there are providers for both lhs = spack.repo.PATH.providers_for(str(self)) rhs = spack.repo.PATH.providers_for(str(other)) @@ -3371,8 +3252,8 @@ def intersects(self, other: Union[str, "Spec"], deps: bool = True) -> bool: return bool(intersection) # A provider can satisfy a virtual dependency. - elif self.virtual or other.virtual: - virtual_spec, non_virtual_spec = (self, other) if self.virtual else (other, self) + elif self_virtual or other_virtual: + virtual_spec, non_virtual_spec = (self, other) if self_virtual else (other, self) try: # Here we might get an abstract spec pkg_cls = spack.repo.PATH.get_pkg_class(non_virtual_spec.fullname) @@ -3442,12 +3323,20 @@ def _intersects_dependencies(self, other): # These two loops handle cases where there is an overly restrictive # vpkg in one spec for a provider in the other (e.g., mpi@3: is not # compatible with mpich2) - for spec in self.virtual_dependencies(): - if spec.name in other_index and not other_index.providers_for(spec): + for spec in self.traverse(): + if ( + spack.repo.PATH.is_virtual(spec.name) + and spec.name in other_index + and not other_index.providers_for(spec) + ): return False - for spec in other.virtual_dependencies(): - if spec.name in self_index and not self_index.providers_for(spec): + for spec in other.traverse(): + if ( + spack.repo.PATH.is_virtual(spec.name) + and spec.name in self_index + and not self_index.providers_for(spec) + ): return False return True @@ -3477,7 +3366,9 @@ def satisfies(self, other: Union[str, "Spec"], deps: bool = True) -> bool: # If the names are different, we need to consider virtuals if self.name != other.name and self.name and other.name: # A concrete provider can satisfy a virtual dependency. - if not self.virtual and other.virtual: + if not spack.repo.PATH.is_virtual(self.name) and spack.repo.PATH.is_virtual( + other.name + ): try: # Here we might get an abstract spec pkg_cls = spack.repo.PATH.get_pkg_class(self.fullname) @@ -3545,7 +3436,7 @@ def satisfies(self, other: Union[str, "Spec"], deps: bool = True) -> bool: lhs_edges: Dict[str, Set[DependencySpec]] = collections.defaultdict(set) for rhs_edge in other.traverse_edges(root=False, cover="edges"): # If we are checking for ^mpi we need to verify if there is any edge - if rhs_edge.spec.virtual: + if spack.repo.PATH.is_virtual(rhs_edge.spec.name): rhs_edge.update_virtuals(virtuals=(rhs_edge.spec.name,)) if not rhs_edge.virtuals: @@ -3589,10 +3480,6 @@ def satisfies(self, other: Union[str, "Spec"], deps: bool = True) -> bool: for rhs in other.traverse(root=False) ) - def virtual_dependencies(self): - """Return list of any virtual deps in this spec.""" - return [spec for spec in self.traverse() if spec.virtual] - @property # type: ignore[misc] # decorated prop not supported in mypy def patches(self): """Return patch objects for any patch sha256 sums on this Spec. @@ -3624,25 +3511,16 @@ def patches(self): return self._patches - def _dup(self, other, deps: Union[bool, dt.DepTypes, dt.DepFlag] = True, cleardeps=True): - """Copy the spec other into self. This is an overwriting - copy. It does not copy any dependents (parents), but by default - copies dependencies. - - To duplicate an entire DAG, call _dup() on the root of the DAG. + def _dup(self, other: "Spec", deps: Union[bool, dt.DepTypes, dt.DepFlag] = True) -> bool: + """Copies "other" into self, by overwriting all attributes. Args: - other (Spec): spec to be copied onto ``self`` - deps: if True copies all the dependencies. If - False copies None. If deptype/depflag, copy matching types. - cleardeps (bool): if True clears the dependencies of ``self``, - before possibly copying the dependencies of ``other`` onto - ``self`` + other: spec to be copied onto ``self`` + deps: if True copies all the dependencies. If False copies None. + If deptype, or depflag, copy matching types. Returns: - True if ``self`` changed because of the copy operation, - False otherwise. - + True if ``self`` changed because of the copy operation, False otherwise. """ # We don't count dependencies as changes here changed = True @@ -3667,14 +3545,15 @@ def _dup(self, other, deps: Union[bool, dt.DepTypes, dt.DepFlag] = True, clearde self.versions = other.versions.copy() self.architecture = other.architecture.copy() if other.architecture else None self.compiler = other.compiler.copy() if other.compiler else None - if cleardeps: - self._dependents = _EdgeMap(store_by_child=False) - self._dependencies = _EdgeMap(store_by_child=True) self.compiler_flags = other.compiler_flags.copy() self.compiler_flags.spec = self self.variants = other.variants.copy() self._build_spec = other._build_spec + # Clear dependencies + self._dependents = _EdgeMap(store_by_child=False) + self._dependencies = _EdgeMap(store_by_child=True) + # FIXME: we manage _patches_in_order_of_appearance specially here # to keep it from leaking out of spec.py, but we should figure # out how to handle it more elegantly in the Variant classes. @@ -3790,30 +3669,23 @@ def __getitem__(self, name: str): csv = query_parameters.pop().strip() query_parameters = re.split(r"\s*,\s*", csv) - order = lambda: itertools.chain( - self.traverse_edges(deptype=dt.LINK, order="breadth", cover="edges"), - self.edges_to_dependencies(depflag=dt.BUILD | dt.RUN | dt.TEST), - self.traverse_edges(deptype=dt.ALL, order="breadth", cover="edges"), + # Consider all direct dependencies and transitive runtime dependencies + order = itertools.chain( + self.edges_to_dependencies(depflag=dt.ALL), + self.traverse_edges(deptype=dt.LINK | dt.RUN, order="breadth", cover="edges"), ) - # Consider runtime dependencies and direct build/test deps before transitive dependencies, - # and prefer matches closest to the root. try: - child: Spec = next( - e.spec - for e in itertools.chain( - (e for e in order() if e.spec.name == name or name in e.virtuals), - # for historical reasons - (e for e in order() if e.spec.concrete and e.spec.package.provides(name)), - ) - ) - except StopIteration: - raise KeyError(f"No spec with name {name} in {self}") + edge = next((e for e in order if e.spec.name == name or name in e.virtuals)) + except StopIteration as e: + raise KeyError(f"No spec with name {name} in {self}") from e if self._concrete: - return SpecBuildInterface(child, name, query_parameters, _parent=self) + return SpecBuildInterface( + edge.spec, name, query_parameters, _parent=self, is_virtual=name in edge.virtuals + ) - return child + return edge.spec def __contains__(self, spec): """True if this spec or some dependency satisfies the spec. @@ -3829,8 +3701,11 @@ def __contains__(self, spec): # if anonymous or same name, we only have to look at the root if not spec.name or spec.name == self.name: return self.satisfies(spec) - else: - return any(s.satisfies(spec) for s in self.traverse(root=False)) + try: + dep = self[spec.name] + except KeyError: + return False + return dep.satisfies(spec) def eq_dag(self, other, deptypes=True, vs=None, vo=None): """True if the full dependency DAGs of specs are equal.""" @@ -3898,6 +3773,13 @@ def _cmp_iter(self): for item in self._cmp_node(): yield item + # If there is ever a breaking change to hash computation, whether accidental or purposeful, + # two specs can be identical modulo DAG hash, depending on what time they were concretized + # From the perspective of many operation in Spack (database, build cache, etc) a different + # DAG hash means a different spec. Here we ensure that two otherwise identical specs, one + # serialized before the hash change and one after, are considered different. + yield self.dag_hash() if self.concrete else None + # This needs to be in _cmp_iter so that no specs with different process hashes # are considered the same by `__hash__` or `__eq__`. # @@ -4557,7 +4439,7 @@ def mask_build_deps(in_spec): return spec - def clear_caches(self, ignore=()): + def clear_caches(self, ignore: Tuple[str, ...] = ()) -> None: """ Clears all cached hashes in a Spec, while preserving other properties. """ @@ -4733,17 +4615,6 @@ def constrain(self, other: "VariantMap") -> bool: return changed - @property - def concrete(self): - """Returns True if the spec is concrete in terms of variants. - - Returns: - bool: True or False - """ - return self.spec._concrete or all( - v in self for v in self.spec.package_class.variant_names() - ) - def copy(self) -> "VariantMap": clone = VariantMap(self.spec) for name, variant in self.items(): @@ -4763,7 +4634,10 @@ def __str__(self): bool_keys = [] kv_keys = [] for key in sorted_keys: - bool_keys.append(key) if isinstance(self[key].value, bool) else kv_keys.append(key) + if isinstance(self[key].value, bool): + bool_keys.append(key) + else: + kv_keys.append(key) # add spaces before and after key/value variants. string = io.StringIO() @@ -4798,14 +4672,14 @@ def substitute_abstract_variants(spec: Spec): elif name in vt.reserved_names: continue - variant_defs = spec.package_class.variant_definitions(name) + variant_defs = spack.repo.PATH.get_pkg_class(spec.fullname).variant_definitions(name) valid_defs = [] for when, vdef in variant_defs: if when.intersects(spec): valid_defs.append(vdef) if not valid_defs: - if name not in spec.package_class.variant_names(): + if name not in spack.repo.PATH.get_pkg_class(spec.fullname).variant_names(): unknown.append(name) else: whens = [str(when) for when, _ in variant_defs] @@ -4867,31 +4741,51 @@ def merge_abstract_anonymous_specs(*abstract_specs: Spec): return merged_spec -def reconstruct_virtuals_on_edges(spec): - """Reconstruct virtuals on edges. Used to read from old DB and reindex. +def reconstruct_virtuals_on_edges(spec: Spec) -> None: + """Reconstruct virtuals on edges. Used to read from old DB and reindex.""" + virtuals_needed: Dict[str, Set[str]] = {} + virtuals_provided: Dict[str, Set[str]] = {} + for edge in spec.traverse_edges(cover="edges", root=False): + parent_key = edge.parent.dag_hash() + if parent_key not in virtuals_needed: + # Construct which virtuals are needed by parent + virtuals_needed[parent_key] = set() + try: + parent_pkg = edge.parent.package + except Exception as e: + warnings.warn( + f"cannot reconstruct virtual dependencies on {edge.parent.name}: {e}" + ) + continue + + virtuals_needed[parent_key].update( + name + for name, when_deps in parent_pkg.dependencies_by_name(when=True).items() + if spack.repo.PATH.is_virtual(name) + and any(edge.parent.satisfies(x) for x in when_deps) + ) - Args: - spec: spec on which we want to reconstruct virtuals - """ - # Collect all possible virtuals - possible_virtuals = set() - for node in spec.traverse(): - try: - possible_virtuals.update({x for x in node.package.dependencies if Spec(x).virtual}) - except Exception as e: - warnings.warn(f"cannot reconstruct virtual dependencies on package {node.name}: {e}") + if not virtuals_needed[parent_key]: continue - # Assume all incoming edges to provider are marked with virtuals= - for vspec in possible_virtuals: - try: - provider = spec[vspec] - except KeyError: - # Virtual not in the DAG + child_key = edge.spec.dag_hash() + if child_key not in virtuals_provided: + virtuals_provided[child_key] = set() + try: + child_pkg = edge.spec.package + except Exception as e: + warnings.warn( + f"cannot reconstruct virtual dependencies on {edge.parent.name}: {e}" + ) + continue + virtuals_provided[child_key].update(x.name for x in child_pkg.virtuals_provided) + + if not virtuals_provided[child_key]: continue - for edge in provider.edges_from_dependents(): - edge.update_virtuals([vspec]) + virtuals_to_add = virtuals_needed[parent_key] & virtuals_provided[child_key] + if virtuals_to_add: + edge.update_virtuals(virtuals_to_add) class SpecfileReaderBase: @@ -4942,9 +4836,7 @@ def from_node_dict(cls, node): spec.external_modules = node["external"]["module"] if spec.external_modules is False: spec.external_modules = None - spec.extra_attributes = node["external"].get( - "extra_attributes", syaml.syaml_dict() - ) + spec.extra_attributes = node["external"].get("extra_attributes") or {} # specs read in are concrete unless marked abstract if node.get("concrete", True): @@ -5221,12 +5113,10 @@ def get_host_environment_metadata() -> Dict[str, str]: def get_host_environment() -> Dict[str, Any]: - """Return a dictionary (lookup) with host information (not including the - os.environ). - """ + """Returns a dictionary with host information (not including the os.environ).""" host_platform = spack.platforms.host() - host_target = host_platform.target("default_target") - host_os = host_platform.operating_system("default_os") + host_target = host_platform.default_target() + host_os = host_platform.default_operating_system() arch_fmt = "platform={0} os={1} target={2}" arch_spec = Spec(arch_fmt.format(host_platform, host_os, host_target)) return { diff --git a/lib/spack/spack/test/abi_splicing.py b/lib/spack/spack/test/abi_splicing.py index c9bf198f6fb767..4c0ca7f0d1b3f4 100644 --- a/lib/spack/spack/test/abi_splicing.py +++ b/lib/spack/spack/test/abi_splicing.py @@ -1,41 +1,20 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -""" Test ABI-based splicing of dependencies """ +"""Test ABI-based splicing of dependencies""" from typing import List import pytest +import spack.concretize import spack.config import spack.deptypes as dt -import spack.solver.asp from spack.installer import PackageInstaller +from spack.solver.asp import SolverError from spack.spec import Spec -class CacheManager: - def __init__(self, specs: List[str]) -> None: - self.req_specs = specs - self.concr_specs: List[Spec] - self.concr_specs = [] - - def __enter__(self): - self.concr_specs = [Spec(s).concretized() for s in self.req_specs] - for s in self.concr_specs: - PackageInstaller([s.package], fake=True, explicit=True).install() - - def __exit__(self, exc_type, exc_val, exc_tb): - for s in self.concr_specs: - s.package.do_uninstall() - - -# MacOS and Windows only work if you pass this function pointer rather than a -# closure -def _mock_has_runtime_dependencies(_x): - return True - - def _make_specs_non_buildable(specs: List[str]): output_config = {} for spec in specs: @@ -44,203 +23,262 @@ def _make_specs_non_buildable(specs: List[str]): @pytest.fixture -def splicing_setup(mutable_database, mock_packages, monkeypatch): - spack.config.set("concretizer:reuse", True) - monkeypatch.setattr( - spack.solver.asp, "_has_runtime_dependencies", _mock_has_runtime_dependencies - ) +def install_specs( + mutable_database, + mock_packages, + mutable_config, + do_not_check_runtimes_on_reuse, + install_mockery, +): + """Returns a function that concretizes and installs a list of abstract specs""" + mutable_config.set("concretizer:reuse", True) + + def _impl(*specs_str): + concrete_specs = [Spec(s).concretized() for s in specs_str] + PackageInstaller([s.package for s in concrete_specs], fake=True, explicit=True).install() + return concrete_specs + + return _impl def _enable_splicing(): spack.config.set("concretizer:splice", {"automatic": True}) -def _has_build_dependency(spec: Spec, name: str): - return any(s.name == name for s in spec.dependencies(None, dt.BUILD)) +@pytest.mark.parametrize("spec_str", ["splice-z", "splice-h@1"]) +def test_spec_reuse(spec_str, install_specs, mutable_config): + """Tests reuse of splice-z, without splicing, as a root and as a dependency of splice-h""" + splice_z = install_specs("splice-z@1.0.0+compat")[0] + mutable_config.set("packages", _make_specs_non_buildable(["splice-z"])) + concrete = spack.concretize.concretize_one(spec_str) + assert concrete["splice-z"].satisfies(splice_z) -def test_simple_reuse(splicing_setup): - with CacheManager(["splice-z@1.0.0+compat"]): - spack.config.set("packages", _make_specs_non_buildable(["splice-z"])) - assert Spec("splice-z").concretized().satisfies(Spec("splice-z")) +@pytest.mark.regression("48578") +def test_splice_installed_hash(install_specs, mutable_config): + """Tests splicing the dependency of an installed spec, for another installed spec""" + splice_t, splice_h = install_specs( + "splice-t@1 ^splice-h@1.0.0+compat ^splice-z@1.0.0", + "splice-h@1.0.2+compat ^splice-z@1.0.0", + ) + packages_config = _make_specs_non_buildable(["splice-t", "splice-h"]) + mutable_config.set("packages", packages_config) + goal_spec = "splice-t@1 ^splice-h@1.0.2+compat ^splice-z@1.0.0" + with pytest.raises(SolverError): + spack.concretize.concretize_one(goal_spec) + _enable_splicing() + concrete = spack.concretize.concretize_one(goal_spec) -def test_simple_dep_reuse(splicing_setup): - with CacheManager(["splice-z@1.0.0+compat"]): - spack.config.set("packages", _make_specs_non_buildable(["splice-z"])) - assert Spec("splice-h@1").concretized().satisfies(Spec("splice-h@1")) + # splice-t has a dependency that is changing, thus its hash should be different + assert concrete.dag_hash() != splice_t.dag_hash() + assert concrete.build_spec.satisfies(splice_t) + assert not concrete.satisfies(splice_t) + # splice-h is reused, so the hash should stay the same + assert concrete["splice-h"].satisfies(splice_h) + assert concrete["splice-h"].build_spec.satisfies(splice_h) + assert concrete["splice-h"].dag_hash() == splice_h.dag_hash() -def test_splice_installed_hash(splicing_setup): - cache = [ - "splice-t@1 ^splice-h@1.0.0+compat ^splice-z@1.0.0", - "splice-h@1.0.2+compat ^splice-z@1.0.0", - ] - with CacheManager(cache): - packages_config = _make_specs_non_buildable(["splice-t", "splice-h"]) - spack.config.set("packages", packages_config) - goal_spec = Spec("splice-t@1 ^splice-h@1.0.2+compat ^splice-z@1.0.0") - with pytest.raises(Exception): - goal_spec.concretized() - _enable_splicing() - assert goal_spec.concretized().satisfies(goal_spec) - - -def test_splice_build_splice_node(splicing_setup): - with CacheManager(["splice-t@1 ^splice-h@1.0.0+compat ^splice-z@1.0.0+compat"]): - spack.config.set("packages", _make_specs_non_buildable(["splice-t"])) - goal_spec = Spec("splice-t@1 ^splice-h@1.0.2+compat ^splice-z@1.0.0+compat") - with pytest.raises(Exception): - goal_spec.concretized() - _enable_splicing() - assert goal_spec.concretized().satisfies(goal_spec) - - -def test_double_splice(splicing_setup): - cache = [ + +def test_splice_build_splice_node(install_specs, mutable_config): + """Tests splicing the dependency of an installed spec, for a spec that is yet to be built""" + splice_t = install_specs("splice-t@1 ^splice-h@1.0.0+compat ^splice-z@1.0.0+compat")[0] + mutable_config.set("packages", _make_specs_non_buildable(["splice-t"])) + + goal_spec = "splice-t@1 ^splice-h@1.0.2+compat ^splice-z@1.0.0+compat" + with pytest.raises(SolverError): + spack.concretize.concretize_one(goal_spec) + + _enable_splicing() + concrete = spack.concretize.concretize_one(goal_spec) + + # splice-t has a dependency that is changing, thus its hash should be different + assert concrete.dag_hash() != splice_t.dag_hash() + assert concrete.build_spec.satisfies(splice_t) + assert not concrete.satisfies(splice_t) + + # splice-h should be different + assert concrete["splice-h"].dag_hash() != splice_t["splice-h"].dag_hash() + assert concrete["splice-h"].build_spec.dag_hash() == concrete["splice-h"].dag_hash() + + +def test_double_splice(install_specs, mutable_config): + """Tests splicing two dependencies of an installed spec, for other installed specs""" + splice_t, splice_h, splice_z = install_specs( "splice-t@1 ^splice-h@1.0.0+compat ^splice-z@1.0.0+compat", "splice-h@1.0.2+compat ^splice-z@1.0.1+compat", "splice-z@1.0.2+compat", - ] - with CacheManager(cache): - freeze_builds_config = _make_specs_non_buildable(["splice-t", "splice-h", "splice-z"]) - spack.config.set("packages", freeze_builds_config) - goal_spec = Spec("splice-t@1 ^splice-h@1.0.2+compat ^splice-z@1.0.2+compat") - with pytest.raises(Exception): - goal_spec.concretized() - _enable_splicing() - assert goal_spec.concretized().satisfies(goal_spec) - - -# The next two tests are mirrors of one another -def test_virtual_multi_splices_in(splicing_setup): - cache = [ - "depends-on-virtual-with-abi ^virtual-abi-1", - "depends-on-virtual-with-abi ^virtual-abi-2", - ] - goal_specs = [ - "depends-on-virtual-with-abi ^virtual-abi-multi abi=one", - "depends-on-virtual-with-abi ^virtual-abi-multi abi=two", - ] - with CacheManager(cache): - spack.config.set("packages", _make_specs_non_buildable(["depends-on-virtual-with-abi"])) - for gs in goal_specs: - with pytest.raises(Exception): - Spec(gs).concretized() - _enable_splicing() - for gs in goal_specs: - assert Spec(gs).concretized().satisfies(gs) - - -def test_virtual_multi_can_be_spliced(splicing_setup): - cache = [ - "depends-on-virtual-with-abi ^virtual-abi-multi abi=one", - "depends-on-virtual-with-abi ^virtual-abi-multi abi=two", - ] - goal_specs = [ - "depends-on-virtual-with-abi ^virtual-abi-1", - "depends-on-virtual-with-abi ^virtual-abi-2", - ] - with CacheManager(cache): - spack.config.set("packages", _make_specs_non_buildable(["depends-on-virtual-with-abi"])) - with pytest.raises(Exception): - for gs in goal_specs: - Spec(gs).concretized() - _enable_splicing() - for gs in goal_specs: - assert Spec(gs).concretized().satisfies(gs) - - -def test_manyvariant_star_matching_variant_splice(splicing_setup): - cache = [ + ) + mutable_config.set("packages", _make_specs_non_buildable(["splice-t", "splice-h", "splice-z"])) + + goal_spec = "splice-t@1 ^splice-h@1.0.2+compat ^splice-z@1.0.2+compat" + with pytest.raises(SolverError): + spack.concretize.concretize_one(goal_spec) + + _enable_splicing() + concrete = spack.concretize.concretize_one(goal_spec) + + # splice-t and splice-h have a dependency that is changing, thus its hash should be different + assert concrete.dag_hash() != splice_t.dag_hash() + assert concrete.build_spec.satisfies(splice_t) + assert not concrete.satisfies(splice_t) + + assert concrete["splice-h"].dag_hash() != splice_h.dag_hash() + assert concrete["splice-h"].build_spec.satisfies(splice_h) + assert not concrete["splice-h"].satisfies(splice_h) + + # splice-z is reused, so the hash should stay the same + assert concrete["splice-z"].dag_hash() == splice_z.dag_hash() + + +@pytest.mark.parametrize( + "original_spec,goal_spec", + [ + # `virtual-abi-1` can be spliced for `virtual-abi-multi abi=one` and vice-versa + ( + "depends-on-virtual-with-abi ^virtual-abi-1", + "depends-on-virtual-with-abi ^virtual-abi-multi abi=one", + ), + ( + "depends-on-virtual-with-abi ^virtual-abi-multi abi=one", + "depends-on-virtual-with-abi ^virtual-abi-1", + ), + # `virtual-abi-2` can be spliced for `virtual-abi-multi abi=two` and vice-versa + ( + "depends-on-virtual-with-abi ^virtual-abi-2", + "depends-on-virtual-with-abi ^virtual-abi-multi abi=two", + ), + ( + "depends-on-virtual-with-abi ^virtual-abi-multi abi=two", + "depends-on-virtual-with-abi ^virtual-abi-2", + ), + ], +) +def test_virtual_multi_splices_in(original_spec, goal_spec, install_specs, mutable_config): + """Tests that we can splice a virtual dependency with a different, but compatible, provider.""" + original = install_specs(original_spec)[0] + mutable_config.set("packages", _make_specs_non_buildable(["depends-on-virtual-with-abi"])) + + with pytest.raises(SolverError): + spack.concretize.concretize_one(goal_spec) + + _enable_splicing() + spliced = spack.concretize.concretize_one(goal_spec) + + assert spliced.dag_hash() != original.dag_hash() + assert spliced.build_spec.dag_hash() == original.dag_hash() + assert spliced["virtual-with-abi"].name != spliced.build_spec["virtual-with-abi"].name + + +@pytest.mark.parametrize( + "original_spec,goal_spec", + [ # can_splice("manyvariants@1.0.0", when="@1.0.1", match_variants="*") - "depends-on-manyvariants ^manyvariants@1.0.0+a+b c=v1 d=v2", - "depends-on-manyvariants ^manyvariants@1.0.0~a~b c=v3 d=v3", - ] - goal_specs = [ - Spec("depends-on-manyvariants ^manyvariants@1.0.1+a+b c=v1 d=v2"), - Spec("depends-on-manyvariants ^manyvariants@1.0.1~a~b c=v3 d=v3"), - ] - with CacheManager(cache): - freeze_build_config = {"depends-on-manyvariants": {"buildable": False}} - spack.config.set("packages", freeze_build_config) - for goal in goal_specs: - with pytest.raises(Exception): - goal.concretized() - _enable_splicing() - for goal in goal_specs: - assert goal.concretized().satisfies(goal) - - -def test_manyvariant_limited_matching(splicing_setup): - cache = [ + ( + "depends-on-manyvariants ^manyvariants@1.0.0+a+b c=v1 d=v2", + "depends-on-manyvariants ^manyvariants@1.0.1+a+b c=v1 d=v2", + ), + ( + "depends-on-manyvariants ^manyvariants@1.0.0~a~b c=v3 d=v3", + "depends-on-manyvariants ^manyvariants@1.0.1~a~b c=v3 d=v3", + ), # can_splice("manyvariants@2.0.0+a~b", when="@2.0.1~a+b", match_variants=["c", "d"]) - "depends-on-manyvariants@2.0 ^manyvariants@2.0.0+a~b c=v3 d=v2", + ( + "depends-on-manyvariants@2.0 ^manyvariants@2.0.0+a~b c=v3 d=v2", + "depends-on-manyvariants@2.0 ^manyvariants@2.0.1~a+b c=v3 d=v2", + ), # can_splice("manyvariants@2.0.0 c=v1 d=v1", when="@2.0.1+a+b") - "depends-on-manyvariants@2.0 ^manyvariants@2.0.0~a~b c=v1 d=v1", - ] - goal_specs = [ - Spec("depends-on-manyvariants@2.0 ^manyvariants@2.0.1~a+b c=v3 d=v2"), - Spec("depends-on-manyvariants@2.0 ^manyvariants@2.0.1+a+b c=v3 d=v3"), - ] - with CacheManager(cache): - freeze_build_config = {"depends-on-manyvariants": {"buildable": False}} - spack.config.set("packages", freeze_build_config) - for s in goal_specs: - with pytest.raises(Exception): - s.concretized() - _enable_splicing() - for s in goal_specs: - assert s.concretized().satisfies(s) - - -def test_external_splice_same_name(splicing_setup): - cache = [ + ( + "depends-on-manyvariants@2.0 ^manyvariants@2.0.0~a~b c=v1 d=v1", + "depends-on-manyvariants@2.0 ^manyvariants@2.0.1+a+b c=v3 d=v3", + ), + ], +) +def test_manyvariant_matching_variant_splice( + original_spec, goal_spec, install_specs, mutable_config +): + """Tests splicing with different kind of matching on variants""" + original = install_specs(original_spec)[0] + mutable_config.set("packages", {"depends-on-manyvariants": {"buildable": False}}) + + with pytest.raises(SolverError): + spack.concretize.concretize_one(goal_spec) + + _enable_splicing() + spliced = spack.concretize.concretize_one(goal_spec) + + assert spliced.dag_hash() != original.dag_hash() + assert spliced.build_spec.dag_hash() == original.dag_hash() + + # The spliced 'manyvariants' is yet to be built + assert spliced["manyvariants"].dag_hash() != original["manyvariants"].dag_hash() + assert spliced["manyvariants"].build_spec.dag_hash() == spliced["manyvariants"].dag_hash() + + +def test_external_splice_same_name(install_specs, mutable_config): + """Tests that externals can be spliced for non-external specs""" + original_splice_h, original_splice_t = install_specs( "splice-h@1.0.0 ^splice-z@1.0.0+compat", "splice-t@1.0 ^splice-h@1.0.1 ^splice-z@1.0.1+compat", - ] - packages_yaml = { - "splice-z": {"externals": [{"spec": "splice-z@1.0.2+compat", "prefix": "/usr"}]} - } - goal_specs = [ - Spec("splice-h@1.0.0 ^splice-z@1.0.2"), - Spec("splice-t@1.0 ^splice-h@1.0.1 ^splice-z@1.0.2"), - ] - with CacheManager(cache): - spack.config.set("packages", packages_yaml) - _enable_splicing() - for s in goal_specs: - assert s.concretized().satisfies(s) - - -def test_spliced_build_deps_only_in_build_spec(splicing_setup): - cache = ["splice-t@1.0 ^splice-h@1.0.1 ^splice-z@1.0.0"] - goal_spec = Spec("splice-t@1.0 ^splice-h@1.0.2 ^splice-z@1.0.0") - - with CacheManager(cache): - _enable_splicing() - concr_goal = goal_spec.concretized() - build_spec = concr_goal._build_spec - # Spec has been spliced - assert build_spec is not None - # Build spec has spliced build dependencies - assert _has_build_dependency(build_spec, "splice-h") - assert _has_build_dependency(build_spec, "splice-z") - # Spliced build dependencies are removed - assert len(concr_goal.dependencies(None, dt.BUILD)) == 0 - - -def test_spliced_transitive_dependency(splicing_setup): - cache = ["splice-depends-on-t@1.0 ^splice-h@1.0.1"] - goal_spec = Spec("splice-depends-on-t^splice-h@1.0.2") - - with CacheManager(cache): - spack.config.set("packages", _make_specs_non_buildable(["splice-depends-on-t"])) - _enable_splicing() - concr_goal = goal_spec.concretized() - # Spec has been spliced - assert concr_goal._build_spec is not None - assert concr_goal["splice-t"]._build_spec is not None - assert concr_goal.satisfies(goal_spec) - # Spliced build dependencies are removed - assert len(concr_goal.dependencies(None, dt.BUILD)) == 0 + ) + mutable_config.set("packages", _make_specs_non_buildable(["splice-t", "splice-h"])) + mutable_config.set( + "packages", + { + "splice-z": { + "externals": [{"spec": "splice-z@1.0.2+compat", "prefix": "/usr"}], + "buildable": False, + } + }, + ) + + _enable_splicing() + concrete_splice_h = spack.concretize.concretize_one("splice-h@1.0.0 ^splice-z@1.0.2") + concrete_splice_t = spack.concretize.concretize_one( + "splice-t@1.0 ^splice-h@1.0.1 ^splice-z@1.0.2" + ) + + assert concrete_splice_h.dag_hash() != original_splice_h.dag_hash() + assert concrete_splice_h.build_spec.dag_hash() == original_splice_h.dag_hash() + assert concrete_splice_h["splice-z"].external + + assert concrete_splice_t.dag_hash() != original_splice_t.dag_hash() + assert concrete_splice_t.build_spec.dag_hash() == original_splice_t.dag_hash() + assert concrete_splice_t["splice-z"].external + + assert concrete_splice_t["splice-z"].dag_hash() == concrete_splice_h["splice-z"].dag_hash() + + +def test_spliced_build_deps_only_in_build_spec(install_specs): + """Tests that build specs are not reported in the spliced spec""" + install_specs("splice-t@1.0 ^splice-h@1.0.1 ^splice-z@1.0.0") + + _enable_splicing() + spliced = spack.concretize.concretize_one("splice-t@1.0 ^splice-h@1.0.2 ^splice-z@1.0.0") + build_spec = spliced.build_spec + + # Spec has been spliced + assert build_spec.dag_hash() != spliced.dag_hash() + # Build spec has spliced build dependencies + assert build_spec.dependencies("splice-h", dt.BUILD) + assert build_spec.dependencies("splice-z", dt.BUILD) + # Spliced build dependencies are removed + assert len(spliced.dependencies(None, dt.BUILD)) == 0 + + +def test_spliced_transitive_dependency(install_specs, mutable_config): + """Tests that build specs are not reported, even for spliced transitive dependencies""" + install_specs("splice-depends-on-t@1.0 ^splice-h@1.0.1") + mutable_config.set("packages", _make_specs_non_buildable(["splice-depends-on-t"])) + + _enable_splicing() + spliced = spack.concretize.concretize_one("splice-depends-on-t^splice-h@1.0.2") + + # Spec has been spliced + assert spliced.build_spec.dag_hash() != spliced.dag_hash() + assert spliced["splice-t"].build_spec.dag_hash() != spliced["splice-t"].dag_hash() + + # Spliced build dependencies are removed + assert len(spliced.dependencies(None, dt.BUILD)) == 0 + assert len(spliced["splice-t"].dependencies(None, dt.BUILD)) == 0 diff --git a/lib/spack/spack/test/architecture.py b/lib/spack/spack/test/architecture.py index 991cc3f8cb9243..8562be992f1b82 100644 --- a/lib/spack/spack/test/architecture.py +++ b/lib/spack/spack/test/architecture.py @@ -60,8 +60,7 @@ def test_user_input_combination(config, target_str, os_str): """Test for all the valid user input combinations that both the target and the operating system match. """ - spec_str = "libelf os={} target={}".format(os_str, target_str) - spec = Spec(spec_str) + spec = Spec(f"libelf os={os_str} target={target_str}") assert spec.architecture.os == str(TEST_PLATFORM.operating_system(os_str)) assert spec.architecture.target == TEST_PLATFORM.target(target_str) @@ -71,8 +70,8 @@ def test_default_os_and_target(default_mock_concretization): after concretization. """ spec = default_mock_concretization("libelf") - assert spec.architecture.os == str(TEST_PLATFORM.operating_system("default_os")) - assert spec.architecture.target == TEST_PLATFORM.target("default_target") + assert spec.architecture.os == str(TEST_PLATFORM.default_operating_system()) + assert spec.architecture.target == TEST_PLATFORM.default_target() def test_operating_system_conversion_to_dict(): @@ -133,5 +132,5 @@ def test_concretize_target_ranges(root_target_range, dep_target_range, result, m f"pkg-a %gcc@10 foobar=bar target={root_target_range} ^pkg-b target={dep_target_range}" ) with spack.concretize.disable_compiler_existence_check(): - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.target == spec["pkg-b"].target == result diff --git a/lib/spack/spack/test/bindist.py b/lib/spack/spack/test/bindist.py index 03302ca02829fe..079102c9abe47e 100644 --- a/lib/spack/spack/test/bindist.py +++ b/lib/spack/spack/test/bindist.py @@ -28,6 +28,7 @@ import spack.binary_distribution as bindist import spack.caches import spack.compilers +import spack.concretize import spack.config import spack.fetch_strategy import spack.hooks.sbang as sbang @@ -35,13 +36,15 @@ import spack.mirrors.mirror import spack.oci.image import spack.paths +import spack.repo import spack.spec import spack.store import spack.util.gpg import spack.util.spack_yaml as syaml import spack.util.url as url_util import spack.util.web as web_util -from spack.binary_distribution import CannotListKeys, GenerateIndexError +from spack.binary_distribution import INDEX_HASH_FILE, CannotListKeys, GenerateIndexError +from spack.database import INDEX_JSON_FILE from spack.installer import PackageInstaller from spack.paths import test_path from spack.spec import Spec @@ -92,7 +95,7 @@ def config_directory(tmp_path_factory): @pytest.fixture(scope="function") -def default_config(tmp_path, config_directory, monkeypatch, install_mockery): +def default_config(tmp_path, config_directory, mock_repo_path, install_mockery): # This fixture depends on install_mockery to ensure # there is a clear order of initialization. The substitution of the # config scopes here is done on top of the substitution that comes with @@ -107,7 +110,6 @@ def default_config(tmp_path, config_directory, monkeypatch, install_mockery): ] with spack.config.use_configuration(*scopes): - spack.config.CONFIG.set("repos", [spack.paths.mock_packages_path]) njobs = spack.config.get("config:build_jobs") if not njobs: spack.config.set("config:build_jobs", 4, scope="user") @@ -128,8 +130,8 @@ def default_config(tmp_path, config_directory, monkeypatch, install_mockery): timeout = spack.config.get("config:connect_timeout") if not timeout: spack.config.set("config:connect_timeout", 10, scope="user") - - yield spack.config.CONFIG + with spack.repo.use_repositories(mock_repo_path): + yield spack.config.CONFIG @pytest.fixture(scope="function") @@ -205,8 +207,9 @@ def test_default_rpaths_create_install_default_layout(temporary_mirror_dir): Test the creation and installation of buildcaches with default rpaths into the default directory layout scheme. """ - gspec, cspec = Spec("garply").concretized(), Spec("corge").concretized() - sy_spec = Spec("symly").concretized() + gspec = spack.concretize.concretize_one("garply") + cspec = spack.concretize.concretize_one("corge") + sy_spec = spack.concretize.concretize_one("symly") # Install 'corge' without using a cache install_cmd("--no-cache", cspec.name) @@ -253,9 +256,9 @@ def test_default_rpaths_install_nondefault_layout(temporary_mirror_dir): Test the creation and installation of buildcaches with default rpaths into the non-default directory layout scheme. """ - cspec = Spec("corge").concretized() + cspec = spack.concretize.concretize_one("corge") # This guy tests for symlink relocation - sy_spec = Spec("symly").concretized() + sy_spec = spack.concretize.concretize_one("symly") # Install some packages with dependent packages # test install in non-default install path scheme @@ -276,7 +279,8 @@ def test_relative_rpaths_install_default_layout(temporary_mirror_dir): Test the creation and installation of buildcaches with relative rpaths into the default directory layout scheme. """ - gspec, cspec = Spec("garply").concretized(), Spec("corge").concretized() + gspec = spack.concretize.concretize_one("garply") + cspec = spack.concretize.concretize_one("corge") # Install buildcache created with relativized rpaths buildcache_cmd("install", "-uf", cspec.name) @@ -305,7 +309,7 @@ def test_relative_rpaths_install_nondefault(temporary_mirror_dir): Test the installation of buildcaches with relativized rpaths into the non-default directory layout scheme. """ - cspec = Spec("corge").concretized() + cspec = spack.concretize.concretize_one("corge") # Test install in non-default install path scheme and relative path buildcache_cmd("install", "-uf", cspec.name) @@ -358,7 +362,8 @@ def test_built_spec_cache(temporary_mirror_dir): that cache from a buildcache index.""" buildcache_cmd("list", "-a", "-l") - gspec, cspec = Spec("garply").concretized(), Spec("corge").concretized() + gspec = spack.concretize.concretize_one("garply") + cspec = spack.concretize.concretize_one("corge") for s in [gspec, cspec]: results = bindist.get_mirrors_for_spec(s) @@ -381,7 +386,7 @@ def test_spec_needs_rebuild(monkeypatch, tmpdir): mirror_dir = tmpdir.join("mirror_dir") mirror_url = url_util.path_to_file_url(mirror_dir.strpath) - s = Spec("libdwarf").concretized() + s = spack.concretize.concretize_one("libdwarf") # Install a package install_cmd(s.name) @@ -410,7 +415,7 @@ def test_generate_index_missing(monkeypatch, tmpdir, mutable_config): mirror_url = url_util.path_to_file_url(mirror_dir.strpath) spack.config.set("mirrors", {"test": mirror_url}) - s = Spec("libdwarf").concretized() + s = spack.concretize.concretize_one("libdwarf") # Install a package install_cmd("--no-cache", s.name) @@ -494,7 +499,7 @@ def mock_list_url(url, recursive=False): def test_update_sbang(tmp_path, temporary_mirror, mock_fetch, install_mockery): """Test relocation of the sbang shebang line in a package script""" - s = Spec("old-sbang").concretized() + s = spack.concretize.concretize_one("old-sbang") PackageInstaller([s.package]).install() old_prefix, old_sbang_shebang = s.prefix, sbang.sbang_shebang_line() old_contents = f"""\ @@ -602,7 +607,7 @@ def test_etag_fetching_304(): # handled as success, since it means the local cache is up-to-date. def response_304(request: urllib.request.Request): url = request.get_full_url() - if url == "https://www.example.com/build_cache/index.json": + if url == f"https://www.example.com/build_cache/{INDEX_JSON_FILE}": assert request.get_header("If-none-match") == '"112a8bbc1b3f7f185621c1ee335f0502"' raise urllib.error.HTTPError( url, 304, "Not Modified", hdrs={}, fp=None # type: ignore[arg-type] @@ -624,7 +629,7 @@ def test_etag_fetching_200(): # Test conditional fetch with etags. The remote has modified the file. def response_200(request: urllib.request.Request): url = request.get_full_url() - if url == "https://www.example.com/build_cache/index.json": + if url == f"https://www.example.com/build_cache/{INDEX_JSON_FILE}": assert request.get_header("If-none-match") == '"112a8bbc1b3f7f185621c1ee335f0502"' return urllib.response.addinfourl( io.BytesIO(b"Result"), @@ -675,7 +680,7 @@ def test_default_index_fetch_200(): def urlopen(request: urllib.request.Request): url = request.get_full_url() - if url.endswith("index.json.hash"): + if url.endswith(INDEX_HASH_FILE): return urllib.response.addinfourl( # type: ignore[arg-type] io.BytesIO(index_json_hash.encode()), headers={}, # type: ignore[arg-type] @@ -683,7 +688,7 @@ def urlopen(request: urllib.request.Request): code=200, ) - elif url.endswith("index.json"): + elif url.endswith(INDEX_JSON_FILE): return urllib.response.addinfourl( io.BytesIO(index_json.encode()), headers={"Etag": '"59bcc3ad6775562f845953cf01624225"'}, # type: ignore[arg-type] @@ -714,7 +719,7 @@ def test_default_index_dont_fetch_index_json_hash_if_no_local_hash(): def urlopen(request: urllib.request.Request): url = request.get_full_url() - if url.endswith("index.json"): + if url.endswith(INDEX_JSON_FILE): return urllib.response.addinfourl( io.BytesIO(index_json.encode()), headers={"Etag": '"59bcc3ad6775562f845953cf01624225"'}, # type: ignore[arg-type] @@ -743,7 +748,7 @@ def test_default_index_not_modified(): def urlopen(request: urllib.request.Request): url = request.get_full_url() - if url.endswith("index.json.hash"): + if url.endswith(INDEX_HASH_FILE): return urllib.response.addinfourl( io.BytesIO(index_json_hash.encode()), headers={}, # type: ignore[arg-type] @@ -788,7 +793,7 @@ def test_default_index_json_404(): def urlopen(request: urllib.request.Request): url = request.get_full_url() - if url.endswith("index.json.hash"): + if url.endswith(INDEX_HASH_FILE): return urllib.response.addinfourl( io.BytesIO(index_json_hash.encode()), headers={}, # type: ignore[arg-type] @@ -796,7 +801,7 @@ def urlopen(request: urllib.request.Request): code=200, ) - elif url.endswith("index.json"): + elif url.endswith(INDEX_JSON_FILE): raise urllib.error.HTTPError( url, code=404, diff --git a/lib/spack/spack/test/bootstrap.py b/lib/spack/spack/test/bootstrap.py index f691ab173ee2cb..17476999790516 100644 --- a/lib/spack/spack/test/bootstrap.py +++ b/lib/spack/spack/test/bootstrap.py @@ -220,14 +220,12 @@ def test_source_is_disabled(mutable_config): # The source is not explicitly enabled or disabled, so the following # call should raise to skip using it for bootstrapping - with pytest.raises(ValueError): - spack.bootstrap.core.source_is_enabled_or_raise(conf) + assert not spack.bootstrap.core.source_is_enabled(conf) # Try to explicitly disable the source and verify that the behavior # is the same as above spack.config.add("bootstrap:trusted:{0}:{1}".format(conf["name"], False)) - with pytest.raises(ValueError): - spack.bootstrap.core.source_is_enabled_or_raise(conf) + assert not spack.bootstrap.core.source_is_enabled(conf) @pytest.mark.regression("45247") diff --git a/lib/spack/spack/test/build_distribution.py b/lib/spack/spack/test/build_distribution.py index dd6dedbc66747e..647c794c645fce 100644 --- a/lib/spack/spack/test/build_distribution.py +++ b/lib/spack/spack/test/build_distribution.py @@ -3,20 +3,19 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import pytest import spack.binary_distribution as bd +import spack.concretize import spack.mirrors.mirror -import spack.spec from spack.installer import PackageInstaller pytestmark = pytest.mark.not_on_windows("does not run on windows") def test_build_tarball_overwrite(install_mockery, mock_fetch, monkeypatch, tmp_path): - spec = spack.spec.Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") PackageInstaller([spec.package], fake=True).install() specs = [spec] diff --git a/lib/spack/spack/test/build_environment.py b/lib/spack/spack/test/build_environment.py index 83891a51be1aa3..14a09e85dcfb10 100644 --- a/lib/spack/spack/test/build_environment.py +++ b/lib/spack/spack/test/build_environment.py @@ -16,6 +16,7 @@ import spack.build_environment import spack.compiler import spack.compilers +import spack.concretize import spack.config import spack.deptypes as dt import spack.package_base @@ -163,8 +164,7 @@ def test_static_to_shared_library(build_environment): @pytest.mark.regression("8345") @pytest.mark.usefixtures("config", "mock_packages") def test_cc_not_changed_by_modules(monkeypatch, working_env): - s = spack.spec.Spec("cmake") - s.concretize() + s = spack.concretize.concretize_one("cmake") pkg = s.package def _set_wrong_cc(x): @@ -184,7 +184,7 @@ def test_setup_dependent_package_inherited_modules( working_env, mock_packages, install_mockery, mock_fetch ): # This will raise on regression - s = spack.spec.Spec("cmake-client-inheritor").concretized() + s = spack.concretize.concretize_one("cmake-client-inheritor") PackageInstaller([s.package]).install() @@ -277,7 +277,7 @@ def platform_pathsep(pathlist): return convert_to_platform_path(pathlist) # Monkeypatch a pkg.compiler.environment with the required modifications - pkg = spack.spec.Spec("cmake").concretized().package + pkg = spack.concretize.concretize_one("cmake").package monkeypatch.setattr(pkg.compiler, "environment", modifications) # Trigger the modifications spack.build_environment.setup_package(pkg, False) @@ -301,7 +301,7 @@ def custom_env(pkg, env): env.prepend_path("PATH", test_path) env.append_flags("ENV_CUSTOM_CC_FLAGS", "--custom-env-flag1") - pkg = spack.spec.Spec("cmake").concretized().package + pkg = spack.concretize.concretize_one("cmake").package monkeypatch.setattr(pkg.compiler, "setup_custom_environment", custom_env) spack.build_environment.setup_package(pkg, False) @@ -322,7 +322,7 @@ def test_external_config_env(mock_packages, mutable_config, working_env): } spack.config.set("packages:cmake", cmake_config) - cmake_client = spack.spec.Spec("cmake-client").concretized() + cmake_client = spack.concretize.concretize_one("cmake-client") spack.build_environment.setup_package(cmake_client.package, False) assert os.environ["TEST_ENV_VAR_SET"] == "yes it's set" @@ -330,8 +330,7 @@ def test_external_config_env(mock_packages, mutable_config, working_env): @pytest.mark.regression("9107") def test_spack_paths_before_module_paths(config, mock_packages, monkeypatch, working_env): - s = spack.spec.Spec("cmake") - s.concretize() + s = spack.concretize.concretize_one("cmake") pkg = s.package module_path = os.path.join("path", "to", "module") @@ -352,8 +351,7 @@ def _set_wrong_cc(x): def test_package_inheritance_module_setup(config, mock_packages, working_env): - s = spack.spec.Spec("multimodule-inheritance") - s.concretize() + s = spack.concretize.concretize_one("multimodule-inheritance") pkg = s.package spack.build_environment.setup_package(pkg, False) @@ -387,11 +385,10 @@ def test_wrapper_variables( not in cuda_include_dirs ) - root = spack.spec.Spec("dt-diamond") - root.concretize() + root = spack.concretize.concretize_one("dt-diamond") for s in root.traverse(): - s.prefix = "/{0}-prefix/".format(s.name) + s.set_prefix(f"/{s.name}-prefix/") dep_pkg = root["dt-diamond-left"].package dep_lib_paths = ["/test/path/to/ex1.so", "/test/path/to/subdir/ex2.so"] @@ -399,7 +396,7 @@ def test_wrapper_variables( dep_libs = LibraryList(dep_lib_paths) dep2_pkg = root["dt-diamond-right"].package - dep2_pkg.spec.prefix = str(installation_dir_with_headers) + dep2_pkg.spec.set_prefix(str(installation_dir_with_headers)) setattr(dep_pkg, "libs", dep_libs) try: @@ -453,7 +450,7 @@ def test_external_prefixes_last(mutable_config, mock_packages, working_env, monk """ ) spack.config.set("packages", cfg_data) - top = spack.spec.Spec("dt-diamond").concretized() + top = spack.concretize.concretize_one("dt-diamond") def _trust_me_its_a_dir(path): return True @@ -500,8 +497,7 @@ def test_parallel_false_is_not_propagating(default_mock_concretization): ) def test_setting_dtags_based_on_config(config_setting, expected_flag, config, mock_packages): # Pick a random package to be able to set compiler's variables - s = spack.spec.Spec("cmake") - s.concretize() + s = spack.concretize.concretize_one("cmake") pkg = s.package env = EnvironmentModifications() @@ -533,7 +529,7 @@ def setup_dependent_package(module, dependent_spec): assert dependent_module.ninja is not None dependent_spec.package.test_attr = True - externaltool = spack.spec.Spec("externaltest").concretized() + externaltool = spack.concretize.concretize_one("externaltest") monkeypatch.setattr( externaltool["externaltool"].package, "setup_dependent_package", setup_dependent_package ) @@ -728,7 +724,7 @@ def test_build_system_globals_only_set_on_root_during_build(default_mock_concret But obviously it can lead to very hard to find bugs... We should get rid of those globals and define them instead as a property on the package instance. """ - root = spack.spec.Spec("mpileaks").concretized() + root = spack.concretize.concretize_one("mpileaks") build_variables = ("std_cmake_args", "std_meson_args", "std_pip_args") # See todo above, we clear out any properties that may have been set by the previous test. diff --git a/lib/spack/spack/test/build_systems.py b/lib/spack/spack/test/build_systems.py index 0b35a67005f4c2..e6b2594394fdd3 100644 --- a/lib/spack/spack/test/build_systems.py +++ b/lib/spack/spack/test/build_systems.py @@ -15,6 +15,7 @@ import spack.build_systems.autotools import spack.build_systems.cmake import spack.builder +import spack.concretize import spack.environment import spack.error import spack.paths @@ -146,7 +147,7 @@ def test_none_is_allowed(self, default_mock_concretization): def test_libtool_archive_files_are_deleted_by_default(self, mutable_database): # Install a package that creates a mock libtool archive - s = Spec("libtool-deletion").concretized() + s = spack.concretize.concretize_one("libtool-deletion") PackageInstaller([s.package], explicit=True).install() # Assert the libtool archive is not there and we have @@ -161,7 +162,7 @@ def test_libtool_archive_files_might_be_installed_on_demand( ): # Install a package that creates a mock libtool archive, # patch its package to preserve the installation - s = Spec("libtool-deletion").concretized() + s = spack.concretize.concretize_one("libtool-deletion") monkeypatch.setattr( type(spack.builder.create(s.package)), "install_libtool_archives", True ) @@ -175,7 +176,9 @@ def test_autotools_gnuconfig_replacement(self, mutable_database): Tests whether only broken config.sub and config.guess are replaced with files from working alternatives from the gnuconfig package. """ - s = Spec("autotools-config-replacement +patch_config_files +gnuconfig").concretized() + s = spack.concretize.concretize_one( + Spec("autotools-config-replacement +patch_config_files +gnuconfig") + ) PackageInstaller([s.package]).install() with open(os.path.join(s.prefix.broken, "config.sub"), encoding="utf-8") as f: @@ -194,7 +197,9 @@ def test_autotools_gnuconfig_replacement_disabled(self, mutable_database): """ Tests whether disabling patch_config_files """ - s = Spec("autotools-config-replacement ~patch_config_files +gnuconfig").concretized() + s = spack.concretize.concretize_one( + Spec("autotools-config-replacement ~patch_config_files +gnuconfig") + ) PackageInstaller([s.package]).install() with open(os.path.join(s.prefix.broken, "config.sub"), encoding="utf-8") as f: @@ -219,8 +224,9 @@ def test_autotools_gnuconfig_replacement_no_gnuconfig(self, mutable_database, mo enabled, but gnuconfig is not listed as a direct build dependency. """ monkeypatch.setattr(spack.platforms.test.Test, "default", "x86_64") - s = Spec("autotools-config-replacement +patch_config_files ~gnuconfig") - s.concretize() + s = spack.concretize.concretize_one( + Spec("autotools-config-replacement +patch_config_files ~gnuconfig") + ) msg = "Cannot patch config files: missing dependencies: gnuconfig" with pytest.raises(ChildError, match=msg): @@ -300,7 +306,7 @@ def test_define(self, default_mock_concretization): assert define("SINGLE", "red") == "-DSINGLE:STRING=red" def test_define_from_variant(self): - s = Spec("cmake-client multi=up,right ~truthy single=red").concretized() + s = spack.concretize.concretize_one("cmake-client multi=up,right ~truthy single=red") arg = s.package.define_from_variant("MULTI") assert arg == "-DMULTI:STRING=right;up" @@ -397,8 +403,8 @@ def test_autoreconf_search_path_args_multiple(default_mock_concretization, tmpdi aclocal_fst = str(tmpdir.mkdir("fst").mkdir("share").mkdir("aclocal")) aclocal_snd = str(tmpdir.mkdir("snd").mkdir("share").mkdir("aclocal")) build_dep_one, build_dep_two = spec.dependencies(deptype="build") - build_dep_one.prefix = str(tmpdir.join("fst")) - build_dep_two.prefix = str(tmpdir.join("snd")) + build_dep_one.set_prefix(str(tmpdir.join("fst"))) + build_dep_two.set_prefix(str(tmpdir.join("snd"))) assert spack.build_systems.autotools._autoreconf_search_path_args(spec) == [ "-I", aclocal_fst, @@ -416,8 +422,8 @@ def test_autoreconf_search_path_args_skip_automake(default_mock_concretization, aclocal_snd = str(tmpdir.mkdir("snd").mkdir("share").mkdir("aclocal")) build_dep_one, build_dep_two = spec.dependencies(deptype="build") build_dep_one.name = "automake" - build_dep_one.prefix = str(tmpdir.join("fst")) - build_dep_two.prefix = str(tmpdir.join("snd")) + build_dep_one.set_prefix(str(tmpdir.join("fst"))) + build_dep_two.set_prefix(str(tmpdir.join("snd"))) assert spack.build_systems.autotools._autoreconf_search_path_args(spec) == ["-I", aclocal_snd] @@ -428,7 +434,7 @@ def test_autoreconf_search_path_args_external_order(default_mock_concretization, aclocal_snd = str(tmpdir.mkdir("snd").mkdir("share").mkdir("aclocal")) build_dep_one, build_dep_two = spec.dependencies(deptype="build") build_dep_one.external_path = str(tmpdir.join("fst")) - build_dep_two.prefix = str(tmpdir.join("snd")) + build_dep_two.set_prefix(str(tmpdir.join("snd"))) assert spack.build_systems.autotools._autoreconf_search_path_args(spec) == [ "-I", aclocal_snd, @@ -441,8 +447,8 @@ def test_autoreconf_search_path_skip_nonexisting(default_mock_concretization, tm """Skip -I flags for non-existing directories""" spec = default_mock_concretization("dttop") build_dep_one, build_dep_two = spec.dependencies(deptype="build") - build_dep_one.prefix = str(tmpdir.join("fst")) - build_dep_two.prefix = str(tmpdir.join("snd")) + build_dep_one.set_prefix(str(tmpdir.join("fst"))) + build_dep_two.set_prefix(str(tmpdir.join("snd"))) assert spack.build_systems.autotools._autoreconf_search_path_args(spec) == [] diff --git a/lib/spack/spack/test/builder.py b/lib/spack/spack/test/builder.py index c895e46ae74ec9..bfcd49a4de1c20 100644 --- a/lib/spack/spack/test/builder.py +++ b/lib/spack/spack/test/builder.py @@ -1,20 +1,20 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import pytest from llnl.util.filesystem import touch import spack.builder +import spack.concretize import spack.paths import spack.repo -import spack.spec @pytest.fixture() -def builder_test_repository(): +def builder_test_repository(config): builder_test_path = os.path.join(spack.paths.repos_path, "builder.test") with spack.repo.use_repositories(builder_test_path) as mock_repo: yield mock_repo @@ -78,7 +78,7 @@ def builder_test_repository(): @pytest.mark.disable_clean_stage_check def test_callbacks_and_installation_procedure(spec_str, expected_values, working_env): """Test the correct execution of callbacks and installation procedures for packages.""" - s = spack.spec.Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) builder = spack.builder.create(s.package) for phase_fn in builder: phase_fn.execute() @@ -101,7 +101,7 @@ def test_callbacks_and_installation_procedure(spec_str, expected_values, working ], ) def test_old_style_compatibility_with_super(spec_str, method_name, expected): - s = spack.spec.Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) builder = spack.builder.create(s.package) value = getattr(builder, method_name)() assert value == expected @@ -112,7 +112,7 @@ def test_old_style_compatibility_with_super(spec_str, method_name, expected): @pytest.mark.usefixtures("builder_test_repository", "config", "working_env") @pytest.mark.disable_clean_stage_check def test_build_time_tests_are_executed_from_default_builder(): - s = spack.spec.Spec("old-style-autotools").concretized() + s = spack.concretize.concretize_one("old-style-autotools") builder = spack.builder.create(s.package) builder.pkg.run_tests = True for phase_fn in builder: @@ -126,7 +126,7 @@ def test_build_time_tests_are_executed_from_default_builder(): @pytest.mark.usefixtures("builder_test_repository", "config", "working_env") def test_monkey_patching_wrapped_pkg(): """Confirm 'run_tests' is accessible through wrappers.""" - s = spack.spec.Spec("old-style-autotools").concretized() + s = spack.concretize.concretize_one("old-style-autotools") builder = spack.builder.create(s.package) assert s.package.run_tests is False assert builder.pkg.run_tests is False @@ -141,7 +141,7 @@ def test_monkey_patching_wrapped_pkg(): @pytest.mark.usefixtures("builder_test_repository", "config", "working_env") def test_monkey_patching_test_log_file(): """Confirm 'test_log_file' is accessible through wrappers.""" - s = spack.spec.Spec("old-style-autotools").concretized() + s = spack.concretize.concretize_one("old-style-autotools") builder = spack.builder.create(s.package) s.package.tester.test_log_file = "/some/file" @@ -154,7 +154,7 @@ def test_monkey_patching_test_log_file(): @pytest.mark.not_on_windows("Does not run on windows") def test_install_time_test_callback(tmpdir, config, mock_packages, mock_stage): """Confirm able to run stand-alone test as a post-install callback.""" - s = spack.spec.Spec("py-test-callback").concretized() + s = spack.concretize.concretize_one("py-test-callback") builder = spack.builder.create(s.package) builder.pkg.run_tests = True s.package.tester.test_log_file = tmpdir.join("install_test.log") @@ -174,7 +174,7 @@ def test_mixins_with_builders(working_env): """Tests that run_after and run_before callbacks are accumulated correctly, when mixins are used with builders. """ - s = spack.spec.Spec("builder-and-mixins").concretized() + s = spack.concretize.concretize_one("builder-and-mixins") builder = spack.builder.create(s.package) # Check that callbacks added by the mixin are in the list diff --git a/lib/spack/spack/test/buildrequest.py b/lib/spack/spack/test/buildrequest.py index 41067d7f069f00..bea3badd45c871 100644 --- a/lib/spack/spack/test/buildrequest.py +++ b/lib/spack/spack/test/buildrequest.py @@ -4,6 +4,7 @@ import pytest +import spack.concretize import spack.deptypes as dt import spack.installer as inst import spack.repo @@ -21,8 +22,7 @@ def test_build_request_errors(install_mockery): def test_build_request_basics(install_mockery): - spec = spack.spec.Spec("dependent-install") - spec.concretize() + spec = spack.concretize.concretize_one("dependent-install") assert spec.concrete # Ensure key properties match expectations @@ -39,8 +39,7 @@ def test_build_request_basics(install_mockery): def test_build_request_strings(install_mockery): """Tests of BuildRequest repr and str for coverage purposes.""" # Using a package with one dependency - spec = spack.spec.Spec("dependent-install") - spec.concretize() + spec = spack.concretize.concretize_one("dependent-install") assert spec.concrete # Ensure key properties match expectations @@ -72,7 +71,7 @@ def test_build_request_deptypes( package_deptypes, dependencies_deptypes, ): - s = spack.spec.Spec("dependent-install").concretized() + s = spack.concretize.concretize_one("dependent-install") build_request = inst.BuildRequest( s.package, diff --git a/lib/spack/spack/test/buildtask.py b/lib/spack/spack/test/buildtask.py index 9771c90071c564..5eddd3e2ce1a88 100644 --- a/lib/spack/spack/test/buildtask.py +++ b/lib/spack/spack/test/buildtask.py @@ -4,6 +4,7 @@ import pytest +import spack.concretize import spack.error import spack.installer as inst import spack.repo @@ -24,7 +25,7 @@ def test_build_task_errors(install_mockery): inst.BuildTask(pkg_cls(spec), None) # Using a concretized package now means the request argument is checked. - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.concrete with pytest.raises(TypeError, match="is not a valid build request"): @@ -47,8 +48,7 @@ def test_build_task_errors(install_mockery): def test_build_task_basics(install_mockery): - spec = spack.spec.Spec("dependent-install") - spec.concretize() + spec = spack.concretize.concretize_one("dependent-install") assert spec.concrete # Ensure key properties match expectations @@ -69,8 +69,7 @@ def test_build_task_basics(install_mockery): def test_build_task_strings(install_mockery): """Tests of build_task repr and str for coverage purposes.""" # Using a package with one dependency - spec = spack.spec.Spec("dependent-install") - spec.concretize() + spec = spack.concretize.concretize_one("dependent-install") assert spec.concrete # Ensure key properties match expectations diff --git a/lib/spack/spack/test/ci.py b/lib/spack/spack/test/ci.py index c703510ee2fa76..2e67709696b2c2 100644 --- a/lib/spack/spack/test/ci.py +++ b/lib/spack/spack/test/ci.py @@ -1,21 +1,23 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import io import os import subprocess +from urllib.error import HTTPError import pytest import llnl.util.filesystem as fs import spack.ci as ci +import spack.concretize import spack.environment as ev import spack.error import spack.paths as spack_paths import spack.repo as repo -import spack.spec import spack.util.git -from spack.spec import Spec +from spack.test.conftest import MockHTTPResponse pytestmark = [pytest.mark.usefixtures("mock_packages")] @@ -54,7 +56,7 @@ def test_pipeline_dag(config, tmpdir): builder.add_package("pkg-a", dependencies=[("pkg-b", None, None), ("pkg-c", None, None)]) with repo.use_repositories(builder.root): - spec_a = Spec("pkg-a").concretized() + spec_a = spack.concretize.concretize_one("pkg-a") key_a = ci.common.PipelineDag.key(spec_a) key_b = ci.common.PipelineDag.key(spec_a["pkg-b"]) @@ -163,38 +165,8 @@ def test_import_signing_key(mock_gnupghome): ci.import_signing_key(signing_key) -class FakeWebResponder: - def __init__(self, response_code=200, content_to_read=[]): - self._resp_code = response_code - self._content = content_to_read - self._read = [False for c in content_to_read] - - def open(self, request, data=None, timeout=object()): - return self - - def getcode(self): - return self._resp_code - - def read(self, length=None): - if len(self._content) <= 0: - return None - - if not self._read[-1]: - return_content = self._content[-1] - if length: - self._read[-1] = True - else: - self._read.pop() - self._content.pop() - return return_content - - self._read.pop() - self._content.pop() - return None - - -def test_download_and_extract_artifacts(tmpdir, monkeypatch, working_env): - os.environ.update({"GITLAB_PRIVATE_TOKEN": "faketoken"}) +def test_download_and_extract_artifacts(tmpdir, monkeypatch): + monkeypatch.setenv("GITLAB_PRIVATE_TOKEN", "faketoken") url = "https://www.nosuchurlexists.itsfake/artifacts.zip" working_dir = os.path.join(tmpdir.strpath, "repro") @@ -202,10 +174,13 @@ def test_download_and_extract_artifacts(tmpdir, monkeypatch, working_env): spack_paths.test_path, "data", "ci", "gitlab", "artifacts.zip" ) - with open(test_artifacts_path, "rb") as fd: - fake_responder = FakeWebResponder(content_to_read=[fd.read()]) + def _urlopen_OK(*args, **kwargs): + with open(test_artifacts_path, "rb") as f: + return MockHTTPResponse( + "200", "OK", {"Content-Type": "application/zip"}, io.BytesIO(f.read()) + ) - monkeypatch.setattr(ci, "build_opener", lambda handler: fake_responder) + monkeypatch.setattr(ci, "urlopen", _urlopen_OK) ci.download_and_extract_artifacts(url, working_dir) @@ -215,7 +190,11 @@ def test_download_and_extract_artifacts(tmpdir, monkeypatch, working_env): found_install = fs.find(working_dir, "install.sh") assert len(found_install) == 1 - fake_responder._resp_code = 400 + def _urlopen_500(*args, **kwargs): + raise HTTPError(url, 500, "Internal Server Error", {}, None) + + monkeypatch.setattr(ci, "urlopen", _urlopen_500) + with pytest.raises(spack.error.SpackError): ci.download_and_extract_artifacts(url, working_dir) @@ -329,16 +308,14 @@ def test_get_spec_filter_list(mutable_mock_env_path, mutable_mock_repo): e1.add("hypre") e1.concretize() - """ - Concretizing the above environment results in the following graphs: + # Concretizing the above environment results in the following graphs: - mpileaks -> mpich (provides mpi virtual dep of mpileaks) - -> callpath -> dyninst -> libelf - -> libdwarf -> libelf - -> mpich (provides mpi dep of callpath) + # mpileaks -> mpich (provides mpi virtual dep of mpileaks) + # -> callpath -> dyninst -> libelf + # -> libdwarf -> libelf + # -> mpich (provides mpi dep of callpath) - hypre -> openblas-with-lapack (provides lapack and blas virtual deps of hypre) - """ + # hypre -> openblas-with-lapack (provides lapack and blas virtual deps of hypre) touched = ["libdwarf"] @@ -449,7 +426,7 @@ def test_ci_run_standalone_tests_not_installed_junit( log_file = tmp_path / "junit.xml" args = { "log_file": str(log_file), - "job_spec": spack.spec.Spec("printing-package").concretized(), + "job_spec": spack.concretize.concretize_one("printing-package"), "repro_dir": str(repro_dir), "fail_fast": True, } @@ -468,7 +445,7 @@ def test_ci_run_standalone_tests_not_installed_cdash( log_file = tmp_path / "junit.xml" args = { "log_file": str(log_file), - "job_spec": spack.spec.Spec("printing-package").concretized(), + "job_spec": spack.concretize.concretize_one("printing-package"), "repro_dir": str(repro_dir), } @@ -501,7 +478,7 @@ def test_ci_run_standalone_tests_not_installed_cdash( def test_ci_skipped_report(tmpdir, mock_packages, config): """Test explicit skipping of report as well as CI's 'package' arg.""" pkg = "trivial-smoke-test" - spec = spack.spec.Spec(pkg).concretized() + spec = spack.concretize.concretize_one(pkg) ci_cdash = { "url": "file://fake", "build-group": "fake-group", diff --git a/lib/spack/spack/test/cmd/bootstrap.py b/lib/spack/spack/test/cmd/bootstrap.py index dd532a6ad7ba93..0796815c8ef716 100644 --- a/lib/spack/spack/test/cmd/bootstrap.py +++ b/lib/spack/spack/test/cmd/bootstrap.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import sys import pytest @@ -10,6 +10,7 @@ import spack.bootstrap import spack.bootstrap.core +import spack.concretize import spack.config import spack.environment as ev import spack.main @@ -183,7 +184,7 @@ def test_bootstrap_mirror_metadata(mutable_config, linux_os, monkeypatch, tmpdir """ old_create = spack.mirrors.utils.create monkeypatch.setattr(spack.mirrors.utils, "create", lambda p, s: old_create(p, [])) - monkeypatch.setattr(spack.spec.Spec, "concretized", lambda p: p) + monkeypatch.setattr(spack.concretize, "concretize_one", lambda p: spack.spec.Spec(p)) # Create the mirror in a temporary folder compilers = [ diff --git a/lib/spack/spack/test/cmd/build_env.py b/lib/spack/spack/test/cmd/build_env.py index 576292de49d64c..88c51a460b15d9 100644 --- a/lib/spack/spack/test/cmd/build_env.py +++ b/lib/spack/spack/test/cmd/build_env.py @@ -12,7 +12,7 @@ build_env = SpackCommand("build-env") -@pytest.mark.parametrize("pkg", [("zlib",), ("zlib", "--")]) +@pytest.mark.parametrize("pkg", [("pkg-c",), ("pkg-c", "--")]) @pytest.mark.usefixtures("config", "mock_packages", "working_env") def test_it_just_runs(pkg): build_env(*pkg) @@ -38,7 +38,7 @@ def test_build_env_requires_a_spec(args): @pytest.mark.usefixtures("config", "mock_packages", "working_env") def test_dump(shell_as, shell, tmpdir): with tmpdir.as_cwd(): - build_env("--dump", _out_file, "zlib") + build_env("--dump", _out_file, "pkg-c") with open(_out_file, encoding="utf-8") as f: if shell == "pwsh": assert any(line.startswith("$Env:PATH") for line in f.readlines()) @@ -51,7 +51,7 @@ def test_dump(shell_as, shell, tmpdir): @pytest.mark.usefixtures("config", "mock_packages", "working_env") def test_pickle(tmpdir): with tmpdir.as_cwd(): - build_env("--pickle", _out_file, "zlib") + build_env("--pickle", _out_file, "pkg-c") environment = pickle.load(open(_out_file, "rb")) assert isinstance(environment, dict) assert "PATH" in environment diff --git a/lib/spack/spack/test/cmd/buildcache.py b/lib/spack/spack/test/cmd/buildcache.py index 82db44683758a4..83e99459219040 100644 --- a/lib/spack/spack/test/cmd/buildcache.py +++ b/lib/spack/spack/test/cmd/buildcache.py @@ -12,6 +12,7 @@ import spack.binary_distribution import spack.cmd.buildcache +import spack.concretize import spack.environment as ev import spack.error import spack.main @@ -19,7 +20,6 @@ import spack.spec import spack.util.url from spack.installer import PackageInstaller -from spack.spec import Spec buildcache = spack.main.SpackCommand("buildcache") install = spack.main.SpackCommand("install") @@ -81,7 +81,7 @@ def tests_buildcache_create(install_mockery, mock_fetch, monkeypatch, tmpdir): buildcache("push", "--unsigned", str(tmpdir), pkg) - spec = Spec(pkg).concretized() + spec = spack.concretize.concretize_one(pkg) tarball_path = spack.binary_distribution.tarball_path_name(spec, ".spack") tarball = spack.binary_distribution.tarball_name(spec, ".spec.json") assert os.path.exists(os.path.join(str(tmpdir), "build_cache", tarball_path)) @@ -101,7 +101,7 @@ def tests_buildcache_create_env( buildcache("push", "--unsigned", str(tmpdir)) - spec = Spec(pkg).concretized() + spec = spack.concretize.concretize_one(pkg) tarball_path = spack.binary_distribution.tarball_path_name(spec, ".spack") tarball = spack.binary_distribution.tarball_name(spec, ".spec.json") assert os.path.exists(os.path.join(str(tmpdir), "build_cache", tarball_path)) @@ -145,10 +145,10 @@ def test_update_key_index( gpg("create", "Test Signing Key", "nobody@nowhere.com") - s = Spec("libdwarf").concretized() + s = spack.concretize.concretize_one("libdwarf") # Install a package - install(s.name) + install("--fake", s.name) # Put installed package in the buildcache, which, because we're signing # it, should result in the public key getting pushed to the buildcache @@ -175,10 +175,10 @@ def test_buildcache_autopush(tmp_path, install_mockery, mock_fetch): mirror("add", "--unsigned", "mirror", mirror_dir.as_uri()) mirror("add", "--autopush", "--unsigned", "mirror-autopush", mirror_autopush_dir.as_uri()) - s = Spec("libdwarf").concretized() + s = spack.concretize.concretize_one("libdwarf") # Install and generate build cache index - PackageInstaller([s.package], explicit=True).install() + PackageInstaller([s.package], fake=True, explicit=True).install() metadata_file = spack.binary_distribution.tarball_name(s, ".spec.json") @@ -219,8 +219,8 @@ def verify_mirror_contents(): assert False # Install a package and put it in the buildcache - s = Spec(out_env_pkg).concretized() - install(s.name) + s = spack.concretize.concretize_one(out_env_pkg) + install("--fake", s.name) buildcache("push", "-u", "-f", src_mirror_url, s.name) env("create", "test") @@ -329,7 +329,7 @@ def test_buildcache_create_install( buildcache("push", "--unsigned", str(tmpdir), pkg) - spec = Spec(pkg).concretized() + spec = spack.concretize.concretize_one(pkg) tarball_path = spack.binary_distribution.tarball_path_name(spec, ".spack") tarball = spack.binary_distribution.tarball_name(spec, ".spec.json") assert os.path.exists(os.path.join(str(tmpdir), "build_cache", tarball_path)) @@ -450,7 +450,7 @@ def test_push_and_install_with_mirror_marked_unsigned_does_not_require_extra_fla def test_skip_no_redistribute(mock_packages, config): - specs = list(Spec("no-redistribute-dependent").concretized().traverse()) + specs = list(spack.concretize.concretize_one("no-redistribute-dependent").traverse()) filtered = spack.cmd.buildcache._skip_no_redistribute_for_public(specs) assert not any(s.name == "no-redistribute" for s in filtered) assert any(s.name == "no-redistribute-dependent" for s in filtered) @@ -490,7 +490,7 @@ def test_push_without_build_deps(tmp_path, temporary_store, mock_packages, mutab mirror("add", "--unsigned", "my-mirror", str(tmp_path)) - s = spack.spec.Spec("dtrun3").concretized() + s = spack.concretize.concretize_one("dtrun3") PackageInstaller([s.package], explicit=True, fake=True).install() s["dtbuild3"].package.do_uninstall() diff --git a/lib/spack/spack/test/cmd/checksum.py b/lib/spack/spack/test/cmd/checksum.py index b6b37358ca1cd1..b98a13edbf7cea 100644 --- a/lib/spack/spack/test/cmd/checksum.py +++ b/lib/spack/spack/test/cmd/checksum.py @@ -3,14 +3,15 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import argparse +import pathlib import pytest import spack.cmd.checksum +import spack.concretize import spack.error import spack.package_base import spack.repo -import spack.spec import spack.stage import spack.util.web from spack.main import SpackCommand @@ -22,7 +23,15 @@ @pytest.fixture -def can_fetch_versions(monkeypatch): +def no_add(monkeypatch): + def add_versions_to_pkg(pkg, version_lines, open_in_editor): + raise AssertionError("Should not be called") + + monkeypatch.setattr(spack.cmd.checksum, "add_versions_to_pkg", add_versions_to_pkg) + + +@pytest.fixture +def can_fetch_versions(monkeypatch, no_add): """Fake successful version detection.""" def fetch_remote_versions(pkg, concurrency): @@ -45,7 +54,7 @@ def url_exists(url, curl=None): @pytest.fixture -def cannot_fetch_versions(monkeypatch): +def cannot_fetch_versions(monkeypatch, no_add): """Fake unsuccessful version detection.""" def fetch_remote_versions(pkg, concurrency): @@ -88,7 +97,6 @@ def test_checksum_args(arguments, expected): (["--batch", "preferred-test"], "version of preferred-test"), (["--latest", "preferred-test"], "Found 1 version"), (["--preferred", "preferred-test"], "Found 1 version"), - (["--add-to-package", "preferred-test"], "Added 0 new versions to"), (["--verify", "preferred-test"], "Verified 1 of 1"), (["--verify", "zlib", "1.2.13"], "1.2.13 [-] No previous checksum"), ], @@ -271,15 +279,12 @@ def test_checksum_interactive_unrecognized_command(): assert interactive_version_filter(v.copy(), input=input) == v -def test_checksum_versions(mock_packages, can_fetch_versions): +def test_checksum_versions(mock_packages, can_fetch_versions, monkeypatch): pkg_cls = spack.repo.PATH.get_pkg_class("zlib") versions = [str(v) for v in pkg_cls.versions] output = spack_checksum("zlib", *versions) assert "Found 3 versions" in output assert "version(" in output - output = spack_checksum("--add-to-package", "zlib", *versions) - assert "Found 3 versions" in output - assert "Added 0 new versions to" in output def test_checksum_missing_version(mock_packages, cannot_fetch_versions): @@ -287,7 +292,6 @@ def test_checksum_missing_version(mock_packages, cannot_fetch_versions): assert "Could not find any remote versions" in output output = spack_checksum("--add-to-package", "preferred-test", "99.99.99", fail_on_error=False) assert "Could not find any remote versions" in output - assert "Added 1 new versions to" not in output def test_checksum_deprecated_version(mock_packages, can_fetch_versions): @@ -297,8 +301,6 @@ def test_checksum_deprecated_version(mock_packages, can_fetch_versions): "--add-to-package", "deprecated-versions", "1.1.0", fail_on_error=False ) assert "Version 1.1.0 is deprecated" in output - # TODO alecbcs: broken assertion. - # assert "Added 0 new versions to" not in output def test_checksum_url(mock_packages, config): @@ -308,7 +310,7 @@ def test_checksum_url(mock_packages, config): def test_checksum_verification_fails(default_mock_concretization, capsys, can_fetch_versions): - spec = spack.spec.Spec("zlib").concretized() + spec = spack.concretize.concretize_one("zlib") pkg = spec.package versions = list(pkg.versions.keys()) version_hashes = {versions[0]: "abadhash", Version("0.1"): "123456789"} @@ -337,3 +339,52 @@ def test_checksum_manual_download_fails(mock_packages, monkeypatch): monkeypatch.setattr(spack.package_base.PackageBase, "download_instr", error) with pytest.raises(ManualDownloadRequiredError, match=error): spack_checksum(name, *versions) + + +def test_upate_package_contents(tmp_path: pathlib.Path): + """Test that the package.py file is updated with the new versions.""" + pkg_path = tmp_path / "package.py" + pkg_path.write_text( + """\ +from spack.package import * + +class Zlib(Package): + homepage = "http://zlib.net" + url = "http://zlib.net/fossils/zlib-1.2.11.tar.gz" + + version("1.2.11", sha256="c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1") + version("1.2.8", sha256="36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d") + version("1.2.3", sha256="1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e") + variant("pic", default=True, description="test") + + def install(self, spec, prefix): + make("install") +""" + ) + version_lines = """\ + version("1.2.13", sha256="abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890") + version("1.2.5", sha256="abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890") + version("1.2.3", sha256="1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e") +""" + # two new versions are added + assert spack.cmd.checksum.add_versions_to_pkg(str(pkg_path), version_lines) == 2 + assert ( + pkg_path.read_text() + == """\ +from spack.package import * + +class Zlib(Package): + homepage = "http://zlib.net" + url = "http://zlib.net/fossils/zlib-1.2.11.tar.gz" + + version("1.2.13", sha256="abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890") # FIXME + version("1.2.11", sha256="c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1") + version("1.2.8", sha256="36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d") + version("1.2.5", sha256="abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890") # FIXME + version("1.2.3", sha256="1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e") + variant("pic", default=True, description="test") + + def install(self, spec, prefix): + make("install") +""" + ) diff --git a/lib/spack/spack/test/cmd/ci.py b/lib/spack/spack/test/cmd/ci.py index 919c322c2b0995..e2058efc4ed2d6 100644 --- a/lib/spack/spack/test/cmd/ci.py +++ b/lib/spack/spack/test/cmd/ci.py @@ -5,7 +5,6 @@ import os import pathlib import shutil -from io import BytesIO from typing import NamedTuple import jsonschema @@ -18,6 +17,7 @@ import spack.ci as ci import spack.cmd import spack.cmd.ci +import spack.concretize import spack.environment as ev import spack.hash_types as ht import spack.main @@ -27,9 +27,12 @@ from spack.ci.common import PipelineDag, PipelineOptions, SpackCIConfig from spack.ci.generator_registry import generator from spack.cmd.ci import FAILED_CREATE_BUILDCACHE_CODE +from spack.database import INDEX_JSON_FILE +from spack.error import SpackError from spack.schema.buildcache_spec import schema as specfile_schema from spack.schema.database_index import schema as db_idx_schema from spack.spec import Spec +from spack.test.conftest import MockHTTPResponse config_cmd = spack.main.SpackCommand("config") ci_cmd = spack.main.SpackCommand("ci") @@ -168,7 +171,9 @@ def test_ci_generate_with_env(ci_generate_test, tmp_path, mock_binary_index): url: https://my.fake.cdash project: Not used site: Nothing -""" +""", + "--artifacts-root", + str(tmp_path / "my_artifacts_root"), ) yaml_contents = syaml.load(outputfile.read_text()) @@ -190,7 +195,7 @@ def test_ci_generate_with_env(ci_generate_test, tmp_path, mock_binary_index): assert "variables" in yaml_contents assert "SPACK_ARTIFACTS_ROOT" in yaml_contents["variables"] - assert yaml_contents["variables"]["SPACK_ARTIFACTS_ROOT"] == "jobs_scratch_dir" + assert yaml_contents["variables"]["SPACK_ARTIFACTS_ROOT"] == "my_artifacts_root" def test_ci_generate_with_env_missing_section(ci_generate_test, tmp_path, mock_binary_index): @@ -237,7 +242,7 @@ def test_ci_generate_with_cdash_token(ci_generate_test, tmp_path, mock_binary_in # That fake token should have resulted in being unable to # register build group with cdash, but the workload should # still have been generated. - assert "Problem populating buildgroup" in output + assert "Failed to create or retrieve buildgroups" in output expected_keys = ["rebuild-index", "stages", "variables", "workflow"] assert all([key in yaml_contents.keys() for key in expected_keys]) @@ -327,14 +332,14 @@ def test_ci_generate_pkg_with_deps(ci_generate_test, tmp_path, ci_base_environme f"""\ spack: specs: - - flatten-deps + - dependent-install mirrors: buildcache-destination: {tmp_path / 'ci-mirror'} ci: pipeline-gen: - submapping: - match: - - flatten-deps + - dependent-install build-job: tags: - donotcare @@ -353,12 +358,12 @@ def test_ci_generate_pkg_with_deps(ci_generate_test, tmp_path, ci_base_environme assert "stage" in ci_obj assert ci_obj["stage"] == "stage-0" found.append("dependency-install") - if "flatten-deps" in ci_key: + if "dependent-install" in ci_key: assert "stage" in ci_obj assert ci_obj["stage"] == "stage-1" - found.append("flatten-deps") + found.append("dependent-install") - assert "flatten-deps" in found + assert "dependent-install" in found assert "dependency-install" in found @@ -370,14 +375,14 @@ def test_ci_generate_for_pr_pipeline(ci_generate_test, tmp_path, monkeypatch): f"""\ spack: specs: - - flatten-deps + - dependent-install mirrors: buildcache-destination: {tmp_path / 'ci-mirror'} ci: pipeline-gen: - submapping: - match: - - flatten-deps + - dependent-install build-job: tags: - donotcare @@ -846,7 +851,7 @@ def test_push_to_build_cache( # Test generating buildcache index while we have bin mirror buildcache_cmd("update-index", mirror_url) - with open(mirror_dir / "build_cache" / "index.json", encoding="utf-8") as idx_fd: + with open(mirror_dir / "build_cache" / INDEX_JSON_FILE, encoding="utf-8") as idx_fd: index_object = json.load(idx_fd) jsonschema.validate(index_object, db_idx_schema) @@ -897,7 +902,7 @@ def test_ci_generate_override_runner_attrs( f"""\ spack: specs: - - flatten-deps + - dependent-install - pkg-a mirrors: buildcache-destination: {tmp_path / "ci-mirror"} @@ -906,7 +911,7 @@ def test_ci_generate_override_runner_attrs( - match_behavior: {match_behavior} submapping: - match: - - flatten-deps + - dependent-install build-job: tags: - specific-one @@ -1004,8 +1009,8 @@ def test_ci_generate_override_runner_attrs( assert the_elt["script"][0] == "main step" assert len(the_elt["after_script"]) == 1 assert the_elt["after_script"][0] == "post step one" - if "flatten-deps" in ci_key: - # The flatten-deps match specifies that we keep the two + if "dependent-install" in ci_key: + # The dependent-install match specifies that we keep the two # top level variables, but add a third specifc one. It # also adds a custom tag which should be combined with # the top-level tag. @@ -1056,15 +1061,15 @@ def test_ci_rebuild_index( with working_dir(tmp_path): env_cmd("create", "test", "./spack.yaml") with ev.read("test"): - concrete_spec = Spec("callpath").concretized() + concrete_spec = spack.concretize.concretize_one("callpath") with open(tmp_path / "spec.json", "w", encoding="utf-8") as f: f.write(concrete_spec.to_json(hash=ht.dag_hash)) - install_cmd("--add", "-f", str(tmp_path / "spec.json")) + install_cmd("--fake", "--add", "-f", str(tmp_path / "spec.json")) buildcache_cmd("push", "-u", "-f", mirror_url, "callpath") ci_cmd("rebuild-index") - with open(mirror_dir / "build_cache" / "index.json", encoding="utf-8") as f: + with open(mirror_dir / "build_cache" / INDEX_JSON_FILE, encoding="utf-8") as f: jsonschema.validate(json.load(f), db_idx_schema) @@ -1177,17 +1182,15 @@ def test_ci_generate_read_broken_specs_url( ci_base_environment, ): """Verify that `broken-specs-url` works as intended""" - spec_a = Spec("pkg-a") - spec_a.concretize() + spec_a = spack.concretize.concretize_one("pkg-a") a_dag_hash = spec_a.dag_hash() - spec_flattendeps = Spec("flatten-deps") - spec_flattendeps.concretize() + spec_flattendeps = spack.concretize.concretize_one("dependent-install") flattendeps_dag_hash = spec_flattendeps.dag_hash() broken_specs_url = tmp_path.as_uri() - # Mark 'a' as broken (but not 'flatten-deps') + # Mark 'a' as broken (but not 'dependent-install') broken_spec_a_url = "{0}/{1}".format(broken_specs_url, a_dag_hash) job_stack = "job_stack" a_job_url = "a_job_url" @@ -1201,7 +1204,7 @@ def test_ci_generate_read_broken_specs_url( f"""\ spack: specs: - - flatten-deps + - dependent-install - pkg-a mirrors: buildcache-destination: {(tmp_path / "ci-mirror").as_uri()} @@ -1211,7 +1214,7 @@ def test_ci_generate_read_broken_specs_url( - submapping: - match: - pkg-a - - flatten-deps + - dependent-install - pkg-b - dependency-install build-job: @@ -1234,7 +1237,7 @@ def test_ci_generate_read_broken_specs_url( ) assert expected in output - not_expected = f"flatten-deps/{flattendeps_dag_hash[:7]} (in stack" + not_expected = f"dependent-install/{flattendeps_dag_hash[:7]} (in stack" assert not_expected not in output @@ -1322,46 +1325,106 @@ def test_ci_reproduce( env.concretize() env.write() - repro_dir.mkdir() + def fake_download_and_extract_artifacts(url, work_dir, merge_commit_test=True): + with working_dir(tmp_path), ev.Environment(".") as env: + if not os.path.exists(repro_dir): + repro_dir.mkdir() + + job_spec = env.concrete_roots()[0] + with open(repro_dir / "archivefiles.json", "w", encoding="utf-8") as f: + f.write(job_spec.to_json(hash=ht.dag_hash)) + artifacts_root = repro_dir / "jobs_scratch_dir" + pipeline_path = artifacts_root / "pipeline.yml" + + ci_cmd( + "generate", + "--output-file", + str(pipeline_path), + "--artifacts-root", + str(artifacts_root), + ) + + job_name = gitlab_generator.get_job_name(job_spec) + + with open(repro_dir / "repro.json", "w", encoding="utf-8") as f: + f.write( + json.dumps( + { + "job_name": job_name, + "job_spec_json": "archivefiles.json", + "ci_project_dir": str(repro_dir), + } + ) + ) + + with open(repro_dir / "install.sh", "w", encoding="utf-8") as f: + f.write("#!/bin/sh\n\n#fake install\nspack install blah\n") - job_spec = env.concrete_roots()[0] - with open(repro_dir / "archivefiles.json", "w", encoding="utf-8") as f: - f.write(job_spec.to_json(hash=ht.dag_hash)) + with open(repro_dir / "spack_info.txt", "w", encoding="utf-8") as f: + if merge_commit_test: + f.write( + f"\nMerge {last_two_git_commits[1]} into {last_two_git_commits[0]}\n\n" + ) + else: + f.write(f"\ncommit {last_two_git_commits[1]}\n\n") - artifacts_root = repro_dir / "scratch_dir" - pipeline_path = artifacts_root / "pipeline.yml" + return "jobs_scratch_dir" - ci_cmd( - "generate", - "--output-file", - str(pipeline_path), - "--artifacts-root", - str(artifacts_root), + monkeypatch.setattr(ci, "download_and_extract_artifacts", fake_download_and_extract_artifacts) + rep_out = ci_cmd( + "reproduce-build", + "https://example.com/api/v1/projects/1/jobs/2/artifacts", + "--working-dir", + str(repro_dir), + output=str, + ) + # Make sure the script was generated + assert (repro_dir / "start.sh").exists() + + # Make sure we tell the user where it is when not in interactive mode + assert f"$ {repro_dir}/start.sh" in rep_out + + # Ensure the correct commits are used + assert f"checkout_commit: {last_two_git_commits[0]}" in rep_out + assert f"merge_commit: {last_two_git_commits[1]}" in rep_out + + # Test re-running in dirty working dir + with pytest.raises(SpackError, match=f"{repro_dir}"): + rep_out = ci_cmd( + "reproduce-build", + "https://example.com/api/v1/projects/1/jobs/2/artifacts", + "--working-dir", + str(repro_dir), + output=str, ) - job_name = gitlab_generator.get_job_name(job_spec) + # Cleanup between tests + shutil.rmtree(repro_dir) - with open(repro_dir / "repro.json", "w", encoding="utf-8") as f: - f.write( - json.dumps( - { - "job_name": job_name, - "job_spec_json": "archivefiles.json", - "ci_project_dir": str(repro_dir), - } - ) - ) + # Test --use-local-head + rep_out = ci_cmd( + "reproduce-build", + "https://example.com/api/v1/projects/1/jobs/2/artifacts", + "--use-local-head", + "--working-dir", + str(repro_dir), + output=str, + ) - with open(repro_dir / "install.sh", "w", encoding="utf-8") as f: - f.write("#!/bin/sh\n\n#fake install\nspack install blah\n") + # Make sure we are checkout out the HEAD commit without a merge commit + assert "checkout_commit: HEAD" in rep_out + assert "merge_commit: None" in rep_out - with open(repro_dir / "spack_info.txt", "w", encoding="utf-8") as f: - f.write(f"\nMerge {last_two_git_commits[1]} into {last_two_git_commits[0]}\n\n") + # Test the case where the spack_info.txt is not a merge commit + monkeypatch.setattr( + ci, + "download_and_extract_artifacts", + lambda url, wd: fake_download_and_extract_artifacts(url, wd, False), + ) - def fake_download_and_extract_artifacts(url, work_dir): - pass + # Cleanup between tests + shutil.rmtree(repro_dir) - monkeypatch.setattr(ci, "download_and_extract_artifacts", fake_download_and_extract_artifacts) rep_out = ci_cmd( "reproduce-build", "https://example.com/api/v1/projects/1/jobs/2/artifacts", @@ -1375,6 +1438,10 @@ def fake_download_and_extract_artifacts(url, work_dir): # Make sure we tell the user where it is when not in interactive mode assert f"$ {repro_dir}/start.sh" in rep_out + # Ensure the correct commit is used (different than HEAD) + assert f"checkout_commit: {last_two_git_commits[1]}" in rep_out + assert "merge_commit: None" in rep_out + @pytest.mark.parametrize( "url_in,url_out", @@ -1447,7 +1514,7 @@ def test_gitlab_config_scopes(ci_generate_test, tmp_path): include: [{configs_path}] view: false specs: - - flatten-deps + - dependent-install mirrors: buildcache-destination: {tmp_path / "ci-mirror"} ci: @@ -1533,8 +1600,7 @@ def dynamic_mapping_setup(tmpdir): """ ) - spec_a = Spec("pkg-a") - spec_a.concretize() + spec_a = spack.concretize.concretize_one("pkg-a") return gitlab_generator.get_job_name(spec_a) @@ -1549,10 +1615,10 @@ def test_ci_dynamic_mapping_empty( ci_base_environment, ): # The test will always return an empty dictionary - def fake_dyn_mapping_urlopener(*args, **kwargs): - return BytesIO("{}".encode()) + def _urlopen(*args, **kwargs): + return MockHTTPResponse.with_json(200, "OK", headers={}, body={}) - monkeypatch.setattr(ci.common, "_dyn_mapping_urlopener", fake_dyn_mapping_urlopener) + monkeypatch.setattr(ci.common, "_urlopen", _urlopen) _ = dynamic_mapping_setup(tmpdir) with tmpdir.as_cwd(): @@ -1573,15 +1639,15 @@ def test_ci_dynamic_mapping_full( monkeypatch, ci_base_environment, ): - # The test will always return an empty dictionary - def fake_dyn_mapping_urlopener(*args, **kwargs): - return BytesIO( - json.dumps( - {"variables": {"MY_VAR": "hello"}, "ignored_field": 0, "unallowed_field": 0} - ).encode() + def _urlopen(*args, **kwargs): + return MockHTTPResponse.with_json( + 200, + "OK", + headers={}, + body={"variables": {"MY_VAR": "hello"}, "ignored_field": 0, "unallowed_field": 0}, ) - monkeypatch.setattr(ci.common, "_dyn_mapping_urlopener", fake_dyn_mapping_urlopener) + monkeypatch.setattr(ci.common, "_urlopen", _urlopen) label = dynamic_mapping_setup(tmpdir) with tmpdir.as_cwd(): diff --git a/lib/spack/spack/test/cmd/clean.py b/lib/spack/spack/test/cmd/clean.py index 01a8d3181f0f06..91482530560778 100644 --- a/lib/spack/spack/test/cmd/clean.py +++ b/lib/spack/spack/test/cmd/clean.py @@ -10,10 +10,8 @@ import spack.caches import spack.cmd.clean -import spack.environment as ev import spack.main import spack.package_base -import spack.spec import spack.stage import spack.store @@ -69,20 +67,6 @@ def test_function_calls(command_line, effects, mock_calls_for_clean): assert mock_calls_for_clean[name] == (1 if name in effects else 0) -def test_env_aware_clean(mock_stage, install_mockery, mutable_mock_env_path, monkeypatch): - e = ev.create("test", with_view=False) - e.add("mpileaks") - e.concretize() - - def fail(*args, **kwargs): - raise Exception("This should not have been called") - - monkeypatch.setattr(spack.spec.Spec, "concretize", fail) - - with e: - clean("mpileaks") - - def test_remove_python_cache(tmpdir, monkeypatch): cache_files = ["file1.pyo", "file2.pyc"] source_file = "file1.py" diff --git a/lib/spack/spack/test/cmd/config.py b/lib/spack/spack/test/cmd/config.py index d7bcc13ab40414..3c923f35ccd90c 100644 --- a/lib/spack/spack/test/cmd/config.py +++ b/lib/spack/spack/test/cmd/config.py @@ -8,12 +8,12 @@ import llnl.util.filesystem as fs +import spack.concretize import spack.config import spack.database import spack.environment as ev import spack.main import spack.schema.config -import spack.spec import spack.store import spack.util.spack_yaml as syaml @@ -335,7 +335,7 @@ def test_config_add_override_leaf_from_file(mutable_empty_config, tmpdir): def test_config_add_update_dict_from_file(mutable_empty_config, tmpdir): - config("add", "packages:all:compiler:[gcc]") + config("add", "packages:all:require:['%gcc']") # contents to add to file contents = """spack: @@ -357,7 +357,7 @@ def test_config_add_update_dict_from_file(mutable_empty_config, tmpdir): expected = """packages: all: target: [x86_64] - compiler: [gcc] + require: ['%gcc'] """ assert expected == output @@ -593,8 +593,7 @@ def test_config_prefer_upstream( prepared_db = spack.database.Database(mock_db_root, layout=gen_mock_layout("/a/")) for spec in ["hdf5 +mpi", "hdf5 ~mpi", "boost+debug~icu+graph", "dependency-install", "patch"]: - dep = spack.spec.Spec(spec) - dep.concretize() + dep = spack.concretize.concretize_one(spec) prepared_db.add(dep) downstream_db_root = str(tmpdir_factory.mktemp("mock_downstream_db_root")) @@ -607,7 +606,6 @@ def test_config_prefer_upstream( packages = syaml.load(open(cfg_file, encoding="utf-8"))["packages"] # Make sure only the non-default variants are set. - assert packages["all"] == {"compiler": ["gcc@=10.2.1"]} assert packages["boost"] == {"variants": "+debug +graph", "version": ["1.63.0"]} assert packages["dependency-install"] == {"version": ["2.0"]} # Ensure that neither variant gets listed for hdf5, since they conflict diff --git a/lib/spack/spack/test/cmd/debug.py b/lib/spack/spack/test/cmd/debug.py index 121ac7e1f7590b..8c11e5088119ee 100644 --- a/lib/spack/spack/test/cmd/debug.py +++ b/lib/spack/spack/test/cmd/debug.py @@ -2,57 +2,21 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os -import os.path import platform -import pytest - import spack import spack.platforms import spack.spec from spack.main import SpackCommand -from spack.util.executable import which debug = SpackCommand("debug") -@pytest.mark.db -def test_create_db_tarball(tmpdir, database): - with tmpdir.as_cwd(): - debug("create-db-tarball") - - # get the first non-dotfile to avoid coverage files in the directory - files = os.listdir(os.getcwd()) - tarball_name = next( - f for f in files if not f.startswith(".") and not f.startswith("tests") - ) - - # debug command made an archive - assert os.path.exists(tarball_name) - - # print contents of archive - tar = which("tar") - contents = tar("tzf", tarball_name, output=str) - - # DB file is included - assert "index.json" in contents - - # specfiles from all installs are included - for spec in database.query(): - # externals won't have a specfile - if spec.external: - continue - - spec_suffix = "%s/.spack/spec.json" % spec.dag_hash() - assert spec_suffix in contents - - def test_report(): out = debug("report") host_platform = spack.platforms.host() - host_os = host_platform.operating_system("frontend") - host_target = host_platform.target("frontend") + host_os = host_platform.default_operating_system() + host_target = host_platform.default_target() architecture = spack.spec.ArchSpec((str(host_platform), str(host_os), str(host_target))) assert spack.get_version() in out diff --git a/lib/spack/spack/test/cmd/dependencies.py b/lib/spack/spack/test/cmd/dependencies.py index abe69bc01a5b02..e13439eba08e88 100644 --- a/lib/spack/spack/test/cmd/dependencies.py +++ b/lib/spack/spack/test/cmd/dependencies.py @@ -24,32 +24,24 @@ mpi_deps = ["fake"] -def test_direct_dependencies(mock_packages): - out = dependencies("mpileaks") - actual = set(re.split(r"\s+", out.strip())) - expected = set(["callpath"] + mpis) - assert expected == actual - - -def test_transitive_dependencies(mock_packages): - out = dependencies("--transitive", "mpileaks") - actual = set(re.split(r"\s+", out.strip())) - expected = set(["callpath", "dyninst", "libdwarf", "libelf"] + mpis + mpi_deps) - assert expected == actual - - -def test_transitive_dependencies_with_deptypes(mock_packages): - out = dependencies("--transitive", "--deptype=link,run", "dtbuild1") - deps = set(re.split(r"\s+", out.strip())) - assert set(["dtlink2", "dtrun2"]) == deps - - out = dependencies("--transitive", "--deptype=build", "dtbuild1") - deps = set(re.split(r"\s+", out.strip())) - assert set(["dtbuild2", "dtlink2"]) == deps - - out = dependencies("--transitive", "--deptype=link", "dtbuild1") - deps = set(re.split(r"\s+", out.strip())) - assert set(["dtlink2"]) == deps +@pytest.mark.parametrize( + "cli_args,expected", + [ + (["mpileaks"], set(["callpath"] + mpis)), + ( + ["--transitive", "mpileaks"], + set(["callpath", "dyninst", "libdwarf", "libelf"] + mpis + mpi_deps), + ), + (["--transitive", "--deptype=link,run", "dtbuild1"], {"dtlink2", "dtrun2"}), + (["--transitive", "--deptype=build", "dtbuild1"], {"dtbuild2", "dtlink2"}), + (["--transitive", "--deptype=link", "dtbuild1"], {"dtlink2"}), + ], +) +def test_direct_dependencies(cli_args, expected, mock_runtimes): + out = dependencies(*cli_args) + result = set(re.split(r"\s+", out.strip())) + expected.update(mock_runtimes) + assert expected == result @pytest.mark.db diff --git a/lib/spack/spack/test/cmd/deprecate.py b/lib/spack/spack/test/cmd/deprecate.py index 81da47b9759de9..76fc6aa50c706c 100644 --- a/lib/spack/spack/test/cmd/deprecate.py +++ b/lib/spack/spack/test/cmd/deprecate.py @@ -4,6 +4,7 @@ import pytest +import spack.concretize import spack.spec import spack.store from spack.enums import InstallRecordStatus @@ -16,16 +17,16 @@ def test_deprecate(mock_packages, mock_archive, mock_fetch, install_mockery): - install("libelf@0.8.13") - install("libelf@0.8.10") + install("--fake", "libelf@0.8.13") + install("--fake", "libelf@0.8.10") - all_installed = spack.store.STORE.db.query() + all_installed = spack.store.STORE.db.query("libelf") assert len(all_installed) == 2 deprecate("-y", "libelf@0.8.10", "libelf@0.8.13") - non_deprecated = spack.store.STORE.db.query() - all_available = spack.store.STORE.db.query(installed=InstallRecordStatus.ANY) + non_deprecated = spack.store.STORE.db.query("libelf") + all_available = spack.store.STORE.db.query("libelf", installed=InstallRecordStatus.ANY) assert all_available == all_installed assert non_deprecated == spack.store.STORE.db.query("libelf@0.8.13") @@ -38,24 +39,24 @@ def test_deprecate_fails_no_such_package(mock_packages, mock_archive, mock_fetch output = deprecate("-y", "libelf@0.8.10", "libelf@0.8.13", fail_on_error=False) assert "Spec 'libelf@0.8.10' matches no installed packages" in output - install("libelf@0.8.10") + install("--fake", "libelf@0.8.10") output = deprecate("-y", "libelf@0.8.10", "libelf@0.8.13", fail_on_error=False) assert "Spec 'libelf@0.8.13' matches no installed packages" in output -def test_deprecate_install(mock_packages, mock_archive, mock_fetch, install_mockery): - """Tests that the ```-i`` option allows us to deprecate in favor of a spec - that is not yet installed.""" - install("libelf@0.8.10") - - to_deprecate = spack.store.STORE.db.query() +def test_deprecate_install(mock_packages, mock_archive, mock_fetch, install_mockery, monkeypatch): + """Tests that the -i option allows us to deprecate in favor of a spec + that is not yet installed. + """ + install("--fake", "libelf@0.8.10") + to_deprecate = spack.store.STORE.db.query("libelf") assert len(to_deprecate) == 1 deprecate("-y", "-i", "libelf@0.8.10", "libelf@0.8.13") - non_deprecated = spack.store.STORE.db.query() - deprecated = spack.store.STORE.db.query(installed=InstallRecordStatus.DEPRECATED) + non_deprecated = spack.store.STORE.db.query("libelf") + deprecated = spack.store.STORE.db.query("libelf", installed=InstallRecordStatus.DEPRECATED) assert deprecated == to_deprecate assert len(non_deprecated) == 1 assert non_deprecated[0].satisfies("libelf@0.8.13") @@ -63,11 +64,11 @@ def test_deprecate_install(mock_packages, mock_archive, mock_fetch, install_mock def test_deprecate_deps(mock_packages, mock_archive, mock_fetch, install_mockery): """Test that the deprecate command deprecates all dependencies properly.""" - install("libdwarf@20130729 ^libelf@0.8.13") - install("libdwarf@20130207 ^libelf@0.8.10") + install("--fake", "libdwarf@20130729 ^libelf@0.8.13") + install("--fake", "libdwarf@20130207 ^libelf@0.8.10") - new_spec = spack.spec.Spec("libdwarf@20130729^libelf@0.8.13").concretized() - old_spec = spack.spec.Spec("libdwarf@20130207^libelf@0.8.10").concretized() + new_spec = spack.concretize.concretize_one("libdwarf@20130729^libelf@0.8.13") + old_spec = spack.concretize.concretize_one("libdwarf@20130207^libelf@0.8.10") all_installed = spack.store.STORE.db.query() @@ -80,14 +81,14 @@ def test_deprecate_deps(mock_packages, mock_archive, mock_fetch, install_mockery assert all_available == all_installed assert sorted(all_available) == sorted(deprecated + non_deprecated) - assert sorted(non_deprecated) == sorted(list(new_spec.traverse())) - assert sorted(deprecated) == sorted(list(old_spec.traverse())) + assert sorted(non_deprecated) == sorted(new_spec.traverse()) + assert sorted(deprecated) == sorted([old_spec, old_spec["libelf"]]) def test_uninstall_deprecated(mock_packages, mock_archive, mock_fetch, install_mockery): """Tests that we can still uninstall deprecated packages.""" - install("libelf@0.8.13") - install("libelf@0.8.10") + install("--fake", "libelf@0.8.13") + install("--fake", "libelf@0.8.10") deprecate("-y", "libelf@0.8.10", "libelf@0.8.13") @@ -103,38 +104,38 @@ def test_uninstall_deprecated(mock_packages, mock_archive, mock_fetch, install_m def test_deprecate_already_deprecated(mock_packages, mock_archive, mock_fetch, install_mockery): """Tests that we can re-deprecate a spec to change its deprecator.""" - install("libelf@0.8.13") - install("libelf@0.8.12") - install("libelf@0.8.10") + install("--fake", "libelf@0.8.13") + install("--fake", "libelf@0.8.12") + install("--fake", "libelf@0.8.10") - deprecated_spec = spack.spec.Spec("libelf@0.8.10").concretized() + deprecated_spec = spack.concretize.concretize_one("libelf@0.8.10") deprecate("-y", "libelf@0.8.10", "libelf@0.8.12") deprecator = spack.store.STORE.db.deprecator(deprecated_spec) - assert deprecator == spack.spec.Spec("libelf@0.8.12").concretized() + assert deprecator == spack.concretize.concretize_one("libelf@0.8.12") deprecate("-y", "libelf@0.8.10", "libelf@0.8.13") - non_deprecated = spack.store.STORE.db.query() - all_available = spack.store.STORE.db.query(installed=InstallRecordStatus.ANY) + non_deprecated = spack.store.STORE.db.query("libelf") + all_available = spack.store.STORE.db.query("libelf", installed=InstallRecordStatus.ANY) assert len(non_deprecated) == 2 assert len(all_available) == 3 deprecator = spack.store.STORE.db.deprecator(deprecated_spec) - assert deprecator == spack.spec.Spec("libelf@0.8.13").concretized() + assert deprecator == spack.concretize.concretize_one("libelf@0.8.13") def test_deprecate_deprecator(mock_packages, mock_archive, mock_fetch, install_mockery): """Tests that when a deprecator spec is deprecated, its deprecatee specs are updated to point to the new deprecator.""" - install("libelf@0.8.13") - install("libelf@0.8.12") - install("libelf@0.8.10") + install("--fake", "libelf@0.8.13") + install("--fake", "libelf@0.8.12") + install("--fake", "libelf@0.8.10") - first_deprecated_spec = spack.spec.Spec("libelf@0.8.10").concretized() - second_deprecated_spec = spack.spec.Spec("libelf@0.8.12").concretized() - final_deprecator = spack.spec.Spec("libelf@0.8.13").concretized() + first_deprecated_spec = spack.concretize.concretize_one("libelf@0.8.10") + second_deprecated_spec = spack.concretize.concretize_one("libelf@0.8.12") + final_deprecator = spack.concretize.concretize_one("libelf@0.8.13") deprecate("-y", "libelf@0.8.10", "libelf@0.8.12") @@ -143,8 +144,8 @@ def test_deprecate_deprecator(mock_packages, mock_archive, mock_fetch, install_m deprecate("-y", "libelf@0.8.12", "libelf@0.8.13") - non_deprecated = spack.store.STORE.db.query() - all_available = spack.store.STORE.db.query(installed=InstallRecordStatus.ANY) + non_deprecated = spack.store.STORE.db.query("libelf") + all_available = spack.store.STORE.db.query("libelf", installed=InstallRecordStatus.ANY) assert len(non_deprecated) == 1 assert len(all_available) == 3 @@ -157,14 +158,14 @@ def test_deprecate_deprecator(mock_packages, mock_archive, mock_fetch, install_m def test_concretize_deprecated(mock_packages, mock_archive, mock_fetch, install_mockery): """Tests that the concretizer throws an error if we concretize to a deprecated spec""" - install("libelf@0.8.13") - install("libelf@0.8.10") + install("--fake", "libelf@0.8.13") + install("--fake", "libelf@0.8.10") deprecate("-y", "libelf@0.8.10", "libelf@0.8.13") spec = spack.spec.Spec("libelf@0.8.10") with pytest.raises(spack.spec.SpecDeprecatedError): - spec.concretize() + spack.concretize.concretize_one(spec) @pytest.mark.usefixtures("mock_packages", "mock_archive", "mock_fetch", "install_mockery") diff --git a/lib/spack/spack/test/cmd/dev_build.py b/lib/spack/spack/test/cmd/dev_build.py index f5349e2015bf05..0cb048f26b43f5 100644 --- a/lib/spack/spack/test/cmd/dev_build.py +++ b/lib/spack/spack/test/cmd/dev_build.py @@ -8,6 +8,7 @@ import llnl.util.filesystem as fs +import spack.concretize import spack.environment as ev import spack.error import spack.repo @@ -23,7 +24,9 @@ def test_dev_build_basics(tmpdir, install_mockery): - spec = spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}").concretized() + spec = spack.concretize.concretize_one( + spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}") + ) assert "dev_path" in spec.variants @@ -41,7 +44,9 @@ def test_dev_build_basics(tmpdir, install_mockery): def test_dev_build_before(tmpdir, install_mockery): - spec = spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}").concretized() + spec = spack.concretize.concretize_one( + spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}") + ) with tmpdir.as_cwd(): with open(spec.package.filename, "w", encoding="utf-8") as f: @@ -57,7 +62,9 @@ def test_dev_build_before(tmpdir, install_mockery): def test_dev_build_until(tmpdir, install_mockery): - spec = spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}").concretized() + spec = spack.concretize.concretize_one( + spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}") + ) with tmpdir.as_cwd(): with open(spec.package.filename, "w", encoding="utf-8") as f: @@ -75,7 +82,9 @@ def test_dev_build_until(tmpdir, install_mockery): def test_dev_build_until_last_phase(tmpdir, install_mockery): # Test that we ignore the last_phase argument if it is already last - spec = spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}").concretized() + spec = spack.concretize.concretize_one( + spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}") + ) with tmpdir.as_cwd(): with open(spec.package.filename, "w", encoding="utf-8") as f: @@ -93,7 +102,9 @@ def test_dev_build_until_last_phase(tmpdir, install_mockery): def test_dev_build_before_until(tmpdir, install_mockery): - spec = spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}").concretized() + spec = spack.concretize.concretize_one( + spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={tmpdir}") + ) with tmpdir.as_cwd(): with open(spec.package.filename, "w", encoding="utf-8") as f: @@ -116,21 +127,21 @@ def test_dev_build_before_until(tmpdir, install_mockery): assert not_installed in out -def print_spack_cc(*args): - # Eat arguments and print environment variable to test - print(os.environ.get("CC", "")) +def _print_spack_short_spec(*args): + print(f"SPACK_SHORT_SPEC={os.environ['SPACK_SHORT_SPEC']}") def test_dev_build_drop_in(tmpdir, mock_packages, monkeypatch, install_mockery, working_env): - monkeypatch.setattr(os, "execvp", print_spack_cc) + monkeypatch.setattr(os, "execvp", _print_spack_short_spec) with tmpdir.as_cwd(): output = dev_build("-b", "edit", "--drop-in", "sh", "dev-build-test-install@0.0.0") - assert os.path.join("lib", "spack", "env") in output + assert "SPACK_SHORT_SPEC=dev-build-test-install@0.0.0" in output def test_dev_build_fails_already_installed(tmpdir, install_mockery): - spec = spack.spec.Spec("dev-build-test-install@0.0.0 dev_path=%s" % tmpdir) - spec.concretize() + spec = spack.concretize.concretize_one( + spack.spec.Spec("dev-build-test-install@0.0.0 dev_path=%s" % tmpdir) + ) with tmpdir.as_cwd(): with open(spec.package.filename, "w", encoding="utf-8") as f: @@ -168,12 +179,25 @@ def test_dev_build_fails_no_version(mock_packages): assert "dev-build spec must have a single, concrete version" in output +def test_dev_build_can_parse_path_with_at_symbol(tmpdir, install_mockery): + special_char_dir = tmpdir.mkdir("tmp@place") + spec = spack.spec.Spec(f'dev-build-test-install@0.0.0 dev_path="{special_char_dir}"') + spec.concretize() + + with special_char_dir.as_cwd(): + with open(spec.package.filename, "w", encoding="utf-8") as f: + f.write(spec.package.original_string) + dev_build("dev-build-test-install@0.0.0") + assert spec.package.filename in os.listdir(spec.prefix) + + def test_dev_build_env(tmpdir, install_mockery, mutable_mock_env_path): """Test Spack does dev builds for packages in develop section of env.""" # setup dev-build-test-install package for dev build build_dir = tmpdir.mkdir("build") - spec = spack.spec.Spec("dev-build-test-install@0.0.0 dev_path=%s" % build_dir) - spec.concretize() + spec = spack.concretize.concretize_one( + spack.spec.Spec("dev-build-test-install@0.0.0 dev_path=%s" % build_dir) + ) with build_dir.as_cwd(): with open(spec.package.filename, "w", encoding="utf-8") as f: @@ -208,8 +232,9 @@ def test_dev_build_env_with_vars(tmpdir, install_mockery, mutable_mock_env_path, """Test Spack does dev builds for packages in develop section of env (path with variables).""" # setup dev-build-test-install package for dev build build_dir = tmpdir.mkdir("build") - spec = spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={build_dir}") - spec.concretize() + spec = spack.concretize.concretize_one( + spack.spec.Spec(f"dev-build-test-install@0.0.0 dev_path={build_dir}") + ) # store the build path in an environment variable that will be used in the environment monkeypatch.setenv("CUSTOM_BUILD_PATH", build_dir) @@ -246,8 +271,9 @@ def test_dev_build_env_version_mismatch(tmpdir, install_mockery, mutable_mock_en """Test Spack constraints concretization by develop specs.""" # setup dev-build-test-install package for dev build build_dir = tmpdir.mkdir("build") - spec = spack.spec.Spec("dev-build-test-install@0.0.0 dev_path=%s" % tmpdir) - spec.concretize() + spec = spack.concretize.concretize_one( + spack.spec.Spec("dev-build-test-install@0.0.0 dev_path=%s" % tmpdir) + ) with build_dir.as_cwd(): with open(spec.package.filename, "w", encoding="utf-8") as f: @@ -327,8 +353,8 @@ def test_dev_build_multiple(tmpdir, install_mockery, mutable_mock_env_path, mock with ev.read("test"): # Do concretization inside environment for dev info # These specs are the source of truth to compare against the installs - leaf_spec.concretize() - root_spec.concretize() + leaf_spec = spack.concretize.concretize_one(leaf_spec) + root_spec = spack.concretize.concretize_one(root_spec) # Do install install() @@ -374,8 +400,8 @@ def test_dev_build_env_dependency(tmpdir, install_mockery, mock_fetch, mutable_m # concretize in the environment to get the dev build info # equivalent to setting dev_build and dev_path variants # on all specs above - spec.concretize() - dep_spec.concretize() + spec = spack.concretize.concretize_one(spec) + dep_spec = spack.concretize.concretize_one(dep_spec) install() # Ensure that both specs installed properly @@ -399,8 +425,9 @@ def test_dev_build_rebuild_on_source_changes( """ # setup dev-build-test-install package for dev build build_dir = tmpdir.mkdir("build") - spec = spack.spec.Spec("dev-build-test-install@0.0.0 dev_path=%s" % build_dir) - spec.concretize() + spec = spack.concretize.concretize_one( + spack.spec.Spec("dev-build-test-install@0.0.0 dev_path=%s" % build_dir) + ) def reset_string(): with build_dir.as_cwd(): diff --git a/lib/spack/spack/test/cmd/develop.py b/lib/spack/spack/test/cmd/develop.py index 9394987eb580ca..046d5e9d8fcb03 100644 --- a/lib/spack/spack/test/cmd/develop.py +++ b/lib/spack/spack/test/cmd/develop.py @@ -8,6 +8,7 @@ import llnl.util.filesystem as fs +import spack.concretize import spack.config import spack.environment as ev import spack.package_base @@ -138,7 +139,8 @@ def check_path(stage, dest): self.check_develop(e, spack.spec.Spec("mpich@=1.0"), path) # Check modifications actually worked - assert spack.spec.Spec("mpich@1.0").concretized().satisfies("dev_path=%s" % abspath) + result = spack.concretize.concretize_one("mpich@1.0") + assert result.satisfies("dev_path=%s" % abspath) def test_develop_canonicalize_path_no_args(self, monkeypatch): env("create", "test") @@ -165,7 +167,8 @@ def check_path(stage, dest): self.check_develop(e, spack.spec.Spec("mpich@=1.0"), path) # Check modifications actually worked - assert spack.spec.Spec("mpich@1.0").concretized().satisfies("dev_path=%s" % abspath) + result = spack.concretize.concretize_one("mpich@1.0") + assert result.satisfies("dev_path=%s" % abspath) def _git_commit_list(git_repo_dir): @@ -190,7 +193,7 @@ def test_develop_full_git_repo( spack.package_base.PackageBase, "git", "file://%s" % repo_path, raising=False ) - spec = spack.spec.Spec("git-test-commit@1.2").concretized() + spec = spack.concretize.concretize_one("git-test-commit@1.2") try: spec.package.do_stage() commits = _git_commit_list(spec.package.stage[0].source_path) @@ -213,3 +216,22 @@ def test_develop_full_git_repo( develop_dir = spec.variants["dev_path"].value commits = _git_commit_list(develop_dir) assert len(commits) > 1 + + +def test_concretize_dev_path_with_at_symbol_in_env(mutable_mock_env_path, tmpdir, mock_packages): + spec_like = "develop-test@develop" + + develop_dir = tmpdir.mkdir("build@location") + env("create", "test_at_sym") + + with ev.read("test_at_sym") as e: + add(spec_like) + develop(f"--path={develop_dir}", spec_like) + e.concretize() + result = e.concrete_roots() + + assert len(result) == 1 + cspec = result[0] + assert cspec.satisfies(spec_like), cspec + assert cspec.is_develop, cspec + assert develop_dir in cspec.variants["dev_path"], cspec diff --git a/lib/spack/spack/test/cmd/diff.py b/lib/spack/spack/test/cmd/diff.py index f07b91f0ecadcb..c077e49af14d17 100644 --- a/lib/spack/spack/test/cmd/diff.py +++ b/lib/spack/spack/test/cmd/diff.py @@ -5,9 +5,9 @@ import pytest import spack.cmd.diff +import spack.concretize import spack.main import spack.repo -import spack.spec import spack.util.spack_json as sjson from spack.test.conftest import create_test_repo @@ -133,8 +133,8 @@ def test_repo(_create_test_repo, monkeypatch, mock_stage): def test_diff_ignore(test_repo): - specA = spack.spec.Spec("p1+usev1").concretized() - specB = spack.spec.Spec("p1~usev1").concretized() + specA = spack.concretize.concretize_one("p1+usev1") + specB = spack.concretize.concretize_one("p1~usev1") c1 = spack.cmd.diff.compare_specs(specA, specB, to_string=False) @@ -154,8 +154,8 @@ def find(function_list, name, args): # Check ignoring changes on multiple packages - specA = spack.spec.Spec("p1+usev1 ^p3+p3var").concretized() - specA = spack.spec.Spec("p1~usev1 ^p3~p3var").concretized() + specA = spack.concretize.concretize_one("p1+usev1 ^p3+p3var") + specA = spack.concretize.concretize_one("p1~usev1 ^p3~p3var") c3 = spack.cmd.diff.compare_specs(specA, specB, to_string=False) assert find(c3["a_not_b"], "variant_value", ["p3", "p3var"]) @@ -168,8 +168,8 @@ def find(function_list, name, args): def test_diff_cmd(install_mockery, mock_fetch, mock_archive, mock_packages): """Test that we can install two packages and diff them""" - specA = spack.spec.Spec("mpileaks").concretized() - specB = spack.spec.Spec("mpileaks+debug").concretized() + specA = spack.concretize.concretize_one("mpileaks") + specB = spack.concretize.concretize_one("mpileaks+debug") # Specs should be the same as themselves c = spack.cmd.diff.compare_specs(specA, specA, to_string=True) @@ -194,7 +194,7 @@ def test_diff_cmd(install_mockery, mock_fetch, mock_archive, mock_packages): def test_load_first(install_mockery, mock_fetch, mock_archive, mock_packages): """Test with and without the --first option""" - install_cmd("mpileaks") + install_cmd("--fake", "mpileaks") # Only one version of mpileaks will work diff_cmd("mpileaks", "mpileaks") diff --git a/lib/spack/spack/test/cmd/env.py b/lib/spack/spack/test/cmd/env.py index 240b7cf5dceca7..c79ec42d62df13 100644 --- a/lib/spack/spack/test/cmd/env.py +++ b/lib/spack/spack/test/cmd/env.py @@ -19,6 +19,7 @@ from llnl.util.symlink import readlink import spack.cmd.env +import spack.concretize import spack.config import spack.environment as ev import spack.environment.depfile as depfile @@ -957,7 +958,7 @@ def test_lockfile_spliced_specs(environment_from_manifest, install_mockery): """Test that an environment can round-trip a spliced spec.""" # Create a local install for zmpi to splice in # Default concretization is not using zmpi - zmpi = spack.spec.Spec("zmpi").concretized() + zmpi = spack.concretize.concretize_one("zmpi") PackageInstaller([zmpi.package], fake=True).install() e1 = environment_from_manifest( @@ -1037,6 +1038,58 @@ def test_init_from_yaml(environment_from_manifest): assert not e2.specs_by_hash +def test_init_from_yaml_relative_includes(tmp_path): + files = [ + "relative_copied/packages.yaml", + "./relative_copied/compilers.yaml", + "repos.yaml", + "./config.yaml", + ] + + manifest = f""" +spack: + specs: [] + include: {files} +""" + + e1_path = tmp_path / "e1" + e1_manifest = e1_path / "spack.yaml" + fs.mkdirp(e1_path) + with open(e1_manifest, "w", encoding="utf-8") as f: + f.write(manifest) + + for f in files: + fs.touchp(e1_path / f) + + e2 = _env_create("test2", init_file=e1_manifest) + + for f in files: + assert os.path.exists(os.path.join(e2.path, f)) + + +def test_init_from_yaml_relative_includes_outside_env(tmp_path): + files = ["../outside_env_not_copied/repos.yaml"] + + manifest = f""" +spack: + specs: [] + include: {files} +""" + + # subdir to ensure parent of environment dir is not shared + e1_path = tmp_path / "e1_subdir" / "e1" + e1_manifest = e1_path / "spack.yaml" + fs.mkdirp(e1_path) + with open(e1_manifest, "w", encoding="utf-8") as f: + f.write(manifest) + + for f in files: + fs.touchp(e1_path / f) + + with pytest.raises(spack.config.ConfigFileError, match="Detected 1 missing include"): + _ = _env_create("test2", init_file=e1_manifest) + + def test_env_view_external_prefix(tmp_path, mutable_database, mock_packages): fake_prefix = tmp_path / "a-prefix" fake_bin = fake_prefix / "bin" @@ -1320,39 +1373,43 @@ def test_config_change_existing(mutable_mock_env_path, tmp_path, mock_packages, with e: # List of requirements, flip a variant config("change", "packages:mpich:require:~debug") - test_spec = spack.spec.Spec("mpich").concretized() + test_spec = spack.concretize.concretize_one("mpich") assert test_spec.satisfies("@3.0.2~debug") # List of requirements, change the version (in a different scope) config("change", "packages:mpich:require:@3.0.3") - test_spec = spack.spec.Spec("mpich").concretized() + test_spec = spack.concretize.concretize_one("mpich") assert test_spec.satisfies("@3.0.3") # "require:" as a single string, also try specifying # a spec string that requires enclosing in quotes as # part of the config path config("change", 'packages:libelf:require:"@0.8.12:"') - spack.spec.Spec("libelf@0.8.12").concretized() + spack.concretize.concretize_one("libelf@0.8.12") # No need for assert, if there wasn't a failure, we # changed the requirement successfully. # Use change to add a requirement for a package that # has no requirements defined config("change", "packages:fftw:require:+mpi") - test_spec = spack.spec.Spec("fftw").concretized() + test_spec = spack.concretize.concretize_one("fftw") assert test_spec.satisfies("+mpi") config("change", "packages:fftw:require:~mpi") - test_spec = spack.spec.Spec("fftw").concretized() + test_spec = spack.concretize.concretize_one("fftw") assert test_spec.satisfies("~mpi") config("change", "packages:fftw:require:@1.0") - test_spec = spack.spec.Spec("fftw").concretized() + test_spec = spack.concretize.concretize_one("fftw") assert test_spec.satisfies("@1.0~mpi") # Use "--match-spec" to change one spec in a "one_of" # list config("change", "packages:bowtie:require:@1.2.2", "--match-spec", "@1.2.0") - spack.spec.Spec("bowtie@1.3.0").concretize() - spack.spec.Spec("bowtie@1.2.2").concretized() + # confirm that we can concretize to either value + spack.concretize.concretize_one("bowtie@1.3.0") + spack.concretize.concretize_one("bowtie@1.2.2") + # confirm that we cannot concretize to the old value + with pytest.raises(spack.solver.asp.UnsatisfiableSpecError): + spack.concretize.concretize_one("bowtie@1.2.0") def test_config_change_new(mutable_mock_env_path, tmp_path, mock_packages, mutable_config): @@ -1367,8 +1424,8 @@ def test_config_change_new(mutable_mock_env_path, tmp_path, mock_packages, mutab with ev.Environment(tmp_path): config("change", "packages:mpich:require:~debug") with pytest.raises(spack.solver.asp.UnsatisfiableSpecError): - spack.spec.Spec("mpich+debug").concretized() - spack.spec.Spec("mpich~debug").concretized() + spack.concretize.concretize_one("mpich+debug") + spack.concretize.concretize_one("mpich~debug") # Now check that we raise an error if we need to add a require: constraint # when preexisting config manually specified it as a singular spec @@ -1382,7 +1439,7 @@ def test_config_change_new(mutable_mock_env_path, tmp_path, mock_packages, mutab """ ) with ev.Environment(tmp_path): - assert spack.spec.Spec("mpich").concretized().satisfies("@3.0.3") + assert spack.concretize.concretize_one("mpich").satisfies("@3.0.3") with pytest.raises(spack.error.ConfigError, match="not a list"): config("change", "packages:mpich:require:~debug") @@ -1690,10 +1747,13 @@ def test_stage(mock_stage, mock_fetch, install_mockery): root = str(mock_stage) def check_stage(spec): - spec = Spec(spec).concretized() + spec = spack.concretize.concretize_one(spec) for dep in spec.traverse(): stage_name = f"{stage_prefix}{dep.name}-{dep.version}-{dep.dag_hash()}" - assert os.path.isdir(os.path.join(root, stage_name)) + if dep.external: + assert not os.path.exists(os.path.join(root, stage_name)) + else: + assert os.path.isdir(os.path.join(root, stage_name)) check_stage("mpileaks") check_stage("zmpi") @@ -1791,7 +1851,7 @@ def test_indirect_build_dep(tmp_path): with spack.repo.use_repositories(builder.root): x_spec = Spec("x") - x_concretized = x_spec.concretized() + x_concretized = spack.concretize.concretize_one(x_spec) _env_create("test", with_view=False) e = ev.read("test") @@ -1824,10 +1884,10 @@ def test_store_different_build_deps(tmp_path): with spack.repo.use_repositories(builder.root): y_spec = Spec("y ^z@3") - y_concretized = y_spec.concretized() + y_concretized = spack.concretize.concretize_one(y_spec) x_spec = Spec("x ^z@2") - x_concretized = x_spec.concretized() + x_concretized = spack.concretize.concretize_one(x_spec) # Even though x chose a different 'z', the y it chooses should be identical # *aside* from the dependency on 'z'. The dag_hash() will show the difference @@ -2120,15 +2180,7 @@ def configure_reuse(reuse_mode, combined_env) -> Optional[ev.Environment]: "from_environment_raise", ], ) -def test_env_include_concrete_reuse(monkeypatch, reuse_mode): - - # The mock packages do not use the gcc-runtime - def mock_has_runtime_dependencies(*args, **kwargs): - return True - - monkeypatch.setattr( - spack.solver.asp, "_has_runtime_dependencies", mock_has_runtime_dependencies - ) +def test_env_include_concrete_reuse(do_not_check_runtimes_on_reuse, reuse_mode): # The default mpi version is 3.x provided by mpich in the mock repo. # This test verifies that concretizing with an included concrete # environment with "concretizer:reuse:true" the included @@ -2617,7 +2669,7 @@ def test_stack_yaml_remove_from_matrix_no_effect(tmpdir): - packages: - matrix: - [mpileaks, callpath] - - [target=be] + - [target=default_target] specs: - $packages """ @@ -2642,7 +2694,7 @@ def test_stack_yaml_force_remove_from_matrix(tmpdir): - packages: - matrix: - [mpileaks, callpath] - - [target=be] + - [target=default_target] specs: - $packages """ @@ -2662,7 +2714,7 @@ def test_stack_yaml_force_remove_from_matrix(tmpdir): assert before_user == after_user - mpileaks_spec = Spec("mpileaks target=be") + mpileaks_spec = Spec("mpileaks target=default_target") assert mpileaks_spec in before_conc assert mpileaks_spec not in after_conc @@ -3026,6 +3078,34 @@ def test_stack_view_activate_from_default( assert "FOOBAR=mpileaks" in shell +def test_envvar_set_in_activate(tmp_path, mock_packages, install_mockery): + spack_yaml = tmp_path / "spack.yaml" + spack_yaml.write_text( + """ +spack: + specs: + - cmake%gcc + env_vars: + set: + ENVAR_SET_IN_ENV_LOAD: "True" +""" + ) + + env("create", "test", str(spack_yaml)) + with ev.read("test"): + install("--fake") + + test_env = ev.read("test") + output = env("activate", "--sh", "test") + + assert "ENVAR_SET_IN_ENV_LOAD=True" in output + + with test_env: + with spack.util.environment.set_env(ENVAR_SET_IN_ENV_LOAD="True"): + output = env("deactivate", "--sh") + assert "unset ENVAR_SET_IN_ENV_LOAD" in output + + def test_stack_view_no_activate_without_default( installed_environment, template_combinatorial_env, tmp_path ): diff --git a/lib/spack/spack/test/cmd/extensions.py b/lib/spack/spack/test/cmd/extensions.py index e46439ceb645fc..be80ef9828cc85 100644 --- a/lib/spack/spack/test/cmd/extensions.py +++ b/lib/spack/spack/test/cmd/extensions.py @@ -5,16 +5,18 @@ import pytest +import spack.concretize from spack.installer import PackageInstaller from spack.main import SpackCommand, SpackCommandError -from spack.spec import Spec extensions = SpackCommand("extensions") @pytest.fixture def python_database(mock_packages, mutable_database): - specs = [Spec(s).concretized() for s in ["python", "py-extension1", "py-extension2"]] + specs = [ + spack.concretize.concretize_one(s) for s in ["python", "py-extension1", "py-extension2"] + ] PackageInstaller([s.package for s in specs], explicit=True, fake=True).install() yield @@ -22,7 +24,7 @@ def python_database(mock_packages, mutable_database): @pytest.mark.not_on_windows("All Fetchers Failed") @pytest.mark.db def test_extensions(mock_packages, python_database, capsys): - ext2 = Spec("py-extension2").concretized() + ext2 = spack.concretize.concretize_one("py-extension2") def check_output(ni): with capsys.disabled(): diff --git a/lib/spack/spack/test/cmd/external.py b/lib/spack/spack/test/cmd/external.py index 4fca0ecb037555..7c4b871d6b9439 100644 --- a/lib/spack/spack/test/cmd/external.py +++ b/lib/spack/spack/test/cmd/external.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import sys import pytest diff --git a/lib/spack/spack/test/cmd/find.py b/lib/spack/spack/test/cmd/find.py index 6c9efb0de7a968..9b2f2c9c773c20 100644 --- a/lib/spack/spack/test/cmd/find.py +++ b/lib/spack/spack/test/cmd/find.py @@ -12,13 +12,13 @@ import spack.cmd as cmd import spack.cmd.find +import spack.concretize import spack.environment as ev import spack.repo import spack.store import spack.user_environment as uenv from spack.enums import InstallRecordStatus from spack.main import SpackCommand -from spack.spec import Spec from spack.test.conftest import create_test_repo from spack.test.utilities import SpackCommandArgs from spack.util.pattern import Bunch @@ -201,7 +201,8 @@ def test_find_json_deps(database): @pytest.mark.db def test_display_json(database, capsys): specs = [ - Spec(s).concretized() for s in ["mpileaks ^zmpi", "mpileaks ^mpich", "mpileaks ^mpich2"] + spack.concretize.concretize_one(s) + for s in ["mpileaks ^zmpi", "mpileaks ^mpich", "mpileaks ^mpich2"] ] cmd.display_specs_as_json(specs) @@ -216,7 +217,8 @@ def test_display_json(database, capsys): @pytest.mark.db def test_display_json_deps(database, capsys): specs = [ - Spec(s).concretized() for s in ["mpileaks ^zmpi", "mpileaks ^mpich", "mpileaks ^mpich2"] + spack.concretize.concretize_one(s) + for s in ["mpileaks ^zmpi", "mpileaks ^mpich", "mpileaks ^mpich2"] ] cmd.display_specs_as_json(specs, deps=True) @@ -231,21 +233,27 @@ def test_display_json_deps(database, capsys): @pytest.mark.db def test_find_format(database, config): output = find("--format", "{name}-{^mpi.name}", "mpileaks") - assert set(output.strip().split("\n")) == set( - ["mpileaks-zmpi", "mpileaks-mpich", "mpileaks-mpich2"] - ) + assert set(output.strip().split("\n")) == { + "mpileaks-zmpi", + "mpileaks-mpich", + "mpileaks-mpich2", + } output = find("--format", "{name}-{version}-{compiler.name}-{^mpi.name}", "mpileaks") assert "installed package" not in output - assert set(output.strip().split("\n")) == set( - ["mpileaks-2.3-gcc-zmpi", "mpileaks-2.3-gcc-mpich", "mpileaks-2.3-gcc-mpich2"] - ) + assert set(output.strip().split("\n")) == { + "mpileaks-2.3-gcc-zmpi", + "mpileaks-2.3-gcc-mpich", + "mpileaks-2.3-gcc-mpich2", + } output = find("--format", "{name}-{^mpi.name}-{hash:7}", "mpileaks") elements = output.strip().split("\n") - assert set(e[:-7] for e in elements) == set( - ["mpileaks-zmpi-", "mpileaks-mpich-", "mpileaks-mpich2-"] - ) + assert set(e[:-7] for e in elements) == { + "mpileaks-zmpi-", + "mpileaks-mpich-", + "mpileaks-mpich2-", + } # hashes are in base32 for e in elements: @@ -275,7 +283,7 @@ def test_find_format_deps(database, config): def test_find_format_deps_paths(database, config): output = find("-dp", "--format", "{name}-{version}", "mpileaks", "^zmpi") - spec = Spec("mpileaks ^zmpi").concretized() + spec = spack.concretize.concretize_one("mpileaks ^zmpi") prefixes = [s.prefix for s in spec.traverse()] assert ( @@ -300,7 +308,8 @@ def test_find_very_long(database, config): output = find("-L", "--no-groups", "mpileaks") specs = [ - Spec(s).concretized() for s in ["mpileaks ^zmpi", "mpileaks ^mpich", "mpileaks ^mpich2"] + spack.concretize.concretize_one(s) + for s in ["mpileaks ^zmpi", "mpileaks ^mpich", "mpileaks ^mpich2"] ] assert set(output.strip().split("\n")) == set( @@ -345,7 +354,7 @@ def test_find_prefix_in_env( """Test `find` formats requiring concrete specs work in environments.""" env("create", "test") with ev.read("test"): - install("--add", "mpileaks") + install("--fake", "--add", "mpileaks") find("-p") find("-l") find("-L") diff --git a/lib/spack/spack/test/cmd/gc.py b/lib/spack/spack/test/cmd/gc.py index 8efdd8f2958c2f..24131b311c9dcd 100644 --- a/lib/spack/spack/test/cmd/gc.py +++ b/lib/spack/spack/test/cmd/gc.py @@ -5,6 +5,7 @@ import pytest +import spack.concretize import spack.deptypes as dt import spack.environment as ev import spack.main @@ -25,8 +26,7 @@ def test_gc_without_build_dependency(mutable_database): @pytest.mark.db def test_gc_with_build_dependency(mutable_database): - s = spack.spec.Spec("simple-inheritance") - s.concretize() + s = spack.concretize.concretize_one("simple-inheritance") PackageInstaller([s.package], explicit=True, fake=True).install() assert "There are no unused specs." in gc("-yb") @@ -36,8 +36,8 @@ def test_gc_with_build_dependency(mutable_database): @pytest.mark.db def test_gc_with_constraints(mutable_database): - s_cmake1 = spack.spec.Spec("simple-inheritance ^cmake@3.4.3").concretized() - s_cmake2 = spack.spec.Spec("simple-inheritance ^cmake@3.23.1").concretized() + s_cmake1 = spack.concretize.concretize_one("simple-inheritance ^cmake@3.4.3") + s_cmake2 = spack.concretize.concretize_one("simple-inheritance ^cmake@3.23.1") PackageInstaller([s_cmake1.package], explicit=True, fake=True).install() PackageInstaller([s_cmake2.package], explicit=True, fake=True).install() @@ -52,8 +52,7 @@ def test_gc_with_constraints(mutable_database): @pytest.mark.db def test_gc_with_environment(mutable_database, mutable_mock_env_path): - s = spack.spec.Spec("simple-inheritance") - s.concretize() + s = spack.concretize.concretize_one("simple-inheritance") PackageInstaller([s.package], explicit=True, fake=True).install() e = ev.create("test_gc") @@ -68,8 +67,7 @@ def test_gc_with_environment(mutable_database, mutable_mock_env_path): @pytest.mark.db def test_gc_with_build_dependency_in_environment(mutable_database, mutable_mock_env_path): - s = spack.spec.Spec("simple-inheritance") - s.concretize() + s = spack.concretize.concretize_one("simple-inheritance") PackageInstaller([s.package], explicit=True, fake=True).install() e = ev.create("test_gc") @@ -120,8 +118,7 @@ def test_gc_except_any_environments(mutable_database, mutable_mock_env_path): @pytest.mark.db def test_gc_except_specific_environments(mutable_database, mutable_mock_env_path): - s = spack.spec.Spec("simple-inheritance") - s.concretize() + s = spack.concretize.concretize_one("simple-inheritance") PackageInstaller([s.package], explicit=True, fake=True).install() assert mutable_database.query_local("zmpi") @@ -142,13 +139,12 @@ def test_gc_except_specific_environments(mutable_database, mutable_mock_env_path def test_gc_except_nonexisting_dir_env(mutable_database, mutable_mock_env_path, tmpdir): output = gc("-ye", tmpdir.strpath, fail_on_error=False) assert "No such environment" in output - gc.returncode == 1 + assert gc.returncode == 1 @pytest.mark.db def test_gc_except_specific_dir_env(mutable_database, mutable_mock_env_path, tmpdir): - s = spack.spec.Spec("simple-inheritance") - s.concretize() + s = spack.concretize.concretize_one("simple-inheritance") PackageInstaller([s.package], explicit=True, fake=True).install() assert mutable_database.query_local("zmpi") diff --git a/lib/spack/spack/test/cmd/install.py b/lib/spack/spack/test/cmd/install.py index 4723d1879edae1..88ec80639ac8eb 100644 --- a/lib/spack/spack/test/cmd/install.py +++ b/lib/spack/spack/test/cmd/install.py @@ -19,6 +19,7 @@ import spack.build_environment import spack.cmd.common.arguments import spack.cmd.install +import spack.concretize import spack.config import spack.environment as ev import spack.error @@ -134,7 +135,7 @@ def test_package_output(tmpdir, capsys, install_mockery, mock_fetch): # we can't use output capture here because it interferes with Spack's # logging. TODO: see whether we can get multiple log_outputs to work # when nested AND in pytest - spec = Spec("printing-package").concretized() + spec = spack.concretize.concretize_one("printing-package") pkg = spec.package PackageInstaller([pkg], explicit=True, verbose=True).install() @@ -174,7 +175,7 @@ def test_install_output_on_python_error(mock_packages, mock_archive, mock_fetch, def test_install_with_source(mock_packages, mock_archive, mock_fetch, install_mockery): """Verify that source has been copied into place.""" install("--source", "--keep-stage", "trivial-install-test-package") - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") src = os.path.join(spec.prefix.share, "trivial-install-test-package", "src") assert filecmp.cmp( os.path.join(mock_archive.path, "configure"), os.path.join(src, "configure") @@ -182,8 +183,7 @@ def test_install_with_source(mock_packages, mock_archive, mock_fetch, install_mo def test_install_env_variables(mock_packages, mock_archive, mock_fetch, install_mockery): - spec = Spec("libdwarf") - spec.concretize() + spec = spack.concretize.concretize_one("libdwarf") install("libdwarf") assert os.path.isfile(spec.package.install_env_path) @@ -204,8 +204,7 @@ def test_show_log_on_error(mock_packages, mock_archive, mock_fetch, install_mock def test_install_overwrite(mock_packages, mock_archive, mock_fetch, install_mockery): # Try to install a spec and then to reinstall it. - spec = Spec("libdwarf") - spec.concretize() + spec = spack.concretize.concretize_one("libdwarf") install("libdwarf") @@ -238,8 +237,7 @@ def test_install_overwrite(mock_packages, mock_archive, mock_fetch, install_mock def test_install_overwrite_not_installed(mock_packages, mock_archive, mock_fetch, install_mockery): # Try to install a spec and then to reinstall it. - spec = Spec("libdwarf") - spec.concretize() + spec = spack.concretize.concretize_one("libdwarf") assert not os.path.exists(spec.prefix) @@ -260,7 +258,7 @@ def test_install_commit(mock_git_version_info, install_mockery, mock_packages, m monkeypatch.setattr(spack.package_base.PackageBase, "git", file_url, raising=False) # Use the earliest commit in the respository - spec = Spec(f"git-test-commit@{commits[-1]}").concretized() + spec = spack.concretize.concretize_one(f"git-test-commit@{commits[-1]}") PackageInstaller([spec.package], explicit=True).install() # Ensure first commit file contents were written @@ -273,13 +271,11 @@ def test_install_commit(mock_git_version_info, install_mockery, mock_packages, m def test_install_overwrite_multiple(mock_packages, mock_archive, mock_fetch, install_mockery): # Try to install a spec and then to reinstall it. - libdwarf = Spec("libdwarf") - libdwarf.concretize() + libdwarf = spack.concretize.concretize_one("libdwarf") install("libdwarf") - cmake = Spec("cmake") - cmake.concretize() + cmake = spack.concretize.concretize_one("cmake") install("cmake") @@ -355,7 +351,7 @@ def test_install_invalid_spec(): ) def test_install_from_file(spec, concretize, error_code, tmpdir): if concretize: - spec.concretize() + spec = spack.concretize.concretize_one(spec) specfile = tmpdir.join("spec.yaml") @@ -485,8 +481,7 @@ def test_install_mix_cli_and_files(clispecs, filespecs, tmpdir): for spec in filespecs: filepath = tmpdir.join(spec + ".yaml") args = ["-f", str(filepath)] + args - s = Spec(spec) - s.concretize() + s = spack.concretize.concretize_one(spec) with filepath.open("w") as f: s.to_yaml(f) @@ -495,8 +490,7 @@ def test_install_mix_cli_and_files(clispecs, filespecs, tmpdir): def test_extra_files_are_archived(mock_packages, mock_archive, mock_fetch, install_mockery): - s = Spec("archive-files") - s.concretize() + s = spack.concretize.concretize_one("archive-files") install("archive-files") @@ -615,8 +609,7 @@ def test_cdash_install_from_spec_json( with capfd.disabled(), tmpdir.as_cwd(): spec_json_path = str(tmpdir.join("spec.json")) - pkg_spec = Spec("pkg-a") - pkg_spec.concretize() + pkg_spec = spack.concretize.concretize_one("pkg-a") with open(spec_json_path, "w", encoding="utf-8") as fd: fd.write(pkg_spec.to_json(hash=ht.dag_hash)) @@ -692,8 +685,8 @@ def test_cache_only_fails(tmpdir, mock_fetch, install_mockery, capfd): def test_install_only_dependencies(tmpdir, mock_fetch, install_mockery): - dep = Spec("dependency-install").concretized() - root = Spec("dependent-install").concretized() + dep = spack.concretize.concretize_one("dependency-install") + root = spack.concretize.concretize_one("dependent-install") install("--only", "dependencies", "dependent-install") @@ -714,8 +707,8 @@ def test_install_only_package(tmpdir, mock_fetch, install_mockery, capfd): def test_install_deps_then_package(tmpdir, mock_fetch, install_mockery): - dep = Spec("dependency-install").concretized() - root = Spec("dependent-install").concretized() + dep = spack.concretize.concretize_one("dependency-install") + root = spack.concretize.concretize_one("dependent-install") install("--only", "dependencies", "dependent-install") assert os.path.exists(dep.prefix) @@ -733,8 +726,8 @@ def test_install_only_dependencies_in_env( env("create", "test") with ev.read("test"): - dep = Spec("dependency-install").concretized() - root = Spec("dependent-install").concretized() + dep = spack.concretize.concretize_one("dependency-install") + root = spack.concretize.concretize_one("dependent-install") install("-v", "--only", "dependencies", "--add", "dependent-install") @@ -750,8 +743,8 @@ def test_install_only_dependencies_of_all_in_env( with ev.read("test"): roots = [ - Spec("dependent-install@1.0").concretized(), - Spec("dependent-install@2.0").concretized(), + spack.concretize.concretize_one("dependent-install@1.0"), + spack.concretize.concretize_one("dependent-install@2.0"), ] add("dependent-install@1.0") @@ -900,7 +893,7 @@ def test_cdash_configure_warning(tmpdir, mock_fetch, install_mockery, capfd): # Ensure that even on non-x86_64 architectures, there are no # dependencies installed - spec = Spec("configure-warning").concretized() + spec = spack.concretize.concretize_one("configure-warning") spec.clear_dependencies() specfile = "./spec.json" with open(specfile, "w", encoding="utf-8") as f: @@ -946,7 +939,7 @@ def test_install_env_with_tests_all( ): env("create", "test") with ev.read("test"): - test_dep = Spec("test-dependency").concretized() + test_dep = spack.concretize.concretize_one("test-dependency") add("depb") install("--test", "all") assert os.path.exists(test_dep.prefix) @@ -958,7 +951,7 @@ def test_install_env_with_tests_root( ): env("create", "test") with ev.read("test"): - test_dep = Spec("test-dependency").concretized() + test_dep = spack.concretize.concretize_one("test-dependency") add("depb") install("--test", "root") assert not os.path.exists(test_dep.prefix) diff --git a/lib/spack/spack/test/cmd/license.py b/lib/spack/spack/test/cmd/license.py index 1ece95940d174c..f516fcc53e94ec 100644 --- a/lib/spack/spack/test/cmd/license.py +++ b/lib/spack/spack/test/cmd/license.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import re import pytest diff --git a/lib/spack/spack/test/cmd/list.py b/lib/spack/spack/test/cmd/list.py index 559f481846c42f..3f9266645d4926 100644 --- a/lib/spack/spack/test/cmd/list.py +++ b/lib/spack/spack/test/cmd/list.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import sys from textwrap import dedent diff --git a/lib/spack/spack/test/cmd/load.py b/lib/spack/spack/test/cmd/load.py index d39e246aee2e96..125a8ed0325bbf 100644 --- a/lib/spack/spack/test/cmd/load.py +++ b/lib/spack/spack/test/cmd/load.py @@ -7,7 +7,7 @@ import pytest -import spack.spec +import spack.concretize import spack.user_environment as uenv from spack.main import SpackCommand @@ -26,9 +26,9 @@ def test_manpath_trailing_colon( else ("--sh", "export %s=%s", ";") ) - """Test that the commands generated by load add the MANPATH prefix - inspections. Also test that Spack correctly preserves the default/existing - manpath search path via a trailing colon""" + # Test that the commands generated by load add the MANPATH prefix + # inspections. Also test that Spack correctly preserves the default/existing + # manpath search path via a trailing colon install("mpileaks") sh_out = load(shell, "mpileaks") @@ -49,7 +49,7 @@ def test_load_shell(shell, set_command): """Test that `spack load` applies prefix inspections of its required runtime deps in topo-order""" install("mpileaks") - mpileaks_spec = spack.spec.Spec("mpileaks").concretized() + mpileaks_spec = spack.concretize.concretize_one("mpileaks") # Ensure our reference variable is clean. os.environ["CMAKE_PREFIX_PATH"] = "/hello" + os.pathsep + "/world" @@ -81,7 +81,9 @@ def extract_value(output, variable): # Finally, do we list them in topo order? for i, pkg in enumerate(pkgs): - set(s.name for s in mpileaks_spec[pkg].traverse(direction="parents")) in set(pkgs[:i]) + assert {s.name for s in mpileaks_spec[pkg].traverse(direction="parents")}.issubset( + pkgs[: i + 1] + ) # Lastly, do we keep track that mpileaks was loaded? assert ( @@ -166,7 +168,7 @@ def test_unload( """Tests that any variables set in the user environment are undone by the unload command""" install("mpileaks") - mpileaks_spec = spack.spec.Spec("mpileaks").concretized() + mpileaks_spec = spack.concretize.concretize_one("mpileaks") # Set so unload has something to do os.environ["FOOBAR"] = "mpileaks" @@ -187,7 +189,7 @@ def test_unload_fails_no_shell( ): """Test that spack unload prints an error message without a shell.""" install("mpileaks") - mpileaks_spec = spack.spec.Spec("mpileaks").concretized() + mpileaks_spec = spack.concretize.concretize_one("mpileaks") os.environ[uenv.spack_loaded_hashes_var] = mpileaks_spec.dag_hash() out = unload("mpileaks", fail_on_error=False) diff --git a/lib/spack/spack/test/cmd/location.py b/lib/spack/spack/test/cmd/location.py index dcc013710b12ea..e37d1ab60da070 100644 --- a/lib/spack/spack/test/cmd/location.py +++ b/lib/spack/spack/test/cmd/location.py @@ -8,9 +8,9 @@ from llnl.util.filesystem import mkdirp +import spack.concretize import spack.environment as ev import spack.paths -import spack.spec import spack.stage from spack.main import SpackCommand, SpackCommandError @@ -25,7 +25,7 @@ @pytest.fixture def mock_spec(): # Make it look like the source was actually expanded. - s = spack.spec.Spec("externaltest").concretized() + s = spack.concretize.concretize_one("externaltest") source_path = s.package.stage.source_path mkdirp(source_path) yield s, s.package diff --git a/lib/spack/spack/test/cmd/logs.py b/lib/spack/spack/test/cmd/logs.py index 1a5cf9932b95ba..274be40c7e64ec 100644 --- a/lib/spack/spack/test/cmd/logs.py +++ b/lib/spack/spack/test/cmd/logs.py @@ -13,6 +13,7 @@ import spack import spack.cmd.logs +import spack.concretize import spack.main import spack.spec from spack.main import SpackCommand @@ -53,7 +54,7 @@ def disable_capture(capfd): def test_logs_cmd_errors(install_mockery, mock_fetch, mock_archive, mock_packages): - spec = spack.spec.Spec("libelf").concretized() + spec = spack.concretize.concretize_one("libelf") assert not spec.installed with pytest.raises(spack.main.SpackCommandError, match="is not installed or staged"): @@ -82,7 +83,7 @@ def test_dump_logs(install_mockery, mock_fetch, mock_archive, mock_packages, dis decompress them. """ cmdline_spec = spack.spec.Spec("libelf") - concrete_spec = cmdline_spec.concretized() + concrete_spec = spack.concretize.concretize_one(cmdline_spec) # Sanity check, make sure this test is checking what we want: to # start with diff --git a/lib/spack/spack/test/cmd/mirror.py b/lib/spack/spack/test/cmd/mirror.py index 2780b31cb40c6e..48bae87f66c352 100644 --- a/lib/spack/spack/test/cmd/mirror.py +++ b/lib/spack/spack/test/cmd/mirror.py @@ -7,6 +7,7 @@ import pytest import spack.cmd.mirror +import spack.concretize import spack.config import spack.environment as ev import spack.error @@ -60,7 +61,7 @@ def test_mirror_from_env(tmp_path, mock_packages, mock_fetch, mutable_mock_env_p @pytest.fixture def source_for_pkg_with_hash(mock_packages, tmpdir): - s = spack.spec.Spec("trivial-pkg-with-valid-hash").concretized() + s = spack.concretize.concretize_one("trivial-pkg-with-valid-hash") local_url_basename = os.path.basename(s.package.url) local_path = os.path.join(str(tmpdir), local_url_basename) with open(local_path, "w", encoding="utf-8") as f: @@ -72,7 +73,9 @@ def source_for_pkg_with_hash(mock_packages, tmpdir): def test_mirror_skip_unstable(tmpdir_factory, mock_packages, config, source_for_pkg_with_hash): mirror_dir = str(tmpdir_factory.mktemp("mirror-dir")) - specs = [spack.spec.Spec(x).concretized() for x in ["git-test", "trivial-pkg-with-valid-hash"]] + specs = [ + spack.concretize.concretize_one(x) for x in ["git-test", "trivial-pkg-with-valid-hash"] + ] spack.mirrors.utils.create(mirror_dir, specs, skip_unstable_versions=True) assert set(os.listdir(mirror_dir)) - set(["_source-cache"]) == set( @@ -111,7 +114,7 @@ def test_exclude_specs(mock_packages, config): mirror_specs, _ = spack.cmd.mirror._specs_and_action(args) expected_include = set( - spack.spec.Spec(x).concretized() for x in ["mpich@3.0.3", "mpich@3.0.4", "mpich@3.0"] + spack.concretize.concretize_one(x) for x in ["mpich@3.0.3", "mpich@3.0.4", "mpich@3.0"] ) expected_exclude = set(spack.spec.Spec(x) for x in ["mpich@3.0.1", "mpich@3.0.2", "mpich@1.0"]) assert expected_include <= set(mirror_specs) @@ -145,7 +148,7 @@ def test_exclude_file(mock_packages, tmpdir, config): mirror_specs, _ = spack.cmd.mirror._specs_and_action(args) expected_include = set( - spack.spec.Spec(x).concretized() for x in ["mpich@3.0.3", "mpich@3.0.4", "mpich@3.0"] + spack.concretize.concretize_one(x) for x in ["mpich@3.0.3", "mpich@3.0.4", "mpich@3.0"] ) expected_exclude = set(spack.spec.Spec(x) for x in ["mpich@3.0.1", "mpich@3.0.2", "mpich@1.0"]) assert expected_include <= set(mirror_specs) diff --git a/lib/spack/spack/test/cmd/module.py b/lib/spack/spack/test/cmd/module.py index 6b8fd716b4d00f..271159fd8dd13d 100644 --- a/lib/spack/spack/test/cmd/module.py +++ b/lib/spack/spack/test/cmd/module.py @@ -2,17 +2,17 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import re import pytest +import spack.concretize import spack.config import spack.main import spack.modules import spack.modules.lmod import spack.repo -import spack.spec import spack.store from spack.installer import PackageInstaller @@ -33,7 +33,7 @@ def ensure_module_files_are_there(mock_repo_path, mock_store, mock_configuration def _module_files(module_type, *specs): - specs = [spack.spec.Spec(x).concretized() for x in specs] + specs = [spack.concretize.concretize_one(x) for x in specs] writer_cls = spack.modules.module_types[module_type] return [writer_cls(spec, "default").layout.filename for spec in specs] @@ -184,12 +184,15 @@ def test_setdefault_command(mutable_database, mutable_config): # Install two different versions of pkg-a other_spec, preferred = "pkg-a@1.0", "pkg-a@2.0" - specs = [spack.spec.Spec(other_spec).concretized(), spack.spec.Spec(preferred).concretized()] + specs = [ + spack.concretize.concretize_one(other_spec), + spack.concretize.concretize_one(preferred), + ] PackageInstaller([s.package for s in specs], explicit=True, fake=True).install() writers = { - preferred: writer_cls(spack.spec.Spec(preferred).concretized(), "default"), - other_spec: writer_cls(spack.spec.Spec(other_spec).concretized(), "default"), + preferred: writer_cls(specs[1], "default"), + other_spec: writer_cls(specs[0], "default"), } # Create two module files for the same software diff --git a/lib/spack/spack/test/cmd/repo.py b/lib/spack/spack/test/cmd/repo.py index 02878ec97559ed..3cb35ef09e489b 100644 --- a/lib/spack/spack/test/cmd/repo.py +++ b/lib/spack/spack/test/cmd/repo.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import pytest diff --git a/lib/spack/spack/test/cmd/style.py b/lib/spack/spack/test/cmd/style.py index 6cbd97456d820f..9a21deff67833d 100644 --- a/lib/spack/spack/test/cmd/style.py +++ b/lib/spack/spack/test/cmd/style.py @@ -304,6 +304,8 @@ def test_run_import_check(tmp_path: pathlib.Path): contents = ''' import spack.cmd import spack.config # do not drop this import because of this comment +import spack.repo +import spack.repo_utils # this comment about spack.error should not be removed class Example(spack.build_systems.autotools.AutotoolsPackage): @@ -314,6 +316,7 @@ def foo(config: "spack.error.SpackError"): # the type hint is quoted, so it should not be removed spack.util.executable.Executable("example") print(spack.__version__) + print(spack.repo_utils.__file__) ''' file.write_text(contents) root = str(tmp_path) @@ -329,6 +332,7 @@ def foo(config: "spack.error.SpackError"): output = output_buf.getvalue() assert "issues.py: redundant import: spack.cmd" in output + assert "issues.py: redundant import: spack.repo" in output assert "issues.py: redundant import: spack.config" not in output # comment prevents removal assert "issues.py: missing import: spack" in output # used by spack.__version__ assert "issues.py: missing import: spack.build_systems.autotools" in output diff --git a/lib/spack/spack/test/cmd/tags.py b/lib/spack/spack/test/cmd/tags.py index 04940560468f04..dd435f90316892 100644 --- a/lib/spack/spack/test/cmd/tags.py +++ b/lib/spack/spack/test/cmd/tags.py @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import spack.concretize import spack.main import spack.repo -import spack.spec from spack.installer import PackageInstaller tags = spack.main.SpackCommand("tags") @@ -47,7 +47,7 @@ class tag_path: def test_tags_installed(install_mockery, mock_fetch): - s = spack.spec.Spec("mpich").concretized() + s = spack.concretize.concretize_one("mpich") PackageInstaller([s.package], explicit=True, fake=True).install() out = tags("-i") diff --git a/lib/spack/spack/test/cmd/test.py b/lib/spack/spack/test/cmd/test.py index 12165445a87423..38abd1adf5105d 100644 --- a/lib/spack/spack/test/cmd/test.py +++ b/lib/spack/spack/test/cmd/test.py @@ -11,10 +11,10 @@ import spack.cmd.common.arguments import spack.cmd.test +import spack.concretize import spack.config import spack.install_test import spack.paths -import spack.spec from spack.install_test import TestStatus from spack.main import SpackCommand @@ -240,7 +240,7 @@ def test_read_old_results(mock_packages, mock_test_stage): def test_test_results_none(mock_packages, mock_test_stage): name = "trivial" - spec = spack.spec.Spec("trivial-smoke-test").concretized() + spec = spack.concretize.concretize_one("trivial-smoke-test") suite = spack.install_test.TestSuite([spec], name) suite.ensure_stage() spack.install_test.write_test_suite_file(suite) @@ -255,7 +255,7 @@ def test_test_results_none(mock_packages, mock_test_stage): def test_test_results_status(mock_packages, mock_test_stage, status): """Confirm 'spack test results' returns expected status.""" name = "trivial" - spec = spack.spec.Spec("trivial-smoke-test").concretized() + spec = spack.concretize.concretize_one("trivial-smoke-test") suite = spack.install_test.TestSuite([spec], name) suite.ensure_stage() spack.install_test.write_test_suite_file(suite) @@ -278,7 +278,7 @@ def test_test_results_status(mock_packages, mock_test_stage, status): def test_report_filename_for_cdash(install_mockery, mock_fetch): """Test that the temporary file used to write Testing.xml for CDash is not the upload URL""" name = "trivial" - spec = spack.spec.Spec("trivial-smoke-test").concretized() + spec = spack.concretize.concretize_one("trivial-smoke-test") suite = spack.install_test.TestSuite([spec], name) suite.ensure_stage() diff --git a/lib/spack/spack/test/cmd/undevelop.py b/lib/spack/spack/test/cmd/undevelop.py index 77bb84ec5030e4..b21f48aa6416dc 100644 --- a/lib/spack/spack/test/cmd/undevelop.py +++ b/lib/spack/spack/test/cmd/undevelop.py @@ -1,8 +1,8 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import spack.concretize import spack.environment as ev -import spack.spec from spack.main import SpackCommand undevelop = SpackCommand("undevelop") @@ -30,9 +30,9 @@ def test_undevelop(tmpdir, mutable_config, mock_packages, mutable_mock_env_path) env("create", "test", "./spack.yaml") with ev.read("test"): - before = spack.spec.Spec("mpich").concretized() + before = spack.concretize.concretize_one("mpich") undevelop("mpich") - after = spack.spec.Spec("mpich").concretized() + after = spack.concretize.concretize_one("mpich") # Removing dev spec from environment changes concretization assert before.satisfies("dev_path=*") diff --git a/lib/spack/spack/test/cmd/verify.py b/lib/spack/spack/test/cmd/verify.py index de495ba377a0dd..5ada2fe9f8eaf8 100644 --- a/lib/spack/spack/test/cmd/verify.py +++ b/lib/spack/spack/test/cmd/verify.py @@ -4,19 +4,31 @@ """Tests for the `spack verify` command""" import os +import platform + +import pytest import llnl.util.filesystem as fs -import spack.spec +import spack.cmd.verify +import spack.concretize +import spack.installer import spack.store +import spack.util.executable import spack.util.spack_json as sjson import spack.verify -from spack.main import SpackCommand +from spack.main import SpackCommand, SpackCommandError verify = SpackCommand("verify") install = SpackCommand("install") +def skip_unless_linux(f): + return pytest.mark.skipif( + str(platform.system()) != "Linux", reason="only tested on linux for now" + )(f) + + def test_single_file_verify_cmd(tmpdir): # Test the verify command interface to verifying a single file. filedir = os.path.join(str(tmpdir), "a", "b", "c", "d") @@ -36,7 +48,7 @@ def test_single_file_verify_cmd(tmpdir): with open(manifest_file, "w", encoding="utf-8") as f: sjson.dump({filepath: data}, f) - results = verify("-f", filepath, fail_on_error=False) + results = verify("manifest", "-f", filepath, fail_on_error=False) print(results) assert not results @@ -44,7 +56,7 @@ def test_single_file_verify_cmd(tmpdir): with open(filepath, "w", encoding="utf-8") as f: f.write("I changed.") - results = verify("-f", filepath, fail_on_error=False) + results = verify("manifest", "-f", filepath, fail_on_error=False) expected = ["hash"] mtime = os.stat(filepath).st_mtime @@ -55,7 +67,7 @@ def test_single_file_verify_cmd(tmpdir): assert filepath in results assert all(x in results for x in expected) - results = verify("-fj", filepath, fail_on_error=False) + results = verify("manifest", "-fj", filepath, fail_on_error=False) res = sjson.load(results) assert len(res) == 1 errors = res.pop(filepath) @@ -65,22 +77,72 @@ def test_single_file_verify_cmd(tmpdir): def test_single_spec_verify_cmd(tmpdir, mock_packages, mock_archive, mock_fetch, install_mockery): # Test the verify command interface to verify a single spec install("libelf") - s = spack.spec.Spec("libelf").concretized() + s = spack.concretize.concretize_one("libelf") prefix = s.prefix hash = s.dag_hash() - results = verify("/%s" % hash, fail_on_error=False) + results = verify("manifest", "/%s" % hash, fail_on_error=False) assert not results new_file = os.path.join(prefix, "new_file_for_verify_test") with open(new_file, "w", encoding="utf-8") as f: f.write("New file") - results = verify("/%s" % hash, fail_on_error=False) + results = verify("manifest", "/%s" % hash, fail_on_error=False) assert new_file in results assert "added" in results - results = verify("-j", "/%s" % hash, fail_on_error=False) + results = verify("manifest", "-j", "/%s" % hash, fail_on_error=False) res = sjson.load(results) assert len(res) == 1 assert res[new_file] == ["added"] + + +@pytest.mark.requires_executables("gcc") +@skip_unless_linux +def test_libraries(tmp_path, install_mockery, mock_fetch): + gcc = spack.util.executable.which("gcc", required=True) + s = spack.concretize.concretize_one("libelf") + spack.installer.PackageInstaller([s.package]).install() + os.mkdir(s.prefix.bin) + + # There are no ELF files so the verification should pass + verify("libraries", f"/{s.dag_hash()}") + + # Now put main_with_rpath linking to libf.so inside the prefix and verify again. This should + # work because libf.so can be located in the rpath. + (tmp_path / "f.c").write_text("void f(void){return;}") + (tmp_path / "main.c").write_text("void f(void); int main(void){f();return 0;}") + + gcc("-shared", "-fPIC", "-o", str(tmp_path / "libf.so"), str(tmp_path / "f.c")) + gcc( + "-o", + str(s.prefix.bin.main_with_rpath), + str(tmp_path / "main.c"), + "-L", + str(tmp_path), + f"-Wl,-rpath,{tmp_path}", + "-lf", + ) + verify("libraries", f"/{s.dag_hash()}") + + # Now put main_without_rpath linking to libf.so inside the prefix and verify again. This should + # fail because libf.so cannot be located in the rpath. + gcc( + "-o", + str(s.prefix.bin.main_without_rpath), + str(tmp_path / "main.c"), + "-L", + str(tmp_path), + "-lf", + ) + + with pytest.raises(SpackCommandError): + verify("libraries", f"/{s.dag_hash()}") + + # Check the error message + msg = spack.cmd.verify._verify_libraries(s, []) + assert msg is not None and "libf.so => not found" in msg + + # And check that we can make it pass by ignoring it. + assert spack.cmd.verify._verify_libraries(s, ["libf.so"]) is None diff --git a/lib/spack/spack/test/cmd/view.py b/lib/spack/spack/test/cmd/view.py index f5eeba183335c8..1ff3556a871179 100644 --- a/lib/spack/spack/test/cmd/view.py +++ b/lib/spack/spack/test/cmd/view.py @@ -2,17 +2,17 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import sys import pytest from llnl.util.symlink import _windows_can_symlink +import spack.concretize import spack.util.spack_yaml as s_yaml from spack.installer import PackageInstaller from spack.main import SpackCommand -from spack.spec import Spec extensions = SpackCommand("extensions") install = SpackCommand("install") @@ -190,7 +190,7 @@ def test_view_fails_with_missing_projections_file(tmpdir): def test_view_files_not_ignored( tmpdir, mock_packages, mock_archive, mock_fetch, install_mockery, cmd, with_projection ): - spec = Spec("view-not-ignored").concretized() + spec = spack.concretize.concretize_one("view-not-ignored") pkg = spec.package PackageInstaller([pkg], explicit=True).install() pkg.assert_installed(spec.prefix) diff --git a/lib/spack/spack/test/concretization/compiler_runtimes.py b/lib/spack/spack/test/concretization/compiler_runtimes.py index cf8101daa591a5..1276158700949e 100644 --- a/lib/spack/spack/test/concretization/compiler_runtimes.py +++ b/lib/spack/spack/test/concretization/compiler_runtimes.py @@ -8,6 +8,7 @@ import archspec.cpu +import spack.concretize import spack.config import spack.paths import spack.repo @@ -20,7 +21,7 @@ def _concretize_with_reuse(*, root_str, reused_str): - reused_spec = spack.spec.Spec(reused_str).concretized() + reused_spec = spack.concretize.concretize_one(reused_str) setup = spack.solver.asp.SpackSolverSetup(tests=False) driver = spack.solver.asp.PyclingoDriver() result, _, _ = driver.solve(setup, [spack.spec.Spec(f"{root_str}")], reuse=[reused_spec]) @@ -44,7 +45,7 @@ def enable_runtimes(): def test_correct_gcc_runtime_is_injected_as_dependency(runtime_repo): - s = spack.spec.Spec("pkg-a%gcc@10.2.1 ^pkg-b%gcc@9.4.0").concretized() + s = spack.concretize.concretize_one("pkg-a%gcc@10.2.1 ^pkg-b%gcc@9.4.0") a, b = s["pkg-a"], s["pkg-b"] # Both a and b should depend on the same gcc-runtime directly @@ -61,7 +62,7 @@ def test_external_nodes_do_not_have_runtimes(runtime_repo, mutable_config, tmp_p packages_yaml = {"pkg-b": {"externals": [{"spec": "pkg-b@1.0", "prefix": f"{str(tmp_path)}"}]}} spack.config.set("packages", packages_yaml) - s = spack.spec.Spec("pkg-a%gcc@10.2.1").concretized() + s = spack.concretize.concretize_one("pkg-a%gcc@10.2.1") a, b = s["pkg-a"], s["pkg-b"] diff --git a/lib/spack/spack/test/concretization/core.py b/lib/spack/spack/test/concretization/core.py index 3f10a7e0eca4fd..23b8df55e6d3a4 100644 --- a/lib/spack/spack/test/concretization/core.py +++ b/lib/spack/spack/test/concretization/core.py @@ -68,7 +68,7 @@ def check_spec(abstract, concrete): def check_concretize(abstract_spec): abstract = Spec(abstract_spec) - concrete = abstract.concretized() + concrete = spack.concretize.concretize_one(abstract) assert not abstract.concrete assert concrete.concrete check_spec(abstract, concrete) @@ -148,7 +148,6 @@ def current_host(request, monkeypatch): cpu, _, is_preference = request.param.partition("-") monkeypatch.setattr(spack.platforms.Test, "default", cpu) - monkeypatch.setattr(spack.platforms.Test, "front_end", cpu) if not is_preference: target = archspec.cpu.TARGETS[cpu] monkeypatch.setattr(archspec.cpu, "host", lambda: target) @@ -385,10 +384,13 @@ def test_different_compilers_get_different_flags( ): """Tests that nodes get the flags of the associated compiler.""" mutable_config.set("compilers", [clang12_with_flags, gcc11_with_flags]) - client = Spec( - "cmake-client %gcc@11.1.0 platform=test os=fe target=fe" - " ^cmake %clang@12.2.0 platform=test os=fe target=fe" - ).concretized() + t = archspec.cpu.host().family + client = spack.concretize.concretize_one( + Spec( + f"cmake-client %gcc@11.1.0 platform=test os=redhat6 target={t}" + f" ^cmake %clang@12.2.0 platform=test os=redhat6 target={t}" + ) + ) cmake = client["cmake"] assert set(client.compiler_flags["cflags"]) == {"-O0", "-g"} assert set(cmake.compiler_flags["cflags"]) == {"-O3"} @@ -403,7 +405,7 @@ def test_spec_flags_maintain_order(self, mutable_config, gcc11_with_flags): mutable_config.set("compilers", [gcc11_with_flags]) spec_str = "libelf %gcc@11.1.0 os=redhat6" for _ in range(3): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert all( s.compiler_flags[x] == ["-O0", "-g"] for x in ("cflags", "cxxflags", "fflags") ) @@ -411,7 +413,8 @@ def test_spec_flags_maintain_order(self, mutable_config, gcc11_with_flags): def test_compiler_flags_differ_identical_compilers(self, mutable_config, clang12_with_flags): mutable_config.set("compilers", [clang12_with_flags]) # Correct arch to use test compiler that has flags - spec = Spec("pkg-a %clang@12.2.0 platform=test os=fe target=fe") + t = archspec.cpu.host().family + spec = Spec(f"pkg-a %clang@12.2.0 platform=test os=redhat6 target={t}") # Get the compiler that matches the spec ( compiler = spack.compilers.compiler_for_spec("clang@=12.2.0", spec.architecture) @@ -422,7 +425,7 @@ def test_compiler_flags_differ_identical_compilers(self, mutable_config, clang12 different_dict["compiler"]["flags"] = {"cflags": "-O2"} with spack.config.override("compilers", [different_dict]): - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("cflags=-O2") @pytest.mark.parametrize( @@ -457,7 +460,7 @@ def test_compiler_flags_differ_identical_compilers(self, mutable_config, clang12 ], ) def test_compiler_flag_propagation(self, spec_str, expected, not_expected): - root = Spec(spec_str).concretized() + root = spack.concretize.concretize_one(spec_str) for constraint in expected: assert root.satisfies(constraint) @@ -467,12 +470,12 @@ def test_compiler_flag_propagation(self, spec_str, expected, not_expected): def test_mixing_compilers_only_affects_subdag(self): spack.config.set("packages:all:compiler", ["clang", "gcc"]) - spec = Spec("dt-diamond%gcc ^dt-diamond-bottom%clang").concretized() + spec = spack.concretize.concretize_one("dt-diamond%gcc ^dt-diamond-bottom%clang") for dep in spec.traverse(): assert ("%clang" in dep) == (dep.name == "dt-diamond-bottom") def test_compiler_inherited_upwards(self): - spec = Spec("dt-diamond ^dt-diamond-bottom%clang").concretized() + spec = spack.concretize.concretize_one("dt-diamond ^dt-diamond-bottom%clang") for dep in spec.traverse(): assert "%clang" in dep @@ -486,50 +489,50 @@ def test_architecture_deep_inheritance(self, mock_targets, compiler_factory): del cnl_compiler["compiler"]["target"] with spack.config.override("compilers", [cnl_compiler]): spec_str = "mpileaks %gcc@4.5.0 os=CNL target=nocona ^dyninst os=CNL ^callpath os=CNL" - spec = Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) for s in spec.traverse(root=False): assert s.architecture.target == spec.architecture.target def test_compiler_flags_from_user_are_grouped(self): spec = Spec('pkg-a%gcc cflags="-O -foo-flag foo-val" platform=test') - spec.concretize() + spec = spack.concretize.concretize_one(spec) cflags = spec.compiler_flags["cflags"] assert any(x == "-foo-flag foo-val" for x in cflags) def concretize_multi_provider(self): s = Spec("mpileaks ^multi-provider-mpi@3.0") - s.concretize() + s = spack.concretize.concretize_one(s) assert s["mpi"].version == ver("1.10.3") def test_concretize_dependent_with_singlevalued_variant_type(self): s = Spec("singlevalue-variant-dependent-type") - s.concretize() + s = spack.concretize.concretize_one(s) @pytest.mark.parametrize("spec,version", [("dealii", "develop"), ("xsdk", "0.4.0")]) def concretize_difficult_packages(self, a, b): """Test a couple of large packages that are often broken due to current limitations in the concretizer""" s = Spec(a + "@" + b) - s.concretize() + s = spack.concretize.concretize_one(s) assert s[a].version == ver(b) def test_concretize_two_virtuals(self): """Test a package with multiple virtual dependencies.""" - Spec("hypre").concretize() + spack.concretize.concretize_one("hypre") def test_concretize_two_virtuals_with_one_bound(self, mutable_mock_repo): """Test a package with multiple virtual dependencies and one preset.""" - Spec("hypre ^openblas").concretize() + spack.concretize.concretize_one("hypre ^openblas") def test_concretize_two_virtuals_with_two_bound(self): """Test a package with multiple virtual deps and two of them preset.""" - Spec("hypre ^openblas ^netlib-lapack").concretize() + spack.concretize.concretize_one("hypre ^netlib-lapack") def test_concretize_two_virtuals_with_dual_provider(self): """Test a package with multiple virtual dependencies and force a provider that provides both. """ - Spec("hypre ^openblas-with-lapack").concretize() + spack.concretize.concretize_one("hypre ^openblas-with-lapack") def test_concretize_two_virtuals_with_dual_provider_and_a_conflict(self): """Test a package with multiple virtual dependencies and force a @@ -538,7 +541,7 @@ def test_concretize_two_virtuals_with_dual_provider_and_a_conflict(self): """ s = Spec("hypre ^openblas-with-lapack ^netlib-lapack") with pytest.raises(spack.error.SpackError): - s.concretize() + spack.concretize.concretize_one(s) @pytest.mark.parametrize( "spec_str,expected_propagation", @@ -559,7 +562,7 @@ def test_concretize_two_virtuals_with_dual_provider_and_a_conflict(self): ) def test_concretize_propagate_disabled_variant(self, spec_str, expected_propagation): """Tests various patterns of boolean variant propagation""" - spec = Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) for key, expected_satisfies in expected_propagation: spec[key].satisfies(expected_satisfies) @@ -567,7 +570,7 @@ def test_concretize_propagate_variant_not_dependencies(self): """Test that when propagating a variant it is not propagated to dependencies that do not have that variant""" spec = Spec("quantum-espresso~~invino") - spec.concretize() + spec = spack.concretize.concretize_one(spec) for dep in spec.traverse(root=False): assert "invino" not in dep.variants.keys() @@ -577,21 +580,21 @@ def test_concretize_propagate_variant_exclude_dependency_fail(self): the source package's dependencies""" spec = Spec("hypre ~~shared ^openblas +shared") with pytest.raises(spack.error.UnsatisfiableSpecError): - spec.concretize() + spec = spack.concretize.concretize_one(spec) def test_concretize_propagate_same_variant_from_direct_dep_fail(self): """Test that when propagating a variant from the source package and a direct dependency also propagates the same variant with a different value. Raises error""" spec = Spec("ascent +adios2 ++shared ^adios2 ~~shared") with pytest.raises(spack.error.UnsatisfiableSpecError): - spec.concretize() + spec = spack.concretize.concretize_one(spec) def test_concretize_propagate_same_variant_in_dependency_fail(self): """Test that when propagating a variant from the source package, none of it's dependencies can propagate that variant with a different value. Raises error.""" spec = Spec("ascent +adios2 ++shared ^bzip2 ~~shared") with pytest.raises(spack.error.UnsatisfiableSpecError): - spec.concretize() + spec = spack.concretize.concretize_one(spec) def test_concretize_propagate_same_variant_virtual_dependency_fail(self): """Test that when propagating a variant from the source package and a direct @@ -599,19 +602,19 @@ def test_concretize_propagate_same_variant_virtual_dependency_fail(self): different value. Raises error""" spec = Spec("hypre ++shared ^openblas ~~shared") with pytest.raises(spack.error.UnsatisfiableSpecError): - spec.concretize() + spec = spack.concretize.concretize_one(spec) def test_concretize_propagate_same_variant_multiple_sources_diamond_dep_fail(self): """Test that fails when propagating the same variant with different values from multiple sources that share a dependency""" spec = Spec("parent-foo-bar ^dependency-foo-bar++bar ^direct-dep-foo-bar~~bar") with pytest.raises(spack.error.UnsatisfiableSpecError): - spec.concretize() + spec = spack.concretize.concretize_one(spec) def test_concretize_propagate_specified_variant(self): """Test that only the specified variant is propagated to the dependencies""" spec = Spec("parent-foo-bar ~~foo") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("^dependency-foo-bar~foo") assert spec.satisfies("^second-dependency-foo-bar-fee~foo") @@ -624,7 +627,7 @@ def test_concretize_propagate_specified_variant(self): def test_concretize_propagate_one_variant(self): """Test that you can specify to propagate one variant and not all""" spec = Spec("parent-foo-bar ++bar ~foo") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("~foo") and not spec.satisfies("^dependency-foo-bar~foo") assert spec.satisfies("+bar") and spec.satisfies("^dependency-foo-bar+bar") @@ -633,7 +636,7 @@ def test_concretize_propagate_through_first_level_deps(self): """Test that boolean valued variants can be propagated past first level dependecies even if the first level dependency does have the variant""" spec = Spec("parent-foo-bar-fee ++fee") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("+fee") and not spec.satisfies("dependency-foo-bar+fee") assert spec.satisfies("^second-dependency-foo-bar-fee+fee") @@ -642,7 +645,7 @@ def test_concretize_propagate_multiple_variants(self): """Test that multiple boolean valued variants can be propagated from the same source package""" spec = Spec("parent-foo-bar-fee ~~foo ++bar") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("~foo") and spec.satisfies("+bar") assert spec.satisfies("^dependency-foo-bar ~foo +bar") @@ -652,7 +655,7 @@ def test_concretize_propagate_multiple_variants_mulitple_sources(self): """Test the propagates multiple different variants for multiple sources in a diamond dependency""" spec = Spec("parent-foo-bar ^dependency-foo-bar++bar ^direct-dep-foo-bar~~foo") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("^second-dependency-foo-bar-fee+bar") assert spec.satisfies("^second-dependency-foo-bar-fee~foo") @@ -662,7 +665,7 @@ def test_concretize_propagate_multiple_variants_mulitple_sources(self): def test_concretize_propagate_single_valued_variant(self): """Test propagation for single valued variants""" spec = Spec("multivalue-variant libs==static") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("libs=static") assert spec.satisfies("^pkg-a libs=static") @@ -671,7 +674,7 @@ def test_concretize_propagate_multivalue_variant(self): """Test that multivalue variants are propagating the specified value(s) to their dependecies. The dependencies should not have the default value""" spec = Spec("multivalue-variant foo==baz,fee") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("^pkg-a foo=baz,fee") assert spec.satisfies("^pkg-b foo=baz,fee") @@ -682,7 +685,7 @@ def test_concretize_propagate_multiple_multivalue_variant(self): """Tests propagating the same mulitvalued variant from different sources allows the dependents to accept all propagated values""" spec = Spec("multivalue-variant foo==bar ^pkg-a foo==baz") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("multivalue-variant foo=bar") assert spec.satisfies("^pkg-a foo=bar,baz") @@ -692,7 +695,7 @@ def test_concretize_propagate_variant_not_in_source(self): """Test that variant is still propagated even if the source pkg doesn't have the variant""" spec = Spec("callpath++debug") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("^mpich+debug") assert not spec.satisfies("callpath+debug") @@ -702,7 +705,7 @@ def test_concretize_propagate_variant_multiple_deps_not_in_source(self): """Test that a variant can be propagated to multiple dependencies when the variant is not in the source package""" spec = Spec("netlib-lapack++shared") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("^openblas+shared") assert spec.satisfies("^perl+shared") @@ -713,22 +716,22 @@ def test_concretize_propagate_variant_second_level_dep_not_in_source(self): when the variant is not in the source package or any of the first level dependencies""" spec = Spec("parent-foo-bar ++fee") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec.satisfies("^second-dependency-foo-bar-fee +fee") assert not spec.satisfies("parent-foo-bar +fee") - def test_no_matching_compiler_specs(self, mock_low_high_config): + def test_no_matching_compiler_specs(self): # only relevant when not building compilers as needed with spack.concretize.enable_compiler_existence_check(): s = Spec("pkg-a %gcc@=0.0.0") with pytest.raises(spack.concretize.UnavailableCompilerVersionError): - s.concretize() + s = spack.concretize.concretize_one(s) def test_no_compilers_for_arch(self): s = Spec("pkg-a arch=linux-rhel0-x86_64") with pytest.raises(spack.error.SpackError): - s.concretize() + s = spack.concretize.concretize_one(s) def test_virtual_is_fully_expanded_for_callpath(self): # force dependence on fake "zmpi" by asking for MPI 10.0 @@ -736,7 +739,7 @@ def test_virtual_is_fully_expanded_for_callpath(self): assert len(spec.dependencies(name="mpi")) == 1 assert "fake" not in spec - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert len(spec.dependencies(name="zmpi")) == 1 assert all(not d.dependencies(name="mpi") for d in spec.traverse()) assert all(x in spec for x in ("zmpi", "mpi")) @@ -750,7 +753,7 @@ def test_virtual_is_fully_expanded_for_mpileaks(self): assert len(spec.dependencies(name="mpi")) == 1 assert "fake" not in spec - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert len(spec.dependencies(name="zmpi")) == 1 assert len(spec.dependencies(name="callpath")) == 1 @@ -766,13 +769,13 @@ def test_virtual_is_fully_expanded_for_mpileaks(self): @pytest.mark.parametrize("compiler_str", ["clang", "gcc", "gcc@10.2.1", "clang@:15.0.0"]) def test_compiler_inheritance(self, compiler_str): spec_str = "mpileaks %{0}".format(compiler_str) - spec = Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) assert spec["libdwarf"].compiler.satisfies(compiler_str) assert spec["libelf"].compiler.satisfies(compiler_str) def test_external_package(self): spec = Spec("externaltool%gcc") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec["externaltool"].external_path == os.path.sep + os.path.join( "path", "to", "external_tool" ) @@ -785,12 +788,12 @@ def test_nobuild_package(self): """ spec = Spec("externaltool%clang") with pytest.raises(spack.error.SpecError): - spec.concretize() + spec = spack.concretize.concretize_one(spec) def test_external_and_virtual(self, mutable_config): mutable_config.set("packages:stuff", {"buildable": False}) spec = Spec("externaltest") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert spec["externaltool"].external_path == os.path.sep + os.path.join( "path", "to", "external_tool" ) @@ -802,26 +805,26 @@ def test_external_and_virtual(self, mutable_config): def test_compiler_child(self): s = Spec("mpileaks%clang target=x86_64 ^dyninst%gcc") - s.concretize() + s = spack.concretize.concretize_one(s) assert s["mpileaks"].satisfies("%clang") assert s["dyninst"].satisfies("%gcc") def test_conflicts_in_spec(self, conflict_spec): s = Spec(conflict_spec) with pytest.raises(spack.error.SpackError): - s.concretize() + s = spack.concretize.concretize_one(s) def test_conflicts_show_cores(self, conflict_spec, monkeypatch): s = Spec(conflict_spec) with pytest.raises(spack.error.SpackError) as e: - s.concretize() + s = spack.concretize.concretize_one(s) assert "conflict" in e.value.message def test_conflict_in_all_directives_true(self): s = Spec("when-directives-true") with pytest.raises(spack.error.SpackError): - s.concretize() + s = spack.concretize.concretize_one(s) @pytest.mark.parametrize("spec_str", ["conflict@10.0%clang+foo"]) def test_no_conflict_in_external_specs(self, spec_str): @@ -830,7 +833,7 @@ def test_no_conflict_in_external_specs(self, spec_str): ext = Spec(spec_str) data = {"externals": [{"spec": spec_str, "prefix": "/fake/path"}]} spack.config.set("packages::{0}".format(ext.name), data) - ext.concretize() # failure raises exception + ext = spack.concretize.concretize_one(ext) # failure raises exception def test_regression_issue_4492(self): # Constructing a spec which has no dependencies, but is otherwise @@ -839,7 +842,7 @@ def test_regression_issue_4492(self): # cache values. s = Spec("mpileaks") - s.concretize() + s = spack.concretize.concretize_one(s) # Check that now the Spec is concrete, store the hash assert s.concrete @@ -857,7 +860,7 @@ def test_regression_issue_7239(self): # Normal Spec s = Spec("mpileaks") - s.concretize() + s = spack.concretize.concretize_one(s) assert llnl.util.lang.ObjectWrapper not in s.__class__.__mro__ @@ -874,7 +877,7 @@ def test_regression_issue_7705(self): # spec.package.provides(name) doesn't account for conditional # constraints in the concretized spec s = Spec("simple-inheritance~openblas") - s.concretize() + s = spack.concretize.concretize_one(s) assert not s.package.provides("lapack") @@ -886,8 +889,8 @@ def test_regression_issue_7941(self): s = Spec("pkg-a foobar=bar ^pkg-b") t = Spec(str(s)) - s.concretize() - t.concretize() + s = spack.concretize.concretize_one(s) + t = spack.concretize.concretize_one(t) assert s.dag_hash() == t.dag_hash() @@ -908,7 +911,7 @@ def test_regression_issue_7941(self): ) def test_simultaneous_concretization_of_specs(self, abstract_specs): abstract_specs = [Spec(x) for x in abstract_specs] - concrete_specs = spack.concretize.concretize_specs_together(abstract_specs) + concrete_specs = spack.concretize._concretize_specs_together(abstract_specs) # Check there's only one configuration of each package in the DAG names = set(dep.name for spec in concrete_specs for dep in spec.traverse()) @@ -929,7 +932,7 @@ def test_simultaneous_concretization_of_specs(self, abstract_specs): def test_noversion_pkg(self, spec): """Test concretization failures for no-version packages.""" with pytest.raises(spack.error.SpackError): - Spec(spec).concretized() + spack.concretize.concretize_one(spec) @pytest.mark.not_on_windows("Not supported on Windows (yet)") # Include targets to prevent regression on 20537 @@ -949,29 +952,33 @@ def test_adjusting_default_target_based_on_compiler( best_achievable = archspec.cpu.TARGETS[best_achievable] expected = best_achievable if best_achievable < current_host else current_host with spack.concretize.disable_compiler_existence_check(): - s = Spec(spec).concretized() + s = spack.concretize.concretize_one(spec) assert str(s.architecture.target) == str(expected) def test_compiler_version_matches_any_entry_in_compilers_yaml(self): # The behavior here has changed since #8735 / #14730. Now %gcc@10.2 is an abstract # compiler spec, and it should first find a matching compiler gcc@=10.2.1 - assert Spec("mpileaks %gcc@10.2").concretized().compiler == CompilerSpec("gcc@=10.2.1") - assert Spec("mpileaks %gcc@10.2:").concretized().compiler == CompilerSpec("gcc@=10.2.1") + assert spack.concretize.concretize_one( + Spec("mpileaks %gcc@10.2") + ).compiler == CompilerSpec("gcc@=10.2.1") + assert spack.concretize.concretize_one( + Spec("mpileaks %gcc@10.2:") + ).compiler == CompilerSpec("gcc@=10.2.1") # This compiler does not exist with pytest.raises(spack.concretize.UnavailableCompilerVersionError): - Spec("mpileaks %gcc@=10.2").concretized() + spack.concretize.concretize_one("mpileaks %gcc@=10.2") def test_concretize_anonymous(self): with pytest.raises(spack.error.SpackError): s = Spec("+variant") - s.concretize() + s = spack.concretize.concretize_one(s) @pytest.mark.parametrize("spec_str", ["mpileaks ^%gcc", "mpileaks ^cflags=-g"]) def test_concretize_anonymous_dep(self, spec_str): with pytest.raises(spack.error.SpackError): s = Spec(spec_str) - s.concretize() + s = spack.concretize.concretize_one(s) @pytest.mark.parametrize( "spec_str,expected_str", @@ -988,7 +995,7 @@ def test_compiler_conflicts_in_package_py( self, spec_str, expected_str, clang12_with_flags, gcc11_with_flags ): with spack.config.override("compilers", [clang12_with_flags, gcc11_with_flags]): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert s.satisfies(expected_str) @pytest.mark.parametrize( @@ -1009,7 +1016,7 @@ def test_compiler_conflicts_in_package_py( ], ) def test_conditional_variants(self, spec_str, expected, unexpected): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for var in expected: assert s.satisfies("%s=*" % var) @@ -1029,7 +1036,7 @@ def test_conditional_variants_fail(self, bad_spec): with pytest.raises( (spack.error.UnsatisfiableSpecError, spack.spec.InvalidVariantForSpecError) ): - _ = Spec("conditional-variant-pkg" + bad_spec).concretized() + _ = spack.concretize.concretize_one("conditional-variant-pkg" + bad_spec) @pytest.mark.parametrize( "spec_str,expected,unexpected", @@ -1050,7 +1057,7 @@ def test_conditional_dependencies(self, spec_str, expected, unexpected, fuzz_dep """ fuzz_dep_order("py-extension3") # test forwards and backwards - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for dep in expected: msg = '"{0}" is not in "{1}" and was expected' @@ -1074,7 +1081,7 @@ def test_conditional_dependencies(self, spec_str, expected, unexpected, fuzz_dep ], ) def test_patching_dependencies(self, spec_str, patched_deps): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for dep, num_patches in patched_deps: assert s[dep].satisfies("patches=*") @@ -1102,7 +1109,7 @@ def test_patching_dependencies(self, spec_str, patched_deps): ], ) def test_working_around_conflicting_defaults(self, spec_str, expected): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert s.concrete for constraint in expected: @@ -1122,7 +1129,7 @@ def test_external_package_and_compiler_preferences(self, spec_str, expected, mut }, } mutable_config.set("packages", packages_yaml) - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert s.external for condition in expected: @@ -1138,13 +1145,13 @@ def test_package_with_constraint_not_met_by_external(self): spack.config.set("packages", packages_yaml) # quantum-espresso+veritas requires libelf@:0.8.12 - s = Spec("quantum-espresso+veritas").concretized() + s = spack.concretize.concretize_one("quantum-espresso+veritas") assert s.satisfies("^libelf@0.8.12") assert not s["libelf"].external @pytest.mark.regression("9744") def test_cumulative_version_ranges_with_different_length(self): - s = Spec("cumulative-vrange-root").concretized() + s = spack.concretize.concretize_one("cumulative-vrange-root") assert s.concrete assert s.satisfies("^cumulative-vrange-bottom@2.2") @@ -1154,15 +1161,15 @@ def test_dependency_conditional_on_another_dependency_state(self): dep_str = "variant-on-dependency-condition-a" spec_str = "{0} ^{1}".format(root_str, dep_str) - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert s.concrete assert s.satisfies("^variant-on-dependency-condition-b") - s = Spec(spec_str + "+x").concretized() + s = spack.concretize.concretize_one(spec_str + "+x") assert s.concrete assert s.satisfies("^variant-on-dependency-condition-b") - s = Spec(spec_str + "~x").concretized() + s = spack.concretize.concretize_one(spec_str + "~x") assert s.concrete assert not s.satisfies("^variant-on-dependency-condition-b") @@ -1176,7 +1183,7 @@ def test_compiler_constraint_with_external_package(self, spec_str, expected): } spack.config.set("packages", packages_yaml) - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert s.external assert s.satisfies(expected) @@ -1213,12 +1220,12 @@ def test_compiler_in_nonbuildable_external_package( } spack.config.set("packages", packages_yaml) - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert s.satisfies(expected) assert "external-common-perl" not in [d.name for d in s.dependencies()] def test_external_that_would_require_a_virtual_dependency(self): - s = Spec("requires-virtual").concretized() + s = spack.concretize.concretize_one("requires-virtual") assert s.external assert "stuff" not in s @@ -1226,7 +1233,7 @@ def test_external_that_would_require_a_virtual_dependency(self): def test_transitive_conditional_virtual_dependency(self, mutable_config): """Test that an external is used as provider if the virtual is non-buildable""" mutable_config.set("packages:stuff", {"buildable": False}) - s = Spec("transitive-conditional-virtual-dependency").concretized() + s = spack.concretize.concretize_one("transitive-conditional-virtual-dependency") # Test that the default +stuff~mpi is maintained, and the right provider is selected assert s.satisfies("^conditional-virtual-dependency +stuff~mpi") @@ -1236,7 +1243,7 @@ def test_transitive_conditional_virtual_dependency(self, mutable_config): def test_conditional_provides_or_depends_on(self): # Check that we can concretize correctly a spec that can either # provide a virtual or depend on it based on the value of a variant - s = Spec("conditional-provider +disable-v1").concretized() + s = spack.concretize.concretize_one("v1-consumer ^conditional-provider +disable-v1") assert "v1-provider" in s assert s["v1"].name == "v1-provider" assert s["v2"].name == "conditional-provider" @@ -1258,7 +1265,7 @@ def test_conditional_provides_or_depends_on(self): ], ) def test_activating_test_dependencies(self, spec_str, tests_arg, with_dep, without_dep): - s = Spec(spec_str).concretized(tests=tests_arg) + s = spack.concretize.concretize_one(spec_str, tests=tests_arg) for pkg_name in with_dep: msg = "Cannot find test dependency in package '{0}'" @@ -1280,22 +1287,24 @@ def test_compiler_match_is_preferred_to_newer_version(self, compiler_factory): "compilers", [compiler_factory(spec="gcc@10.1.0", operating_system="redhat6")] ): spec_str = "simple-inheritance+openblas %gcc@10.1.0 os=redhat6" - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert "openblas@0.2.15" in s assert s["openblas"].satisfies("%gcc@10.1.0") @pytest.mark.regression("19981") def test_target_ranges_in_conflicts(self): with pytest.raises(spack.error.SpackError): - Spec("impossible-concretization").concretized() + spack.concretize.concretize_one("impossible-concretization") def test_target_compatibility(self): with pytest.raises(spack.error.SpackError): - Spec("libdwarf target=x86_64 ^libelf target=x86_64_v2").concretized() + spack.concretize.concretize_one( + Spec("libdwarf target=x86_64 ^libelf target=x86_64_v2") + ) @pytest.mark.regression("20040") def test_variant_not_default(self): - s = Spec("ecp-viz-sdk").concretized() + s = spack.concretize.concretize_one("ecp-viz-sdk") # Check default variant value for the package assert "+dep" in s["conditional-constrained-dependencies"] @@ -1310,7 +1319,7 @@ def test_custom_compiler_version(self, mutable_config, compiler_factory, monkeyp "compilers", [compiler_factory(spec="gcc@10foo", operating_system="redhat6")] ) monkeypatch.setattr(spack.compiler.Compiler, "real_version", "10.2.1") - s = Spec("pkg-a %gcc@10foo os=redhat6").concretized() + s = spack.concretize.concretize_one("pkg-a %gcc@10foo os=redhat6") assert "%gcc@10foo" in s def test_all_patches_applied(self): @@ -1321,11 +1330,11 @@ def test_all_patches_applied(self): ) localpatch = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" spec = Spec("conditionally-patch-dependency+jasper") - spec.concretize() + spec = spack.concretize.concretize_one(spec) assert (uuidpatch, localpatch) == spec["libelf"].variants["patches"].value def test_dont_select_version_that_brings_more_variants_in(self): - s = Spec("dep-with-variants-if-develop-root").concretized() + s = spack.concretize.concretize_one("dep-with-variants-if-develop-root") assert s["dep-with-variants-if-develop"].satisfies("@1.0") @pytest.mark.regression("20244,20736") @@ -1352,7 +1361,7 @@ def test_dont_select_version_that_brings_more_variants_in(self): ], ) def test_external_package_versions(self, spec_str, is_external, expected): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert s.external == is_external assert s.satisfies(expected) @@ -1381,7 +1390,7 @@ def test_reuse_does_not_overwrite_dev_specs( second_spec = spec if dev_first else dev_spec # concretize and setup spack to reuse in the appropriate manner - first_spec.concretize() + first_spec = spack.concretize.concretize_one(first_spec) def mock_fn(*args, **kwargs): return [first_spec] @@ -1393,7 +1402,7 @@ def mock_fn(*args, **kwargs): # concretize and ensure we did not reuse with spack.config.override("concretizer:reuse", True): - second_spec.concretize() + second_spec = spack.concretize.concretize_one(second_spec) assert first_spec.dag_hash() != second_spec.dag_hash() @pytest.mark.regression("20292") @@ -1412,7 +1421,7 @@ def test_reuse_installed_packages_when_package_def_changes( spack.config.set("concretizer:reuse", False) # Install a spec - root = Spec("root").concretized() + root = spack.concretize.concretize_one("root") dependency = root["changing"].copy() PackageInstaller([root.package], fake=True, explicit=True).install() @@ -1420,9 +1429,11 @@ def test_reuse_installed_packages_when_package_def_changes( repo_with_changing_recipe.change(context) # Try to concretize with the spec installed previously - new_root_with_reuse = Spec("root ^/{0}".format(dependency.dag_hash())).concretized() + new_root_with_reuse = spack.concretize.concretize_one( + Spec("root ^/{0}".format(dependency.dag_hash())) + ) - new_root_without_reuse = Spec("root").concretized() + new_root_without_reuse = spack.concretize.concretize_one("root") # validate that the graphs are the same with reuse, but not without assert ht.build_hash(root) == ht.build_hash(new_root_with_reuse) @@ -1439,23 +1450,23 @@ def test_no_reuse_when_variant_condition_does_not_hold(self, mutable_database, m spack.config.set("concretizer:reuse", True) # Install a spec for which the `version_based` variant condition does not hold - old = Spec("conditional-variant-pkg @1").concretized() + old = spack.concretize.concretize_one("conditional-variant-pkg @1") PackageInstaller([old.package], fake=True, explicit=True).install() # Then explicitly require a spec with `+version_based`, which shouldn't reuse previous spec - new1 = Spec("conditional-variant-pkg +version_based").concretized() + new1 = spack.concretize.concretize_one("conditional-variant-pkg +version_based") assert new1.satisfies("@2 +version_based") - new2 = Spec("conditional-variant-pkg +two_whens").concretized() + new2 = spack.concretize.concretize_one("conditional-variant-pkg +two_whens") assert new2.satisfies("@2 +two_whens +version_based") def test_reuse_with_flags(self, mutable_database, mutable_config): spack.config.set("concretizer:reuse", True) - spec = Spec("pkg-a cflags=-g cxxflags=-g").concretized() + spec = spack.concretize.concretize_one("pkg-a cflags=-g cxxflags=-g") PackageInstaller([spec.package], fake=True, explicit=True).install() testspec = Spec("pkg-a cflags=-g") - testspec.concretize() + testspec = spack.concretize.concretize_one(testspec) assert testspec == spec @pytest.mark.regression("20784") @@ -1463,7 +1474,7 @@ def test_concretization_of_test_dependencies(self): # With clingo we emit dependency_conditions regardless of the type # of the dependency. We need to ensure that there's at least one # dependency type declared to infer that the dependency holds. - s = Spec("test-dep-with-imposed-conditions").concretized() + s = spack.concretize.concretize_one("test-dep-with-imposed-conditions") assert "c" not in s @pytest.mark.parametrize( @@ -1472,7 +1483,7 @@ def test_concretization_of_test_dependencies(self): def test_error_message_for_inconsistent_variants(self, spec_str): s = Spec(spec_str) with pytest.raises(vt.UnknownVariantError): - s.concretize() + s = spack.concretize.concretize_one(s) @pytest.mark.regression("22533") @pytest.mark.parametrize( @@ -1487,7 +1498,7 @@ def test_error_message_for_inconsistent_variants(self, spec_str): ], ) def test_mv_variants_disjoint_sets_from_spec(self, spec_str, variant_name, expected_values): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert set(expected_values) == set(s.variants[variant_name].value) @pytest.mark.regression("22533") @@ -1500,14 +1511,14 @@ def test_mv_variants_disjoint_sets_from_packages_yaml(self): } spack.config.set("packages", external_mvapich2) - s = Spec("mvapich2").concretized() + s = spack.concretize.concretize_one("mvapich2") assert set(s.variants["file_systems"].value) == set(["ufs", "nfs"]) @pytest.mark.regression("22596") def test_external_with_non_default_variant_as_dependency(self): # This package depends on another that is registered as an external # with 'buildable: true' and a variant with a non-default value set - s = Spec("trigger-external-non-default-variant").concretized() + s = spack.concretize.concretize_one("trigger-external-non-default-variant") assert "~foo" in s["external-non-default-variant"] assert "~bar" in s["external-non-default-variant"] @@ -1531,7 +1542,7 @@ def test_os_selection_when_multiple_choices_are_possible( with spack.config.override( "compilers", [compiler_factory(spec="gcc@10.2.1", operating_system="redhat6")] ): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for node in s.traverse(): if node.name == "glibc": continue @@ -1543,7 +1554,7 @@ def test_os_selection_when_multiple_choices_are_possible( [("mpileaks", "%gcc@10.2.1"), ("mpileaks ^mpich%clang@15.0.0", "%clang@15.0.0")], ) def test_compiler_is_unique(self, spec_str, expected_compiler): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for node in s.traverse(): assert node.satisfies(expected_compiler) @@ -1558,7 +1569,7 @@ def test_compiler_is_unique(self, spec_str, expected_compiler): ], ) def test_multivalued_variants_from_cli(self, spec_str, expected_dict): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for constraint, value in expected_dict.items(): assert s.satisfies(constraint) == value @@ -1575,7 +1586,7 @@ def test_multivalued_variants_from_cli(self, spec_str, expected_dict): ) def test_deprecated_versions_not_selected(self, spec_str, expected): with spack.config.override("config:deprecated", True): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) s.satisfies(expected) @pytest.mark.regression("24196") @@ -1584,7 +1595,7 @@ def test_version_badness_more_important_than_default_mv_variants(self): # a transitive dependency with a multi-valued variant, that old # version was preferred because of the order of our optimization # criteria. - s = Spec("root").concretized() + s = spack.concretize.concretize_one("root") assert s["gmt"].satisfies("@2.0") @pytest.mark.regression("24205") @@ -1593,7 +1604,7 @@ def test_provider_must_meet_requirements(self): # requirements are met. s = Spec("unsat-virtual-dependency") with pytest.raises((RuntimeError, spack.error.UnsatisfiableSpecError)): - s.concretize() + s = spack.concretize.concretize_one(s) @pytest.mark.regression("23951") def test_newer_dependency_adds_a_transitive_virtual(self): @@ -1605,7 +1616,7 @@ def test_newer_dependency_adds_a_transitive_virtual(self): # root@1.0 <- middle@1.0 <- leaf@1.0 # # and "blas" is pulled in only by newer versions of "leaf" - s = Spec("root-adds-virtual").concretized() + s = spack.concretize.concretize_one("root-adds-virtual") assert s["leaf-adds-virtual"].satisfies("@2.0") assert "blas" in s @@ -1613,12 +1624,12 @@ def test_newer_dependency_adds_a_transitive_virtual(self): def test_versions_in_virtual_dependencies(self): # Ensure that a package that needs a given version of a virtual # package doesn't end up using a later implementation - s = Spec("hpcviewer@2019.02").concretized() + s = spack.concretize.concretize_one("hpcviewer@2019.02") assert s["java"].satisfies("virtual-with-versions@1.8.0") @pytest.mark.regression("26866") def test_non_default_provider_of_multiple_virtuals(self): - s = Spec("many-virtual-consumer ^low-priority-provider").concretized() + s = spack.concretize.concretize_one("many-virtual-consumer ^low-priority-provider") assert s["mpi"].name == "low-priority-provider" assert s["lapack"].name == "low-priority-provider" @@ -1641,7 +1652,7 @@ def test_concrete_specs_are_not_modified_on_reuse( # like additional constraints being added to concrete specs in # the answer set produced by clingo. with spack.config.override("concretizer:reuse", True): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert s.installed is expect_installed assert s.satisfies(spec_str) @@ -1652,12 +1663,12 @@ def test_sticky_variant_in_package(self): # to have +allow-gcc set to be concretized with %gcc and clingo is not allowed # to change the default ~allow-gcc with pytest.raises(spack.error.SpackError): - Spec("sticky-variant %gcc").concretized() + spack.concretize.concretize_one("sticky-variant %gcc") - s = Spec("sticky-variant+allow-gcc %gcc").concretized() + s = spack.concretize.concretize_one("sticky-variant+allow-gcc %gcc") assert s.satisfies("%gcc") and s.satisfies("+allow-gcc") - s = Spec("sticky-variant %clang").concretized() + s = spack.concretize.concretize_one("sticky-variant %clang") assert s.satisfies("%clang") and s.satisfies("~allow-gcc") @pytest.mark.regression("42172") @@ -1676,7 +1687,7 @@ def test_sticky_variant_in_external(self, spec, allow_gcc): maybe = llnl.util.lang.nullcontext if allow_gcc else pytest.raises with maybe(spack.error.SpackError): - s = Spec("sticky-variant-dependent%gcc").concretized() + s = spack.concretize.concretize_one("sticky-variant-dependent%gcc") if allow_gcc: assert s.satisfies("%gcc") @@ -1686,10 +1697,10 @@ def test_sticky_variant_in_external(self, spec, allow_gcc): def test_do_not_invent_new_concrete_versions_unless_necessary(self): # ensure we select a known satisfying version rather than creating # a new '2.7' version. - assert ver("=2.7.11") == Spec("python@2.7").concretized().version + assert ver("=2.7.11") == spack.concretize.concretize_one("python@2.7").version # Here there is no known satisfying version - use the one on the spec. - assert ver("=2.7.21") == Spec("python@=2.7.21").concretized().version + assert ver("=2.7.21") == spack.concretize.concretize_one("python@=2.7.21").version @pytest.mark.parametrize( "spec_str,valid", @@ -1708,14 +1719,14 @@ def test_conditional_values_in_variants(self, spec_str, valid): s = Spec(spec_str) raises = pytest.raises((RuntimeError, spack.error.UnsatisfiableSpecError)) with llnl.util.lang.nullcontext() if valid else raises: - s.concretize() + s = spack.concretize.concretize_one(s) def test_conditional_values_in_conditional_variant(self): """Test that conditional variants play well with conditional possible values""" - s = Spec("conditional-values-in-variant@1.50.0").concretized() + s = spack.concretize.concretize_one("conditional-values-in-variant@1.50.0") assert "cxxstd" not in s.variants - s = Spec("conditional-values-in-variant@1.60.0").concretized() + s = spack.concretize.concretize_one("conditional-values-in-variant@1.60.0") assert "cxxstd" in s.variants def test_target_granularity(self): @@ -1724,9 +1735,9 @@ def test_target_granularity(self): default_target = spack.platforms.test.Test.default generic_target = archspec.cpu.TARGETS[default_target].generic.name s = Spec("python") - assert s.concretized().satisfies("target=%s" % default_target) + assert spack.concretize.concretize_one(s).satisfies("target=%s" % default_target) with spack.config.override("concretizer:targets", {"granularity": "generic"}): - assert s.concretized().satisfies("target=%s" % generic_target) + assert spack.concretize.concretize_one(s).satisfies("target=%s" % generic_target) def test_host_compatible_concretization(self): # Check that after setting "host_compatible" to false we cannot concretize. @@ -1735,16 +1746,16 @@ def test_host_compatible_concretization(self): # is that the defaults for the test platform are very old, so there's no # compiler supporting e.g. icelake etc. s = Spec("python target=k10") - assert s.concretized() + assert spack.concretize.concretize_one(s) with spack.config.override("concretizer:targets", {"host_compatible": True}): with pytest.raises(spack.error.SpackError): - s.concretized() + spack.concretize.concretize_one(s) def test_add_microarchitectures_on_explicit_request(self): # Check that if we consider only "generic" targets, we can still solve for # specific microarchitectures on explicit requests with spack.config.override("concretizer:targets", {"granularity": "generic"}): - s = Spec("python target=k10").concretized() + s = spack.concretize.concretize_one("python target=k10") assert s.satisfies("target=k10") @pytest.mark.regression("29201") @@ -1752,12 +1763,12 @@ def test_delete_version_and_reuse(self, mutable_database, repo_with_changing_rec """Test that we can reuse installed specs with versions not declared in package.py """ - root = Spec("root").concretized() + root = spack.concretize.concretize_one("root") PackageInstaller([root.package], fake=True, explicit=True).install() repo_with_changing_recipe.change({"delete_version": True}) with spack.config.override("concretizer:reuse", True): - new_root = Spec("root").concretized() + new_root = spack.concretize.concretize_one("root") assert root.dag_hash() == new_root.dag_hash() @@ -1770,12 +1781,12 @@ def test_installed_version_is_selected_only_for_reuse( """ # Install a dependency that cannot be reused with "root" # because of a conflict in a variant, then delete its version - dependency = Spec("changing@1.0~foo").concretized() + dependency = spack.concretize.concretize_one("changing@1.0~foo") PackageInstaller([dependency.package], fake=True, explicit=True).install() repo_with_changing_recipe.change({"delete_version": True}) with spack.config.override("concretizer:reuse", True): - new_root = Spec("root").concretized() + new_root = spack.concretize.concretize_one("root") assert not new_root["changing"].satisfies("@1.0") @@ -1784,12 +1795,12 @@ def test_reuse_with_unknown_namespace_dont_raise( self, temporary_store, mock_custom_repository ): with spack.repo.use_repositories(mock_custom_repository, override=False): - s = Spec("pkg-c").concretized() + s = spack.concretize.concretize_one("pkg-c") assert s.namespace != "builtin.mock" PackageInstaller([s.package], fake=True, explicit=True).install() with spack.config.override("concretizer:reuse", True): - s = Spec("pkg-c").concretized() + s = spack.concretize.concretize_one("pkg-c") assert s.namespace == "builtin.mock" @pytest.mark.regression("45538") @@ -1797,12 +1808,12 @@ def test_reuse_from_other_namespace_no_raise(self, tmpdir, temporary_store, monk myrepo = spack.repo.MockRepositoryBuilder(tmpdir.mkdir("mock.repo"), namespace="myrepo") myrepo.add_package("zlib") - builtin = Spec("zlib").concretized() + builtin = spack.concretize.concretize_one("zlib") PackageInstaller([builtin.package], fake=True, explicit=True).install() with spack.repo.use_repositories(myrepo.root, override=False): with spack.config.override("concretizer:reuse", True): - myrepo = Spec("myrepo.zlib").concretized() + myrepo = spack.concretize.concretize_one("myrepo.zlib") assert myrepo.namespace == "myrepo" @@ -1811,7 +1822,7 @@ def test_reuse_with_unknown_package_dont_raise(self, tmpdir, temporary_store, mo builder = spack.repo.MockRepositoryBuilder(tmpdir.mkdir("mock.repo"), namespace="myrepo") builder.add_package("pkg-c") with spack.repo.use_repositories(builder.root, override=False): - s = Spec("pkg-c").concretized() + s = spack.concretize.concretize_one("pkg-c") assert s.namespace == "myrepo" PackageInstaller([s.package], fake=True, explicit=True).install() @@ -1822,7 +1833,7 @@ def test_reuse_with_unknown_package_dont_raise(self, tmpdir, temporary_store, mo # TODO (INJECT CONFIGURATION): unclear why the cache needs to be invalidated explicitly repos.repos[0]._pkg_checker.invalidate() with spack.config.override("concretizer:reuse", True): - s = Spec("pkg-c").concretized() + s = spack.concretize.concretize_one("pkg-c") assert s.namespace == "builtin.mock" @pytest.mark.parametrize( @@ -1916,7 +1927,7 @@ def test_solve_in_rounds_all_unsolved(self, monkeypatch, mock_packages): def test_coconcretize_reuse_and_virtuals(self): reusable_specs = [] for s in ["mpileaks ^mpich", "zmpi"]: - reusable_specs.extend(Spec(s).concretized().traverse(root=True)) + reusable_specs.extend(spack.concretize.concretize_one(s).traverse(root=True)) root_specs = [Spec("mpileaks"), Spec("zmpi")] @@ -1933,7 +1944,7 @@ def test_misleading_error_message_on_version(self, mutable_database): # For this bug to be triggered we need a reusable dependency # that is not optimal in terms of optimization scores. # We pick an old version of "b" - reusable_specs = [Spec("non-existing-conditional-dep@1.0").concretized()] + reusable_specs = [spack.concretize.concretize_one("non-existing-conditional-dep@1.0")] root_spec = Spec("non-existing-conditional-dep@2.0") with spack.config.override("concretizer:reuse", True): @@ -1947,7 +1958,9 @@ def test_misleading_error_message_on_version(self, mutable_database): @pytest.mark.regression("31148") def test_version_weight_and_provenance(self): """Test package preferences during coconcretization.""" - reusable_specs = [Spec(spec_str).concretized() for spec_str in ("pkg-b@0.9", "pkg-b@1.0")] + reusable_specs = [ + spack.concretize.concretize_one(spec_str) for spec_str in ("pkg-b@0.9", "pkg-b@1.0") + ] root_spec = Spec("pkg-a foobar=bar") with spack.config.override("concretizer:reuse", True): @@ -1978,7 +1991,7 @@ def test_version_weight_and_provenance(self): def test_reuse_succeeds_with_config_compatible_os(self): root_spec = Spec("pkg-b") - s = root_spec.concretized() + s = spack.concretize.concretize_one(root_spec) other_os = s.copy() mock_os = "ubuntu2204" other_os.architecture = spack.spec.ArchSpec( @@ -1997,13 +2010,13 @@ def test_reuse_succeeds_with_config_compatible_os(self): def test_git_hash_assigned_version_is_preferred(self): hash = "a" * 40 s = Spec("develop-branch-version@%s=develop" % hash) - c = s.concretized() + c = spack.concretize.concretize_one(s) assert hash in str(c) @pytest.mark.parametrize("git_ref", ("a" * 40, "0.2.15", "main")) def test_git_ref_version_is_equivalent_to_specified_version(self, git_ref): s = Spec("develop-branch-version@git.%s=develop" % git_ref) - c = s.concretized() + c = spack.concretize.concretize_one(s) assert git_ref in str(c) print(str(c)) assert s.satisfies("@develop") @@ -2013,7 +2026,7 @@ def test_git_ref_version_is_equivalent_to_specified_version(self, git_ref): def test_git_ref_version_succeeds_with_unknown_version(self, git_ref): # main is not defined in the package.py for this file s = Spec("develop-branch-version@git.%s=main" % git_ref) - s.concretize() + s = spack.concretize.concretize_one(s) assert s.satisfies("develop-branch-version@main") @pytest.mark.regression("31484") @@ -2030,7 +2043,7 @@ def test_installed_externals_are_reused( spack.config.set("packages", external_conf) # Install the external spec - external1 = Spec("changing@1.0").concretized() + external1 = spack.concretize.concretize_one("changing@1.0") PackageInstaller([external1.package], fake=True, explicit=True).install() assert external1.external @@ -2039,12 +2052,12 @@ def test_installed_externals_are_reused( # Try to concretize the external without reuse and confirm the hash changed with spack.config.override("concretizer:reuse", False): - external2 = Spec("changing@1.0").concretized() + external2 = spack.concretize.concretize_one("changing@1.0") assert external2.dag_hash() != external1.dag_hash() # ... while with reuse we have the same hash with spack.config.override("concretizer:reuse", True): - external3 = Spec("changing@1.0").concretized() + external3 = spack.concretize.concretize_one("changing@1.0") assert external3.dag_hash() == external1.dag_hash() @pytest.mark.regression("31484") @@ -2061,18 +2074,18 @@ def test_user_can_select_externals_with_require(self, mutable_database, tmp_path # mpich and others are installed, so check that # fresh use the external, reuse does not with spack.config.override("concretizer:reuse", False): - mpi_spec = Spec("mpi").concretized() + mpi_spec = spack.concretize.concretize_one("mpi") assert mpi_spec.name == "multi-provider-mpi" with spack.config.override("concretizer:reuse", True): - mpi_spec = Spec("mpi").concretized() + mpi_spec = spack.concretize.concretize_one("mpi") assert mpi_spec.name != "multi-provider-mpi" external_conf["mpi"]["require"] = "multi-provider-mpi" spack.config.set("packages", external_conf) with spack.config.override("concretizer:reuse", True): - mpi_spec = Spec("mpi").concretized() + mpi_spec = spack.concretize.concretize_one("mpi") assert mpi_spec.name == "multi-provider-mpi" @pytest.mark.regression("31484") @@ -2086,12 +2099,12 @@ def test_installed_specs_disregard_conflicts(self, mutable_database, monkeypatch # If we concretize with --fresh the conflict is taken into account with spack.config.override("concretizer:reuse", False): - s = Spec("mpich").concretized() + s = spack.concretize.concretize_one("mpich") assert s.satisfies("+debug") # If we concretize with --reuse it is not, since "mpich~debug" was already installed with spack.config.override("concretizer:reuse", True): - s = Spec("mpich").concretized() + s = spack.concretize.concretize_one("mpich") assert s.installed assert s.satisfies("~debug"), s @@ -2099,14 +2112,15 @@ def test_installed_specs_disregard_conflicts(self, mutable_database, monkeypatch def test_require_targets_are_allowed(self, mutable_database): """Test that users can set target constraints under the require attribute.""" # Configuration to be added to packages.yaml - external_conf = {"all": {"require": "target=%s" % spack.platforms.test.Test.front_end}} + required_target = archspec.cpu.TARGETS[spack.platforms.test.Test.default].family + external_conf = {"all": {"require": f"target={required_target}"}} spack.config.set("packages", external_conf) with spack.config.override("concretizer:reuse", False): - spec = Spec("mpich").concretized() + spec = spack.concretize.concretize_one("mpich") for s in spec.traverse(): - assert s.satisfies("target=%s" % spack.platforms.test.Test.front_end) + assert s.satisfies(f"target={required_target}") def test_external_python_extensions_have_dependency(self): """Test that python extensions have access to a python dependency @@ -2120,7 +2134,7 @@ def test_external_python_extensions_have_dependency(self): } spack.config.set("packages", external_conf) - spec = Spec("py-extension2").concretized() + spec = spack.concretize.concretize_one("py-extension2") assert "python" in spec["py-extension1"] assert spec["python"] == spec["py-extension1"]["python"] @@ -2148,7 +2162,7 @@ def test_external_python_extension_find_dependency_from_config(self, python_spec } spack.config.set("packages", external_conf) - spec = Spec("py-extension1").concretized() + spec = spack.concretize.concretize_one("py-extension1") assert "python" in spec["py-extension1"] assert spec["python"].prefix == fake_path @@ -2172,7 +2186,7 @@ def test_external_python_extension_find_dependency_from_installed(self, monkeypa spack.config.set("packages", external_conf) # install python external - python = Spec("python").concretized() + python = spack.concretize.concretize_one("python") def query(*args, **kwargs): return [python] @@ -2183,7 +2197,7 @@ def query(*args, **kwargs): external_conf.pop("python") spack.config.set("packages", external_conf) - spec = Spec("py-extension1").concretized() + spec = spack.concretize.concretize_one("py-extension1") assert "python" in spec["py-extension1"] assert spec["python"].prefix == fake_path @@ -2212,7 +2226,7 @@ def find_fake_python(classes, path_hints): } spack.config.set("packages", external_conf) - spec = Spec("py-extension1").concretized() + spec = spack.concretize.concretize_one("py-extension1") assert "python" in spec["py-extension1"] assert spec["python"].prefix == prefix @@ -2230,7 +2244,7 @@ def test_external_python_extension_find_unified_python(self): spack.config.set("packages", external_conf) abstract_specs = [Spec(s) for s in ["py-extension1", "python"]] - specs = spack.concretize.concretize_specs_together(abstract_specs) + specs = spack.concretize._concretize_specs_together(abstract_specs) assert specs[0]["python"] == specs[1]["python"] @pytest.mark.regression("36190") @@ -2278,7 +2292,7 @@ def test_clear_error_when_unknown_compiler_requested(self, mock_packages): with pytest.raises( spack.error.UnsatisfiableSpecError, match="Cannot set the required compiler: pkg-a%foo" ): - Spec("pkg-a %foo").concretized() + spack.concretize.concretize_one("pkg-a %foo") @pytest.mark.regression("36339") def test_compiler_match_constraints_when_selected(self): @@ -2314,7 +2328,7 @@ def test_compiler_match_constraints_when_selected(self): }, ] spack.config.set("compilers", compiler_configuration) - s = Spec("pkg-a %gcc@:11").concretized() + s = spack.concretize.concretize_one("pkg-a %gcc@:11") assert s.compiler.version == ver("=11.1.0"), s @pytest.mark.regression("36339") @@ -2336,7 +2350,7 @@ def test_compiler_with_custom_non_numeric_version(self, mock_executable): } ] spack.config.set("compilers", compiler_configuration) - s = Spec("pkg-a %gcc@foo").concretized() + s = spack.concretize.concretize_one("pkg-a %gcc@foo") assert s.compiler.version == ver("=foo") @pytest.mark.regression("36628") @@ -2362,13 +2376,13 @@ def test_concretization_with_compilers_supporting_target_any(self): ] with spack.config.override("compilers", compiler_configuration): - s = Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") assert s.satisfies("%gcc@12.1.0") @pytest.mark.parametrize("spec_str", ["mpileaks", "mpileaks ^mpich"]) def test_virtuals_are_annotated_on_edges(self, spec_str): """Tests that information on virtuals is annotated on DAG edges""" - spec = Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) mpi_provider = spec["mpi"].name edges = spec.edges_to_dependencies(name=mpi_provider) @@ -2388,7 +2402,7 @@ def test_explicit_splices( } spack.config.CONFIG.set("concretizer", {"splice": {"explicit": [splice_info]}}) - spec = spack.spec.Spec("hdf5 ^zmpi").concretized() + spec = spack.concretize.concretize_one("hdf5 ^zmpi") assert spec.satisfies(f"^mpich@{mpich_spec.version}") assert spec.build_spec.dependencies(name="zmpi", deptype="link") @@ -2406,14 +2420,14 @@ def test_explicit_splice_fails_nonexistent(mutable_config, mock_packages, mock_s spack.config.CONFIG.set("concretizer", {"splice": {"explicit": [splice_info]}}) with pytest.raises(spack.spec.InvalidHashError): - _ = spack.spec.Spec("hdf5^zmpi").concretized() + _ = spack.concretize.concretize_one("hdf5^zmpi") def test_explicit_splice_fails_no_hash(mutable_config, mock_packages, mock_store): splice_info = {"target": "mpi", "replacement": "mpich"} spack.config.CONFIG.set("concretizer", {"splice": {"explicit": [splice_info]}}) with pytest.raises(spack.solver.asp.InvalidSpliceError, match="must be specified by hash"): - _ = spack.spec.Spec("hdf5^zmpi").concretized() + _ = spack.concretize.concretize_one("hdf5^zmpi") def test_explicit_splice_non_match_nonexistent_succeeds( mutable_config, mock_packages, mock_store @@ -2421,7 +2435,7 @@ def test_explicit_splice_non_match_nonexistent_succeeds( """When we have a nonexistent splice configured but are not using it, don't fail.""" splice_info = {"target": "will_not_match", "replacement": "nonexistent/doesnotexist"} spack.config.CONFIG.set("concretizer", {"splice": {"explicit": [splice_info]}}) - spec = spack.spec.Spec("zlib").concretized() + spec = spack.concretize.concretize_one("zlib") # the main test is that it does not raise assert not spec.spliced @@ -2433,7 +2447,7 @@ def test_explicit_splice_non_match_nonexistent_succeeds( def test_virtuals_are_reconstructed_on_reuse(self, spec_str, mpi_name, mutable_database): """Tests that when we reuse a spec, virtual on edges are reconstructed correctly""" with spack.config.override("concretizer:reuse", True): - spec = Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) assert spec.installed mpi_edges = spec.edges_to_dependencies(mpi_name) assert len(mpi_edges) == 1 @@ -2444,7 +2458,7 @@ def test_dont_define_new_version_from_input_if_checksum_required(self, working_e with pytest.raises(spack.error.UnsatisfiableSpecError): # normally spack concretizes to @=3.0 if it's not defined in package.py, except # when checksums are required - Spec("pkg-a@=3.0").concretized() + spack.concretize.concretize_one("pkg-a@=3.0") @pytest.mark.regression("39570") @pytest.mark.db @@ -2452,15 +2466,15 @@ def test_reuse_python_from_cli_and_extension_from_db(self, mutable_database): """Tests that reusing python with and explicit request on the command line, when the spec also reuses a python extension from the DB, doesn't fail. """ - s = Spec("py-extension1").concretized() + s = spack.concretize.concretize_one("py-extension1") python_hash = s["python"].dag_hash() PackageInstaller([s.package], fake=True, explicit=True).install() with spack.config.override("concretizer:reuse", True): - with_reuse = Spec(f"py-extension2 ^/{python_hash}").concretized() + with_reuse = spack.concretize.concretize_one(f"py-extension2 ^/{python_hash}") with spack.config.override("concretizer:reuse", False): - without_reuse = Spec("py-extension2").concretized() + without_reuse = spack.concretize.concretize_one("py-extension2") assert with_reuse.dag_hash() == without_reuse.dag_hash() @@ -2484,7 +2498,7 @@ def test_select_lower_priority_package_from_repository_stack( # 'builtin.mock" and "duplicates.test" share a 'gmake' package additional_repo = os.path.join(spack.paths.repos_path, "duplicates.test") with spack.repo.use_repositories(additional_repo, override=False): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for name, namespace in expected_namespaces.items(): assert s[name].concrete @@ -2501,13 +2515,13 @@ def test_reuse_specs_from_non_available_compilers(self, mutable_config, mutable_ mutable_config.set("concretizer:reuse", True) # mpileaks is in the database, it will be reused with gcc@=10.2.1 - root = Spec("mpileaks").concretized() + root = spack.concretize.concretize_one("mpileaks") for s in root.traverse(): assert s.satisfies("%gcc@10.2.1") # fftw is not in the database, therefore the root will be compiled with gcc@=9.4.0, # while the mpi is reused from the database and is compiled with gcc@=10.2.1 - root = Spec("fftw").concretized() + root = spack.concretize.concretize_one("fftw") assert root.satisfies("%gcc@=9.4.0") for s in root.traverse(root=False): assert s.satisfies("%gcc@10.2.1") @@ -2522,7 +2536,7 @@ def test_externals_with_platform_explicitly_set(self, tmp_path): } } spack.config.set("packages", external_conf) - s = Spec("mpich").concretized() + s = spack.concretize.concretize_one("mpich") assert s.external @pytest.mark.regression("43267") @@ -2533,10 +2547,10 @@ def test_spec_with_build_dep_from_json(self, tmp_path): The bug was triggered by missing virtuals on edges that were trimmed from pure build dependencies. """ - build_dep = Spec("dttop").concretized() + build_dep = spack.concretize.concretize_one("dttop") json_file = tmp_path / "build.json" json_file.write_text(build_dep.to_json()) - s = Spec(f"dtuse ^{str(json_file)}").concretized() + s = spack.concretize.concretize_one(f"dtuse ^{str(json_file)}") assert s["dttop"].dag_hash() == build_dep.dag_hash() @pytest.mark.regression("44040") @@ -2563,14 +2577,14 @@ def test_exclude_specs_from_reuse(self, monkeypatch): """ # Prepare a mock mirror that returns an old version of dyninst request_str = "callpath ^mpich" - reused = Spec(f"{request_str} ^dyninst@8.1.1").concretized() + reused = spack.concretize.concretize_one(f"{request_str} ^dyninst@8.1.1") monkeypatch.setattr(spack.solver.asp, "_specs_from_mirror", lambda: [reused]) # Exclude dyninst from reuse, so we expect that the old version is not taken into account with spack.config.override( "concretizer:reuse", {"from": [{"type": "buildcache", "exclude": ["dyninst"]}]} ): - result = Spec(request_str).concretized() + result = spack.concretize.concretize_one(request_str) assert result.dag_hash() != reused.dag_hash() assert result["mpich"].dag_hash() == reused["mpich"].dag_hash() @@ -2607,7 +2621,7 @@ def test_include_specs_from_externals_and_libcs( with spack.config.override( "concretizer:reuse", {"from": [{"type": "external", "include": included_externals}]} ): - result = Spec(request_str).concretized() + result = spack.concretize.concretize_one(request_str) assert result["deprecated-versions"].satisfies("@1.1.0") @@ -2616,7 +2630,7 @@ def test_include_specs_from_externals_and_libcs( "concretizer:reuse", {"from": [{"type": "external", "exclude": ["deprecated-versions"]}]}, ): - result = Spec(request_str).concretized() + result = spack.concretize.concretize_one(request_str) assert result["deprecated-versions"].satisfies("@1.0.0") @@ -2630,7 +2644,7 @@ def test_can_reuse_concrete_externals_for_dependents(self, mutable_config, tmp_p } mutable_config.set("packages", packages_yaml) # Concretize with gcc@9 to get a suboptimal spec, since we have gcc@10 available - external_spec = Spec("externaltool@2 %gcc@9").concretized() + external_spec = spack.concretize.concretize_one("externaltool@2 %gcc@9") assert external_spec.external root_specs = [Spec("sombrero")] @@ -2651,11 +2665,11 @@ def test_cannot_reuse_host_incompatible_libc(self): # We install b@1 ^glibc@2.30, and b@0 ^glibc@2.28. The former is not host compatible, the # latter is. - fst = Spec("pkg-b@1").concretized() + fst = spack.concretize.concretize_one("pkg-b@1") fst._mark_concrete(False) fst.dependencies("glibc")[0].versions = VersionList(["=2.30"]) fst._mark_concrete(True) - snd = Spec("pkg-b@0").concretized() + snd = spack.concretize.concretize_one("pkg-b@0") # The spec b@1 ^glibc@2.30 is "more optimal" than b@0 ^glibc@2.28, but due to glibc # incompatibility, it should not be reused. @@ -2684,7 +2698,7 @@ def test_corrupted_external_does_not_halt_concretization(self, corrupted_str, mu } mutable_config.set("packages", packages_yaml) # Assert we don't raise due to the corrupted external entry above - s = Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") assert s.concrete @pytest.mark.regression("44828") @@ -2707,7 +2721,7 @@ def test_correct_external_is_selected_from_packages_yaml(self, mutable_config): mutable_config.set("packages", packages_yaml) mutable_config.set("concretizer", concretizer_yaml) - s = Spec("cmake").concretized() + s = spack.concretize.concretize_one("cmake") # Check that we got the properties from the right external assert s.external @@ -2740,7 +2754,7 @@ def test_two_gmake(self, strategy): """ spack.config.CONFIG.set("concretizer:duplicates:strategy", strategy) - s = Spec("hdf5").concretized() + s = spack.concretize.concretize_one("hdf5") # Check that hdf5 depends on gmake@=4.1 hdf5_gmake = s["hdf5"].dependencies(name="gmake", deptype="build") @@ -2772,7 +2786,7 @@ def test_two_setuptools(self, strategy): """ spack.config.CONFIG.set("concretizer:duplicates:strategy", strategy) - s = Spec("py-shapely").concretized() + s = spack.concretize.concretize_one("py-shapely") # Requirements on py-shapely setuptools = s["py-shapely"].dependencies(name="py-setuptools", deptype="build") assert len(setuptools) == 1 and setuptools[0].satisfies("@=60") @@ -2791,11 +2805,11 @@ def test_solution_without_cycles(self): """Tests that when we concretize a spec with cycles, a fallback kicks in to recompute a solution without cycles. """ - s = Spec("cycle-a").concretized() + s = spack.concretize.concretize_one("cycle-a") assert s["cycle-a"].satisfies("+cycle") assert s["cycle-b"].satisfies("~cycle") - s = Spec("cycle-b").concretized() + s = spack.concretize.concretize_one("cycle-b") assert s["cycle-a"].satisfies("~cycle") assert s["cycle-b"].satisfies("+cycle") @@ -2811,7 +2825,7 @@ def test_pure_build_virtual_dependency(self, strategy): """ spack.config.CONFIG.set("concretizer:duplicates:strategy", strategy) - s = Spec("virtual-build").concretized() + s = spack.concretize.concretize_one("virtual-build") assert s["pkgconfig"].name == "pkg-config" @pytest.mark.regression("40595") @@ -2843,7 +2857,7 @@ def test_no_multiple_solutions_with_different_edges_same_nodes(self): """ spec_str = "py-floating" - root = spack.spec.Spec(spec_str).concretized() + root = spack.concretize.concretize_one(spec_str) assert root["py-shapely"].satisfies("^py-setuptools@=60") assert root["py-numpy"].satisfies("^py-setuptools@=59") @@ -2922,7 +2936,7 @@ def test_adding_specs(self, input_specs, default_mock_concretization): objects in memory. """ container = spack.solver.asp.ConcreteSpecsByHash() - input_specs = [Spec(s).concretized() for s in input_specs] + input_specs = [spack.concretize.concretize_one(s) for s in input_specs] for s in input_specs: container.add(s) @@ -2960,7 +2974,7 @@ def test_condition_triggered_by_edge_property( self, spec_str, expected_satisfies, expected_not_satisfies ): """Tests that we can enforce constraints based on edge attributes""" - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for expected in expected_satisfies: assert s.satisfies(expected), str(expected) @@ -2977,7 +2991,7 @@ def test_virtuals_provided_together_but_only_one_required_in_dag(self): o openblas (provides blas and lapack together) """ - s = Spec("blas-only-client ^openblas").concretized() + s = spack.concretize.concretize_one("blas-only-client ^openblas") assert s.satisfies("^[virtuals=blas] openblas") assert not s.satisfies("^[virtuals=blas,lapack] openblas") @@ -3110,14 +3124,13 @@ def test_concretization_version_order(): ), ], ) -@pytest.mark.usefixtures("mutable_database", "mock_store") +@pytest.mark.usefixtures("mutable_database", "mock_store", "do_not_check_runtimes_on_reuse") @pytest.mark.not_on_windows("Expected length is different on Windows") def test_filtering_reused_specs( - roots, reuse_yaml, expected, not_expected, expected_length, mutable_config, monkeypatch + roots, reuse_yaml, expected, not_expected, expected_length, mutable_config ): """Tests that we can select which specs are to be reused, using constraints as filters""" # Assume all specs have a runtime dependency - monkeypatch.setattr(spack.solver.asp, "_has_runtime_dependencies", lambda x: True) mutable_config.set("concretizer:reuse", reuse_yaml) selector = spack.solver.asp.ReusableSpecsSelector(mutable_config) specs = selector.reusable_specs(roots) @@ -3137,10 +3150,11 @@ def test_filtering_reused_specs( [({"from": [{"type": "local"}]}, 17), ({"from": [{"type": "buildcache"}]}, 0)], ) @pytest.mark.not_on_windows("Expected length is different on Windows") -def test_selecting_reused_sources(reuse_yaml, expected_length, mutable_config, monkeypatch): +def test_selecting_reused_sources( + reuse_yaml, expected_length, mutable_config, do_not_check_runtimes_on_reuse +): """Tests that we can turn on/off sources of reusable specs""" # Assume all specs have a runtime dependency - monkeypatch.setattr(spack.solver.asp, "_has_runtime_dependencies", lambda x: True) mutable_config.set("concretizer:reuse", reuse_yaml) selector = spack.solver.asp.ReusableSpecsSelector(mutable_config) specs = selector.reusable_specs(["mpileaks"]) @@ -3167,18 +3181,22 @@ def test_spec_filters(specs, include, exclude, expected): @pytest.mark.regression("38484") def test_git_ref_version_can_be_reused(install_mockery, do_not_check_runtimes_on_reuse): - first_spec = spack.spec.Spec("git-ref-package@git.2.1.5=2.1.5~opt").concretized() + first_spec = spack.concretize.concretize_one( + spack.spec.Spec("git-ref-package@git.2.1.5=2.1.5~opt") + ) PackageInstaller([first_spec.package], fake=True, explicit=True).install() with spack.config.override("concretizer:reuse", True): # reproducer of the issue is that spack will solve when there is a change to the base spec - second_spec = spack.spec.Spec("git-ref-package@git.2.1.5=2.1.5+opt").concretized() + second_spec = spack.concretize.concretize_one( + spack.spec.Spec("git-ref-package@git.2.1.5=2.1.5+opt") + ) assert second_spec.dag_hash() != first_spec.dag_hash() # we also want to confirm that reuse actually works so leave variant off to # let solver reuse third_spec = spack.spec.Spec("git-ref-package@git.2.1.5=2.1.5") assert first_spec.satisfies(third_spec) - third_spec.concretize() + third_spec = spack.concretize.concretize_one(third_spec) assert third_spec.dag_hash() == first_spec.dag_hash() @@ -3191,14 +3209,16 @@ def test_reuse_prefers_standard_over_git_versions( but we want to prefer the standard version over git ref based versions so install git ref last and ensure it is not picked up by reuse """ - standard_spec = spack.spec.Spec(f"git-ref-package@{standard_version}").concretized() + standard_spec = spack.concretize.concretize_one( + spack.spec.Spec(f"git-ref-package@{standard_version}") + ) PackageInstaller([standard_spec.package], fake=True, explicit=True).install() - git_spec = spack.spec.Spec("git-ref-package@git.2.1.5=2.1.5").concretized() + git_spec = spack.concretize.concretize_one("git-ref-package@git.2.1.5=2.1.5") PackageInstaller([git_spec.package], fake=True, explicit=True).install() with spack.config.override("concretizer:reuse", True): - test_spec = spack.spec.Spec("git-ref-package@2").concretized() + test_spec = spack.concretize.concretize_one("git-ref-package@2") assert git_spec.dag_hash() != test_spec.dag_hash() assert standard_spec.dag_hash() == test_spec.dag_hash() diff --git a/lib/spack/spack/test/concretization/errors.py b/lib/spack/spack/test/concretization/errors.py index 7a118fec047502..f86ed6d187e023 100644 --- a/lib/spack/spack/test/concretization/errors.py +++ b/lib/spack/spack/test/concretization/errors.py @@ -4,9 +4,9 @@ import pytest +import spack.concretize import spack.config import spack.solver.asp -import spack.spec version_error_messages = [ "Cannot satisfy 'fftw@:1.0' and 'fftw@1.1:", @@ -57,7 +57,7 @@ def test_error_messages(error_messages, config_set, spec, mock_packages, mutable spack.config.set(path, conf) with pytest.raises(spack.solver.asp.UnsatisfiableSpecError) as e: - _ = spack.spec.Spec(spec).concretized() + _ = spack.concretize.concretize_one(spec) for em in error_messages: assert em in str(e.value) diff --git a/lib/spack/spack/test/concretization/flag_mixing.py b/lib/spack/spack/test/concretization/flag_mixing.py index 906dd5d84fa2fc..b5e8f3a9604e90 100644 --- a/lib/spack/spack/test/concretization/flag_mixing.py +++ b/lib/spack/spack/test/concretization/flag_mixing.py @@ -1,16 +1,6 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import pathlib - -import pytest - -import spack.config -import spack.environment as ev -import spack.paths -import spack.repo -import spack.util.spack_yaml as syaml -from spack.spec import Spec """ These tests include the following package DAGs: @@ -41,6 +31,18 @@ y """ +import pathlib + +import pytest + +import spack.concretize +import spack.config +import spack.environment as ev +import spack.paths +import spack.repo +import spack.spec +import spack.util.spack_yaml as syaml + @pytest.fixture def test_repo(mutable_config, monkeypatch, mock_stage): @@ -62,12 +64,12 @@ def test_mix_spec_and_requirements(concretize_scope, test_repo): """ update_concretize_scope(conf_str, "packages") - s1 = Spec('y cflags="-a"').concretized() + s1 = spack.concretize.concretize_one('y cflags="-a"') assert s1.satisfies('cflags="-a -c"') def test_mix_spec_and_dependent(concretize_scope, test_repo): - s1 = Spec('x ^y cflags="-a"').concretized() + s1 = spack.concretize.concretize_one('x ^y cflags="-a"') assert s1["y"].satisfies('cflags="-a -d1"') @@ -92,10 +94,22 @@ def test_mix_spec_and_compiler_cfg(concretize_scope, test_repo): conf_str = _compiler_cfg_one_entry_with_cflags("-Wall") update_concretize_scope(conf_str, "compilers") - s1 = Spec('y %gcc@12.100.100 cflags="-O2"').concretized() + s1 = spack.concretize.concretize_one('y %gcc@12.100.100 cflags="-O2"') assert s1.satisfies('cflags="-Wall -O2"') +def test_pkg_flags_from_compiler_and_none(concretize_scope, mock_packages): + conf_str = _compiler_cfg_one_entry_with_cflags("-Wall") + update_concretize_scope(conf_str, "compilers") + + s1 = spack.spec.Spec("cmake%gcc@12.100.100") + s2 = spack.spec.Spec("cmake-client^cmake%clang") + concrete = dict(spack.concretize.concretize_together([(s1, None), (s2, None)])) + + assert concrete[s1].compiler_flags["cflags"] == ["-Wall"] + assert concrete[s2].compiler_flags["cflags"] == [] + + @pytest.mark.parametrize( "cmd_flags,req_flags,cmp_flags,dflags,expected_order", [ @@ -147,7 +161,7 @@ def test_flag_order_and_grouping( if cmd_flags: spec_str += f' cflags="{cmd_flags}"' - root_spec = Spec(spec_str).concretized() + root_spec = spack.concretize.concretize_one(spec_str) spec = root_spec["y"] satisfy_flags = " ".join(x for x in [cmd_flags, req_flags, cmp_flags, expected_dflags] if x) assert spec.satisfies(f'cflags="{satisfy_flags}"') @@ -155,11 +169,11 @@ def test_flag_order_and_grouping( def test_two_dependents_flag_mixing(concretize_scope, test_repo): - root_spec1 = Spec("w~moveflaglater").concretized() + root_spec1 = spack.concretize.concretize_one("w~moveflaglater") spec1 = root_spec1["y"] assert spec1.compiler_flags["cflags"] == "-d0 -d1 -d2".split() - root_spec2 = Spec("w+moveflaglater").concretized() + root_spec2 = spack.concretize.concretize_one("w+moveflaglater") spec2 = root_spec2["y"] assert spec2.compiler_flags["cflags"] == "-d3 -d1 -d2".split() @@ -168,7 +182,7 @@ def test_propagate_and_compiler_cfg(concretize_scope, test_repo): conf_str = _compiler_cfg_one_entry_with_cflags("-f2") update_concretize_scope(conf_str, "compilers") - root_spec = Spec("v %gcc@12.100.100 cflags=='-f1'").concretized() + root_spec = spack.concretize.concretize_one("v %gcc@12.100.100 cflags=='-f1'") assert root_spec["y"].satisfies("cflags='-f1 -f2'") @@ -177,7 +191,7 @@ def test_propagate_and_compiler_cfg(concretize_scope, test_repo): def test_propagate_and_pkg_dep(concretize_scope, test_repo): - root_spec1 = Spec("x ~activatemultiflag cflags=='-f1'").concretized() + root_spec1 = spack.concretize.concretize_one("x ~activatemultiflag cflags=='-f1'") assert root_spec1["y"].satisfies("cflags='-f1 -d1'") @@ -189,7 +203,7 @@ def test_propagate_and_require(concretize_scope, test_repo): """ update_concretize_scope(conf_str, "packages") - root_spec1 = Spec("v cflags=='-f1'").concretized() + root_spec1 = spack.concretize.concretize_one("v cflags=='-f1'") assert root_spec1["y"].satisfies("cflags='-f1 -f2'") # Next, check that a requirement does not "undo" a request for @@ -201,7 +215,7 @@ def test_propagate_and_require(concretize_scope, test_repo): """ update_concretize_scope(conf_str, "packages") - root_spec2 = Spec("v cflags=='-f1'").concretized() + root_spec2 = spack.concretize.concretize_one("v cflags=='-f1'") assert root_spec2["y"].satisfies("cflags='-f1'") # Note: requirements cannot enforce propagation: any attempt to do @@ -245,7 +259,7 @@ def test_diamond_dep_flag_mixing(concretize_scope, test_repo): nodes of the diamond always appear in the same order). `Spec.traverse` is responsible for handling both of these needs. """ - root_spec1 = Spec("t").concretized() + root_spec1 = spack.concretize.concretize_one("t") spec1 = root_spec1["y"] assert spec1.satisfies('cflags="-c1 -c2 -d1 -d2 -e1 -e2"') assert spec1.compiler_flags["cflags"] == "-c1 -c2 -e1 -e2 -d1 -d2".split() diff --git a/lib/spack/spack/test/concretization/preferences.py b/lib/spack/spack/test/concretization/preferences.py index 255bc021011b95..004e3140c42f02 100644 --- a/lib/spack/spack/test/concretization/preferences.py +++ b/lib/spack/spack/test/concretization/preferences.py @@ -7,6 +7,7 @@ import pytest +import spack.concretize import spack.config import spack.package_prefs import spack.repo @@ -46,7 +47,7 @@ def configure_permissions(): def concretize(abstract_spec): - return Spec(abstract_spec).concretized() + return spack.concretize.concretize_one(abstract_spec) def update_packages(pkgname, section, value): @@ -111,7 +112,7 @@ def test_preferred_variants_from_wildcard(self): def test_preferred_compilers(self, compiler_str, spec_str): """Test preferred compilers are applied correctly""" update_packages("all", "compiler", [compiler_str]) - spec = spack.spec.Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) assert spec.compiler == CompilerSpec(compiler_str) def test_preferred_target(self, mutable_mock_repo): @@ -213,15 +214,13 @@ def test_config_set_pkg_property_new(self, mock_repo_path): def test_preferred(self): """ "Test packages with some version marked as preferred=True""" - spec = Spec("python") - spec.concretize() + spec = spack.concretize.concretize_one("python") assert spec.version == Version("2.7.11") # now add packages.yaml with versions other than preferred # ensure that once config is in place, non-preferred version is used update_packages("python", "version", ["3.5.0"]) - spec = Spec("python") - spec.concretize() + spec = spack.concretize.concretize_one("python") assert spec.version == Version("3.5.0") def test_preferred_undefined_raises(self): @@ -229,7 +228,7 @@ def test_preferred_undefined_raises(self): update_packages("python", "version", ["3.5.0.1"]) spec = Spec("python") with pytest.raises(ConfigError): - spec.concretize() + spack.concretize.concretize_one(spec) def test_preferred_truncated(self): """Versions without "=" are treated as version ranges: if there is @@ -237,36 +236,30 @@ def test_preferred_truncated(self): (don't define a new version). """ update_packages("python", "version", ["3.5"]) - spec = Spec("python") - spec.concretize() + spec = spack.concretize.concretize_one("python") assert spec.satisfies("@3.5.1") def test_develop(self): """Test concretization with develop-like versions""" - spec = Spec("develop-test") - spec.concretize() + spec = spack.concretize.concretize_one("develop-test") assert spec.version == Version("0.2.15") - spec = Spec("develop-test2") - spec.concretize() + spec = spack.concretize.concretize_one("develop-test2") assert spec.version == Version("0.2.15") # now add packages.yaml with develop-like versions # ensure that once config is in place, develop-like version is used update_packages("develop-test", "version", ["develop"]) - spec = Spec("develop-test") - spec.concretize() + spec = spack.concretize.concretize_one("develop-test") assert spec.version == Version("develop") update_packages("develop-test2", "version", ["0.2.15.develop"]) - spec = Spec("develop-test2") - spec.concretize() + spec = spack.concretize.concretize_one("develop-test2") assert spec.version == Version("0.2.15.develop") def test_external_mpi(self): # make sure this doesn't give us an external first. - spec = Spec("mpi") - spec.concretize() - assert not spec["mpi"].external + spec = spack.concretize.concretize_one("mpi") + assert not spec.external and spec.package.provides("mpi") # load config conf = syaml.load_config( @@ -284,8 +277,7 @@ def test_external_mpi(self): spack.config.set("packages", conf, scope="concretize") # ensure that once config is in place, external is used - spec = Spec("mpi") - spec.concretize() + spec = spack.concretize.concretize_one("mpi") assert spec["mpich"].external_path == os.path.sep + os.path.join("dummy", "path") def test_external_module(self, monkeypatch): @@ -300,9 +292,8 @@ def mock_module(cmd, module): monkeypatch.setattr(spack.util.module_cmd, "module", mock_module) - spec = Spec("mpi") - spec.concretize() - assert not spec["mpi"].external + spec = spack.concretize.concretize_one("mpi") + assert not spec.external and spec.package.provides("mpi") # load config conf = syaml.load_config( @@ -320,8 +311,7 @@ def mock_module(cmd, module): spack.config.set("packages", conf, scope="concretize") # ensure that once config is in place, external is used - spec = Spec("mpi") - spec.concretize() + spec = spack.concretize.concretize_one("mpi") assert spec["mpich"].external_path == os.path.sep + os.path.join("dummy", "path") def test_buildable_false(self): @@ -467,7 +457,7 @@ def test_variant_not_flipped_to_pull_externals(self): """Test that a package doesn't prefer pulling in an external to using the default value of a variant. """ - s = Spec("vdefault-or-external-root").concretized() + s = spack.concretize.concretize_one("vdefault-or-external-root") assert "~external" in s["vdefault-or-external"] assert "externaltool" not in s @@ -479,7 +469,7 @@ def test_dependencies_cant_make_version_parent_score_better(self): that makes the overall version score even or better and maybe has a better score in some lower priority criteria. """ - s = Spec("version-test-root").concretized() + s = spack.concretize.concretize_one("version-test-root") assert s.satisfies("^version-test-pkg@2.4.6") assert "version-test-dependency-preferred" not in s @@ -497,13 +487,13 @@ def test_multivalued_variants_are_lower_priority_than_providers(self): with spack.config.override( "packages:all", {"providers": {"somevirtual": ["some-virtual-preferred"]}} ): - s = Spec("somevirtual").concretized() + s = spack.concretize.concretize_one("somevirtual") assert s.name == "some-virtual-preferred" @pytest.mark.regression("26721,19736") def test_sticky_variant_accounts_for_packages_yaml(self): with spack.config.override("packages:sticky-variant", {"variants": "+allow-gcc"}): - s = Spec("sticky-variant %gcc").concretized() + s = spack.concretize.concretize_one("sticky-variant %gcc") assert s.satisfies("%gcc") and s.satisfies("+allow-gcc") @pytest.mark.regression("41134") @@ -512,5 +502,5 @@ def test_default_preference_variant_different_type_does_not_error(self): packages.yaml doesn't fail with an error. """ with spack.config.override("packages:all", {"variants": "+foo"}): - s = Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") assert s.satisfies("foo=bar") diff --git a/lib/spack/spack/test/concretization/requirements.py b/lib/spack/spack/test/concretization/requirements.py index 495943c4938897..c2e5d4cadaf9d8 100644 --- a/lib/spack/spack/test/concretization/requirements.py +++ b/lib/spack/spack/test/concretization/requirements.py @@ -1,11 +1,11 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os import pathlib import pytest +import spack.concretize import spack.config import spack.error import spack.package_base @@ -42,7 +42,7 @@ def test_one_package_multiple_reqs(concretize_scope, test_repo): - "~shared" """ update_packages_config(conf_str) - y_spec = Spec("y").concretized() + y_spec = spack.concretize.concretize_one("y") assert y_spec.satisfies("@2.4~shared") @@ -57,7 +57,7 @@ def test_requirement_isnt_optional(concretize_scope, test_repo): """ update_packages_config(conf_str) with pytest.raises(UnsatisfiableSpecError): - Spec("x@1.1").concretize() + spack.concretize.concretize_one("x@1.1") def test_require_undefined_version(concretize_scope, test_repo): @@ -74,7 +74,7 @@ def test_require_undefined_version(concretize_scope, test_repo): """ update_packages_config(conf_str) with pytest.raises(spack.error.ConfigError): - Spec("x").concretize() + spack.concretize.concretize_one("x") def test_require_truncated(concretize_scope, test_repo): @@ -89,7 +89,7 @@ def test_require_truncated(concretize_scope, test_repo): require: "@1" """ update_packages_config(conf_str) - xspec = Spec("x").concretized() + xspec = spack.concretize.concretize_one("x") assert xspec.satisfies("@1.1") @@ -159,7 +159,7 @@ def test_requirement_adds_new_version( ) update_packages_config(conf_str) - s1 = Spec("v").concretized() + s1 = spack.concretize.concretize_one("v") assert s1.satisfies("@2.2") # Make sure the git commit info is retained assert isinstance(s1.version, spack.version.GitVersion) @@ -180,8 +180,8 @@ def test_requirement_adds_version_satisfies( ) # Sanity check: early version of T does not include U - s0 = Spec("t@2.0").concretized() - assert not ("u" in s0) + s0 = spack.concretize.concretize_one("t@2.0") + assert "u" not in s0 conf_str = """\ packages: @@ -192,18 +192,18 @@ def test_requirement_adds_version_satisfies( ) update_packages_config(conf_str) - s1 = Spec("t").concretized() + s1 = spack.concretize.concretize_one("t") assert "u" in s1 assert s1.satisfies("@2.2") @pytest.mark.parametrize("require_checksum", (True, False)) def test_requirement_adds_git_hash_version( - require_checksum, concretize_scope, test_repo, mock_git_version_info, monkeypatch, working_env + require_checksum, concretize_scope, test_repo, mock_git_version_info, monkeypatch ): # A full commit sha is a checksummed version, so this test should pass in both cases if require_checksum: - os.environ["SPACK_CONCRETIZER_REQUIRE_CHECKSUM"] = "yes" + monkeypatch.setenv("SPACK_CONCRETIZER_REQUIRE_CHECKSUM", "yes") repo_path, filename, commits = mock_git_version_info monkeypatch.setattr( @@ -218,7 +218,7 @@ def test_requirement_adds_git_hash_version( """ update_packages_config(conf_str) - s1 = Spec("v").concretized() + s1 = spack.concretize.concretize_one("v") assert isinstance(s1.version, spack.version.GitVersion) assert s1.satisfies(f"v@{a_commit_hash}") @@ -239,8 +239,8 @@ def test_requirement_adds_multiple_new_versions( """ update_packages_config(conf_str) - assert Spec("v").concretized().satisfies(f"@{commits[0]}=2.2") - assert Spec("v@2.3").concretized().satisfies(f"v@{commits[1]}=2.3") + assert spack.concretize.concretize_one("v").satisfies(f"@{commits[0]}=2.2") + assert spack.concretize.concretize_one("v@2.3").satisfies(f"v@{commits[1]}=2.3") # TODO: this belongs in the concretize_preferences test module but uses @@ -263,11 +263,11 @@ def test_preference_adds_new_version( """ update_packages_config(conf_str) - assert Spec("v").concretized().satisfies(f"@{commits[0]}=2.2") - assert Spec("v@2.3").concretized().satisfies(f"@{commits[1]}=2.3") + assert spack.concretize.concretize_one("v").satisfies(f"@{commits[0]}=2.2") + assert spack.concretize.concretize_one("v@2.3").satisfies(f"@{commits[1]}=2.3") # When installing by hash, a lookup is triggered, so it's not mapped to =2.3. - s3 = Spec(f"v@{commits[1]}").concretized() + s3 = spack.concretize.concretize_one(f"v@{commits[1]}") assert s3.satisfies(f"v@{commits[1]}") assert not s3.satisfies("@2.3") @@ -287,7 +287,7 @@ def test_external_adds_new_version_that_is_preferred(concretize_scope, test_repo """ update_packages_config(conf_str) - spec = Spec("x").concretized() + spec = spack.concretize.concretize_one("x") assert spec["y"].satisfies("@2.7") assert spack.version.Version("2.7") not in spec["y"].package.versions @@ -296,7 +296,7 @@ def test_requirement_is_successfully_applied(concretize_scope, test_repo): """If a simple requirement can be satisfied, make sure the concretization succeeds and the requirement spec is applied. """ - s1 = Spec("x").concretized() + s1 = spack.concretize.concretize_one("x") # Without any requirements/preferences, the later version is preferred assert s1.satisfies("@1.1") @@ -306,7 +306,7 @@ def test_requirement_is_successfully_applied(concretize_scope, test_repo): require: "@1.0" """ update_packages_config(conf_str) - s2 = Spec("x").concretized() + s2 = spack.concretize.concretize_one("x") # The requirement forces choosing the eariler version assert s2.satisfies("@1.0") @@ -323,7 +323,7 @@ def test_multiple_packages_requirements_are_respected(concretize_scope, test_rep require: "@2.4" """ update_packages_config(conf_str) - spec = Spec("x").concretized() + spec = spack.concretize.concretize_one("x") assert spec["x"].satisfies("@1.0") assert spec["y"].satisfies("@2.4") @@ -339,7 +339,7 @@ def test_oneof(concretize_scope, test_repo): - one_of: ["@2.4", "~shared"] """ update_packages_config(conf_str) - spec = Spec("x").concretized() + spec = spack.concretize.concretize_one("x") # The concretizer only has to satisfy one of @2.4/~shared, and @2.4 # comes first so it is prioritized assert spec["y"].satisfies("@2.4+shared") @@ -358,10 +358,10 @@ def test_one_package_multiple_oneof_groups(concretize_scope, test_repo): """ update_packages_config(conf_str) - s1 = Spec("y@2.5").concretized() + s1 = spack.concretize.concretize_one("y@2.5") assert s1.satisfies("%clang~shared") - s2 = Spec("y@2.4").concretized() + s2 = spack.concretize.concretize_one("y@2.4") assert s2.satisfies("%gcc+shared") @@ -377,10 +377,10 @@ def test_require_cflags(concretize_scope, mock_packages): """ update_packages_config(conf_str) - spec_mpich2 = Spec("mpich2").concretized() + spec_mpich2 = spack.concretize.concretize_one("mpich2") assert spec_mpich2.satisfies("cflags=-g") - spec_mpi = Spec("mpi").concretized() + spec_mpi = spack.concretize.concretize_one("mpi") assert spec_mpi.satisfies("mpich cflags=-O1") @@ -403,7 +403,7 @@ def test_requirements_for_package_that_is_not_needed(concretize_scope, test_repo """ update_packages_config(conf_str) - s1 = Spec("v").concretized() + s1 = spack.concretize.concretize_one("v") assert s1.satisfies("@2.1") @@ -420,10 +420,10 @@ def test_oneof_ordering(concretize_scope, test_repo): """ update_packages_config(conf_str) - s1 = Spec("y").concretized() + s1 = spack.concretize.concretize_one("y") assert s1.satisfies("@2.4") - s2 = Spec("y@2.5").concretized() + s2 = spack.concretize.concretize_one("y@2.5") assert s2.satisfies("@2.5") @@ -437,14 +437,14 @@ def test_reuse_oneof(concretize_scope, test_repo, tmp_path, mock_fetch): store_dir = tmp_path / "store" with spack.store.use_store(str(store_dir)): - s1 = Spec("y@2.5 ~shared").concretized() + s1 = spack.concretize.concretize_one("y@2.5~shared") PackageInstaller([s1.package], fake=True, explicit=True).install() update_packages_config(conf_str) with spack.config.override("concretizer:reuse", True): - s2 = Spec("y").concretized() - assert not s2.satisfies("@2.5 ~shared") + s2 = spack.concretize.concretize_one("y") + assert not s2.satisfies("@2.5~shared") @pytest.mark.parametrize( @@ -472,7 +472,7 @@ def test_requirements_and_deprecated_versions( update_packages_config(conf_str) with spack.config.override("config:deprecated", allow_deprecated): - s1 = Spec("y").concretized() + s1 = spack.concretize.concretize_one("y") for constrain in expected: assert s1.satisfies(constrain) @@ -490,7 +490,7 @@ def test_default_requirements_with_all(spec_str, requirement_str, concretize_sco """ update_packages_config(conf_str) - spec = Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) for s in spec.traverse(): assert s.satisfies(requirement_str) @@ -499,7 +499,7 @@ def test_default_requirements_with_all(spec_str, requirement_str, concretize_sco "requirements,expectations", [ (("%gcc", "%clang"), ("%gcc", "%clang")), - (("%gcc ~shared", "@1.0"), ("%gcc ~shared", "@1.0 +shared")), + (("%gcc~shared", "@1.0"), ("%gcc~shared", "@1.0+shared")), ], ) def test_default_and_package_specific_requirements( @@ -517,7 +517,7 @@ def test_default_and_package_specific_requirements( """ update_packages_config(conf_str) - spec = Spec("x").concretized() + spec = spack.concretize.concretize_one("x") assert spec.satisfies(specific_exp) for s in spec.traverse(root=False): assert s.satisfies(generic_exp) @@ -532,7 +532,7 @@ def test_requirements_on_virtual(mpi_requirement, concretize_scope, mock_package """ update_packages_config(conf_str) - spec = Spec("callpath").concretized() + spec = spack.concretize.concretize_one("callpath") assert "mpi" in spec assert mpi_requirement in spec @@ -553,7 +553,7 @@ def test_requirements_on_virtual_and_on_package( """ update_packages_config(conf_str) - spec = Spec("callpath").concretized() + spec = spack.concretize.concretize_one("callpath") assert "mpi" in spec assert mpi_requirement in spec assert spec["mpi"].satisfies(specific_requirement) @@ -567,10 +567,10 @@ def test_incompatible_virtual_requirements_raise(concretize_scope, mock_packages """ update_packages_config(conf_str) - spec = Spec("callpath ^zmpi") + spec = Spec("callpath^zmpi") # TODO (multiple nodes): recover a better error message later with pytest.raises((UnsatisfiableSpecError, InternalConcretizerError)): - spec.concretize() + spack.concretize.concretize_one(spec) def test_non_existing_variants_under_all(concretize_scope, mock_packages): @@ -582,7 +582,7 @@ def test_non_existing_variants_under_all(concretize_scope, mock_packages): """ update_packages_config(conf_str) - spec = Spec("callpath ^zmpi").concretized() + spec = spack.concretize.concretize_one("callpath^zmpi") assert "~foo" not in spec @@ -657,7 +657,7 @@ def test_conditional_requirements_from_packages_yaml( and optional when the condition is not met. """ update_packages_config(packages_yaml) - spec = Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) for match_str, expected in expected_satisfies: assert spec.satisfies(match_str) is expected @@ -733,7 +733,7 @@ def test_requirements_fail_with_custom_message( """ update_packages_config(packages_yaml) with pytest.raises(spack.error.SpackError, match=expected_message): - Spec(spec_str).concretized() + spack.concretize.concretize_one(spec_str) def test_skip_requirement_when_default_requirement_condition_cannot_be_met( @@ -752,9 +752,9 @@ def test_skip_requirement_when_default_requirement_condition_cannot_be_met( when: "+shared" """ update_packages_config(packages_yaml) - s = Spec("mpileaks").concretized() + s = spack.concretize.concretize_one("mpileaks") - assert s.satisfies("%clang +shared") + assert s.satisfies("%clang+shared") # Sanity checks that 'callpath' doesn't have the shared variant, but that didn't # cause failures during concretization. assert "shared" not in s["callpath"].variants @@ -781,12 +781,12 @@ def test_requires_directive(concretize_scope, mock_packages): spack.config.CONFIG.clear_caches() # This package requires either clang or gcc - s = Spec("requires_clang_or_gcc").concretized() + s = spack.concretize.concretize_one("requires_clang_or_gcc") assert s.satisfies("%gcc@12.0.0") # This package can only be compiled with clang with pytest.raises(spack.error.SpackError, match="can only be compiled with Clang"): - Spec("requires_clang").concretized() + spack.concretize.concretize_one("requires_clang") @pytest.mark.parametrize( @@ -839,20 +839,20 @@ def test_default_requirements_semantic(packages_yaml, concretize_scope, mock_pac """ update_packages_config(packages_yaml) - # Regular zlib concretize to +shared - s = Spec("zlib").concretized() + # Regular zlib concretize to+shared + s = spack.concretize.concretize_one("zlib") assert s.satisfies("+shared") # If we specify the variant we can concretize only the one matching the constraint - s = Spec("zlib +shared").concretized() + s = spack.concretize.concretize_one("zlib+shared") assert s.satisfies("+shared") with pytest.raises(UnsatisfiableSpecError): - Spec("zlib ~shared").concretized() + spack.concretize.concretize_one("zlib~shared") # A spec without the shared variant still concretize - s = Spec("pkg-a").concretized() - assert not s.satisfies("pkg-a +shared") - assert not s.satisfies("pkg-a ~shared") + s = spack.concretize.concretize_one("pkg-a") + assert not s.satisfies("pkg-a+shared") + assert not s.satisfies("pkg-a~shared") @pytest.mark.parametrize( @@ -896,7 +896,7 @@ def test_default_requirements_semantic(packages_yaml, concretize_scope, mock_pac """ packages: all: - require: "libs=static +feefoo" + require: "libs=static+feefoo" """, "multivalue-variant", ["libs=shared"], @@ -911,7 +911,7 @@ def test_default_requirements_semantic_with_mv_variants( from MV variants. """ update_packages_config(packages_yaml) - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for constraint in expected: assert s.satisfies(constraint), constraint @@ -936,7 +936,7 @@ def test_requiring_package_on_multiple_virtuals(concretize_scope, mock_packages) require: intel-parallel-studio """ ) - s = Spec("dla-future").concretized() + s = spack.concretize.concretize_one("dla-future") assert s["blas"].name == "intel-parallel-studio" assert s["lapack"].name == "intel-parallel-studio" @@ -989,7 +989,7 @@ def test_strong_preferences_packages_yaml( ): """Tests that "preferred" specs are stronger than usual preferences, but can be overridden.""" update_packages_config(packages_yaml) - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for constraint in expected: assert s.satisfies(constraint), constraint @@ -1038,29 +1038,29 @@ def test_conflict_packages_yaml(packages_yaml, spec_str, concretize_scope, mock_ """Tests conflicts that are specified from configuration files.""" update_packages_config(packages_yaml) with pytest.raises(UnsatisfiableSpecError): - Spec(spec_str).concretized() + spack.concretize.concretize_one(spec_str) @pytest.mark.parametrize( "spec_str,expected,not_expected", [ ( - "forward-multi-value +cuda cuda_arch=10 ^dependency-mv~cuda", + "forward-multi-value+cuda cuda_arch=10^dependency-mv~cuda", ["cuda_arch=10", "^dependency-mv~cuda"], ["cuda_arch=11", "^dependency-mv cuda_arch=10", "^dependency-mv cuda_arch=11"], ), ( - "forward-multi-value +cuda cuda_arch=10 ^dependency-mv+cuda", + "forward-multi-value+cuda cuda_arch=10^dependency-mv+cuda", ["cuda_arch=10", "^dependency-mv cuda_arch=10"], ["cuda_arch=11", "^dependency-mv cuda_arch=11"], ), ( - "forward-multi-value +cuda cuda_arch=11 ^dependency-mv+cuda", + "forward-multi-value+cuda cuda_arch=11^dependency-mv+cuda", ["cuda_arch=11", "^dependency-mv cuda_arch=11"], ["cuda_arch=10", "^dependency-mv cuda_arch=10"], ), ( - "forward-multi-value +cuda cuda_arch=10,11 ^dependency-mv+cuda", + "forward-multi-value+cuda cuda_arch=10,11^dependency-mv+cuda", ["cuda_arch=10,11", "^dependency-mv cuda_arch=10,11"], [], ), @@ -1073,9 +1073,9 @@ def test_forward_multi_valued_variant_using_requires( `requires` directives of the form: for _val in ("shared", "static"): - requires(f"^some-virtual-mv libs={_val}", when=f"libs={_val} ^some-virtual-mv") + requires(f"^some-virtual-mv libs={_val}", when=f"libs={_val}^some-virtual-mv") """ - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) for constraint in expected: assert s.satisfies(constraint) @@ -1086,7 +1086,7 @@ def test_forward_multi_valued_variant_using_requires( def test_strong_preferences_higher_priority_than_reuse(concretize_scope, mock_packages): """Tests that strong preferences have a higher priority than reusing specs.""" - reused_spec = Spec("adios2~bzip2").concretized() + reused_spec = spack.concretize.concretize_one("adios2~bzip2") reuse_nodes = list(reused_spec.traverse()) root_specs = [Spec("ascent+adios2")] @@ -1121,7 +1121,7 @@ def test_strong_preferences_higher_priority_than_reuse(concretize_scope, mock_pa solver = spack.solver.asp.Solver() setup = spack.solver.asp.SpackSolverSetup() result, _, _ = solver.driver.solve( - setup, [Spec("ascent+adios2 ^adios2~bzip2")], reuse=reuse_nodes + setup, [Spec("ascent+adios2^adios2~bzip2")], reuse=reuse_nodes ) ascent = result.specs[0] assert ascent["adios2"].dag_hash() == reused_spec.dag_hash(), ascent diff --git a/lib/spack/spack/test/config.py b/lib/spack/spack/test/config.py index 11829ed92bcb8a..5682135ee26895 100644 --- a/lib/spack/spack/test/config.py +++ b/lib/spack/spack/test/config.py @@ -408,7 +408,7 @@ def test_substitute_config_variables(mock_low_high_config, monkeypatch): os.path.join("foo", "$platform", "bar") ) == os.path.abspath(os.path.join("foo", "test", "bar")) - host_target = spack.platforms.host().target("default_target") + host_target = spack.platforms.host().default_target() host_target_family = str(host_target.family) assert spack_path.canonicalize_path( os.path.join("foo", "$target_family", "bar") diff --git a/lib/spack/spack/test/config_values.py b/lib/spack/spack/test/config_values.py index 0af1c50dfdb6b5..70b9b10f96a961 100644 --- a/lib/spack/spack/test/config_values.py +++ b/lib/spack/spack/test/config_values.py @@ -4,7 +4,7 @@ import pytest -import spack.spec +import spack.concretize import spack.store @@ -13,7 +13,7 @@ def test_set_install_hash_length(hash_length, mutable_config, tmpdir): mutable_config.set("config:install_hash_length", hash_length) with spack.store.use_store(str(tmpdir)): - spec = spack.spec.Spec("libelf").concretized() + spec = spack.concretize.concretize_one("libelf") prefix = spec.prefix hash_str = prefix.rsplit("-")[-1] assert len(hash_str) == hash_length @@ -23,7 +23,7 @@ def test_set_install_hash_length(hash_length, mutable_config, tmpdir): def test_set_install_hash_length_upper_case(mutable_config, tmpdir): mutable_config.set("config:install_hash_length", 5) with spack.store.use_store(str(tmpdir), extra_data={"projections": {"all": "{name}-{HASH}"}}): - spec = spack.spec.Spec("libelf").concretized() + spec = spack.concretize.concretize_one("libelf") prefix = spec.prefix hash_str = prefix.rsplit("-")[-1] assert len(hash_str) == 5 diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index 2b4ee83f913988..2193e84e70c500 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -4,13 +4,14 @@ import collections import datetime +import email.message import errno import functools import inspect +import io import itertools import json import os -import os.path import pathlib import re import shutil @@ -36,6 +37,7 @@ import spack.caches import spack.compiler import spack.compilers +import spack.concretize import spack.config import spack.directives_meta import spack.environment as ev @@ -619,7 +621,7 @@ def linux_os(): platform = spack.platforms.host() name, version = "debian", "6" if platform.name == "linux": - current_os = platform.operating_system("default_os") + current_os = platform.default_operating_system() name, version = current_os.name, current_os.version LinuxOS = collections.namedtuple("LinuxOS", ["name", "version"]) return LinuxOS(name=name, version=version) @@ -678,7 +680,6 @@ def load_json(): def mock_targets(mock_uarch_configuration, monkeypatch): """Use this fixture to enable mock uarch targets for testing.""" targets_json, targets = mock_uarch_configuration - monkeypatch.setattr(archspec.cpu.schema, "TARGETS_JSON", targets_json) monkeypatch.setattr(archspec.cpu.microarchitecture, "TARGETS", targets) @@ -849,7 +850,7 @@ def _populate(mock_db): """ def _install(spec): - s = spack.spec.Spec(spec).concretized() + s = spack.concretize.concretize_one(spec) PackageInstaller([s.package], fake=True, explicit=True).install() _install("mpileaks ^mpich") @@ -1983,7 +1984,9 @@ def default_mock_concretization(config, mock_packages, concretized_specs_cache): def _func(spec_str, tests=False): key = spec_str, tests if key not in concretized_specs_cache: - concretized_specs_cache[key] = spack.spec.Spec(spec_str).concretized(tests=tests) + concretized_specs_cache[key] = spack.concretize.concretize_one( + spack.spec.Spec(spec_str), tests=tests + ) return concretized_specs_cache[key].copy() return _func @@ -2125,3 +2128,51 @@ def mock_test_cache(tmp_path_factory): cache_dir = tmp_path_factory.mktemp("cache") print(cache_dir) return spack.util.file_cache.FileCache(str(cache_dir)) + + +class MockHTTPResponse(io.IOBase): + """This is a mock HTTP response, which implements part of http.client.HTTPResponse""" + + def __init__(self, status, reason, headers=None, body=None): + self.msg = None + self.version = 11 + self.url = None + self.headers = email.message.EmailMessage() + self.status = status + self.code = status + self.reason = reason + self.debuglevel = 0 + self._body = body + + if headers is not None: + for key, value in headers.items(): + self.headers[key] = value + + @classmethod + def with_json(cls, status, reason, headers=None, body=None): + """Create a mock HTTP response with JSON string as body""" + body = io.BytesIO(json.dumps(body).encode("utf-8")) + return cls(status, reason, headers, body) + + def read(self, *args, **kwargs): + return self._body.read(*args, **kwargs) + + def getheader(self, name, default=None): + self.headers.get(name, default) + + def getheaders(self): + return self.headers.items() + + def fileno(self): + return 0 + + def getcode(self): + return self.status + + def info(self): + return self.headers + + +@pytest.fixture() +def mock_runtimes(config, mock_packages): + return mock_packages.packages_with_tags("runtime") diff --git a/lib/spack/spack/test/container/images.py b/lib/spack/spack/test/container/images.py index 958a9016ec41c8..0a2836c17b86d0 100644 --- a/lib/spack/spack/test/container/images.py +++ b/lib/spack/spack/test/container/images.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import pytest diff --git a/lib/spack/spack/test/cray_manifest.py b/lib/spack/spack/test/cray_manifest.py index 42585f55fa721f..f04a51c0b0da20 100644 --- a/lib/spack/spack/test/cray_manifest.py +++ b/lib/spack/spack/test/cray_manifest.py @@ -13,6 +13,8 @@ import pytest +import archspec.cpu + import spack import spack.cmd import spack.cmd.external @@ -98,11 +100,8 @@ def spec_json(self): @pytest.fixture def _common_arch(test_platform): - return JsonArchEntry( - platform=test_platform.name, - os=test_platform.front_os, - target=test_platform.target("fe").name, - ) + generic = archspec.cpu.TARGETS[test_platform.default].family + return JsonArchEntry(platform=test_platform.name, os="redhat6", target=generic.name) @pytest.fixture diff --git a/lib/spack/spack/test/cvs_fetch.py b/lib/spack/spack/test/cvs_fetch.py index 61d3c11ee61738..0e7c02ebd508bc 100644 --- a/lib/spack/spack/test/cvs_fetch.py +++ b/lib/spack/spack/test/cvs_fetch.py @@ -8,8 +8,8 @@ from llnl.util.filesystem import mkdirp, touch, working_dir +import spack.concretize from spack.fetch_strategy import CvsFetchStrategy -from spack.spec import Spec from spack.stage import Stage from spack.util.executable import which from spack.version import Version @@ -37,7 +37,7 @@ def test_fetch(type_of_test, mock_cvs_repository, config, mutable_mock_repo): get_date = mock_cvs_repository.get_date # Construct the package under test - spec = Spec("cvs-test").concretized() + spec = spack.concretize.concretize_one("cvs-test") spec.package.versions[Version("cvs")] = test.args # Enter the stage directory and check some properties diff --git a/lib/spack/spack/test/database.py b/lib/spack/spack/test/database.py index b1fb160b6b28ab..4862a04071bb7d 100644 --- a/lib/spack/spack/test/database.py +++ b/lib/spack/spack/test/database.py @@ -28,6 +28,7 @@ import llnl.util.lock as lk from llnl.util.tty.colify import colify +import spack.concretize import spack.database import spack.deptypes as dt import spack.package_base @@ -108,8 +109,8 @@ def test_query_by_install_tree( up_db, down_db = upstream_and_downstream_db # Set the upstream DB to contain "pkg-c" and downstream to contain "pkg-b") - b = spack.spec.Spec("pkg-b").concretized() - c = spack.spec.Spec("pkg-c").concretized() + b = spack.concretize.concretize_one("pkg-b") + c = spack.concretize.concretize_one("pkg-c") with writable(up_db): up_db.add(c) up_db._read() @@ -127,7 +128,7 @@ def test_spec_installed_upstream( # a known installed spec should say that it's installed with spack.repo.use_repositories(mock_custom_repository): - spec = spack.spec.Spec("pkg-c").concretized() + spec = spack.concretize.concretize_one("pkg-c") assert not spec.installed assert not spec.installed_upstream @@ -157,7 +158,7 @@ def test_installed_upstream(upstream_and_downstream_db, tmpdir): builder.add_package("w", dependencies=[("x", None, None), ("y", None, None)]) with spack.repo.use_repositories(builder.root): - spec = spack.spec.Spec("w").concretized() + spec = spack.concretize.concretize_one("w") with writable(upstream_db): for dep in spec.traverse(root=False): upstream_db.add(dep) @@ -169,7 +170,7 @@ def test_installed_upstream(upstream_and_downstream_db, tmpdir): with pytest.raises(spack.database.ForbiddenLockError): upstream_db.get_by_hash(dep.dag_hash()) - new_spec = spack.spec.Spec("w").concretized() + new_spec = spack.concretize.concretize_one("w") downstream_db.add(new_spec) for dep in new_spec.traverse(root=False): upstream, record = downstream_db.query_by_spec_hash(dep.dag_hash()) @@ -191,7 +192,7 @@ def test_removed_upstream_dep(upstream_and_downstream_db, tmpdir, capsys, config builder.add_package("y", dependencies=[("z", None, None)]) with spack.repo.use_repositories(builder): - y = spack.spec.Spec("y").concretized() + y = spack.concretize.concretize_one("y") z = y["z"] # add dependency to upstream, dependents to downstream @@ -225,7 +226,7 @@ def test_add_to_upstream_after_downstream(upstream_and_downstream_db, tmpdir): builder.add_package("x") with spack.repo.use_repositories(builder.root): - spec = spack.spec.Spec("x").concretized() + spec = spack.concretize.concretize_one("x") downstream_db.add(spec) with writable(upstream_db): @@ -258,7 +259,7 @@ def test_cannot_write_upstream(tmp_path, mock_packages, config): db = spack.database.Database(str(tmp_path), is_upstream=True) with pytest.raises(spack.database.ForbiddenLockError): - db.add(spack.spec.Spec("pkg-a").concretized()) + db.add(spack.concretize.concretize_one("pkg-a")) @pytest.mark.usefixtures("config", "temporary_store") @@ -272,7 +273,7 @@ def test_recursive_upstream_dbs(tmpdir, gen_mock_layout): builder.add_package("x", dependencies=[("y", None, None)]) with spack.repo.use_repositories(builder.root): - spec = spack.spec.Spec("x").concretized() + spec = spack.concretize.concretize_one("x") db_c = spack.database.Database(roots[2], layout=layouts[2]) db_c.add(spec["z"]) @@ -422,7 +423,7 @@ def _check_remove_and_add_package(database: spack.database.Database, spec): def _mock_install(spec: str): - s = spack.spec.Spec(spec).concretized() + s = spack.concretize.concretize_one(spec) PackageInstaller([s.package], fake=True, explicit=True).install() @@ -475,8 +476,8 @@ def test_default_queries(database): def test_005_db_exists(database): """Make sure db cache file exists after creating.""" - index_file = os.path.join(database.root, ".spack-db", "index.json") - lock_file = os.path.join(database.root, ".spack-db", "lock") + index_file = os.path.join(database.root, ".spack-db", spack.database.INDEX_JSON_FILE) + lock_file = os.path.join(database.root, ".spack-db", spack.database._LOCK_FILE) assert os.path.exists(str(index_file)) # Lockfiles not currently supported on Windows if sys.platform != "win32": @@ -767,8 +768,7 @@ def test_regression_issue_8036(mutable_database, usr_folder_exists): # existing. Even when the package prefix exists, the package should # not be considered installed until it is added to the database by # the installer with install(). - s = spack.spec.Spec("externaltool@0.9") - s.concretize() + s = spack.concretize.concretize_one("externaltool@0.9") assert not s.installed # Now install the external package and check again the `installed` property @@ -783,8 +783,7 @@ def test_old_external_entries_prefix(mutable_database): jsonschema.validate(db_obj, schema) - s = spack.spec.Spec("externaltool") - s.concretize() + s = spack.concretize.concretize_one("externaltool") db_obj["database"]["installs"][s.dag_hash()]["path"] = "None" @@ -813,8 +812,7 @@ def test_uninstall_by_spec(mutable_database): def test_query_unused_specs(mutable_database): # This spec installs a fake cmake as a build only dependency - s = spack.spec.Spec("simple-inheritance") - s.concretize() + s = spack.concretize.concretize_one("simple-inheritance") PackageInstaller([s.package], fake=True, explicit=True).install() si = s.dag_hash() @@ -856,8 +854,7 @@ def check_unused(roots, deptype, expected): def test_query_spec_with_conditional_dependency(mutable_database): # The issue is triggered by having dependencies that are # conditional on a Boolean variant - s = spack.spec.Spec("hdf5~mpi") - s.concretize() + s = spack.concretize.concretize_one("hdf5~mpi") PackageInstaller([s.package], fake=True, explicit=True).install() results = spack.store.STORE.db.query_local("hdf5 ^mpich") @@ -897,7 +894,7 @@ def _is(self, spec): # Pretend the spec has been failure locked monkeypatch.setattr(spack.database.FailureTracker, "lock_taken", _is) - s = spack.spec.Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") spack.store.STORE.failure_tracker.clear(s) out = capfd.readouterr()[0] assert "Retaining failure marking" in out @@ -915,7 +912,7 @@ def _is(self, spec): # Ensure raise OSError when try to remove the non-existent marking monkeypatch.setattr(spack.database.FailureTracker, "persistent_mark", _is) - s = spack.spec.Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") spack.store.STORE.failure_tracker.clear(s, force=True) out = capfd.readouterr()[1] assert "Removing failure marking despite lock" in out @@ -930,7 +927,7 @@ def _raise_exc(lock): raise lk.LockTimeoutError("write", "/mock-lock", 1.234, 10) with tmpdir.as_cwd(): - s = spack.spec.Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") # Ensure attempt to acquire write lock on the mark raises the exception monkeypatch.setattr(lk.Lock, "acquire_write", _raise_exc) @@ -946,7 +943,7 @@ def _raise_exc(lock): def test_prefix_failed(mutable_database, monkeypatch): """Add coverage to failed operation.""" - s = spack.spec.Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") # Confirm the spec is not already marked as failed assert not spack.store.STORE.failure_tracker.has_failed(s) @@ -970,7 +967,7 @@ def test_prefix_write_lock_error(mutable_database, monkeypatch): def _raise(db, spec): raise lk.LockError("Mock lock error") - s = spack.spec.Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") # Ensure subsequent lock operations fail monkeypatch.setattr(lk.Lock, "acquire_write", _raise) @@ -985,7 +982,7 @@ def test_database_works_with_empty_dir(tmpdir): # Create the lockfile and failures directory otherwise # we'll get a permission error on Database creation db_dir = tmpdir.ensure_dir(".spack-db") - db_dir.ensure("lock") + db_dir.ensure(spack.database._LOCK_FILE) db_dir.ensure_dir("failures") tmpdir.chmod(mode=0o555) db = spack.database.Database(str(tmpdir)) @@ -1178,7 +1175,7 @@ def test_reindex_with_upstreams(tmp_path, monkeypatch, mock_packages, config): # we install `mpileaks` locally with dependencies in the upstream. And we even install # `mpileaks` with the same hash in the upstream. After reindexing, `mpileaks` should still be # in the local db, and `callpath` should not. - mpileaks = spack.spec.Spec("mpileaks").concretized() + mpileaks = spack.concretize.concretize_one("mpileaks") callpath = mpileaks.dependencies("callpath")[0] upstream_store = spack.store.create( diff --git a/lib/spack/spack/test/directives.py b/lib/spack/spack/test/directives.py index 055ef4b4094107..47f8023d598203 100644 --- a/lib/spack/spack/test/directives.py +++ b/lib/spack/spack/test/directives.py @@ -5,6 +5,7 @@ import pytest +import spack.concretize import spack.directives import spack.repo import spack.spec @@ -59,8 +60,8 @@ def test_constraints_from_context_are_merged(mock_packages): @pytest.mark.regression("27754") def test_extends_spec(config, mock_packages): - extender = spack.spec.Spec("extends-spec").concretized() - extendee = spack.spec.Spec("extendee").concretized() + extender = spack.concretize.concretize_one("extends-spec") + extendee = spack.concretize.concretize_one("extendee") assert extender.dependencies assert extender.package.extends(extendee) @@ -205,8 +206,8 @@ def test_repo(_create_test_repo, monkeypatch, mock_stage): ) def test_redistribute_directive(test_repo, spec_str, distribute_src, distribute_bin): spec = spack.spec.Spec(spec_str) - assert spec.package_class.redistribute_source(spec) == distribute_src - concretized_spec = spec.concretized() + assert spack.repo.PATH.get_pkg_class(spec.fullname).redistribute_source(spec) == distribute_src + concretized_spec = spack.concretize.concretize_one(spec) assert concretized_spec.package.redistribute_binary == distribute_bin diff --git a/lib/spack/spack/test/directory_layout.py b/lib/spack/spack/test/directory_layout.py index 81aafc297bb9db..08c4166a76a6e6 100644 --- a/lib/spack/spack/test/directory_layout.py +++ b/lib/spack/spack/test/directory_layout.py @@ -6,13 +6,13 @@ This test verifies that the Spack directory layout works properly. """ import os -import os.path from pathlib import Path import pytest from llnl.path import path_to_os_path +import spack.concretize import spack.hash_types import spack.paths import spack.repo @@ -59,7 +59,7 @@ def test_yaml_directory_layout_parameters(tmpdir, default_mock_concretization): assert package7 == path_package7 # Test separation of architecture or namespace - spec2 = Spec("libelf").concretized() + spec2 = spack.concretize.concretize_one("libelf") arch_scheme = ( "{architecture.platform}/{architecture.target}/{architecture.os}/{name}/{version}/{hash:7}" @@ -97,7 +97,7 @@ def test_read_and_write_spec(temporary_store, config, mock_packages): # If a spec fails to concretize, just skip it. If it is a # real error, it will be caught by concretization tests. try: - spec = spack.spec.Spec(name).concretized() + spec = spack.concretize.concretize_one(name) except Exception: continue @@ -136,7 +136,7 @@ def test_read_and_write_spec(temporary_store, config, mock_packages): assert norm.eq_dag(spec_from_file) # TODO: revise this when build deps are in dag_hash - conc = read_separately.concretized().copy(deps=stored_deptypes) + conc = spack.concretize.concretize_one(read_separately).copy(deps=stored_deptypes) assert conc == spec_from_file assert conc.eq_dag(spec_from_file) @@ -172,12 +172,10 @@ def test_handle_unknown_package(temporary_store, config, mock_packages, tmp_path # Create all the packages that are not in mock. installed_specs = {} for pkg_name in packages: - spec = spack.spec.Spec(pkg_name) - # If a spec fails to concretize, just skip it. If it is a # real error, it will be caught by concretization tests. try: - spec.concretize() + spec = spack.concretize.concretize_one(pkg_name) except Exception: continue @@ -209,7 +207,7 @@ def test_find(temporary_store, config, mock_packages): if name.startswith("external"): # External package tests cannot be installed continue - spec = spack.spec.Spec(name).concretized() + spec = spack.concretize.concretize_one(name) installed_specs[spec.name] = spec layout.create_install_directory(spec) diff --git a/lib/spack/spack/test/env.py b/lib/spack/spack/test/env.py index 882db1e6863244..16c78bb5a9dd10 100644 --- a/lib/spack/spack/test/env.py +++ b/lib/spack/spack/test/env.py @@ -190,8 +190,7 @@ def test_environment_cant_modify_environments_root(tmpdir): @pytest.mark.parametrize( "original_content", [ - ( - """\ + """\ spack: specs: - matrix: @@ -199,7 +198,6 @@ def test_environment_cant_modify_environments_root(tmpdir): - - a concretizer: unify: false""" - ) ], ) def test_roundtrip_spack_yaml_with_comments(original_content, mock_packages, config, tmp_path): diff --git a/lib/spack/spack/test/flag_handlers.py b/lib/spack/spack/test/flag_handlers.py index 8fbd0e0184c747..796b351ee3cd28 100644 --- a/lib/spack/spack/test/flag_handlers.py +++ b/lib/spack/spack/test/flag_handlers.py @@ -7,7 +7,7 @@ import pytest import spack.build_environment -import spack.spec +import spack.concretize from spack.package import build_system_flags, env_flags, inject_flags @@ -30,10 +30,10 @@ def add_o3_to_build_system_cflags(pkg, name, flags): class TestFlagHandlers: def test_no_build_system_flags(self, temp_env): # Test that both autotools and cmake work getting no build_system flags - s1 = spack.spec.Spec("cmake-client").concretized() + s1 = spack.concretize.concretize_one("cmake-client") spack.build_environment.setup_package(s1.package, False) - s2 = spack.spec.Spec("patchelf").concretized() + s2 = spack.concretize.concretize_one("patchelf") spack.build_environment.setup_package(s2.package, False) # Use cppflags as a canary @@ -43,28 +43,28 @@ def test_no_build_system_flags(self, temp_env): def test_unbound_method(self, temp_env): # Other tests test flag_handlers set as bound methods and functions. # This tests an unbound method in python2 (no change in python3). - s = spack.spec.Spec("mpileaks cppflags=-g").concretized() + s = spack.concretize.concretize_one("mpileaks cppflags=-g") s.package.flag_handler = s.package.__class__.inject_flags spack.build_environment.setup_package(s.package, False) assert os.environ["SPACK_CPPFLAGS"] == "-g" assert "CPPFLAGS" not in os.environ def test_inject_flags(self, temp_env): - s = spack.spec.Spec("mpileaks cppflags=-g").concretized() + s = spack.concretize.concretize_one("mpileaks cppflags=-g") s.package.flag_handler = inject_flags spack.build_environment.setup_package(s.package, False) assert os.environ["SPACK_CPPFLAGS"] == "-g" assert "CPPFLAGS" not in os.environ def test_env_flags(self, temp_env): - s = spack.spec.Spec("mpileaks cppflags=-g").concretized() + s = spack.concretize.concretize_one("mpileaks cppflags=-g") s.package.flag_handler = env_flags spack.build_environment.setup_package(s.package, False) assert os.environ["CPPFLAGS"] == "-g" assert "SPACK_CPPFLAGS" not in os.environ def test_build_system_flags_cmake(self, temp_env): - s = spack.spec.Spec("cmake-client cppflags=-g").concretized() + s = spack.concretize.concretize_one("cmake-client cppflags=-g") s.package.flag_handler = build_system_flags spack.build_environment.setup_package(s.package, False) assert "SPACK_CPPFLAGS" not in os.environ @@ -76,7 +76,7 @@ def test_build_system_flags_cmake(self, temp_env): } def test_build_system_flags_autotools(self, temp_env): - s = spack.spec.Spec("patchelf cppflags=-g").concretized() + s = spack.concretize.concretize_one("patchelf cppflags=-g") s.package.flag_handler = build_system_flags spack.build_environment.setup_package(s.package, False) assert "SPACK_CPPFLAGS" not in os.environ @@ -85,7 +85,7 @@ def test_build_system_flags_autotools(self, temp_env): def test_build_system_flags_not_implemented(self, temp_env): """Test the command line flags method raises a NotImplementedError""" - s = spack.spec.Spec("mpileaks cppflags=-g").concretized() + s = spack.concretize.concretize_one("mpileaks cppflags=-g") s.package.flag_handler = build_system_flags try: spack.build_environment.setup_package(s.package, False) @@ -94,7 +94,7 @@ def test_build_system_flags_not_implemented(self, temp_env): assert True def test_add_build_system_flags_autotools(self, temp_env): - s = spack.spec.Spec("patchelf cppflags=-g").concretized() + s = spack.concretize.concretize_one("patchelf cppflags=-g") s.package.flag_handler = add_o3_to_build_system_cflags spack.build_environment.setup_package(s.package, False) assert "-g" in os.environ["SPACK_CPPFLAGS"] @@ -102,7 +102,7 @@ def test_add_build_system_flags_autotools(self, temp_env): assert s.package.configure_flag_args == ["CFLAGS=-O3"] def test_add_build_system_flags_cmake(self, temp_env): - s = spack.spec.Spec("cmake-client cppflags=-g").concretized() + s = spack.concretize.concretize_one("cmake-client cppflags=-g") s.package.flag_handler = add_o3_to_build_system_cflags spack.build_environment.setup_package(s.package, False) assert "-g" in os.environ["SPACK_CPPFLAGS"] @@ -110,7 +110,7 @@ def test_add_build_system_flags_cmake(self, temp_env): assert s.package.cmake_flag_args == ["-DCMAKE_C_FLAGS=-O3"] def test_ld_flags_cmake(self, temp_env): - s = spack.spec.Spec("cmake-client ldflags=-mthreads").concretized() + s = spack.concretize.concretize_one("cmake-client ldflags=-mthreads") s.package.flag_handler = build_system_flags spack.build_environment.setup_package(s.package, False) assert "SPACK_LDFLAGS" not in os.environ @@ -122,7 +122,7 @@ def test_ld_flags_cmake(self, temp_env): } def test_ld_libs_cmake(self, temp_env): - s = spack.spec.Spec("cmake-client ldlibs=-lfoo").concretized() + s = spack.concretize.concretize_one("cmake-client ldlibs=-lfoo") s.package.flag_handler = build_system_flags spack.build_environment.setup_package(s.package, False) assert "SPACK_LDLIBS" not in os.environ @@ -138,7 +138,7 @@ def test_flag_handler(self, name, flags): flags.append("-foo") return (flags, None, None) - s = spack.spec.Spec("cmake-client").concretized() + s = spack.concretize.concretize_one("cmake-client") s.package.flag_handler = test_flag_handler spack.build_environment.setup_package(s.package, False) diff --git a/lib/spack/spack/test/git_fetch.py b/lib/spack/spack/test/git_fetch.py index 7118340cb5980f..8ee447aca3e382 100644 --- a/lib/spack/spack/test/git_fetch.py +++ b/lib/spack/spack/test/git_fetch.py @@ -10,6 +10,7 @@ from llnl.util.filesystem import mkdirp, touch, working_dir +import spack.concretize import spack.config import spack.error import spack.fetch_strategy @@ -185,8 +186,9 @@ def test_adhoc_version_submodules( monkeypatch.setitem(pkg_class.versions, Version("git"), t.args) monkeypatch.setattr(pkg_class, "git", "file://%s" % mock_git_repository.path, raising=False) - spec = Spec("git-test@{0}".format(mock_git_repository.unversioned_commit)) - spec.concretize() + spec = spack.concretize.concretize_one( + Spec("git-test@{0}".format(mock_git_repository.unversioned_commit)) + ) spec.package.do_stage() collected_fnames = set() for root, dirs, files in os.walk(spec.package.stage.source_path): diff --git a/lib/spack/spack/test/graph.py b/lib/spack/spack/test/graph.py index 2708c320b91c50..1de967122345ea 100644 --- a/lib/spack/spack/test/graph.py +++ b/lib/spack/spack/test/graph.py @@ -3,8 +3,8 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import io +import spack.concretize import spack.graph -import spack.spec def test_dynamic_dot_graph_mpileaks(default_mock_concretization): @@ -38,7 +38,7 @@ def test_dynamic_dot_graph_mpileaks(default_mock_concretization): def test_ascii_graph_mpileaks(config, mock_packages, monkeypatch): monkeypatch.setattr(spack.graph.AsciiGraph, "_node_label", lambda self, node: node.name) - s = spack.spec.Spec("mpileaks").concretized() + s = spack.concretize.concretize_one("mpileaks") stream = io.StringIO() graph = spack.graph.AsciiGraph() diff --git a/lib/spack/spack/test/hg_fetch.py b/lib/spack/spack/test/hg_fetch.py index 59baaf8fa860c0..9e7145a547beb7 100644 --- a/lib/spack/spack/test/hg_fetch.py +++ b/lib/spack/spack/test/hg_fetch.py @@ -8,9 +8,9 @@ from llnl.util.filesystem import mkdirp, touch, working_dir +import spack.concretize import spack.config from spack.fetch_strategy import HgFetchStrategy -from spack.spec import Spec from spack.stage import Stage from spack.util.executable import which from spack.version import Version @@ -40,7 +40,7 @@ def test_fetch(type_of_test, secure, mock_hg_repository, config, mutable_mock_re h = mock_hg_repository.hash # Construct the package under test - s = Spec("hg-test").concretized() + s = spack.concretize.concretize_one("hg-test") monkeypatch.setitem(s.package.versions, Version("hg"), t.args) # Enter the stage directory and check some properties diff --git a/lib/spack/spack/test/install.py b/lib/spack/spack/test/install.py index 05d5144fae59e0..7060bb26934bf6 100644 --- a/lib/spack/spack/test/install.py +++ b/lib/spack/spack/test/install.py @@ -11,6 +11,7 @@ import llnl.util.filesystem as fs import spack.build_environment +import spack.concretize import spack.config import spack.database import spack.error @@ -41,7 +42,7 @@ def find_nothing(*args): def test_install_and_uninstall(install_mockery, mock_fetch, monkeypatch): - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") PackageInstaller([spec.package], explicit=True).install() assert spec.installed @@ -53,7 +54,7 @@ def test_install_and_uninstall(install_mockery, mock_fetch, monkeypatch): @pytest.mark.regression("11870") def test_uninstall_non_existing_package(install_mockery, mock_fetch, monkeypatch): """Ensure that we can uninstall a package that has been deleted from the repo""" - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") PackageInstaller([spec.package], explicit=True).install() assert spec.installed @@ -71,8 +72,7 @@ def test_uninstall_non_existing_package(install_mockery, mock_fetch, monkeypatch def test_pkg_attributes(install_mockery, mock_fetch, monkeypatch): # Get a basic concrete spec for the dummy package. - spec = Spec("attributes-foo-app ^attributes-foo") - spec.concretize() + spec = spack.concretize.concretize_one("attributes-foo-app ^attributes-foo") assert spec.concrete pkg = spec.package @@ -127,7 +127,7 @@ def remove_prefix(self): def test_partial_install_delete_prefix_and_stage(install_mockery, mock_fetch, working_env): - s = Spec("canfail").concretized() + s = spack.concretize.concretize_one("canfail") instance_rm_prefix = s.package.remove_prefix @@ -157,7 +157,7 @@ def test_failing_overwrite_install_should_keep_previous_installation( the original install prefix instead of cleaning it. """ # Do a successful install - s = Spec("canfail").concretized() + s = spack.concretize.concretize_one("canfail") s.package.set_install_succeed() # Do a failing overwrite install @@ -173,13 +173,11 @@ def test_failing_overwrite_install_should_keep_previous_installation( def test_dont_add_patches_to_installed_package(install_mockery, mock_fetch, monkeypatch): - dependency = Spec("dependency-install") - dependency.concretize() + dependency = spack.concretize.concretize_one("dependency-install") PackageInstaller([dependency.package], explicit=True).install() dependency_hash = dependency.dag_hash() - dependent = Spec("dependent-install ^/" + dependency_hash) - dependent.concretize() + dependent = spack.concretize.concretize_one("dependent-install ^/" + dependency_hash) monkeypatch.setitem( dependency.package.patches, @@ -191,31 +189,18 @@ def test_dont_add_patches_to_installed_package(install_mockery, mock_fetch, monk def test_installed_dependency_request_conflicts(install_mockery, mock_fetch, mutable_mock_repo): - dependency = Spec("dependency-install") - dependency.concretize() + dependency = spack.concretize.concretize_one("dependency-install") PackageInstaller([dependency.package], explicit=True).install() dependency_hash = dependency.dag_hash() dependent = Spec("conflicting-dependent ^/" + dependency_hash) with pytest.raises(spack.error.UnsatisfiableSpecError): - dependent.concretize() - - -def test_install_dependency_symlinks_pkg(install_mockery, mock_fetch, mutable_mock_repo): - """Test dependency flattening/symlinks mock package.""" - spec = Spec("flatten-deps") - spec.concretize() - pkg = spec.package - PackageInstaller([pkg], explicit=True).install() - - # Ensure dependency directory exists after the installation. - dependency_dir = os.path.join(pkg.prefix, "dependency-install") - assert os.path.isdir(dependency_dir) + spack.concretize.concretize_one(dependent) def test_install_times(install_mockery, mock_fetch, mutable_mock_repo): """Test install times added.""" - spec = Spec("dev-build-test-install-phases").concretized() + spec = spack.concretize.concretize_one("dev-build-test-install-phases") PackageInstaller([spec.package], explicit=True).install() # Ensure dependency directory exists after the installation. @@ -232,27 +217,6 @@ def test_install_times(install_mockery, mock_fetch, mutable_mock_repo): assert all(isinstance(x["seconds"], float) for x in times["phases"]) -def test_flatten_deps(install_mockery, mock_fetch, mutable_mock_repo): - """Explicitly test the flattening code for coverage purposes.""" - # Unfortunately, executing the 'flatten-deps' spec's installation does - # not affect code coverage results, so be explicit here. - spec = Spec("dependent-install") - spec.concretize() - pkg = spec.package - PackageInstaller([pkg], explicit=True).install() - - # Demonstrate that the directory does not appear under the spec - # prior to the flatten operation. - dependency_name = "dependency-install" - assert dependency_name not in os.listdir(pkg.prefix) - - # Flatten the dependencies and ensure the dependency directory is there. - spack.package_base.flatten_dependencies(spec, pkg.prefix) - - dependency_dir = os.path.join(pkg.prefix, dependency_name) - assert os.path.isdir(dependency_dir) - - @pytest.fixture() def install_upstream(tmpdir_factory, gen_mock_layout, install_mockery): """Provides a function that installs a specified set of specs to an @@ -272,7 +236,7 @@ def install_upstream(tmpdir_factory, gen_mock_layout, install_mockery): def _install_upstream(*specs): for spec_str in specs: - prepared_db.add(Spec(spec_str).concretized()) + prepared_db.add(spack.concretize.concretize_one(spec_str)) downstream_root = str(tmpdir_factory.mktemp("mock_downstream_db_root")) return downstream_root, upstream_layout @@ -285,8 +249,7 @@ def test_installed_upstream_external(install_upstream, mock_fetch): """ store_root, _ = install_upstream("externaltool") with spack.store.use_store(store_root): - dependent = Spec("externaltest") - dependent.concretize() + dependent = spack.concretize.concretize_one("externaltest") new_dependency = dependent["externaltool"] assert new_dependency.external @@ -304,8 +267,8 @@ def test_installed_upstream(install_upstream, mock_fetch): """ store_root, upstream_layout = install_upstream("dependency-install") with spack.store.use_store(store_root): - dependency = Spec("dependency-install").concretized() - dependent = Spec("dependent-install").concretized() + dependency = spack.concretize.concretize_one("dependency-install") + dependent = spack.concretize.concretize_one("dependent-install") new_dependency = dependent["dependency-install"] assert new_dependency.installed_upstream @@ -319,7 +282,7 @@ def test_installed_upstream(install_upstream, mock_fetch): @pytest.mark.disable_clean_stage_check def test_partial_install_keep_prefix(install_mockery, mock_fetch, monkeypatch, working_env): - s = Spec("canfail").concretized() + s = spack.concretize.concretize_one("canfail") # If remove_prefix is called at any point in this test, that is an error monkeypatch.setattr(spack.package_base.PackageBase, "remove_prefix", mock_remove_prefix) @@ -336,7 +299,7 @@ def test_partial_install_keep_prefix(install_mockery, mock_fetch, monkeypatch, w def test_second_install_no_overwrite_first(install_mockery, mock_fetch, monkeypatch): - s = Spec("canfail").concretized() + s = spack.concretize.concretize_one("canfail") monkeypatch.setattr(spack.package_base.PackageBase, "remove_prefix", mock_remove_prefix) s.package.set_install_succeed() @@ -356,8 +319,8 @@ def test_install_prefix_collision_fails(config, mock_fetch, mock_packages, tmpdi projections = {"projections": {"all": "one-prefix-per-package-{name}"}} with spack.store.use_store(str(tmpdir), extra_data=projections): with spack.config.override("config:checksum", False): - pkg_a = Spec("libelf@0.8.13").concretized().package - pkg_b = Spec("libelf@0.8.12").concretized().package + pkg_a = spack.concretize.concretize_one("libelf@0.8.13").package + pkg_b = spack.concretize.concretize_one("libelf@0.8.12").package PackageInstaller([pkg_a], explicit=True, fake=True).install() with pytest.raises(InstallError, match="Install prefix collision"): @@ -365,14 +328,14 @@ def test_install_prefix_collision_fails(config, mock_fetch, mock_packages, tmpdi def test_store(install_mockery, mock_fetch): - spec = Spec("cmake-client").concretized() + spec = spack.concretize.concretize_one("cmake-client") pkg = spec.package PackageInstaller([pkg], fake=True, explicit=True).install() @pytest.mark.disable_clean_stage_check def test_failing_build(install_mockery, mock_fetch, capfd): - spec = Spec("failing-build").concretized() + spec = spack.concretize.concretize_one("failing-build") pkg = spec.package with pytest.raises(spack.build_environment.ChildError, match="Expected failure"): @@ -387,8 +350,7 @@ def test_uninstall_by_spec_errors(mutable_database): """Test exceptional cases with the uninstall command.""" # Try to uninstall a spec that has not been installed - spec = Spec("dependent-install") - spec.concretize() + spec = spack.concretize.concretize_one("dependent-install") with pytest.raises(InstallError, match="is not installed"): PackageBase.uninstall_by_spec(spec) @@ -401,7 +363,7 @@ def test_uninstall_by_spec_errors(mutable_database): @pytest.mark.disable_clean_stage_check def test_nosource_pkg_install(install_mockery, mock_fetch, mock_packages, capfd, ensure_debug): """Test install phases with the nosource package.""" - spec = Spec("nosource").concretized() + spec = spack.concretize.concretize_one("nosource") pkg = spec.package # Make sure install works even though there is no associated code. @@ -418,7 +380,7 @@ def test_nosource_bundle_pkg_install( install_mockery, mock_fetch, mock_packages, capfd, ensure_debug ): """Test install phases with the nosource-bundle package.""" - spec = Spec("nosource-bundle").concretized() + spec = spack.concretize.concretize_one("nosource-bundle") pkg = spec.package # Make sure install works even though there is no associated code. @@ -432,7 +394,7 @@ def test_nosource_bundle_pkg_install( def test_nosource_pkg_install_post_install(install_mockery, mock_fetch, mock_packages): """Test install phases with the nosource package with post-install.""" - spec = Spec("nosource-install").concretized() + spec = spack.concretize.concretize_one("nosource-install") pkg = spec.package # Make sure both the install and post-install package methods work. @@ -449,14 +411,14 @@ def test_nosource_pkg_install_post_install(install_mockery, mock_fetch, mock_pac def test_pkg_build_paths(install_mockery): # Get a basic concrete spec for the trivial install package. - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") assert spec.package.log_path.endswith(_spack_build_logfile) assert spec.package.env_path.endswith(_spack_build_envfile) def test_pkg_install_paths(install_mockery): # Get a basic concrete spec for the trivial install package. - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") log_path = os.path.join(spec.prefix, ".spack", _spack_build_logfile + ".gz") assert spec.package.install_log_path == log_path @@ -493,10 +455,10 @@ def test_pkg_install_paths(install_mockery): def test_log_install_without_build_files(install_mockery): """Test the installer log function when no build files are present.""" # Get a basic concrete spec for the trivial install package. - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") # Attempt installing log without the build log file - with pytest.raises(IOError, match="No such file or directory"): + with pytest.raises(OSError, match="No such file or directory"): spack.installer.log(spec.package) @@ -515,7 +477,7 @@ def _install(src, dest): monkeypatch.setattr(fs, "install", _install) - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") # Set up mock build files and try again to include archive failure log_path = spec.package.log_path @@ -587,7 +549,7 @@ def test_empty_install_sanity_check_prefix( monkeypatch, install_mockery, mock_fetch, mock_packages ): """Test empty install triggers sanity_check_prefix.""" - spec = Spec("failing-empty-install").concretized() + spec = spack.concretize.concretize_one("failing-empty-install") with pytest.raises(spack.build_environment.ChildError, match="Nothing was installed"): PackageInstaller([spec.package], explicit=True).install() @@ -599,7 +561,7 @@ def test_install_from_binary_with_missing_patch_succeeds( pushing the package to a binary cache, installation from that binary cache shouldn't error out because of the missing patch.""" # Create a spec s with non-existing patches - s = Spec("trivial-install-test-package").concretized() + s = spack.concretize.concretize_one("trivial-install-test-package") patches = ["a" * 64] s_dict = s.to_dict() s_dict["spec"]["nodes"][0]["patches"] = patches diff --git a/lib/spack/spack/test/installer.py b/lib/spack/spack/test/installer.py index af9ba26fef642c..65e90274211a6d 100644 --- a/lib/spack/spack/test/installer.py +++ b/lib/spack/spack/test/installer.py @@ -16,6 +16,7 @@ import llnl.util.tty as tty import spack.binary_distribution +import spack.concretize import spack.database import spack.deptypes as dt import spack.error @@ -81,7 +82,7 @@ def create_installer( ) -> inst.PackageInstaller: """Create an installer instance for a list of specs or package names that will be concretized.""" - _specs = [spack.spec.Spec(s).concretized() if isinstance(s, str) else s for s in specs] + _specs = [spack.concretize.concretize_one(s) if isinstance(s, str) else s for s in specs] _install_args = {} if install_args is None else install_args return inst.PackageInstaller([spec.package for spec in _specs], **_install_args) @@ -96,8 +97,7 @@ def test_hms(sec, result): def test_get_dependent_ids(install_mockery, mock_packages): # Concretize the parent package, which handle dependency too - spec = spack.spec.Spec("pkg-a") - spec.concretize() + spec = spack.concretize.concretize_one("pkg-a") assert spec.concrete pkg_id = inst.package_id(spec) @@ -133,8 +133,7 @@ def test_install_msg(monkeypatch): def test_install_from_cache_errors(install_mockery): """Test to ensure cover install from cache errors.""" - spec = spack.spec.Spec("trivial-install-test-package") - spec.concretize() + spec = spack.concretize.concretize_one("trivial-install-test-package") assert spec.concrete # Check with cache-only @@ -153,8 +152,7 @@ def test_install_from_cache_errors(install_mockery): def test_install_from_cache_ok(install_mockery, monkeypatch): """Test to ensure cover _install_from_cache to the return.""" - spec = spack.spec.Spec("trivial-install-test-package") - spec.concretize() + spec = spack.concretize.concretize_one("trivial-install-test-package") monkeypatch.setattr(inst, "_try_install_from_binary_cache", _true) monkeypatch.setattr(spack.hooks, "post_install", _noop) @@ -163,8 +161,7 @@ def test_install_from_cache_ok(install_mockery, monkeypatch): def test_process_external_package_module(install_mockery, monkeypatch, capfd): """Test to simply cover the external module message path.""" - spec = spack.spec.Spec("trivial-install-test-package") - spec.concretize() + spec = spack.concretize.concretize_one("trivial-install-test-package") assert spec.concrete # Ensure take the external module path WITHOUT any changes to the database @@ -191,7 +188,7 @@ def _spec(spec, unsigned=False, mirrors_for_spec=None): # Skip database updates monkeypatch.setattr(spack.database.Database, "add", _noop) - spec = spack.spec.Spec("pkg-a").concretized() + spec = spack.concretize.concretize_one("pkg-a") assert inst._process_binary_cache_tarball(spec.package, explicit=False, unsigned=False) out = capfd.readouterr()[0] @@ -201,8 +198,7 @@ def _spec(spec, unsigned=False, mirrors_for_spec=None): def test_try_install_from_binary_cache(install_mockery, mock_packages, monkeypatch): """Test return false when no match exists in the mirror""" - spec = spack.spec.Spec("mpich") - spec.concretize() + spec = spack.concretize.concretize_one("mpich") result = inst._try_install_from_binary_cache(spec.package, False, False) assert not result @@ -274,7 +270,7 @@ def _mock_installed(self): def test_check_before_phase_error(install_mockery): - s = spack.spec.Spec("trivial-install-test-package").concretized() + s = spack.concretize.concretize_one("trivial-install-test-package") s.package.stop_before_phase = "beforephase" with pytest.raises(inst.BadInstallPhase) as exc_info: inst._check_last_phase(s.package) @@ -285,7 +281,7 @@ def test_check_before_phase_error(install_mockery): def test_check_last_phase_error(install_mockery): - s = spack.spec.Spec("trivial-install-test-package").concretized() + s = spack.concretize.concretize_one("trivial-install-test-package") s.package.stop_before_phase = None s.package.last_phase = "badphase" with pytest.raises(inst.BadInstallPhase) as exc_info: @@ -420,15 +416,13 @@ def test_package_id_err(install_mockery): def test_package_id_ok(install_mockery): - spec = spack.spec.Spec("trivial-install-test-package") - spec.concretize() + spec = spack.concretize.concretize_one("trivial-install-test-package") assert spec.concrete assert spec.name in inst.package_id(spec) def test_fake_install(install_mockery): - spec = spack.spec.Spec("trivial-install-test-package") - spec.concretize() + spec = spack.concretize.concretize_one("trivial-install-test-package") assert spec.concrete pkg = spec.package @@ -440,7 +434,7 @@ def test_dump_packages_deps_ok(install_mockery, tmpdir, mock_packages): """Test happy path for dump_packages with dependencies.""" spec_name = "simple-inheritance" - spec = spack.spec.Spec(spec_name).concretized() + spec = spack.concretize.concretize_one(spec_name) inst.dump_packages(spec, str(tmpdir)) repo = mock_packages.repos[0] @@ -471,12 +465,12 @@ def _repoerr(repo, name): # the try-except block monkeypatch.setattr(spack.store.STORE.layout, "build_packages_path", bpp_path) - spec = spack.spec.Spec("simple-inheritance").concretized() + spec = spack.concretize.concretize_one("simple-inheritance") path = str(tmpdir) # The call to install_tree will raise the exception since not mocking # creation of dependency package files within *install* directories. - with pytest.raises(IOError, match=path if sys.platform != "win32" else ""): + with pytest.raises(OSError, match=path if sys.platform != "win32" else ""): inst.dump_packages(spec, path) # Now try the error path, which requires the mock directory structure @@ -563,7 +557,7 @@ def test_combine_phase_logs(tmpdir): def test_combine_phase_logs_does_not_care_about_encoding(tmpdir): # this is invalid utf-8 at a minimum - data = b"\x00\xF4\xBF\x00\xBF\xBF" + data = b"\x00\xf4\xbf\x00\xbf\xbf" input = [str(tmpdir.join("a")), str(tmpdir.join("b"))] output = str(tmpdir.join("c")) @@ -581,7 +575,7 @@ def test_check_deps_status_install_failure(install_mockery): """Tests that checking the dependency status on a request to install 'a' fails, if we mark the dependency as failed. """ - s = spack.spec.Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") for dep in s.traverse(root=False): spack.store.STORE.failure_tracker.mark(dep) @@ -654,8 +648,8 @@ def test_installer_init_requests(install_mockery): @pytest.mark.parametrize("transitive", [True, False]) def test_install_spliced(install_mockery, mock_fetch, monkeypatch, capsys, transitive): """Test installing a spliced spec""" - spec = spack.spec.Spec("splice-t").concretized() - dep = spack.spec.Spec("splice-h+foo").concretized() + spec = spack.concretize.concretize_one("splice-t") + dep = spack.concretize.concretize_one("splice-h+foo") # Do the splice. out = spec.splice(dep, transitive) @@ -669,8 +663,8 @@ def test_install_spliced(install_mockery, mock_fetch, monkeypatch, capsys, trans @pytest.mark.parametrize("transitive", [True, False]) def test_install_spliced_build_spec_installed(install_mockery, capfd, mock_fetch, transitive): """Test installing a spliced spec with the build spec already installed""" - spec = spack.spec.Spec("splice-t").concretized() - dep = spack.spec.Spec("splice-h+foo").concretized() + spec = spack.concretize.concretize_one("splice-t") + dep = spack.concretize.concretize_one("splice-h+foo") # Do the splice. out = spec.splice(dep, transitive) @@ -696,8 +690,8 @@ def test_install_splice_root_from_binary( ): """Test installing a spliced spec with the root available in binary cache""" # Test splicing and rewiring a spec with the same name, different hash. - original_spec = spack.spec.Spec(root_str).concretized() - spec_to_splice = spack.spec.Spec("splice-h+foo").concretized() + original_spec = spack.concretize.concretize_one(root_str) + spec_to_splice = spack.concretize.concretize_one("splice-h+foo") PackageInstaller([original_spec.package, spec_to_splice.package]).install() @@ -853,7 +847,7 @@ def _chgrp(path, group, follow_symlinks=True): monkeypatch.setattr(fs, "chgrp", _chgrp) build_task = create_build_task( - spack.spec.Spec("trivial-install-test-package").concretized().package + spack.concretize.concretize_one("trivial-install-test-package").package ) spec = build_task.request.pkg.spec @@ -1024,7 +1018,8 @@ def test_install_fail_multi(install_mockery, mock_fetch, monkeypatch): def test_install_fail_fast_on_detect(install_mockery, monkeypatch, capsys): """Test fail_fast install when an install failure is detected.""" - b, c = spack.spec.Spec("pkg-b").concretized(), spack.spec.Spec("pkg-c").concretized() + b = spack.concretize.concretize_one("pkg-b") + c = spack.concretize.concretize_one("pkg-c") b_id, c_id = inst.package_id(b), inst.package_id(c) installer = create_installer([b, c], {"fail_fast": True}) @@ -1093,7 +1088,7 @@ def _requeued(installer, task, install_status): def test_install_lock_installed_requeue(install_mockery, monkeypatch, capfd): """Cover basic install handling for installed package.""" - b = spack.spec.Spec("pkg-b").concretized() + b = spack.concretize.concretize_one("pkg-b") b_pkg_id = inst.package_id(b) installer = create_installer([b]) @@ -1279,7 +1274,7 @@ def test_term_status_line(): @pytest.mark.parametrize("explicit", [True, False]) def test_single_external_implicit_install(install_mockery, explicit): pkg = "trivial-install-test-package" - s = spack.spec.Spec(pkg).concretized() + s = spack.concretize.concretize_one(pkg) s.external_path = "/usr" args = {"explicit": [s.dag_hash()] if explicit else []} create_installer([s], args).install() @@ -1288,7 +1283,7 @@ def test_single_external_implicit_install(install_mockery, explicit): def test_overwrite_install_does_install_build_deps(install_mockery, mock_fetch): """When overwrite installing something from sources, build deps should be installed.""" - s = spack.spec.Spec("dtrun3").concretized() + s = spack.concretize.concretize_one("dtrun3") create_installer([s]).install() # Verify there is a pure build dep @@ -1310,7 +1305,7 @@ def test_overwrite_install_does_install_build_deps(install_mockery, mock_fetch): def test_print_install_test_log_skipped(install_mockery, mock_packages, capfd, run_tests): """Confirm printing of install log skipped if not run/no failures.""" name = "trivial-install-test-package" - s = spack.spec.Spec(name).concretized() + s = spack.concretize.concretize_one(name) pkg = s.package pkg.run_tests = run_tests @@ -1324,7 +1319,7 @@ def test_print_install_test_log_failures( ): """Confirm expected outputs when there are test failures.""" name = "trivial-install-test-package" - s = spack.spec.Spec(name).concretized() + s = spack.concretize.concretize_one(name) pkg = s.package # Missing test log is an error diff --git a/lib/spack/spack/test/llnl/util/file_list.py b/lib/spack/spack/test/llnl/util/file_list.py index 587d5d3a7dcddd..6c4f256f060723 100644 --- a/lib/spack/spack/test/llnl/util/file_list.py +++ b/lib/spack/spack/test/llnl/util/file_list.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import fnmatch -import os.path +import os import sys import pytest diff --git a/lib/spack/spack/test/llnl/util/filesystem.py b/lib/spack/spack/test/llnl/util/filesystem.py index 593f7c75c74023..14709ec2852a5c 100644 --- a/lib/spack/spack/test/llnl/util/filesystem.py +++ b/lib/spack/spack/test/llnl/util/filesystem.py @@ -82,7 +82,7 @@ def test_non_existing_src(self, stage): """Test using a non-existing source.""" with fs.working_dir(str(stage)): - with pytest.raises(IOError, match="No such file or directory"): + with pytest.raises(OSError, match="No such file or directory"): fs.copy("source/none", "dest") def test_multiple_src_file_dest(self, stage): @@ -139,7 +139,7 @@ def test_non_existing_src(self, stage): """Test using a non-existing source.""" with fs.working_dir(str(stage)): - with pytest.raises(IOError, match="No such file or directory"): + with pytest.raises(OSError, match="No such file or directory"): fs.install("source/none", "dest") def test_multiple_src_file_dest(self, stage): @@ -220,7 +220,7 @@ def test_non_existing_src(self, stage): """Test using a non-existing source.""" with fs.working_dir(str(stage)): - with pytest.raises(IOError, match="No such file or directory"): + with pytest.raises(OSError, match="No such file or directory"): fs.copy_tree("source/none", "dest") def test_parent_dir(self, stage): @@ -301,7 +301,7 @@ def test_non_existing_src(self, stage): """Test using a non-existing source.""" with fs.working_dir(str(stage)): - with pytest.raises(IOError, match="No such file or directory"): + with pytest.raises(OSError, match="No such file or directory"): fs.install_tree("source/none", "dest") def test_parent_dir(self, stage): diff --git a/lib/spack/spack/test/llnl/util/lang.py b/lib/spack/spack/test/llnl/util/lang.py index 1701cbc290ba0c..728119e31aa7c7 100644 --- a/lib/spack/spack/test/llnl/util/lang.py +++ b/lib/spack/spack/test/llnl/util/lang.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import re import sys from datetime import datetime, timedelta @@ -23,7 +23,7 @@ def now(): def module_path(tmpdir): m = tmpdir.join("foo.py") content = """ -import os.path +import os value = 1 path = os.path.join('/usr', 'bin') diff --git a/lib/spack/spack/test/llnl/util/link_tree.py b/lib/spack/spack/test/llnl/util/link_tree.py index 57175aa32a8a40..3b3c9ff297a677 100644 --- a/lib/spack/spack/test/llnl/util/link_tree.py +++ b/lib/spack/spack/test/llnl/util/link_tree.py @@ -341,39 +341,53 @@ def test_destination_merge_visitor_file_dir_clashes(tmpdir): assert b_to_a.fatal_conflicts[0].dst == "example" -def test_source_merge_visitor_does_not_register_identical_file_conflicts(tmp_path: pathlib.Path): - """Tests whether the SourceMergeVisitor does not register identical file conflicts. - but instead registers the file that triggers the potential conflict.""" - (tmp_path / "dir_bottom").mkdir() - (tmp_path / "dir_bottom" / "file").write_bytes(b"hello") - - (tmp_path / "dir_top").mkdir() - (tmp_path / "dir_top" / "file").symlink_to(tmp_path / "dir_bottom" / "file") - (tmp_path / "dir_top" / "zzzz").write_bytes(b"hello") - - visitor = SourceMergeVisitor() - visitor.set_projection(str(tmp_path / "view")) - - visit_directory_tree(str(tmp_path / "dir_top"), visitor) - - # After visiting the top dir, we should have `file` and `zzzz` listed, in that order. Using - # .items() to test order. - assert list(visitor.files.items()) == [ - (str(tmp_path / "view" / "file"), (str(tmp_path / "dir_top"), "file")), - (str(tmp_path / "view" / "zzzz"), (str(tmp_path / "dir_top"), "zzzz")), - ] - - # Then after visiting the bottom dir, the "conflict" should be resolved, and `file` should - # come from the bottom dir. - visit_directory_tree(str(tmp_path / "dir_bottom"), visitor) - assert not visitor.file_conflicts - assert list(visitor.files.items()) == [ - (str(tmp_path / "view" / "zzzz"), (str(tmp_path / "dir_top"), "zzzz")), - (str(tmp_path / "view" / "file"), (str(tmp_path / "dir_bottom"), "file")), - ] +@pytest.mark.parametrize("normalize", [True, False]) +def test_source_merge_visitor_handles_same_file_gracefully( + tmp_path: pathlib.Path, normalize: bool +): + """Symlinked files/dirs from one prefix to the other are not file or fatal conflicts, they are + resolved by taking the underlying file/dir, and this does not depend on the order prefixes + are visited.""" + + def u(path: str) -> str: + return path.upper() if normalize else path + + (tmp_path / "a").mkdir() + (tmp_path / "a" / "file").write_bytes(b"hello") + (tmp_path / "a" / "dir").mkdir() + (tmp_path / "a" / "dir" / "foo").write_bytes(b"hello") + + (tmp_path / "b").mkdir() + (tmp_path / "b" / u("file")).symlink_to(tmp_path / "a" / "file") + (tmp_path / "b" / u("dir")).symlink_to(tmp_path / "a" / "dir") + (tmp_path / "b" / "bar").write_bytes(b"hello") + + visitor_1 = SourceMergeVisitor(normalize_paths=normalize) + visitor_1.set_projection(str(tmp_path / "view")) + for p in ("a", "b"): + visit_directory_tree(str(tmp_path / p), visitor_1) + + visitor_2 = SourceMergeVisitor(normalize_paths=normalize) + visitor_2.set_projection(str(tmp_path / "view")) + for p in ("b", "a"): + visit_directory_tree(str(tmp_path / p), visitor_2) + + assert not visitor_1.file_conflicts and not visitor_2.file_conflicts + assert not visitor_1.fatal_conflicts and not visitor_2.fatal_conflicts + assert ( + sorted(visitor_1.files.items()) + == sorted(visitor_2.files.items()) + == [ + (str(tmp_path / "view" / "bar"), (str(tmp_path / "b"), "bar")), + (str(tmp_path / "view" / "dir" / "foo"), (str(tmp_path / "a"), f"dir{os.sep}foo")), + (str(tmp_path / "view" / "file"), (str(tmp_path / "a"), "file")), + ] + ) + assert visitor_1.directories[str(tmp_path / "view" / "dir")] == (str(tmp_path / "a"), "dir") + assert visitor_2.directories[str(tmp_path / "view" / "dir")] == (str(tmp_path / "a"), "dir") -def test_source_merge_visitor_does_deals_with_dangling_symlinks(tmp_path: pathlib.Path): +def test_source_merge_visitor_deals_with_dangling_symlinks(tmp_path: pathlib.Path): """When a file and a dangling symlink conflict, this should be handled like a file conflict.""" (tmp_path / "dir_a").mkdir() os.symlink("non-existent", str(tmp_path / "dir_a" / "file")) @@ -396,3 +410,127 @@ def test_source_merge_visitor_does_deals_with_dangling_symlinks(tmp_path: pathli # The first file encountered should be listed. assert visitor.files == {str(tmp_path / "view" / "file"): (str(tmp_path / "dir_a"), "file")} + + +@pytest.mark.parametrize("normalize", [True, False]) +def test_source_visitor_file_file(tmp_path: pathlib.Path, normalize: bool): + (tmp_path / "a").mkdir() + (tmp_path / "b").mkdir() + (tmp_path / "a" / "file").write_bytes(b"") + (tmp_path / "b" / "FILE").write_bytes(b"") + + v = SourceMergeVisitor(normalize_paths=normalize) + for p in ("a", "b"): + visit_directory_tree(str(tmp_path / p), v) + + if normalize: + assert len(v.files) == 1 + assert len(v.directories) == 0 + assert "file" in v.files # first file wins + assert len(v.file_conflicts) == 1 + else: + assert len(v.files) == 2 + assert len(v.directories) == 0 + assert "file" in v.files and "FILE" in v.files + assert not v.fatal_conflicts + assert not v.file_conflicts + + +@pytest.mark.parametrize("normalize", [True, False]) +def test_source_visitor_file_dir(tmp_path: pathlib.Path, normalize: bool): + (tmp_path / "a").mkdir() + (tmp_path / "a" / "file").write_bytes(b"") + (tmp_path / "b").mkdir() + (tmp_path / "b" / "FILE").mkdir() + v1 = SourceMergeVisitor(normalize_paths=normalize) + for p in ("a", "b"): + visit_directory_tree(str(tmp_path / p), v1) + v2 = SourceMergeVisitor(normalize_paths=normalize) + for p in ("b", "a"): + visit_directory_tree(str(tmp_path / p), v2) + + assert not v1.file_conflicts and not v2.file_conflicts + + if normalize: + assert len(v1.fatal_conflicts) == len(v2.fatal_conflicts) == 1 + else: + assert len(v1.files) == len(v2.files) == 1 + assert "file" in v1.files and "file" in v2.files + assert len(v1.directories) == len(v2.directories) == 1 + assert "FILE" in v1.directories and "FILE" in v2.directories + assert not v1.fatal_conflicts and not v2.fatal_conflicts + + +@pytest.mark.parametrize("normalize", [True, False]) +def test_source_visitor_dir_dir(tmp_path: pathlib.Path, normalize: bool): + (tmp_path / "a").mkdir() + (tmp_path / "a" / "dir").mkdir() + (tmp_path / "b").mkdir() + (tmp_path / "b" / "DIR").mkdir() + v = SourceMergeVisitor(normalize_paths=normalize) + for p in ("a", "b"): + visit_directory_tree(str(tmp_path / p), v) + + assert not v.files + assert not v.fatal_conflicts + assert not v.file_conflicts + + if normalize: + assert len(v.directories) == 1 + assert "dir" in v.directories + else: + assert len(v.directories) == 2 + assert "DIR" in v.directories and "dir" in v.directories + + +@pytest.mark.parametrize("normalize", [True, False]) +def test_dst_visitor_file_file(tmp_path: pathlib.Path, normalize: bool): + (tmp_path / "a").mkdir() + (tmp_path / "b").mkdir() + (tmp_path / "a" / "file").write_bytes(b"") + (tmp_path / "b" / "FILE").write_bytes(b"") + + src = SourceMergeVisitor(normalize_paths=normalize) + visit_directory_tree(str(tmp_path / "a"), src) + visit_directory_tree(str(tmp_path / "b"), DestinationMergeVisitor(src)) + + assert len(src.files) == 1 + assert len(src.directories) == 0 + assert "file" in src.files + assert not src.file_conflicts + + if normalize: + assert len(src.fatal_conflicts) == 1 + assert "FILE" in [c.dst for c in src.fatal_conflicts] + else: + assert not src.fatal_conflicts + + +@pytest.mark.parametrize("normalize", [True, False]) +def test_dst_visitor_file_dir(tmp_path: pathlib.Path, normalize: bool): + (tmp_path / "a").mkdir() + (tmp_path / "a" / "file").write_bytes(b"") + (tmp_path / "b").mkdir() + (tmp_path / "b" / "FILE").mkdir() + src1 = SourceMergeVisitor(normalize_paths=normalize) + visit_directory_tree(str(tmp_path / "a"), src1) + visit_directory_tree(str(tmp_path / "b"), DestinationMergeVisitor(src1)) + src2 = SourceMergeVisitor(normalize_paths=normalize) + visit_directory_tree(str(tmp_path / "b"), src2) + visit_directory_tree(str(tmp_path / "a"), DestinationMergeVisitor(src2)) + + assert len(src1.files) == 1 + assert "file" in src1.files + assert not src1.directories + assert not src2.file_conflicts + assert len(src2.directories) == 1 + + if normalize: + assert len(src1.fatal_conflicts) == 1 + assert "FILE" in [c.dst for c in src1.fatal_conflicts] + assert not src2.files + assert len(src2.fatal_conflicts) == 1 + assert "file" in [c.dst for c in src2.fatal_conflicts] + else: + assert not src1.fatal_conflicts and not src2.fatal_conflicts + assert not src1.file_conflicts and not src2.file_conflicts diff --git a/lib/spack/spack/test/llnl/util/lock.py b/lib/spack/spack/test/llnl/util/lock.py index 8e6665834235ec..66822b86991b27 100644 --- a/lib/spack/spack/test/llnl/util/lock.py +++ b/lib/spack/spack/test/llnl/util/lock.py @@ -93,28 +93,26 @@ pass -"""This is a list of filesystem locations to test locks in. Paths are -expanded so that %u is replaced with the current username. '~' is also -legal and will be expanded to the user's home directory. - -Tests are skipped for directories that don't exist, so you'll need to -update this with the locations of NFS, Lustre, and other mounts on your -system. -""" +#: This is a list of filesystem locations to test locks in. Paths are +#: expanded so that %u is replaced with the current username. '~' is also +#: legal and will be expanded to the user's home directory. +#: +#: Tests are skipped for directories that don't exist, so you'll need to +#: update this with the locations of NFS, Lustre, and other mounts on your +#: system. locations = [ tempfile.gettempdir(), os.path.join("/nfs/tmp2/", getpass.getuser()), os.path.join("/p/lscratch*/", getpass.getuser()), ] -"""This is the longest a failed multiproc test will take. -Barriers will time out and raise an exception after this interval. -In MPI mode, barriers don't time out (they hang). See mpi_multiproc_test. -""" +#: This is the longest a failed multiproc test will take. +#: Barriers will time out and raise an exception after this interval. +#: In MPI mode, barriers don't time out (they hang). See mpi_multiproc_test. barrier_timeout = 5 -"""This is the lock timeout for expected failures. -This may need to be higher for some filesystems.""" +#: This is the lock timeout for expected failures. +#: This may need to be higher for some filesystems. lock_fail_timeout = 0.1 @@ -286,9 +284,8 @@ def wait(self): comm.Barrier() # barrier after each MPI test. -"""``multiproc_test()`` should be called by tests below. -``multiproc_test()`` will work for either MPI runs or for local runs. -""" +#: ``multiproc_test()`` should be called by tests below. +#: ``multiproc_test()`` will work for either MPI runs or for local runs. multiproc_test = mpi_multiproc_test if mpi else local_multiproc_test @@ -1339,7 +1336,7 @@ def test_poll_lock_exception(tmpdir, monkeypatch, err_num, err_msg): """Test poll lock exception handling.""" def _lockf(fd, cmd, len, start, whence): - raise IOError(err_num, err_msg) + raise OSError(err_num, err_msg) with tmpdir.as_cwd(): lockfile = "lockfile" @@ -1351,7 +1348,7 @@ def _lockf(fd, cmd, len, start, whence): if err_num in [errno.EAGAIN, errno.EACCES]: assert not lock._poll_lock(fcntl.LOCK_EX) else: - with pytest.raises(IOError, match=err_msg): + with pytest.raises(OSError, match=err_msg): lock._poll_lock(fcntl.LOCK_EX) monkeypatch.undo() diff --git a/lib/spack/spack/test/mirror.py b/lib/spack/spack/test/mirror.py index db162ba369bfed..a0c6458719d1e9 100644 --- a/lib/spack/spack/test/mirror.py +++ b/lib/spack/spack/test/mirror.py @@ -11,6 +11,7 @@ from llnl.util.symlink import resolve_link_target_relative_to_the_link import spack.caches +import spack.concretize import spack.config import spack.fetch_strategy import spack.mirrors.layout @@ -43,7 +44,7 @@ def set_up_package(name, repository, url_attr): 2. Point the package's version args at that repo. """ # Set up packages to point at mock repos. - s = Spec(name).concretized() + s = spack.concretize.concretize_one(name) repos[name] = repository # change the fetch args of the first (only) version. @@ -60,7 +61,7 @@ def check_mirror(): mirrors = {"spack-mirror-test": url_util.path_to_file_url(mirror_root)} with spack.config.override("mirrors", mirrors): with spack.config.override("config:checksum", False): - specs = [Spec(x).concretized() for x in repos] + specs = [spack.concretize.concretize_one(x) for x in repos] spack.mirrors.utils.create(mirror_root, specs) # Stage directory exists @@ -77,7 +78,7 @@ def check_mirror(): # Now try to fetch each package. for name, mock_repo in repos.items(): - spec = Spec(name).concretized() + spec = spack.concretize.concretize_one(name) pkg = spec.package with spack.config.override("config:checksum", False): @@ -212,13 +213,15 @@ def test_invalid_json_mirror_collection(invalid_json, error_message): def test_mirror_archive_paths_no_version(mock_packages, mock_archive): - spec = Spec("trivial-install-test-package@=nonexistingversion").concretized() + spec = spack.concretize.concretize_one( + Spec("trivial-install-test-package@=nonexistingversion") + ) fetcher = spack.fetch_strategy.URLFetchStrategy(url=mock_archive.url) spack.mirrors.layout.default_mirror_layout(fetcher, "per-package-ref", spec) def test_mirror_with_url_patches(mock_packages, monkeypatch): - spec = Spec("patch-several-dependencies").concretized() + spec = spack.concretize.concretize_one("patch-several-dependencies") files_cached_in_mirror = set() def record_store(_class, fetcher, relative_dst, cosmetic_path=None): diff --git a/lib/spack/spack/test/module_parsing.py b/lib/spack/spack/test/module_parsing.py index 0bbbb3c64e9436..5b27742c3cda17 100644 --- a/lib/spack/spack/test/module_parsing.py +++ b/lib/spack/spack/test/module_parsing.py @@ -35,6 +35,53 @@ def test_module_function_change_env(tmp_path): assert environb[b"NOT_AFFECTED"] == b"NOT_AFFECTED" +def test_module_function_change_env_with_module_src_cmd(tmp_path): + environb = { + b"MODULESHOME": b"here", + b"TEST_MODULE_ENV_VAR": b"TEST_FAIL", + b"TEST_ANOTHER_MODULE_ENV_VAR": b"TEST_FAIL", + b"NOT_AFFECTED": b"NOT_AFFECTED", + } + src_file = tmp_path / "src_me" + src_file.write_text("export TEST_MODULE_ENV_VAR=TEST_SUCCESS\n") + module_src_file = tmp_path / "src_me_too" + module_src_file.write_text("export TEST_ANOTHER_MODULE_ENV_VAR=TEST_SUCCESS\n") + module("load", str(src_file), module_template=f". {src_file} 2>&1", environb=environb) + module( + "load", + str(src_file), + module_template=f". {src_file} 2>&1", + module_src_cmd=f". {module_src_file} 2>&1; ", + environb=environb, + ) + assert environb[b"TEST_MODULE_ENV_VAR"] == b"TEST_SUCCESS" + assert environb[b"TEST_ANOTHER_MODULE_ENV_VAR"] == b"TEST_SUCCESS" + assert environb[b"NOT_AFFECTED"] == b"NOT_AFFECTED" + + +def test_module_function_change_env_without_moduleshome_no_module_src_cmd(tmp_path): + environb = { + b"TEST_MODULE_ENV_VAR": b"TEST_FAIL", + b"TEST_ANOTHER_MODULE_ENV_VAR": b"TEST_FAIL", + b"NOT_AFFECTED": b"NOT_AFFECTED", + } + src_file = tmp_path / "src_me" + src_file.write_text("export TEST_MODULE_ENV_VAR=TEST_SUCCESS\n") + module_src_file = tmp_path / "src_me_too" + module_src_file.write_text("export TEST_ANOTHER_MODULE_ENV_VAR=TEST_SUCCESS\n") + module("load", str(src_file), module_template=f". {src_file} 2>&1", environb=environb) + module( + "load", + str(src_file), + module_template=f". {src_file} 2>&1", + module_src_cmd=f". {module_src_file} 2>&1; ", + environb=environb, + ) + assert environb[b"TEST_MODULE_ENV_VAR"] == b"TEST_SUCCESS" + assert environb[b"TEST_ANOTHER_MODULE_ENV_VAR"] == b"TEST_FAIL" + assert environb[b"NOT_AFFECTED"] == b"NOT_AFFECTED" + + def test_module_function_no_change(tmpdir): src_file = str(tmpdir.join("src_me")) with open(src_file, "w", encoding="utf-8") as f: diff --git a/lib/spack/spack/test/modules/common.py b/lib/spack/spack/test/modules/common.py index 423200ef50b1ae..0d858806e5d1ff 100644 --- a/lib/spack/spack/test/modules/common.py +++ b/lib/spack/spack/test/modules/common.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os +import pickle import stat import pytest @@ -9,6 +10,7 @@ from llnl.util.symlink import readlink import spack.cmd.modules +import spack.concretize import spack.config import spack.error import spack.modules @@ -17,10 +19,8 @@ import spack.package_base import spack.package_prefs import spack.repo -import spack.spec from spack.installer import PackageInstaller from spack.modules.common import UpstreamModuleIndex -from spack.spec import Spec pytestmark = [ pytest.mark.not_on_windows("does not run on windows"), @@ -60,7 +60,7 @@ def mock_package_perms(monkeypatch): def test_modules_written_with_proper_permissions( mock_module_filename, mock_package_perms, mock_packages, config ): - spec = spack.spec.Spec("mpileaks").concretized() + spec = spack.concretize.concretize_one("mpileaks") # The code tested is common to all module types, but has to be tested from # one. Tcl picked at random @@ -74,7 +74,7 @@ def test_modules_written_with_proper_permissions( def test_modules_default_symlink( module_type, mock_packages, mock_module_filename, mock_module_defaults, config ): - spec = spack.spec.Spec("mpileaks@2.3").concretized() + spec = spack.concretize.concretize_one("mpileaks@2.3") mock_module_defaults(spec.format("{name}{@version}"), True) generator_cls = spack.modules.module_types[module_type] @@ -180,7 +180,7 @@ def test_get_module_upstream(): @pytest.mark.regression("14347") def test_load_installed_package_not_in_repo(install_mockery, mock_fetch, monkeypatch): """Test that installed packages that have been removed are still loadable""" - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") PackageInstaller([spec.package], explicit=True).install() spack.modules.module_types["tcl"](spec, "default", True).write() @@ -224,3 +224,10 @@ def test_check_module_set_name(mutable_config): with pytest.raises(spack.error.ConfigError, match=msg): spack.cmd.modules.check_module_set_name("third") + + +@pytest.mark.parametrize("module_type", ["tcl", "lmod"]) +def test_module_writers_are_pickleable(default_mock_concretization, module_type): + s = default_mock_concretization("mpileaks") + writer = spack.modules.module_types[module_type](s, "default") + assert pickle.loads(pickle.dumps(writer)).spec == s diff --git a/lib/spack/spack/test/modules/conftest.py b/lib/spack/spack/test/modules/conftest.py index d4dbf342a6c15d..eb43d42489db61 100644 --- a/lib/spack/spack/test/modules/conftest.py +++ b/lib/spack/spack/test/modules/conftest.py @@ -5,6 +5,7 @@ import pytest +import spack.concretize import spack.modules.lmod import spack.modules.tcl import spack.spec @@ -18,7 +19,7 @@ def modulefile_content(request): def _impl(spec_like, module_set_name="default", explicit=True): if isinstance(spec_like, str): spec_like = spack.spec.Spec(spec_like) - spec = spec_like.concretized() + spec = spack.concretize.concretize_one(spec_like) generator = writer_cls(spec, module_set_name, explicit) generator.write(overwrite=True) written_module = pathlib.Path(generator.layout.filename) @@ -35,7 +36,7 @@ def factory(request, mock_modules_root): writer_cls = getattr(request.module, "writer_cls") def _mock(spec_string, module_set_name="default", explicit=True): - spec = spack.spec.Spec(spec_string).concretized() + spec = spack.concretize.concretize_one(spec_string) return writer_cls(spec, module_set_name, explicit), spec return _mock diff --git a/lib/spack/spack/test/modules/lmod.py b/lib/spack/spack/test/modules/lmod.py index c90884573bfe24..5bd0d73cd15b10 100644 --- a/lib/spack/spack/test/modules/lmod.py +++ b/lib/spack/spack/test/modules/lmod.py @@ -8,6 +8,7 @@ import archspec.cpu +import spack.concretize import spack.config import spack.environment as ev import spack.main @@ -435,7 +436,7 @@ def test_modules_relative_to_view( module_configuration("with_view") install("--add", "cmake") - spec = spack.spec.Spec("cmake").concretized() + spec = spack.concretize.concretize_one("cmake") content = modulefile_content("cmake") expected = e.default_view.get_projection_for_spec(spec) @@ -455,7 +456,7 @@ def test_hide_implicits(self, module_configuration, temporary_store): """Tests the addition and removal of hide command in modulerc.""" module_configuration("hide_implicits") - spec = spack.spec.Spec("mpileaks@2.3").concretized() + spec = spack.concretize.concretize_one("mpileaks@2.3") # mpileaks is defined as implicit, thus hide command should appear in modulerc writer = writer_cls(spec, "default", False) @@ -507,8 +508,8 @@ def test_hide_implicits(self, module_configuration, temporary_store): # three versions of mpileaks are implicit writer = writer_cls(spec, "default", False) writer.write(overwrite=True) - spec_alt1 = spack.spec.Spec("mpileaks@2.2").concretized() - spec_alt2 = spack.spec.Spec("mpileaks@2.1").concretized() + spec_alt1 = spack.concretize.concretize_one("mpileaks@2.2") + spec_alt2 = spack.concretize.concretize_one("mpileaks@2.1") writer_alt1 = writer_cls(spec_alt1, "default", False) writer_alt1.write(overwrite=True) writer_alt2 = writer_cls(spec_alt2, "default", False) diff --git a/lib/spack/spack/test/modules/tcl.py b/lib/spack/spack/test/modules/tcl.py index 8cc6b25493bf7b..33cb66b333e0bd 100644 --- a/lib/spack/spack/test/modules/tcl.py +++ b/lib/spack/spack/test/modules/tcl.py @@ -8,9 +8,9 @@ import archspec.cpu +import spack.concretize import spack.modules.common import spack.modules.tcl -import spack.spec mpich_spec_string = "mpich@3.0.4" mpileaks_spec_string = "mpileaks" @@ -238,10 +238,7 @@ def test_exclude(self, modulefile_content, module_configuration, host_architectu assert len([x for x in content if "module load " in x]) == 1 - # Catch "Exception" to avoid using FileNotFoundError on Python 3 - # and IOError on Python 2 or common bases like EnvironmentError - # which are not officially documented - with pytest.raises(Exception): + with pytest.raises(FileNotFoundError): modulefile_content(f"callpath target={host_architecture_str}") content = modulefile_content(f"zmpi target={host_architecture_str}") @@ -393,8 +390,7 @@ def test_setup_environment(self, modulefile_content, module_configuration): assert len([x for x in content if "setenv FOOBAR" in x]) == 1 assert len([x for x in content if "setenv FOOBAR {mpileaks}" in x]) == 1 - spec = spack.spec.Spec("mpileaks") - spec.concretize() + spec = spack.concretize.concretize_one("mpileaks") content = modulefile_content(spec["callpath"]) assert len([x for x in content if "setenv FOOBAR" in x]) == 1 @@ -468,14 +464,12 @@ def test_hide_implicits_with_arg(self, module_configuration): module_configuration("exclude_implicits") # mpileaks is defined as explicit with explicit argument set on writer - mpileaks_spec = spack.spec.Spec("mpileaks") - mpileaks_spec.concretize() + mpileaks_spec = spack.concretize.concretize_one("mpileaks") writer = writer_cls(mpileaks_spec, "default", True) assert not writer.conf.excluded # callpath is defined as implicit with explicit argument set on writer - callpath_spec = spack.spec.Spec("callpath") - callpath_spec.concretize() + callpath_spec = spack.concretize.concretize_one("callpath") writer = writer_cls(callpath_spec, "default", False) assert writer.conf.excluded @@ -510,7 +504,7 @@ def test_hide_implicits(self, module_configuration, temporary_store): """Tests the addition and removal of hide command in modulerc.""" module_configuration("hide_implicits") - spec = spack.spec.Spec("mpileaks@2.3").concretized() + spec = spack.concretize.concretize_one("mpileaks@2.3") # mpileaks is defined as implicit, thus hide command should appear in modulerc writer = writer_cls(spec, "default", False) @@ -557,8 +551,8 @@ def test_hide_implicits(self, module_configuration, temporary_store): # three versions of mpileaks are implicit writer = writer_cls(spec, "default", False) writer.write(overwrite=True) - spec_alt1 = spack.spec.Spec("mpileaks@2.2").concretized() - spec_alt2 = spack.spec.Spec("mpileaks@2.1").concretized() + spec_alt1 = spack.concretize.concretize_one("mpileaks@2.2") + spec_alt2 = spack.concretize.concretize_one("mpileaks@2.1") writer_alt1 = writer_cls(spec_alt1, "default", False) writer_alt1.write(overwrite=True) writer_alt2 = writer_cls(spec_alt2, "default", False) diff --git a/lib/spack/spack/test/multimethod.py b/lib/spack/spack/test/multimethod.py index 24408ad9bc2d74..a9996b3b62572b 100644 --- a/lib/spack/spack/test/multimethod.py +++ b/lib/spack/spack/test/multimethod.py @@ -6,9 +6,9 @@ import pytest +import spack.concretize import spack.config import spack.platforms -import spack.spec from spack.multimethod import NoSuchMethodError pytestmark = [ @@ -28,7 +28,7 @@ def pkg_name(request): def test_no_version_match(pkg_name): - spec = spack.spec.Spec(pkg_name + "@2.0").concretized() + spec = spack.concretize.concretize_one(pkg_name + "@2.0") with pytest.raises(NoSuchMethodError): spec.package.no_version_2() @@ -74,7 +74,7 @@ def test_multimethod_calls( with spack.config.override( "compilers", [compiler_factory(spec="apple-clang@9.1.0", operating_system="elcapitan")] ): - s = spack.spec.Spec(pkg_name + constraint_str).concretized() + s = spack.concretize.concretize_one(pkg_name + constraint_str) msg = f"Method {method_name} from {s} is giving a wrong result" assert getattr(s.package, method_name)() == expected_result, msg @@ -83,10 +83,10 @@ def test_target_match(pkg_name): platform = spack.platforms.host() targets = list(platform.targets.values()) for target in targets[:-1]: - s = spack.spec.Spec(pkg_name + " target=" + target.name).concretized() + s = spack.concretize.concretize_one(pkg_name + " target=" + target.name) assert s.package.different_by_target() == target.name - s = spack.spec.Spec(pkg_name + " target=" + targets[-1].name).concretized() + s = spack.concretize.concretize_one(pkg_name + " target=" + targets[-1].name) if len(targets) == 1: assert s.package.different_by_target() == targets[-1].name else: @@ -116,5 +116,5 @@ def test_target_match(pkg_name): ], ) def test_multimethod_calls_and_inheritance(spec_str, method_name, expected_result): - s = spack.spec.Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) assert getattr(s.package, method_name)() == expected_result diff --git a/lib/spack/spack/test/oci/mock_registry.py b/lib/spack/spack/test/oci/mock_registry.py index 1ee28bb32495dc..b35bb4f96951b3 100644 --- a/lib/spack/spack/test/oci/mock_registry.py +++ b/lib/spack/spack/test/oci/mock_registry.py @@ -4,7 +4,6 @@ import base64 -import email.message import hashlib import io import json @@ -19,49 +18,7 @@ import spack.oci.oci from spack.oci.image import Digest from spack.oci.opener import OCIAuthHandler - - -class MockHTTPResponse(io.IOBase): - """This is a mock HTTP response, which implements part of http.client.HTTPResponse""" - - def __init__(self, status, reason, headers=None, body=None): - self.msg = None - self.version = 11 - self.url = None - self.headers = email.message.EmailMessage() - self.status = status - self.code = status - self.reason = reason - self.debuglevel = 0 - self._body = body - - if headers is not None: - for key, value in headers.items(): - self.headers[key] = value - - @classmethod - def with_json(cls, status, reason, headers=None, body=None): - """Create a mock HTTP response with JSON string as body""" - body = io.BytesIO(json.dumps(body).encode("utf-8")) - return cls(status, reason, headers, body) - - def read(self, *args, **kwargs): - return self._body.read(*args, **kwargs) - - def getheader(self, name, default=None): - self.headers.get(name, default) - - def getheaders(self): - return self.headers.items() - - def fileno(self): - return 0 - - def getcode(self): - return self.status - - def info(self): - return self.headers +from spack.test.conftest import MockHTTPResponse class MiddlewareError(Exception): diff --git a/lib/spack/spack/test/oci/urlopen.py b/lib/spack/spack/test/oci/urlopen.py index f46bab5bf79e81..b8fcc84e484960 100644 --- a/lib/spack/spack/test/oci/urlopen.py +++ b/lib/spack/spack/test/oci/urlopen.py @@ -32,6 +32,7 @@ get_bearer_challenge, parse_www_authenticate, ) +from spack.test.conftest import MockHTTPResponse from spack.test.oci.mock_registry import ( DummyServer, DummyServerUrllibHandler, @@ -39,7 +40,6 @@ InMemoryOCIRegistryWithAuth, MiddlewareError, MockBearerTokenServer, - MockHTTPResponse, create_opener, ) diff --git a/lib/spack/spack/test/optional_deps.py b/lib/spack/spack/test/optional_deps.py index ceba2f6ed11700..ea44da42b79779 100644 --- a/lib/spack/spack/test/optional_deps.py +++ b/lib/spack/spack/test/optional_deps.py @@ -4,6 +4,7 @@ import pytest +import spack.concretize from spack.spec import Spec @@ -72,14 +73,11 @@ def spec_and_expected(request): def test_default_variant(config, mock_packages): - spec = Spec("optional-dep-test-3") - spec.concretize() + spec = spack.concretize.concretize_one("optional-dep-test-3") assert "pkg-a" in spec - spec = Spec("optional-dep-test-3~var") - spec.concretize() + spec = spack.concretize.concretize_one("optional-dep-test-3~var") assert "pkg-a" in spec - spec = Spec("optional-dep-test-3+var") - spec.concretize() + spec = spack.concretize.concretize_one("optional-dep-test-3+var") assert "pkg-b" in spec diff --git a/lib/spack/spack/test/package_class.py b/lib/spack/spack/test/package_class.py index 2730aad40c4a9b..7edec99fabe2d0 100644 --- a/lib/spack/spack/test/package_class.py +++ b/lib/spack/spack/test/package_class.py @@ -1,7 +1,6 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - """Test class methods on Package objects. This doesn't include methods on package *instances* (like do_patch(), @@ -16,21 +15,19 @@ import llnl.util.filesystem as fs +import spack.binary_distribution import spack.compilers +import spack.concretize import spack.deptypes as dt import spack.error import spack.install_test import spack.package import spack.package_base -import spack.repo import spack.spec +import spack.store from spack.build_systems.generic import Package from spack.error import InstallError - - -@pytest.fixture(scope="module") -def mpi_names(mock_repo_path): - return [spec.name for spec in mock_repo_path.providers_for("mpi")] +from spack.solver.input_analysis import NoStaticAnalysis, StaticAnalysis @pytest.fixture() @@ -52,78 +49,94 @@ def mpileaks_possible_deps(mock_packages, mpi_names): return possible -def test_possible_dependencies(mock_packages, mpileaks_possible_deps): - pkg_cls = spack.repo.PATH.get_pkg_class("mpileaks") - expanded_possible_deps = pkg_cls.possible_dependencies(expand_virtuals=True) - assert mpileaks_possible_deps == expanded_possible_deps - assert { - "callpath": {"dyninst", "mpi"}, - "dyninst": {"libdwarf", "libelf"}, - "libdwarf": {"libelf"}, - "libelf": set(), - "mpi": set(), - "mpileaks": {"callpath", "mpi"}, - } == pkg_cls.possible_dependencies(expand_virtuals=False) - - -def test_possible_direct_dependencies(mock_packages, mpileaks_possible_deps): - pkg_cls = spack.repo.PATH.get_pkg_class("mpileaks") - deps = pkg_cls.possible_dependencies(transitive=False, expand_virtuals=False) - assert {"callpath": set(), "mpi": set(), "mpileaks": {"callpath", "mpi"}} == deps - - -def test_possible_dependencies_virtual(mock_packages, mpi_names): - expected = dict( - (name, set(dep for dep in spack.repo.PATH.get_pkg_class(name).dependencies_by_name())) - for name in mpi_names +@pytest.fixture(params=[NoStaticAnalysis, StaticAnalysis]) +def mock_inspector(config, mock_packages, request): + inspector_cls = request.param + if inspector_cls is NoStaticAnalysis: + return inspector_cls(configuration=config, repo=mock_packages) + return inspector_cls( + configuration=config, + repo=mock_packages, + store=spack.store.STORE, + binary_index=spack.binary_distribution.BINARY_INDEX, ) - # only one mock MPI has a dependency - expected["fake"] = set() - assert expected == spack.package_base.possible_dependencies("mpi", transitive=False) +@pytest.fixture +def mpi_names(mock_inspector): + return [spec.name for spec in mock_inspector.providers_for("mpi")] -def test_possible_dependencies_missing(mock_packages): - pkg_cls = spack.repo.PATH.get_pkg_class("missing-dependency") - missing = {} - pkg_cls.possible_dependencies(transitive=True, missing=missing) - assert {"this-is-a-missing-dependency"} == missing["missing-dependency"] +@pytest.mark.parametrize( + "pkg_name,fn_kwargs,expected", + [ + ( + "mpileaks", + {"expand_virtuals": True, "allowed_deps": dt.ALL}, + { + "fake", + "mpileaks", + "multi-provider-mpi", + "callpath", + "dyninst", + "mpich2", + "libdwarf", + "zmpi", + "low-priority-provider", + "intel-parallel-studio", + "mpich", + "libelf", + }, + ), + ( + "mpileaks", + {"expand_virtuals": False, "allowed_deps": dt.ALL}, + {"callpath", "dyninst", "libdwarf", "libelf", "mpileaks"}, + ), + ( + "mpileaks", + {"expand_virtuals": False, "allowed_deps": dt.ALL, "transitive": False}, + {"callpath", "mpileaks"}, + ), + ("dtbuild1", {"allowed_deps": dt.LINK | dt.RUN}, {"dtbuild1", "dtrun2", "dtlink2"}), + ("dtbuild1", {"allowed_deps": dt.BUILD}, {"dtbuild1", "dtbuild2", "dtlink2"}), + ("dtbuild1", {"allowed_deps": dt.LINK}, {"dtbuild1", "dtlink2"}), + ], +) +def test_possible_dependencies(pkg_name, fn_kwargs, expected, mock_runtimes, mock_inspector): + """Tests possible nodes of mpileaks, under different scenarios.""" + expected.update(mock_runtimes) + result, *_ = mock_inspector.possible_dependencies(pkg_name, **fn_kwargs) + assert expected == result -def test_possible_dependencies_with_deptypes(mock_packages): - dtbuild1 = spack.repo.PATH.get_pkg_class("dtbuild1") +def test_possible_dependencies_virtual(mock_inspector, mock_packages, mock_runtimes, mpi_names): + expected = set(mpi_names) + for name in mpi_names: + expected.update(dep for dep in mock_packages.get_pkg_class(name).dependencies_by_name()) + expected.update(mock_runtimes) - assert { - "dtbuild1": {"dtrun2", "dtlink2"}, - "dtlink2": set(), - "dtrun2": set(), - } == dtbuild1.possible_dependencies(depflag=dt.LINK | dt.RUN) + real_pkgs, *_ = mock_inspector.possible_dependencies( + "mpi", transitive=False, allowed_deps=dt.ALL + ) + assert expected == real_pkgs - assert { - "dtbuild1": {"dtbuild2", "dtlink2"}, - "dtbuild2": set(), - "dtlink2": set(), - } == dtbuild1.possible_dependencies(depflag=dt.BUILD) - assert {"dtbuild1": {"dtlink2"}, "dtlink2": set()} == dtbuild1.possible_dependencies( - depflag=dt.LINK - ) +def test_possible_dependencies_missing(mock_inspector): + result, *_ = mock_inspector.possible_dependencies("missing-dependency", allowed_deps=dt.ALL) + assert "this-is-a-missing-dependency" not in result -def test_possible_dependencies_with_multiple_classes(mock_packages, mpileaks_possible_deps): +def test_possible_dependencies_with_multiple_classes( + mock_inspector, mock_packages, mpileaks_possible_deps +): pkgs = ["dt-diamond", "mpileaks"] - expected = mpileaks_possible_deps.copy() - expected.update( - { - "dt-diamond": set(["dt-diamond-left", "dt-diamond-right"]), - "dt-diamond-left": set(["dt-diamond-bottom"]), - "dt-diamond-right": set(["dt-diamond-bottom"]), - "dt-diamond-bottom": set(), - } - ) + expected = set(mpileaks_possible_deps) + expected.update({"dt-diamond", "dt-diamond-left", "dt-diamond-right", "dt-diamond-bottom"}) + expected.update(mock_packages.packages_with_tags("runtime")) - assert expected == spack.package_base.possible_dependencies(*pkgs) + real_pkgs, *_ = mock_inspector.possible_dependencies(*pkgs, allowed_deps=dt.ALL) + assert set(expected) == real_pkgs def setup_install_test(source_paths, test_root): @@ -166,8 +179,7 @@ def setup_install_test(source_paths, test_root): ) def test_cache_extra_sources(install_mockery, spec, sources, extras, expect): """Test the package's cache extra test sources helper function.""" - s = spack.spec.Spec(spec).concretized() - s.package.spec.concretize() + s = spack.concretize.concretize_one(spec) source_path = s.package.stage.source_path srcs = [fs.join_path(source_path, src) for src in sources] @@ -205,8 +217,7 @@ def test_cache_extra_sources(install_mockery, spec, sources, extras, expect): def test_cache_extra_sources_fails(install_mockery): - s = spack.spec.Spec("pkg-a").concretized() - s.package.spec.concretize() + s = spack.concretize.concretize_one("pkg-a") with pytest.raises(InstallError) as exc_info: spack.install_test.cache_extra_test_sources(s.package, ["/a/b", "no-such-file"]) diff --git a/lib/spack/spack/test/packages.py b/lib/spack/spack/test/packages.py index 302dbe8df81aec..9c4b1142a7861f 100644 --- a/lib/spack/spack/test/packages.py +++ b/lib/spack/spack/test/packages.py @@ -7,6 +7,7 @@ import pytest import spack.build_systems.cmake as cmake +import spack.concretize import spack.directives import spack.error import spack.fetch_strategy @@ -75,13 +76,13 @@ def test_inheritance_of_directives(self): assert len(pkg_cls.provided) == 2 # Check that Spec instantiation behaves as we expect - s = Spec("simple-inheritance").concretized() + s = spack.concretize.concretize_one("simple-inheritance") assert "^cmake" in s assert "^openblas" in s assert "+openblas" in s assert "mpi" in s - s = Spec("simple-inheritance~openblas").concretized() + s = spack.concretize.concretize_one("simple-inheritance~openblas") assert "^cmake" in s assert "^openblas" not in s assert "~openblas" in s @@ -89,9 +90,8 @@ def test_inheritance_of_directives(self): @pytest.mark.regression("11844") def test_inheritance_of_patches(self): - s = Spec("patch-inheritance") # Will error if inheritor package cannot find inherited patch files - s.concretize() + _ = spack.concretize.concretize_one("patch-inheritance") def test_import_class_from_package(self): from spack.pkg.builtin.mock.mpich import Mpich # noqa: F401 @@ -115,7 +115,7 @@ def test_import_namespace_container_modules(self): def test_urls_for_versions(mock_packages, config): """Version directive without a 'url' argument should use default url.""" for spec_str in ("url_override@0.9.0", "url_override@1.0.0"): - s = Spec(spec_str).concretized() + s = spack.concretize.concretize_one(spec_str) url = s.package.url_for_version("0.9.0") assert url == "http://www.anothersite.org/uo-0.9.0.tgz" @@ -137,7 +137,7 @@ def test_url_for_version_with_no_urls(mock_packages, config): def test_custom_cmake_prefix_path(mock_packages, config): - spec = Spec("depends-on-define-cmake-prefix-paths").concretized() + spec = spack.concretize.concretize_one("depends-on-define-cmake-prefix-paths") assert cmake.get_cmake_prefix_path(spec.package) == [ spec["define-cmake-prefix-paths"].prefix.test @@ -145,7 +145,7 @@ def test_custom_cmake_prefix_path(mock_packages, config): def test_url_for_version_with_only_overrides(mock_packages, config): - s = Spec("url-only-override").concretized() + s = spack.concretize.concretize_one("url-only-override") # these exist and should just take the URL provided in the package assert s.package.url_for_version("1.0.0") == "http://a.example.com/url_override-1.0.0.tar.gz" @@ -160,7 +160,7 @@ def test_url_for_version_with_only_overrides(mock_packages, config): def test_url_for_version_with_only_overrides_with_gaps(mock_packages, config): - s = Spec("url-only-override-with-gaps").concretized() + s = spack.concretize.concretize_one("url-only-override-with-gaps") # same as for url-only-override -- these are specific assert s.package.url_for_version("1.0.0") == "http://a.example.com/url_override-1.0.0.tar.gz" diff --git a/lib/spack/spack/test/packaging.py b/lib/spack/spack/test/packaging.py index 4b5f41ade6b37b..7bd079adcff2b2 100644 --- a/lib/spack/spack/test/packaging.py +++ b/lib/spack/spack/test/packaging.py @@ -20,6 +20,7 @@ import spack.binary_distribution as bindist import spack.cmd.buildcache as buildcache +import spack.concretize import spack.config import spack.error import spack.fetch_strategy @@ -31,8 +32,7 @@ from spack.fetch_strategy import URLFetchStrategy from spack.installer import PackageInstaller from spack.paths import mock_gpg_keys_path -from spack.relocate import macho_find_paths, relocate_links, relocate_text -from spack.spec import Spec +from spack.relocate import _macho_find_paths, relocate_links, relocate_text pytestmark = pytest.mark.not_on_windows("does not run on windows") @@ -40,7 +40,7 @@ @pytest.mark.usefixtures("install_mockery", "mock_gnupghome") def test_buildcache(mock_archive, tmp_path, monkeypatch, mutable_config): # Install a test package - spec = Spec("trivial-install-test-package").concretized() + spec = spack.concretize.concretize_one("trivial-install-test-package") monkeypatch.setattr(spec.package, "fetcher", URLFetchStrategy(url=mock_archive.url)) PackageInstaller([spec.package], explicit=True).install() pkghash = "/" + str(spec.dag_hash(7)) @@ -287,7 +287,7 @@ def test_replace_paths(tmpdir): for prefix, hash in prefix2hash.items(): prefix2prefix[prefix] = hash2prefix[hash] - out_dict = macho_find_paths( + out_dict = _macho_find_paths( [oldlibdir_a, oldlibdir_b, oldlibdir_c, oldlibdir_cc, oldlibdir_local], [ os.path.join(oldlibdir_a, libfile_a), @@ -309,7 +309,7 @@ def test_replace_paths(tmpdir): os.path.join(oldlibdir_cc, libfile_c): os.path.join(libdir_cc, libfile_c), } - out_dict = macho_find_paths( + out_dict = _macho_find_paths( [oldlibdir_a, oldlibdir_b, oldlibdir_c, oldlibdir_cc, oldlibdir_local], [ os.path.join(oldlibdir_a, libfile_a), @@ -332,7 +332,7 @@ def test_replace_paths(tmpdir): os.path.join(oldlibdir_cc, libfile_c): os.path.join(libdir_cc, libfile_c), } - out_dict = macho_find_paths( + out_dict = _macho_find_paths( [oldlibdir_a, oldlibdir_b, oldlibdir_c, oldlibdir_cc, oldlibdir_local], [ f"@rpath/{libfile_a}", @@ -356,7 +356,7 @@ def test_replace_paths(tmpdir): libdir_local: libdir_local, } - out_dict = macho_find_paths( + out_dict = _macho_find_paths( [oldlibdir_a, oldlibdir_b, oldlibdir_d, oldlibdir_local], [f"@rpath/{libfile_a}", f"@rpath/{libfile_b}", f"@rpath/{libfile_loco}"], None, @@ -465,7 +465,7 @@ def test_macho_relocation_with_changing_projection(relocation_dict): the two schemes, like /a/b/baz. """ original_rpath = "/foo/bar/baz/abcdef" - result = macho_find_paths( + result = _macho_find_paths( [original_rpath], deps=[], idpath=None, prefix_to_prefix=relocation_dict ) assert result[original_rpath] == "/a/b/c/abcdef" diff --git a/lib/spack/spack/test/patch.py b/lib/spack/spack/test/patch.py index 24d2759ac6f543..4d0d4a15cb4dcc 100644 --- a/lib/spack/spack/test/patch.py +++ b/lib/spack/spack/test/patch.py @@ -12,6 +12,7 @@ from llnl.util.filesystem import mkdirp, touch, working_dir +import spack.concretize import spack.error import spack.fetch_strategy import spack.patch @@ -91,7 +92,7 @@ def mock_patch_stage(tmpdir_factory, monkeypatch): def test_url_patch(mock_patch_stage, filename, sha256, archive_sha256, config): # Make a patch object url = url_util.path_to_file_url(filename) - s = Spec("patch").concretized() + s = spack.concretize.concretize_one("patch") # make a stage with Stage(url) as stage: # TODO: url isn't used; maybe refactor Stage @@ -145,8 +146,7 @@ def test_url_patch(mock_patch_stage, filename, sha256, archive_sha256, config): def test_patch_in_spec(mock_packages, config): """Test whether patches in a package appear in the spec.""" - spec = Spec("patch") - spec.concretize() + spec = spack.concretize.concretize_one("patch") assert "patches" in list(spec.variants.keys()) # Here the order is bar, foo, baz. Note that MV variants order @@ -164,18 +164,15 @@ def test_patch_mixed_versions_subset_constraint(mock_packages, config): a patch applied to a version range of x.y.z versions is not applied to an x.y version. """ - spec1 = Spec("patch@1.0.1") - spec1.concretize() + spec1 = spack.concretize.concretize_one("patch@1.0.1") assert biz_sha256 in spec1.variants["patches"].value - spec2 = Spec("patch@=1.0") - spec2.concretize() + spec2 = spack.concretize.concretize_one("patch@=1.0") assert biz_sha256 not in spec2.variants["patches"].value def test_patch_order(mock_packages, config): - spec = Spec("dep-diamond-patch-top") - spec.concretize() + spec = spack.concretize.concretize_one("dep-diamond-patch-top") mid2_sha256 = ( "mid21234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234" @@ -233,8 +230,7 @@ def test_nested_directives(mock_packages): @pytest.mark.not_on_windows("Test requires Autotools") def test_patched_dependency(mock_packages, install_mockery, mock_fetch): """Test whether patched dependencies work.""" - spec = Spec("patch-a-dependency") - spec.concretize() + spec = spack.concretize.concretize_one("patch-a-dependency") assert "patches" in list(spec["libelf"].variants.keys()) # make sure the patch makes it into the dependency spec @@ -274,8 +270,7 @@ def test_patch_failure_develop_spec_exits_gracefully( ): """ensure that a failing patch does not trigger exceptions for develop specs""" - spec = Spec(f"patch-a-dependency ^libelf dev_path={tmpdir}") - spec.concretize() + spec = spack.concretize.concretize_one(f"patch-a-dependency ^libelf dev_path={tmpdir}") libelf = spec["libelf"] assert "patches" in list(libelf.variants.keys()) pkg = libelf.package @@ -291,8 +286,7 @@ def test_patch_failure_restages(mock_packages, install_mockery, mock_fetch): ensure that a failing patch does not trigger exceptions for non-develop specs and the source gets restaged """ - spec = Spec("patch-a-dependency") - spec.concretize() + spec = spack.concretize.concretize_one("patch-a-dependency") pkg = spec["libelf"].package with pkg.stage: bad_patch_indicator = trigger_bad_patch(pkg) @@ -303,8 +297,7 @@ def test_patch_failure_restages(mock_packages, install_mockery, mock_fetch): def test_multiple_patched_dependencies(mock_packages, config): """Test whether multiple patched dependencies work.""" - spec = Spec("patch-several-dependencies") - spec.concretize() + spec = spack.concretize.concretize_one("patch-several-dependencies") # basic patch on libelf assert "patches" in list(spec["libelf"].variants.keys()) @@ -319,8 +312,7 @@ def test_multiple_patched_dependencies(mock_packages, config): def test_conditional_patched_dependencies(mock_packages, config): """Test whether conditional patched dependencies work.""" - spec = Spec("patch-several-dependencies @1.0") - spec.concretize() + spec = spack.concretize.concretize_one("patch-several-dependencies @1.0") # basic patch on libelf assert "patches" in list(spec["libelf"].variants.keys()) @@ -396,8 +388,9 @@ def get_patch(spec, ending): def test_conditional_patched_deps_with_conditions(mock_packages, config): """Test whether conditional patched dependencies with conditions work.""" - spec = Spec("patch-several-dependencies @1.0 ^libdwarf@20111030") - spec.concretize() + spec = spack.concretize.concretize_one( + Spec("patch-several-dependencies @1.0 ^libdwarf@20111030") + ) libelf = spec["libelf"] libdwarf = spec["libdwarf"] @@ -412,8 +405,9 @@ def test_write_and_read_sub_dags_with_patched_deps(mock_packages, config): """Test whether patched dependencies are still correct after writing and reading a sub-DAG of a concretized Spec. """ - spec = Spec("patch-several-dependencies @1.0 ^libdwarf@20111030") - spec.concretize() + spec = spack.concretize.concretize_one( + Spec("patch-several-dependencies @1.0 ^libdwarf@20111030") + ) # write to YAML and read back in -- new specs will *only* contain # their sub-DAGs, and won't contain the dependent that patched them @@ -474,7 +468,7 @@ def test_equality(): def test_sha256_setter(mock_patch_stage, config): path = os.path.join(data_path, "foo.patch") - s = Spec("patch").concretized() + s = spack.concretize.concretize_one("patch") patch = spack.patch.FilePatch(s.package, path, level=1, working_dir=".") patch.sha256 = "abc" diff --git a/lib/spack/spack/test/repo.py b/lib/spack/spack/test/repo.py index 7d793b81eaa1fe..40e10dcfc79baa 100644 --- a/lib/spack/spack/test/repo.py +++ b/lib/spack/spack/test/repo.py @@ -65,12 +65,21 @@ def test_repo_unknown_pkg(mutable_mock_repo): mutable_mock_repo.get_pkg_class("builtin.mock.nonexistentpackage") -@pytest.mark.maybeslow -def test_repo_last_mtime(): - latest_mtime = max( - os.path.getmtime(p.module.__file__) for p in spack.repo.PATH.all_package_classes() - ) - assert spack.repo.PATH.last_mtime() == latest_mtime +def test_repo_last_mtime(mock_packages): + mtime_with_package_py = [ + (os.path.getmtime(p.module.__file__), p.module.__file__) + for p in spack.repo.PATH.all_package_classes() + ] + repo_mtime = spack.repo.PATH.last_mtime() + max_mtime, max_file = max(mtime_with_package_py) + if max_mtime > repo_mtime: + modified_after = "\n ".join( + f"{path} ({mtime})" for mtime, path in mtime_with_package_py if mtime > repo_mtime + ) + assert ( + max_mtime <= repo_mtime + ), f"the following files were modified while running tests:\n {modified_after}" + assert max_mtime == repo_mtime, f"last_mtime incorrect for {max_file}" def test_repo_invisibles(mutable_mock_repo, extra_repo): @@ -91,13 +100,13 @@ def test_namespace_hasattr(attr_name, exists, mutable_mock_repo): @pytest.mark.regression("24552") -def test_all_package_names_is_cached_correctly(): +def test_all_package_names_is_cached_correctly(mock_packages): assert "mpi" in spack.repo.all_package_names(include_virtuals=True) assert "mpi" not in spack.repo.all_package_names(include_virtuals=False) @pytest.mark.regression("29203") -def test_use_repositories_doesnt_change_class(): +def test_use_repositories_doesnt_change_class(mock_packages): """Test that we don't create the same package module and class multiple times when swapping repositories. """ @@ -166,18 +175,25 @@ def test_repo_dump_virtuals(tmpdir, mutable_mock_repo, mock_packages, ensure_deb assert "package.py" in os.listdir(tmpdir), "Expected the virtual's package to be copied" -@pytest.mark.parametrize( - "repo_paths,namespaces", - [ - ([spack.paths.packages_path], ["builtin"]), - ([spack.paths.mock_packages_path], ["builtin.mock"]), - ([spack.paths.packages_path, spack.paths.mock_packages_path], ["builtin", "builtin.mock"]), - ([spack.paths.mock_packages_path, spack.paths.packages_path], ["builtin.mock", "builtin"]), - ], -) -def test_repository_construction_doesnt_use_globals( - nullify_globals, tmp_path, repo_paths, namespaces -): +@pytest.mark.parametrize("repos", [["mock"], ["extra"], ["mock", "extra"], ["extra", "mock"]]) +def test_repository_construction_doesnt_use_globals(nullify_globals, tmp_path, repos): + def _repo_paths(repos): + repo_paths, namespaces = [], [] + for entry in repos: + if entry == "mock": + repo_paths.append(spack.paths.mock_packages_path) + namespaces.append("builtin.mock") + if entry == "extra": + name = "extra.mock" + repo_dir = tmp_path / name + repo_dir.mkdir() + _ = spack.repo.MockRepositoryBuilder(repo_dir, name) + repo_paths.append(str(repo_dir)) + namespaces.append(name) + return repo_paths, namespaces + + repo_paths, namespaces = _repo_paths(repos) + repo_cache = spack.util.file_cache.FileCache(str(tmp_path / "cache")) repo_path = spack.repo.RepoPath(*repo_paths, cache=repo_cache) assert len(repo_path.repos) == len(namespaces) diff --git a/lib/spack/spack/test/reporters.py b/lib/spack/spack/test/reporters.py index 1b81700fffce03..2d587a382418d1 100644 --- a/lib/spack/spack/test/reporters.py +++ b/lib/spack/spack/test/reporters.py @@ -132,7 +132,8 @@ def test_reporters_extract_skipped(state): parts = spack.reporters.extract.extract_test_parts("fake", outputs) assert len(parts) == 1 - parts[0]["completed"] == expected + + assert parts[0]["completed"] == spack.reporters.extract.completed["skipped"] def test_reporters_skip_new(): diff --git a/lib/spack/spack/test/rewiring.py b/lib/spack/spack/test/rewiring.py index 33d7f46dce75e3..282e16a8f1b3e9 100644 --- a/lib/spack/spack/test/rewiring.py +++ b/lib/spack/spack/test/rewiring.py @@ -8,11 +8,11 @@ import pytest +import spack.concretize import spack.deptypes as dt import spack.rewiring import spack.store from spack.installer import PackageInstaller -from spack.spec import Spec from spack.test.relocate import text_in_bin if sys.platform == "darwin": @@ -37,8 +37,8 @@ def check_spliced_spec_prefixes(spliced_spec): @pytest.mark.parametrize("transitive", [True, False]) def test_rewire_db(mock_fetch, install_mockery, transitive): """Tests basic rewiring without binary executables.""" - spec = Spec("splice-t^splice-h~foo").concretized() - dep = Spec("splice-h+foo").concretized() + spec = spack.concretize.concretize_one("splice-t^splice-h~foo") + dep = spack.concretize.concretize_one("splice-h+foo") PackageInstaller([spec.package, dep.package], explicit=True).install() spliced_spec = spec.splice(dep, transitive=transitive) assert spec.dag_hash() != spliced_spec.dag_hash() @@ -61,8 +61,8 @@ def test_rewire_db(mock_fetch, install_mockery, transitive): @pytest.mark.parametrize("transitive", [True, False]) def test_rewire_bin(mock_fetch, install_mockery, transitive): """Tests basic rewiring with binary executables.""" - spec = Spec("quux").concretized() - dep = Spec("garply cflags=-g").concretized() + spec = spack.concretize.concretize_one("quux") + dep = spack.concretize.concretize_one("garply cflags=-g") PackageInstaller([spec.package, dep.package], explicit=True).install() spliced_spec = spec.splice(dep, transitive=transitive) @@ -90,8 +90,8 @@ def test_rewire_bin(mock_fetch, install_mockery, transitive): def test_rewire_writes_new_metadata(mock_fetch, install_mockery): """Tests that new metadata was written during a rewire. Accuracy of metadata is left to other tests.""" - spec = Spec("quux").concretized() - dep = Spec("garply cflags=-g").concretized() + spec = spack.concretize.concretize_one("quux") + dep = spack.concretize.concretize_one("garply cflags=-g") PackageInstaller([spec.package, dep.package], explicit=True).install() spliced_spec = spec.splice(dep, transitive=True) spack.rewiring.rewire(spliced_spec) @@ -134,8 +134,8 @@ def test_rewire_writes_new_metadata(mock_fetch, install_mockery): @pytest.mark.parametrize("transitive", [True, False]) def test_uninstall_rewired_spec(mock_fetch, install_mockery, transitive): """Test that rewired packages can be uninstalled as normal.""" - spec = Spec("quux").concretized() - dep = Spec("garply cflags=-g").concretized() + spec = spack.concretize.concretize_one("quux") + dep = spack.concretize.concretize_one("garply cflags=-g") PackageInstaller([spec.package, dep.package], explicit=True).install() spliced_spec = spec.splice(dep, transitive=transitive) spack.rewiring.rewire(spliced_spec) @@ -148,8 +148,8 @@ def test_uninstall_rewired_spec(mock_fetch, install_mockery, transitive): def test_rewire_not_installed_fails(mock_fetch, install_mockery): """Tests error when an attempt is made to rewire a package that was not previously installed.""" - spec = Spec("quux").concretized() - dep = Spec("garply cflags=-g").concretized() + spec = spack.concretize.concretize_one("quux") + dep = spack.concretize.concretize_one("garply cflags=-g") spliced_spec = spec.splice(dep, False) with pytest.raises( spack.rewiring.PackageNotInstalledError, @@ -163,8 +163,8 @@ def test_rewire_virtual(mock_fetch, install_mockery): dep = "splice-a" alt_dep = "splice-h" - spec = Spec(f"splice-vt^{dep}").concretized() - alt_spec = Spec(alt_dep).concretized() + spec = spack.concretize.concretize_one(f"splice-vt^{dep}") + alt_spec = spack.concretize.concretize_one(alt_dep) PackageInstaller([spec.package, alt_spec.package]).install() diff --git a/lib/spack/spack/test/sbang.py b/lib/spack/spack/test/sbang.py index d840d0971022b9..1917e12a65cb5a 100644 --- a/lib/spack/spack/test/sbang.py +++ b/lib/spack/spack/test/sbang.py @@ -198,7 +198,7 @@ def script_dir(sbang_line): ], ) def test_shebang_interpreter_regex(shebang, interpreter): - sbang.get_interpreter(shebang) == interpreter + assert sbang.get_interpreter(shebang) == interpreter def test_shebang_handling(script_dir, sbang_line): diff --git a/lib/spack/spack/test/schema.py b/lib/spack/spack/test/schema.py index 010afde80c8396..d712576cc714f0 100644 --- a/lib/spack/spack/test/schema.py +++ b/lib/spack/spack/test/schema.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import json -import os.path +import os import jsonschema import pytest @@ -64,7 +64,7 @@ def test_validate_spec(validate_spec_schema): # Check that invalid data throws data["^python@3.7@"] = "baz" - with pytest.raises(jsonschema.ValidationError, match="unexpected characters"): + with pytest.raises(jsonschema.ValidationError, match="is not a valid spec"): v.validate(data) @@ -73,7 +73,7 @@ def test_module_suffixes(module_suffixes_schema): v = spack.schema.Validator(module_suffixes_schema) data = {"tcl": {"all": {"suffixes": {"^python@2.7@": "py2.7"}}}} - with pytest.raises(jsonschema.ValidationError, match="unexpected characters"): + with pytest.raises(jsonschema.ValidationError, match="is not a valid spec"): v.validate(data) diff --git a/lib/spack/spack/test/spack_yaml.py b/lib/spack/spack/test/spack_yaml.py index d3bea4e66d02d1..0a27a219c36883 100644 --- a/lib/spack/spack/test/spack_yaml.py +++ b/lib/spack/spack/test/spack_yaml.py @@ -137,3 +137,19 @@ def test_round_trip_configuration(initial_content, expected_final_content, tmp_p expected_final_content = initial_content assert final_content.getvalue() == expected_final_content + + +def test_sorted_dict(): + assert syaml.sorted_dict( + { + "z": 0, + "y": [{"x": 0, "w": [2, 1, 0]}, 0], + "v": ({"u": 0, "t": 0, "s": 0}, 0, {"r": 0, "q": 0}), + "p": 0, + } + ) == { + "p": 0, + "v": ({"s": 0, "t": 0, "u": 0}, 0, {"q": 0, "r": 0}), + "y": [{"w": [2, 1, 0], "x": 0}, 0], + "z": 0, + } diff --git a/lib/spack/spack/test/spec_dag.py b/lib/spack/spack/test/spec_dag.py index 5de2bd87f6e779..2b5a18e3ea2980 100644 --- a/lib/spack/spack/test/spec_dag.py +++ b/lib/spack/spack/test/spec_dag.py @@ -6,6 +6,7 @@ """ import pytest +import spack.concretize import spack.deptypes as dt import spack.error import spack.repo @@ -74,7 +75,7 @@ def test_test_deptype(tmpdir): builder.add_package("w", dependencies=[("x", "test", None), ("y", None, None)]) with spack.repo.use_repositories(builder.root): - spec = Spec("w").concretized(tests=("w",)) + spec = spack.concretize.concretize_one("w", tests=("w",)) assert "x" in spec assert "z" not in spec @@ -106,8 +107,7 @@ def test_installed_deps(monkeypatch, mock_packages): # BUT d is only a build dependency of C, so it won't constrain # link/run dependents of C when C is depended on as an existing # (concrete) installation. - c_spec = Spec(c) - c_spec.concretize() + c_spec = spack.concretize.concretize_one(c) assert c_spec[d].version == spack.version.Version("2") installed_names = [s.name for s in c_spec.traverse()] @@ -122,7 +122,7 @@ def _mock_installed(self): # *if* we're doing a fresh installation. a_spec = Spec(a) a_spec._add_dependency(c_spec, depflag=dt.BUILD | dt.LINK, virtuals=()) - a_spec.concretize() + a_spec = spack.concretize.concretize_one(a_spec) assert spack.version.Version("2") == a_spec[c][d].version assert spack.version.Version("2") == a_spec[e].version assert spack.version.Version("3") == a_spec[b][d].version @@ -140,12 +140,12 @@ def test_specify_preinstalled_dep(tmpdir, monkeypatch): builder.add_package("pkg-a", dependencies=[("pkg-b", None, None)]) with spack.repo.use_repositories(builder.root): - b_spec = Spec("pkg-b").concretized() + b_spec = spack.concretize.concretize_one("pkg-b") monkeypatch.setattr(Spec, "installed", property(lambda x: x.name != "pkg-a")) a_spec = Spec("pkg-a") a_spec._add_dependency(b_spec, depflag=dt.BUILD | dt.LINK, virtuals=()) - a_spec.concretize() + a_spec = spack.concretize.concretize_one(a_spec) assert {x.name for x in a_spec.traverse()} == {"pkg-a", "pkg-b", "pkg-c"} @@ -167,7 +167,7 @@ def test_conditional_dep_with_user_constraints(tmpdir, spec_str, expr_str, expec builder.add_package("x", dependencies=[("y", None, "x@2:")]) with spack.repo.use_repositories(builder.root): - spec = Spec(spec_str).concretized() + spec = spack.concretize.concretize_one(spec_str) result = expr_str in spec assert result is expected, "{0} in {1}".format(expr_str, spec) @@ -181,10 +181,10 @@ def test_conflicting_package_constraints(self, set_dependency): spec = Spec("mpileaks ^mpich ^callpath ^dyninst ^libelf ^libdwarf") with pytest.raises(spack.error.UnsatisfiableSpecError): - spec.concretize() + spack.concretize.concretize_one(spec) def test_preorder_node_traversal(self): - dag = Spec("mpileaks ^zmpi").concretized() + dag = spack.concretize.concretize_one("mpileaks ^zmpi") names = ["mpileaks", "callpath", "dyninst", "libdwarf", "libelf", "zmpi", "fake"] pairs = list(zip([0, 1, 2, 3, 4, 2, 3], names)) @@ -196,7 +196,7 @@ def test_preorder_node_traversal(self): assert [(x, y.name) for x, y in traversal] == pairs def test_preorder_edge_traversal(self): - dag = Spec("mpileaks ^zmpi").concretized() + dag = spack.concretize.concretize_one("mpileaks ^zmpi") names = [ "mpileaks", @@ -218,7 +218,7 @@ def test_preorder_edge_traversal(self): assert [(x, y.name) for x, y in traversal] == pairs def test_preorder_path_traversal(self): - dag = Spec("mpileaks ^zmpi").concretized() + dag = spack.concretize.concretize_one("mpileaks ^zmpi") names = [ "mpileaks", @@ -241,7 +241,7 @@ def test_preorder_path_traversal(self): assert [(x, y.name) for x, y in traversal] == pairs def test_postorder_node_traversal(self): - dag = Spec("mpileaks ^zmpi").concretized() + dag = spack.concretize.concretize_one("mpileaks ^zmpi") names = ["libelf", "libdwarf", "dyninst", "fake", "zmpi", "callpath", "mpileaks"] pairs = list(zip([4, 3, 2, 3, 2, 1, 0], names)) @@ -253,7 +253,7 @@ def test_postorder_node_traversal(self): assert [(x, y.name) for x, y in traversal] == pairs def test_postorder_edge_traversal(self): - dag = Spec("mpileaks ^zmpi").concretized() + dag = spack.concretize.concretize_one("mpileaks ^zmpi") names = [ "libelf", @@ -275,7 +275,7 @@ def test_postorder_edge_traversal(self): assert [(x, y.name) for x, y in traversal] == pairs def test_postorder_path_traversal(self): - dag = Spec("mpileaks ^zmpi").concretized() + dag = spack.concretize.concretize_one("mpileaks ^zmpi") names = [ "libelf", @@ -310,8 +310,8 @@ def test_dependents_and_dependencies_are_correct(self): } ) check_links(spec) - spec.concretize() - check_links(spec) + concrete = spack.concretize.concretize_one(spec) + check_links(concrete) @pytest.mark.parametrize( "constraint_str,spec_str", @@ -319,7 +319,6 @@ def test_dependents_and_dependencies_are_correct(self): ("mpich@1.0", "mpileaks ^mpich@2.0"), ("mpich%gcc", "mpileaks ^mpich%intel"), ("mpich%gcc@4.6", "mpileaks ^mpich%gcc@4.5"), - ("mpich platform=test target=be", "mpileaks ^mpich platform=test target=fe"), ], ) def test_unsatisfiable_cases(self, set_dependency, constraint_str, spec_str): @@ -328,7 +327,7 @@ def test_unsatisfiable_cases(self, set_dependency, constraint_str, spec_str): """ set_dependency("mpileaks", constraint_str) with pytest.raises(spack.error.UnsatisfiableSpecError): - Spec(spec_str).concretize() + spack.concretize.concretize_one(spec_str) @pytest.mark.parametrize( "spec_str", ["libelf ^mpich", "libelf ^libdwarf", "mpich ^dyninst ^libelf"] @@ -336,7 +335,7 @@ def test_unsatisfiable_cases(self, set_dependency, constraint_str, spec_str): def test_invalid_dep(self, spec_str): spec = Spec(spec_str) with pytest.raises(spack.error.SpecError): - spec.concretize() + spack.concretize.concretize_one(spec) def test_equal(self): # Different spec structures to test for equality @@ -398,8 +397,7 @@ def test_copy_simple(self): assert not orig_ids.intersection(copy_ids) def test_copy_concretized(self): - orig = Spec("mpileaks") - orig.concretize() + orig = spack.concretize.concretize_one("mpileaks") copy = orig.copy() check_links(copy) @@ -417,7 +415,7 @@ def test_copy_through_spec_build_interface(self): """Check that copying dependencies using id(node) as a fast identifier of the node works when the spec is wrapped in a SpecBuildInterface object. """ - s = Spec("mpileaks").concretized() + s = spack.concretize.concretize_one("mpileaks") c0 = s.copy() assert c0 == s @@ -430,31 +428,29 @@ def test_copy_through_spec_build_interface(self): c2 = s["mpileaks"]["mpileaks"].copy() assert c0 == c1 == c2 == s - """ - Here is the graph with deptypes labeled (assume all packages have a 'dt' - prefix). Arrows are marked with the deptypes ('b' for 'build', 'l' for - 'link', 'r' for 'run'). + # Here is the graph with deptypes labeled (assume all packages have a 'dt' + # prefix). Arrows are marked with the deptypes ('b' for 'build', 'l' for + # 'link', 'r' for 'run'). - use -bl-> top + # use -bl-> top - top -b-> build1 - top -bl-> link1 - top -r-> run1 + # top -b-> build1 + # top -bl-> link1 + # top -r-> run1 - build1 -b-> build2 - build1 -bl-> link2 - build1 -r-> run2 + # build1 -b-> build2 + # build1 -bl-> link2 + # build1 -r-> run2 - link1 -bl-> link3 + # link1 -bl-> link3 - run1 -bl-> link5 - run1 -r-> run3 + # run1 -bl-> link5 + # run1 -r-> run3 - link3 -b-> build2 - link3 -bl-> link4 + # link3 -b-> build2 + # link3 -bl-> link4 - run3 -b-> build3 - """ + # run3 -b-> build3 @pytest.mark.parametrize( "spec_str,deptypes,expected", @@ -500,7 +496,7 @@ def test_copy_through_spec_build_interface(self): ], ) def test_deptype_traversal(self, spec_str, deptypes, expected): - dag = Spec(spec_str).concretized() + dag = spack.concretize.concretize_one(spec_str) traversal = dag.traverse(deptype=deptypes) assert [x.name for x in traversal] == expected @@ -589,8 +585,9 @@ def test_construct_spec_with_deptypes(self): assert s["b"].edges_to_dependencies(name="c")[0].depflag == dt.BUILD assert s["d"].edges_to_dependencies(name="e")[0].depflag == dt.BUILD | dt.LINK assert s["e"].edges_to_dependencies(name="f")[0].depflag == dt.RUN - - assert s["c"].edges_from_dependents(name="b")[0].depflag == dt.BUILD + # The subscript follows link/run transitive deps or direct build/test deps, therefore + # we need an extra step to get to "c" + assert s["b"]["c"].edges_from_dependents(name="b")[0].depflag == dt.BUILD assert s["e"].edges_from_dependents(name="d")[0].depflag == dt.BUILD | dt.LINK assert s["f"].edges_from_dependents(name="e")[0].depflag == dt.RUN @@ -620,20 +617,18 @@ def check_diamond_deptypes(self, spec): def test_concretize_deptypes(self): """Ensure that dependency types are preserved after concretization.""" - s = Spec("dt-diamond") - s.concretize() + s = spack.concretize.concretize_one("dt-diamond") self.check_diamond_deptypes(s) def test_copy_deptypes(self): """Ensure that dependency types are preserved by spec copy.""" - s1 = Spec("dt-diamond").concretized() + s1 = spack.concretize.concretize_one("dt-diamond") self.check_diamond_deptypes(s1) s2 = s1.copy() self.check_diamond_deptypes(s2) def test_getitem_query(self): - s = Spec("mpileaks") - s.concretize() + s = spack.concretize.concretize_one("mpileaks") # Check a query to a non-virtual package a = s["callpath"] @@ -663,8 +658,7 @@ def test_getitem_query(self): assert query.isvirtual def test_getitem_exceptional_paths(self): - s = Spec("mpileaks") - s.concretize() + s = spack.concretize.concretize_one("mpileaks") # Needed to get a proxy object q = s["mpileaks"] @@ -735,7 +729,7 @@ def test_invalid_literal_spec(self): def test_spec_tree_respect_deptypes(self): # Version-test-root uses version-test-pkg as a build dependency - s = Spec("version-test-root").concretized() + s = spack.concretize.concretize_one("version-test-root") out = s.tree(deptypes="all") assert "version-test-pkg" in out out = s.tree(deptypes=("link", "run")) @@ -819,9 +813,9 @@ def test_synthetic_construction_of_split_dependencies_from_same_package(mock_pac # # To demonstrate that a spec can now hold two direct # dependencies from the same package - root = Spec("pkg-b").concretized() - link_run_spec = Spec("pkg-c@=1.0").concretized() - build_spec = Spec("pkg-c@=2.0").concretized() + root = spack.concretize.concretize_one("pkg-b") + link_run_spec = spack.concretize.concretize_one("pkg-c@=1.0") + build_spec = spack.concretize.concretize_one("pkg-c@=2.0") root.add_dependency_edge(link_run_spec, depflag=dt.LINK, virtuals=()) root.add_dependency_edge(link_run_spec, depflag=dt.RUN, virtuals=()) @@ -848,8 +842,8 @@ def test_synthetic_construction_bootstrapping(mock_packages, config): # | build # pkg-b@1.0 # - root = Spec("pkg-b@=2.0").concretized() - bootstrap = Spec("pkg-b@=1.0").concretized() + root = spack.concretize.concretize_one("pkg-b@=2.0") + bootstrap = spack.concretize.concretize_one("pkg-b@=1.0") root.add_dependency_edge(bootstrap, depflag=dt.BUILD, virtuals=()) @@ -866,8 +860,8 @@ def test_addition_of_different_deptypes_in_multiple_calls(mock_packages, config) # pkg-b@1.0 # # with three calls and check we always have a single edge - root = Spec("pkg-b@=2.0").concretized() - bootstrap = Spec("pkg-b@=1.0").concretized() + root = spack.concretize.concretize_one("pkg-b@=2.0") + bootstrap = spack.concretize.concretize_one("pkg-b@=1.0") for current_depflag in (dt.BUILD, dt.LINK, dt.RUN): root.add_dependency_edge(bootstrap, depflag=current_depflag, virtuals=()) @@ -894,9 +888,9 @@ def test_addition_of_different_deptypes_in_multiple_calls(mock_packages, config) def test_adding_same_deptype_with_the_same_name_raises( mock_packages, config, c1_depflag, c2_depflag ): - p = Spec("pkg-b@=2.0").concretized() - c1 = Spec("pkg-b@=1.0").concretized() - c2 = Spec("pkg-b@=2.0").concretized() + p = spack.concretize.concretize_one("pkg-b@=2.0") + c1 = spack.concretize.concretize_one("pkg-b@=1.0") + c2 = spack.concretize.concretize_one("pkg-b@=2.0") p.add_dependency_edge(c1, depflag=c1_depflag, virtuals=()) with pytest.raises(spack.error.SpackError): @@ -905,8 +899,9 @@ def test_adding_same_deptype_with_the_same_name_raises( @pytest.mark.regression("33499") def test_indexing_prefers_direct_or_transitive_link_deps(): - # Test whether spec indexing prefers direct/transitive link type deps over deps of - # build/run/test deps, and whether it does fall back to a full dag search. + """Tests whether spec indexing prefers direct/transitive link/run type deps over deps of + build/test deps. + """ root = Spec("root") # Use a and z to since we typically traverse by edges sorted alphabetically. @@ -919,7 +914,7 @@ def test_indexing_prefers_direct_or_transitive_link_deps(): z3_flavor_1 = Spec("z3 +through_a1") z3_flavor_2 = Spec("z3 +through_z1") - root.add_dependency_edge(a1, depflag=dt.BUILD | dt.RUN | dt.TEST, virtuals=()) + root.add_dependency_edge(a1, depflag=dt.BUILD | dt.TEST, virtuals=()) # unique package as a dep of a build/run/test type dep. a1.add_dependency_edge(a2, depflag=dt.ALL, virtuals=()) @@ -934,8 +929,14 @@ def test_indexing_prefers_direct_or_transitive_link_deps(): assert "through_z1" in root["z3"].variants assert "through_a1" in a1["z3"].variants - # Ensure that the full DAG is still searched - assert root["a2"] + # Ensure that only the runtime sub-DAG can be searched + with pytest.raises(KeyError): + root["a2"] + + # Check consistency of __contains__ with __getitem__ + assert "z3 +through_z1" in root + assert "z3 +through_a1" in a1 + assert "a2" not in root def test_getitem_sticks_to_subdag(): diff --git a/lib/spack/spack/test/spec_list.py b/lib/spack/spack/test/spec_list.py index 7571657368c795..275d267fa69f26 100644 --- a/lib/spack/spack/test/spec_list.py +++ b/lib/spack/spack/test/spec_list.py @@ -5,6 +5,7 @@ import pytest +import spack.concretize from spack.installer import PackageInstaller from spack.spec import Spec from spack.spec_list import SpecList @@ -198,8 +199,8 @@ def test_spec_list_matrix_exclude(self, mock_packages): def test_spec_list_exclude_with_abstract_hashes(self, mock_packages, install_mockery): # Put mpich in the database so it can be referred to by hash. - mpich_1 = Spec("mpich+debug").concretized() - mpich_2 = Spec("mpich~debug").concretized() + mpich_1 = spack.concretize.concretize_one("mpich+debug") + mpich_2 = spack.concretize.concretize_one("mpich~debug") PackageInstaller([mpich_1.package, mpich_2.package], explicit=True, fake=True).install() # Create matrix and exclude +debug, which excludes the first mpich after its abstract hash diff --git a/lib/spack/spack/test/spec_semantics.py b/lib/spack/spack/test/spec_semantics.py index b0ee3709f30975..ca31f66fce2fcb 100644 --- a/lib/spack/spack/test/spec_semantics.py +++ b/lib/spack/spack/test/spec_semantics.py @@ -6,6 +6,7 @@ import pytest +import spack.concretize import spack.deptypes as dt import spack.directives import spack.error @@ -459,7 +460,6 @@ def test_concrete_specs_which_satisfies_abstract(self, lhs, rhs, default_mock_co ("foo platform=linux", "platform=test os=redhat6 target=x86"), ("foo os=redhat6", "platform=test os=debian6 target=x86_64"), ("foo target=x86_64", "platform=test os=redhat6 target=x86"), - ("foo arch=test-frontend-frontend", "platform=test os=frontend target=backend"), ("foo%intel", "%gcc"), ("foo%intel", "%gcc"), ("foo%gcc@4.3", "%gcc@4.4:4.6"), @@ -486,7 +486,6 @@ def test_concrete_specs_which_satisfies_abstract(self, lhs, rhs, default_mock_co ("libelf+debug", "libelf~debug"), ("libelf+debug~foo", "libelf+debug+foo"), ("libelf debug=True", "libelf debug=False"), - ("libelf platform=test target=be os=be", "libelf target=fe os=fe"), ("namespace=builtin.mock", "namespace=builtin"), ], ) @@ -589,8 +588,7 @@ def test_satisfies_single_valued_variant(self): https://github.com/spack/spack/pull/2386#issuecomment-282147639 is handled correctly. """ - a = Spec("pkg-a foobar=bar") - a.concretize() + a = spack.concretize.concretize_one("pkg-a foobar=bar") assert a.satisfies("foobar=bar") assert a.satisfies("foobar=*") @@ -609,21 +607,18 @@ def test_satisfies_single_valued_variant(self): assert "^pkg-b" in a def test_unsatisfied_single_valued_variant(self): - a = Spec("pkg-a foobar=baz") - a.concretize() + a = spack.concretize.concretize_one("pkg-a foobar=baz") assert "^pkg-b" not in a - mv = Spec("multivalue-variant") - mv.concretize() + mv = spack.concretize.concretize_one("multivalue-variant") assert "pkg-a@1.0" not in mv def test_indirect_unsatisfied_single_valued_variant(self): - spec = Spec("singlevalue-variant-dependent") - spec.concretize() + spec = spack.concretize.concretize_one("singlevalue-variant-dependent") assert "pkg-a@1.0" not in spec def test_satisfied_namespace(self): - spec = Spec("zlib").concretized() + spec = spack.concretize.concretize_one("zlib") assert spec.satisfies("namespace=builtin.mock") assert not spec.satisfies("namespace=builtin") @@ -683,7 +678,7 @@ def test_unsatisfiable_multi_value_variant(self, default_mock_concretization): # ...but will fail during concretization if there are # values in the variant that are not allowed with pytest.raises(InvalidVariantValueError): - a.concretize() + spack.concretize.concretize_one(a) # This time we'll try to set a single-valued variant a = Spec('multivalue-variant fee="bar"') @@ -700,15 +695,14 @@ def test_unsatisfiable_multi_value_variant(self, default_mock_concretization): # ...but will fail during concretization if there are # multiple values set with pytest.raises(MultipleValuesInExclusiveVariantError): - a.concretize() + spack.concretize.concretize_one(a) def test_copy_satisfies_transitive(self): - spec = Spec("dttop") - spec.concretize() + spec = spack.concretize.concretize_one("dttop") copy = spec.copy() - for s in spec.traverse(): - assert s.satisfies(copy[s.name]) - assert copy[s.name].satisfies(s) + for s, t in zip(spec.traverse(), copy.traverse()): + assert s.satisfies(t) + assert t.satisfies(s) def test_intersects_virtual(self): assert Spec("mpich").intersects(Spec("mpi")) @@ -727,7 +721,7 @@ def test_intersects_virtual_providers(self): def test_intersectable_concrete_specs_must_have_the_same_hash(self): """Ensure that concrete specs are matched *exactly* by hash.""" - s1 = Spec("mpileaks").concretized() + s1 = spack.concretize.concretize_one("mpileaks") s2 = s1.copy() assert s1.satisfies(s2) @@ -767,17 +761,10 @@ def test_dep_index(self, default_mock_concretization): @pytest.mark.usefixtures("config") def test_virtual_index(self): - s = Spec("callpath") - s.concretize() - - s_mpich = Spec("callpath ^mpich") - s_mpich.concretize() - - s_mpich2 = Spec("callpath ^mpich2") - s_mpich2.concretize() - - s_zmpi = Spec("callpath ^zmpi") - s_zmpi.concretize() + s = spack.concretize.concretize_one("callpath") + s_mpich = spack.concretize.concretize_one("callpath ^mpich") + s_mpich2 = spack.concretize.concretize_one("callpath ^mpich2") + s_zmpi = spack.concretize.concretize_one("callpath ^zmpi") assert s["mpi"].name != "mpi" assert s_mpich["mpi"].name == "mpich" @@ -880,6 +867,12 @@ def test_spec_formatting(self, default_mock_concretization): ("{namespace=namespace}", "namespace=", "namespace", lambda spec: spec), ("{compiler.name}", "", "name", lambda spec: spec.compiler), ("{compiler.version}", "", "version", lambda spec: spec.compiler), + ( + "{compiler.version.up_to_1}", + "", + "up_to_1", + lambda spec: spec.compiler.version.up_to(1), + ), ("{%compiler.name}", "%", "name", lambda spec: spec.compiler), ("{@compiler.version}", "@", "version", lambda spec: spec.compiler), ("{architecture.platform}", "", "platform", lambda spec: spec.architecture), @@ -1047,7 +1040,7 @@ def test_abstract_spec_prefix_error(self): spec.prefix def test_forwarding_of_architecture_attributes(self): - spec = Spec("libelf target=x86_64").concretized() + spec = spack.concretize.concretize_one("libelf target=x86_64") # Check that we can still access each member through # the architecture attribute @@ -1372,7 +1365,7 @@ def test_target_constraints(self, spec, constraint, expected_result): def test_error_message_unknown_variant(self): s = Spec("mpileaks +unknown") with pytest.raises(UnknownVariantError): - s.concretize() + spack.concretize.concretize_one(s) @pytest.mark.regression("18527") def test_satisfies_dependencies_ordered(self): @@ -1399,8 +1392,7 @@ def test_splice_swap_names_mismatch_virtuals(self, default_mock_concretization, def test_spec_override(self): init_spec = Spec("pkg-a foo=baz foobar=baz cflags=-O3 cxxflags=-O1") change_spec = Spec("pkg-a foo=fee cflags=-O2") - new_spec = Spec.override(init_spec, change_spec) - new_spec.concretize() + new_spec = spack.concretize.concretize_one(Spec.override(init_spec, change_spec)) assert "foo=fee" in new_spec # This check fails without concretizing: apparently if both specs are # abstract, then the spec will always be considered to satisfy @@ -1419,8 +1411,7 @@ def test_spec_override_with_nonexisting_variant(self): def test_spec_override_with_variant_not_in_init_spec(self): init_spec = Spec("pkg-a foo=baz foobar=baz cflags=-O3 cxxflags=-O1") change_spec = Spec("pkg-a +bvv ~lorem_ipsum") - new_spec = Spec.override(init_spec, change_spec) - new_spec.concretize() + new_spec = spack.concretize.concretize_one(Spec.override(init_spec, change_spec)) assert "+bvv" in new_spec assert "~lorem_ipsum" in new_spec @@ -1513,7 +1504,7 @@ def test_virtual_deps_bindings(self, default_mock_concretization, spec_str, spec ) def test_unsatisfiable_virtual_deps_bindings(self, spec_str): with pytest.raises(spack.solver.asp.UnsatisfiableSpecError): - Spec(spec_str).concretized() + spack.concretize.concretize_one(spec_str) @pytest.mark.parametrize( @@ -1611,7 +1602,7 @@ def test_spec_format_path_posix(spec_str, format_str, expected, mock_git_test_pa def test_is_extension_after_round_trip_to_dict(config, mock_packages, spec_str): # x is constructed directly from string, y from a # round-trip to dict representation - x = Spec(spec_str).concretized() + x = spack.concretize.concretize_one(spec_str) y = Spec.from_dict(x.to_dict()) # Using 'y' since the round-trip make us lose build dependencies @@ -1712,7 +1703,7 @@ def test_call_dag_hash_on_old_dag_hash_spec(mock_packages, default_mock_concreti def test_spec_trim(mock_packages, config): - top = Spec("dt-diamond").concretized() + top = spack.concretize.concretize_one("dt-diamond") top.trim("dt-diamond-left") remaining = set(x.name for x in top.traverse()) assert set(["dt-diamond", "dt-diamond-right", "dt-diamond-bottom"]) == remaining @@ -1725,7 +1716,7 @@ def test_spec_trim(mock_packages, config): @pytest.mark.regression("30861") def test_concretize_partial_old_dag_hash_spec(mock_packages, config): # create an "old" spec with no package hash - bottom = Spec("dt-diamond-bottom").concretized() + bottom = spack.concretize.concretize_one("dt-diamond-bottom") delattr(bottom, "_package_hash") dummy_hash = "zd4m26eis2wwbvtyfiliar27wkcv3ehk" @@ -1736,7 +1727,7 @@ def test_concretize_partial_old_dag_hash_spec(mock_packages, config): top.add_dependency_edge(bottom, depflag=0, virtuals=()) # concretize with the already-concrete dependency - top.concretize() + top = spack.concretize.concretize_one(top) for spec in top.traverse(): assert spec.concrete @@ -1841,6 +1832,16 @@ def test_abstract_contains_semantic(lhs, rhs, expected, mock_packages): # Different virtuals intersect if there is at least package providing both (Spec, "mpi", "lapack", (True, False, False)), (Spec, "mpi", "pkgconfig", (False, False, False)), + # Intersection among target ranges for different architectures + (Spec, "target=x86_64:", "target=ppc64le:", (False, False, False)), + (Spec, "target=x86_64:", "target=:power9", (False, False, False)), + (Spec, "target=:haswell", "target=:power9", (False, False, False)), + (Spec, "target=:haswell", "target=ppc64le:", (False, False, False)), + # Intersection among target ranges for the same architecture + (Spec, "target=:haswell", "target=x86_64:", (True, True, True)), + (Spec, "target=:haswell", "target=x86_64_v4:", (False, False, False)), + # Edge case of uarch that split in a diamond structure, from a common ancestor + (Spec, "target=:cascadelake", "target=:cannonlake", (False, False, False)), ], ) def test_intersects_and_satisfies(factory, lhs_str, rhs_str, results): @@ -1890,6 +1891,16 @@ def test_intersects_and_satisfies(factory, lhs_str, rhs_str, results): # Flags (Spec, "cppflags=-foo", "cppflags=-foo", False, "cppflags=-foo"), (Spec, "cppflags=-foo", "cflags=-foo", True, "cppflags=-foo cflags=-foo"), + # Target ranges + (Spec, "target=x86_64:", "target=x86_64:", False, "target=x86_64:"), + (Spec, "target=x86_64:", "target=:haswell", True, "target=x86_64:haswell"), + ( + Spec, + "target=x86_64:haswell", + "target=x86_64_v2:icelake", + True, + "target=x86_64_v2:haswell", + ), ], ) def test_constrain(factory, lhs_str, rhs_str, result, constrained_str): @@ -1954,7 +1965,7 @@ def test_edge_equality_does_not_depend_on_virtual_order(): def test_old_format_strings_trigger_error(default_mock_concretization): - s = Spec("pkg-a").concretized() + s = spack.concretize.concretize_one("pkg-a") with pytest.raises(SpecFormatStringError): s.format("${PACKAGE}-${VERSION}-${HASH}") @@ -1978,3 +1989,26 @@ def test_equality_discriminate_on_propagation(lhs, rhs): def test_comparison_multivalued_variants(): assert Spec("x=a") < Spec("x=a,b") < Spec("x==a,b") < Spec("x==a,b,c") + + +def test_comparison_after_breaking_hash_change(): + # We simulate a breaking change in DAG hash computation in Spack. We have two specs that are + # entirely equal modulo DAG hash. When deserializing these specs, we don't want them to compare + # as equal, because DAG hash is used throughout in Spack to distinguish between specs + # (e.g. database, build caches, install dir). + s = Spec("example@=1.0") + s._mark_concrete(True) + + # compute the dag hash and a change to it + dag_hash = s.dag_hash() + new_dag_hash = f"{'b' if dag_hash[0] == 'a' else 'a'}{dag_hash[1:]}" + + before_breakage = s.to_dict() + after_breakage = s.to_dict() + after_breakage["spec"]["nodes"][0]["hash"] = new_dag_hash + assert before_breakage != after_breakage + + x = Spec.from_dict(before_breakage) + y = Spec.from_dict(after_breakage) + assert x != y + assert len({x, y}) == 2 diff --git a/lib/spack/spack/test/spec_syntax.py b/lib/spack/spack/test/spec_syntax.py index 842c2f72470159..4f58be0b2c378b 100644 --- a/lib/spack/spack/test/spec_syntax.py +++ b/lib/spack/spack/test/spec_syntax.py @@ -10,6 +10,7 @@ import spack.binary_distribution import spack.cmd +import spack.concretize import spack.platforms.test import spack.repo import spack.spec @@ -305,7 +306,7 @@ def _specfile_for(spec_str, filename): ( r"os=fe", # Various translations associated with the architecture [Token(SpecTokens.KEY_VALUE_PAIR, value="os=fe")], - "arch=test-redhat6-None", + "arch=test-debian6-None", ), ( r"os=default_os", @@ -776,7 +777,7 @@ def test_spec_by_hash_tokens(text, tokens): @pytest.mark.db def test_spec_by_hash(database, monkeypatch, config): mpileaks = database.query_one("mpileaks ^zmpi") - b = spack.spec.Spec("pkg-b").concretized() + b = spack.concretize.concretize_one("pkg-b") monkeypatch.setattr(spack.binary_distribution, "update_cache_and_get_specs", lambda: [b]) hash_str = f"/{mpileaks.dag_hash()}" @@ -873,7 +874,7 @@ def test_ambiguous_hash(mutable_database): In the past this ambiguity error would happen during parse time.""" # This is a very sketchy as manually setting hashes easily breaks invariants - x1 = spack.spec.Spec("pkg-a").concretized() + x1 = spack.concretize.concretize_one("pkg-a") x2 = x1.copy() x1._hash = "xyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" x1._process_hash = "xyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" @@ -947,8 +948,8 @@ def test_nonexistent_hash(database, config): ], ) def test_disambiguate_hash_by_spec(spec1, spec2, constraint, mock_packages, monkeypatch, config): - spec1_concrete = spack.spec.Spec(spec1).concretized() - spec2_concrete = spack.spec.Spec(spec2).concretized() + spec1_concrete = spack.concretize.concretize_one(spec1) + spec2_concrete = spack.concretize.concretize_one(spec2) spec1_concrete._hash = "spec1" spec2_concrete._hash = "spec2" @@ -998,14 +999,14 @@ def test_disambiguate_hash_by_spec(spec1, spec2, constraint, mock_packages, monk ("x arch=linux-rhel7-ppc64le arch=linux-rhel7-x86_64", "two architectures"), ("y ^x arch=linux-rhel7-x86_64 arch=linux-rhel7-x86_64", "two architectures"), ("y ^x arch=linux-rhel7-x86_64 arch=linux-rhel7-ppc64le", "two architectures"), - ("x os=fe os=fe", "'os'"), - ("x os=fe os=be", "'os'"), - ("x target=fe target=fe", "'target'"), - ("x target=fe target=be", "'target'"), + ("x os=redhat6 os=debian6", "'os'"), + ("x os=debian6 os=redhat6", "'os'"), + ("x target=core2 target=x86_64", "'target'"), + ("x target=x86_64 target=core2", "'target'"), ("x platform=test platform=test", "'platform'"), # TODO: these two seem wrong: need to change how arch is initialized (should fail on os) - ("x os=fe platform=test target=fe os=fe", "'platform'"), - ("x target=be platform=test os=be os=fe", "'platform'"), + ("x os=debian6 platform=test target=default_target os=redhat6", "two architectures"), + ("x target=default_target platform=test os=redhat6 os=debian6", "'platform'"), # Dependencies ("^[@foo] zlib", "edge attributes"), ("x ^[deptypes=link]foo ^[deptypes=run]foo", "conflicting dependency types"), @@ -1139,7 +1140,7 @@ def test_parse_filename_missing_slash_as_spec(specfile_for, tmpdir, filename): # Check that if we concretize this spec, we get a good error # message that mentions we might've meant a file. with pytest.raises(spack.repo.UnknownEntityError) as exc_info: - spec.concretize() + spack.concretize.concretize_one(spec) assert exc_info.value.long_message assert ( "Did you mean to specify a filename with './libelf.yaml'?" in exc_info.value.long_message @@ -1147,7 +1148,7 @@ def test_parse_filename_missing_slash_as_spec(specfile_for, tmpdir, filename): # make sure that only happens when the spec ends in yaml with pytest.raises(spack.repo.UnknownPackageError) as exc_info: - SpecParser("builtin.mock.doesnotexist").next_spec().concretize() + spack.concretize.concretize_one(SpecParser("builtin.mock.doesnotexist").next_spec()) assert not exc_info.value.long_message or ( "Did you mean to specify a filename with" not in exc_info.value.long_message ) diff --git a/lib/spack/spack/test/spec_yaml.py b/lib/spack/spack/test/spec_yaml.py index 78901f9034804a..411beb357227a9 100644 --- a/lib/spack/spack/test/spec_yaml.py +++ b/lib/spack/spack/test/spec_yaml.py @@ -7,11 +7,9 @@ The YAML and JSON formats preserve DAG information in the spec. """ -import ast import collections import collections.abc import gzip -import inspect import io import json import os @@ -20,13 +18,14 @@ import pytest import ruamel.yaml +import spack.concretize +import spack.config import spack.hash_types as ht import spack.paths import spack.repo import spack.spec import spack.util.spack_json as sjson import spack.util.spack_yaml as syaml -import spack.version from spack.spec import Spec, save_dependency_specfiles from spack.util.spack_yaml import SpackYAMLError, syaml_dict @@ -107,8 +106,7 @@ def test_roundtrip_concrete_specs(abstract_spec, default_mock_concretization): def test_yaml_subdag(config, mock_packages): - spec = Spec("mpileaks^mpich+debug") - spec.concretize() + spec = spack.concretize.concretize_one("mpileaks^mpich+debug") yaml_spec = Spec.from_yaml(spec.to_yaml()) json_spec = Spec.from_json(spec.to_json()) @@ -127,7 +125,7 @@ def test_using_ordered_dict(default_mock_concretization, spec_str): def descend_and_check(iterable, level=0): if isinstance(iterable, collections.abc.Mapping): - assert isinstance(iterable, syaml_dict) + assert type(iterable) in (syaml_dict, dict) return descend_and_check(iterable.values(), level=level + 1) max_level = level for value in iterable: @@ -143,163 +141,92 @@ def descend_and_check(iterable, level=0): assert level >= 5 -def test_ordered_read_not_required_for_consistent_dag_hash(config, mock_packages): +@pytest.mark.parametrize("spec_str", ["mpileaks ^zmpi", "dttop", "dtuse"]) +def test_ordered_read_not_required_for_consistent_dag_hash( + spec_str, mutable_config: spack.config.Configuration, mock_packages +): """Make sure ordered serialization isn't required to preserve hashes. - For consistent hashes, we require that YAML and json documents - have their keys serialized in a deterministic order. However, we - don't want to require them to be serialized in order. This - ensures that is not required. - """ - specs = ["mpileaks ^zmpi", "dttop", "dtuse"] - for spec in specs: - spec = Spec(spec) - spec.concretize() - - # - # Dict & corresponding YAML & JSON from the original spec. - # - spec_dict = spec.to_dict() - spec_yaml = spec.to_yaml() - spec_json = spec.to_json() - - # - # Make a spec with reversed OrderedDicts for every - # OrderedDict in the original. - # - reversed_spec_dict = reverse_all_dicts(spec.to_dict()) - - # - # Dump to YAML and JSON - # - yaml_string = syaml.dump(spec_dict, default_flow_style=False) - reversed_yaml_string = syaml.dump(reversed_spec_dict, default_flow_style=False) - json_string = sjson.dump(spec_dict) - reversed_json_string = sjson.dump(reversed_spec_dict) - - # - # Do many consistency checks - # - - # spec yaml is ordered like the spec dict - assert yaml_string == spec_yaml - assert json_string == spec_json - - # reversed string is different from the original, so it - # *would* generate a different hash - assert yaml_string != reversed_yaml_string - assert json_string != reversed_json_string - - # build specs from the "wrongly" ordered data - round_trip_yaml_spec = Spec.from_yaml(yaml_string) - round_trip_json_spec = Spec.from_json(json_string) - round_trip_reversed_yaml_spec = Spec.from_yaml(reversed_yaml_string) - round_trip_reversed_json_spec = Spec.from_yaml(reversed_json_string) - - # Strip spec if we stripped the yaml - spec = spec.copy(deps=ht.dag_hash.depflag) - - # specs are equal to the original - assert spec == round_trip_yaml_spec - assert spec == round_trip_json_spec - - assert spec == round_trip_reversed_yaml_spec - assert spec == round_trip_reversed_json_spec - assert round_trip_yaml_spec == round_trip_reversed_yaml_spec - assert round_trip_json_spec == round_trip_reversed_json_spec - # dag_hashes are equal - assert spec.dag_hash() == round_trip_yaml_spec.dag_hash() - assert spec.dag_hash() == round_trip_json_spec.dag_hash() - assert spec.dag_hash() == round_trip_reversed_yaml_spec.dag_hash() - assert spec.dag_hash() == round_trip_reversed_json_spec.dag_hash() - - # dag_hash is equal after round-trip by dag_hash - spec.concretize() - round_trip_yaml_spec.concretize() - round_trip_json_spec.concretize() - round_trip_reversed_yaml_spec.concretize() - round_trip_reversed_json_spec.concretize() - assert spec.dag_hash() == round_trip_yaml_spec.dag_hash() - assert spec.dag_hash() == round_trip_json_spec.dag_hash() - assert spec.dag_hash() == round_trip_reversed_yaml_spec.dag_hash() - assert spec.dag_hash() == round_trip_reversed_json_spec.dag_hash() - - -@pytest.mark.parametrize("module", [spack.spec, spack.version]) -def test_hashes_use_no_python_dicts(module): - """Coarse check to make sure we don't use dicts in Spec.to_node_dict(). - - Python dicts are not guaranteed to iterate in a deterministic order - (at least not in all python versions) so we need to use lists and - syaml_dicts. syaml_dicts are ordered and ensure that hashes in Spack - are deterministic. - - This test is intended to handle cases that are not covered by the - consistency checks above, or that would be missed by a dynamic check. - This test traverses the ASTs of functions that are used in our hash - algorithms, finds instances of dictionaries being constructed, and - prints out the line numbers where they occur. - - """ - - class FindFunctions(ast.NodeVisitor): - """Find a function definition called to_node_dict.""" - - def __init__(self): - self.nodes = [] + For consistent hashes, we require that YAML and JSON serializations have their keys in a + deterministic order. However, we don't want to require them to be serialized in order. This + ensures that is not required.""" + + # Make sure that `extra_attributes` of externals is order independent for hashing. + extra_attributes = { + "compilers": {"c": "/some/path/bin/cc", "cxx": "/some/path/bin/c++"}, + "foo": "bar", + "baz": "qux", + } + mutable_config.set( + "packages:dtuse", + { + "buildable": False, + "externals": [ + {"spec": "dtuse@=1.0", "prefix": "/usr", "extra_attributes": extra_attributes} + ], + }, + ) - def visit_FunctionDef(self, node): - if node.name in ("to_node_dict", "to_dict", "to_dict_or_value"): - self.nodes.append(node) + spec = spack.concretize.concretize_one(spec_str) - class FindDicts(ast.NodeVisitor): - """Find source locations of dicts in an AST.""" + if spec_str == "dtuse": + assert spec.external and spec.extra_attributes == extra_attributes - def __init__(self, filename): - self.nodes = [] - self.filename = filename + spec_dict = spec.to_dict(hash=ht.dag_hash) + spec_yaml = spec.to_yaml() + spec_json = spec.to_json() - def add_error(self, node): - self.nodes.append( - "Use syaml_dict instead of dict at %s:%s:%s" - % (self.filename, node.lineno, node.col_offset) - ) + # Make a spec with dict keys reversed recursively + spec_dict_rev = reverse_all_dicts(spec_dict) - def visit_Dict(self, node): - self.add_error(node) + # Dump to YAML and JSON + yaml_string = syaml.dump(spec_dict, default_flow_style=False) + yaml_string_rev = syaml.dump(spec_dict_rev, default_flow_style=False) + json_string = sjson.dump(spec_dict) + json_string_rev = sjson.dump(spec_dict_rev) - def visit_Call(self, node): - name = None - if isinstance(node.func, ast.Name): - name = node.func.id - elif isinstance(node.func, ast.Attribute): - name = node.func.attr + # spec yaml is ordered like the spec dict + assert yaml_string == spec_yaml + assert json_string == spec_json - if name == "dict": - self.add_error(node) + # reversed string is different from the original, so it *would* generate a different hash + assert yaml_string != yaml_string_rev + assert json_string != json_string_rev - find_functions = FindFunctions() - module_ast = ast.parse(inspect.getsource(module)) - find_functions.visit(module_ast) + # build specs from the "wrongly" ordered data + from_yaml = Spec.from_yaml(yaml_string) + from_json = Spec.from_json(json_string) + from_yaml_rev = Spec.from_yaml(yaml_string_rev) + from_json_rev = Spec.from_json(json_string_rev) - find_dicts = FindDicts(module.__file__) - for node in find_functions.nodes: - find_dicts.visit(node) + # Strip spec if we stripped the yaml + spec = spec.copy(deps=ht.dag_hash.depflag) - # fail with offending lines if we found some dicts. - assert [] == find_dicts.nodes + # specs and their hashes are equal to the original + assert ( + spec.process_hash() + == from_yaml.process_hash() + == from_json.process_hash() + == from_yaml_rev.process_hash() + == from_json_rev.process_hash() + ) + assert ( + spec.dag_hash() + == from_yaml.dag_hash() + == from_json.dag_hash() + == from_yaml_rev.dag_hash() + == from_json_rev.dag_hash() + ) + assert spec == from_yaml == from_json == from_yaml_rev == from_json_rev def reverse_all_dicts(data): """Descend into data and reverse all the dictionaries""" if isinstance(data, dict): - return syaml_dict( - reversed([(reverse_all_dicts(k), reverse_all_dicts(v)) for k, v in data.items()]) - ) + return type(data)((k, reverse_all_dicts(v)) for k, v in reversed(list(data.items()))) elif isinstance(data, (list, tuple)): return type(data)(reverse_all_dicts(elt) for elt in data) - else: - return data + return data def check_specs_equal(original_spec, spec_yaml_path): @@ -322,7 +249,7 @@ def test_save_dependency_spec_jsons_subset(tmpdir, config): builder.add_package("pkg-a", dependencies=[("pkg-b", None, None), ("pkg-c", None, None)]) with spack.repo.use_repositories(builder.root): - spec_a = Spec("pkg-a").concretized() + spec_a = spack.concretize.concretize_one("pkg-a") b_spec = spec_a["pkg-b"] c_spec = spec_a["pkg-c"] @@ -389,7 +316,7 @@ def test_legacy_yaml(tmpdir, install_mockery, mock_packages): build_hash: iaapywazxgetn6gfv2cfba353qzzqvhy """ spec = Spec.from_yaml(yaml) - concrete_spec = spec.concretized() + concrete_spec = spack.concretize.concretize_one(spec) assert concrete_spec.eq_dag(spec) @@ -500,6 +427,9 @@ def test_load_json_specfiles(specfile, expected_hash, reader_cls): openmpi_edges = s2.edges_to_dependencies(name="openmpi") assert len(openmpi_edges) == 1 + # Check that virtuals have been reconstructed + assert "mpi" in openmpi_edges[0].virtuals + # The virtuals attribute must be a tuple, when read from a # JSON or YAML file, not a list for edge in s2.traverse_edges(): diff --git a/lib/spack/spack/test/stage.py b/lib/spack/spack/test/stage.py index c7b9a871b35bd9..71eafcbd20aaee 100644 --- a/lib/spack/spack/test/stage.py +++ b/lib/spack/spack/test/stage.py @@ -125,7 +125,7 @@ def check_expand_archive(stage, stage_name, expected_file_list): assert os.path.isfile(fn) with open(fn, encoding="utf-8") as _file: - _file.read() == contents + assert _file.read() == contents def check_fetch(stage, stage_name): diff --git a/lib/spack/spack/test/svn_fetch.py b/lib/spack/spack/test/svn_fetch.py index ac3be1558f99c8..b8d0853d717104 100644 --- a/lib/spack/spack/test/svn_fetch.py +++ b/lib/spack/spack/test/svn_fetch.py @@ -8,9 +8,9 @@ from llnl.util.filesystem import mkdirp, touch, working_dir +import spack.concretize import spack.config from spack.fetch_strategy import SvnFetchStrategy -from spack.spec import Spec from spack.stage import Stage from spack.util.executable import which from spack.version import Version @@ -40,7 +40,7 @@ def test_fetch(type_of_test, secure, mock_svn_repository, config, mutable_mock_r h = mock_svn_repository.hash # Construct the package under test - s = Spec("svn-test").concretized() + s = spack.concretize.concretize_one("svn-test") monkeypatch.setitem(s.package.versions, Version("svn"), t.args) # Enter the stage directory and check some properties diff --git a/lib/spack/spack/test/test_suite.py b/lib/spack/spack/test/test_suite.py index a6ae7037ac1359..5b6ef111cc6f65 100644 --- a/lib/spack/spack/test/test_suite.py +++ b/lib/spack/spack/test/test_suite.py @@ -9,6 +9,7 @@ from llnl.util.filesystem import join_path, mkdirp, touch +import spack.concretize import spack.config import spack.install_test import spack.spec @@ -39,7 +40,7 @@ def ensure_results(filename, expected, present=True): def test_test_log_name(mock_packages, config): """Ensure test log path is reasonable.""" - spec = spack.spec.Spec("libdwarf").concretized() + spec = spack.concretize.concretize_one("libdwarf") test_name = "test_name" @@ -52,7 +53,7 @@ def test_test_log_name(mock_packages, config): def test_test_ensure_stage(mock_test_stage, mock_packages): """Make sure test stage directory is properly set up.""" - spec = spack.spec.Spec("libdwarf").concretized() + spec = spack.concretize.concretize_one("libdwarf") test_name = "test_name" @@ -65,7 +66,7 @@ def test_test_ensure_stage(mock_test_stage, mock_packages): def test_write_test_result(mock_packages, mock_test_stage): """Ensure test results written to a results file.""" - spec = spack.spec.Spec("libdwarf").concretized() + spec = spack.concretize.concretize_one("libdwarf") result = "TEST" test_name = "write-test" @@ -85,7 +86,7 @@ def test_write_test_result(mock_packages, mock_test_stage): def test_test_not_installed(mock_packages, install_mockery, mock_test_stage): """Attempt to perform stand-alone test for not_installed package.""" - spec = spack.spec.Spec("trivial-smoke-test").concretized() + spec = spack.concretize.concretize_one("trivial-smoke-test") test_suite = spack.install_test.TestSuite([spec]) test_suite() @@ -102,7 +103,7 @@ def test_test_external( mock_packages, install_mockery, mock_test_stage, monkeypatch, arguments, status, msg ): name = "trivial-smoke-test" - spec = spack.spec.Spec(name).concretized() + spec = spack.concretize.concretize_one(name) spec.external_path = "/path/to/external/{0}".format(name) monkeypatch.setattr(spack.spec.Spec, "installed", _true) @@ -123,7 +124,7 @@ def ensure_current_cache_fail(test_suite): with pytest.raises(spack.install_test.TestSuiteSpecError): _ = test_suite.current_test_data_dir - spec = spack.spec.Spec("libelf").concretized() + spec = spack.concretize.concretize_one("libelf") test_suite = spack.install_test.TestSuite([spec], "test-cache") # Check no current specs yield failure @@ -141,7 +142,7 @@ def ensure_current_cache_fail(test_suite): def test_test_spec_run_once(mock_packages, install_mockery, mock_test_stage): - spec = spack.spec.Spec("libelf").concretized() + spec = spack.concretize.concretize_one("libelf") test_suite = spack.install_test.TestSuite([spec], "test-dups") (test_suite.specs[0]).package.test_suite = test_suite @@ -151,7 +152,7 @@ def test_test_spec_run_once(mock_packages, install_mockery, mock_test_stage): @pytest.mark.not_on_windows("Cannot find echo executable") def test_test_spec_passes(mock_packages, install_mockery, mock_test_stage, monkeypatch): - spec = spack.spec.Spec("simple-standalone-test").concretized() + spec = spack.concretize.concretize_one("simple-standalone-test") monkeypatch.setattr(spack.spec.Spec, "installed", _true) test_suite = spack.install_test.TestSuite([spec]) test_suite() @@ -177,7 +178,7 @@ def test_get_test_suite_too_many(mock_packages, mock_test_stage): name = "duplicate-alias" def add_suite(package): - spec = spack.spec.Spec(package).concretized() + spec = spack.concretize.concretize_one(package) suite = spack.install_test.TestSuite([spec], name) suite.ensure_stage() spack.install_test.write_test_suite_file(suite) @@ -199,7 +200,7 @@ def add_suite(package): ) def test_test_function_names(mock_packages, install_mockery, virtuals, expected): """Confirm test_function_names works as expected with/without virtuals.""" - spec = spack.spec.Spec("mpich").concretized() + spec = spack.concretize.concretize_one("mpich") tests = spack.install_test.test_function_names(spec.package, add_virtuals=virtuals) assert sorted(tests) == sorted(expected) @@ -212,7 +213,7 @@ def test_test_functions_fails(): def test_test_functions_pkgless(mock_packages, install_mockery, ensure_debug, capsys): """Confirm works for package providing a package-less virtual.""" - spec = spack.spec.Spec("simple-standalone-test").concretized() + spec = spack.concretize.concretize_one("simple-standalone-test") fns = spack.install_test.test_functions(spec.package, add_virtuals=True) out = capsys.readouterr() assert len(fns) == 2, "Expected two test functions" @@ -295,7 +296,7 @@ def test_process_test_parts(mock_packages): def test_test_part_fail(tmpdir, install_mockery, mock_fetch, mock_test_stage): """Confirm test_part with a ProcessError results in FAILED status.""" - s = spack.spec.Spec("trivial-smoke-test").concretized() + s = spack.concretize.concretize_one("trivial-smoke-test") pkg = s.package pkg.tester.test_log_file = str(tmpdir.join("test-log.txt")) touch(pkg.tester.test_log_file) @@ -311,7 +312,7 @@ def test_test_part_fail(tmpdir, install_mockery, mock_fetch, mock_test_stage): def test_test_part_pass(install_mockery, mock_fetch, mock_test_stage): """Confirm test_part that succeeds results in PASSED status.""" - s = spack.spec.Spec("trivial-smoke-test").concretized() + s = spack.concretize.concretize_one("trivial-smoke-test") pkg = s.package name = "test_echo" @@ -330,7 +331,7 @@ def test_test_part_pass(install_mockery, mock_fetch, mock_test_stage): def test_test_part_skip(install_mockery, mock_fetch, mock_test_stage): """Confirm test_part that raises SkipTest results in test status SKIPPED.""" - s = spack.spec.Spec("trivial-smoke-test").concretized() + s = spack.concretize.concretize_one("trivial-smoke-test") pkg = s.package name = "test_skip" @@ -344,7 +345,7 @@ def test_test_part_skip(install_mockery, mock_fetch, mock_test_stage): def test_test_part_missing_exe_fail_fast(tmpdir, install_mockery, mock_fetch, mock_test_stage): """Confirm test_part with fail fast enabled raises exception.""" - s = spack.spec.Spec("trivial-smoke-test").concretized() + s = spack.concretize.concretize_one("trivial-smoke-test") pkg = s.package pkg.tester.test_log_file = str(tmpdir.join("test-log.txt")) touch(pkg.tester.test_log_file) @@ -365,7 +366,7 @@ def test_test_part_missing_exe_fail_fast(tmpdir, install_mockery, mock_fetch, mo def test_test_part_missing_exe(tmpdir, install_mockery, mock_fetch, mock_test_stage): """Confirm test_part with missing executable fails.""" - s = spack.spec.Spec("trivial-smoke-test").concretized() + s = spack.concretize.concretize_one("trivial-smoke-test") pkg = s.package pkg.tester.test_log_file = str(tmpdir.join("test-log.txt")) touch(pkg.tester.test_log_file) @@ -401,7 +402,7 @@ def test_embedded_test_part_status( ): """Check to ensure the status of the enclosing test part reflects summary of embedded parts.""" - s = spack.spec.Spec("trivial-smoke-test").concretized() + s = spack.concretize.concretize_one("trivial-smoke-test") pkg = s.package base_name = "test_example" part_name = f"{pkg.__class__.__name__}::{base_name}" @@ -428,7 +429,7 @@ def test_write_tested_status( tmpdir, install_mockery, mock_fetch, mock_test_stage, statuses, expected ): """Check to ensure the status of the enclosing test part reflects summary of embedded parts.""" - s = spack.spec.Spec("trivial-smoke-test").concretized() + s = spack.concretize.concretize_one("trivial-smoke-test") pkg = s.package for i, status in enumerate(statuses): pkg.tester.test_parts[f"test_{i}"] = status @@ -444,7 +445,7 @@ def test_write_tested_status( @pytest.mark.regression("37840") def test_write_tested_status_no_repeats(tmpdir, install_mockery, mock_fetch, mock_test_stage): """Emulate re-running the same stand-alone tests a second time.""" - s = spack.spec.Spec("trivial-smoke-test").concretized() + s = spack.concretize.concretize_one("trivial-smoke-test") pkg = s.package statuses = [TestStatus.PASSED, TestStatus.PASSED] for i, status in enumerate(statuses): diff --git a/lib/spack/spack/test/url_fetch.py b/lib/spack/spack/test/url_fetch.py index c487633f510df6..f186a7b5a06e96 100644 --- a/lib/spack/spack/test/url_fetch.py +++ b/lib/spack/spack/test/url_fetch.py @@ -13,6 +13,7 @@ import llnl.util.tty as tty from llnl.util.filesystem import is_exe, working_dir +import spack.concretize import spack.config import spack.error import spack.fetch_strategy as fs @@ -21,7 +22,6 @@ import spack.util.executable import spack.util.web as web_util import spack.version -from spack.spec import Spec from spack.stage import Stage from spack.util.executable import which @@ -192,7 +192,7 @@ def test_from_list_url(mock_packages, config, spec, url, digest, _fetch_method): have checksums in the package. """ with spack.config.override("config:url_fetch_method", _fetch_method): - s = Spec(spec).concretized() + s = spack.concretize.concretize_one(spec) fetch_strategy = fs.from_list_url(s.package) assert isinstance(fetch_strategy, fs.URLFetchStrategy) assert os.path.basename(fetch_strategy.url) == url @@ -218,7 +218,7 @@ def test_new_version_from_list_url( ): """Test non-specific URLs from the url-list-test package.""" with spack.config.override("config:url_fetch_method", _fetch_method): - s = Spec(f"url-list-test @{requested_version}").concretized() + s = spack.concretize.concretize_one(f"url-list-test @{requested_version}") fetch_strategy = fs.from_list_url(s.package) assert isinstance(fetch_strategy, fs.URLFetchStrategy) @@ -232,7 +232,7 @@ def test_new_version_from_list_url( def test_nosource_from_list_url(mock_packages, config): """This test confirms BundlePackages do not have list url.""" - s = Spec("nosource").concretized() + s = spack.concretize.concretize_one("nosource") fetch_strategy = fs.from_list_url(s.package) assert fetch_strategy is None @@ -354,21 +354,6 @@ def test_url_missing_curl(mutable_config, missing_curl, monkeypatch): web_util.url_exists("https://example.com/") -def test_url_fetch_text_urllib_bad_returncode(mutable_config, monkeypatch): - class response: - def getcode(self): - return 404 - - def _read_from_url(*args, **kwargs): - return None, None, response() - - monkeypatch.setattr(web_util, "read_from_url", _read_from_url) - mutable_config.set("config:url_fetch_method", "urllib") - - with pytest.raises(spack.error.FetchError, match="failed with error code"): - web_util.fetch_url_text("https://example.com/") - - def test_url_fetch_text_urllib_web_error(mutable_config, monkeypatch): def _raise_web_error(*args, **kwargs): raise web_util.SpackWebError("bad url") @@ -376,5 +361,5 @@ def _raise_web_error(*args, **kwargs): monkeypatch.setattr(web_util, "read_from_url", _raise_web_error) mutable_config.set("config:url_fetch_method", "urllib") - with pytest.raises(spack.error.FetchError, match="fetch failed to verify"): + with pytest.raises(spack.error.FetchError, match="fetch failed"): web_util.fetch_url_text("https://example.com/") diff --git a/lib/spack/spack/test/util/archive.py b/lib/spack/spack/test/util/archive.py index 70133c13818aae..b0993f7eb85338 100644 --- a/lib/spack/spack/test/util/archive.py +++ b/lib/spack/spack/test/util/archive.py @@ -154,3 +154,35 @@ def test_gzip_compressed_tarball_is_reproducible(tmpdir): == spack.util.crypto.checksum_stream(hashlib.sha256, f) == spack.util.crypto.checksum_stream(hashlib.sha256, g) ) + + +def test_reproducible_tarfile_from_prefix_path_to_name(tmp_path: Path): + prefix = tmp_path / "example" + prefix.mkdir() + (prefix / "file1").write_bytes(b"file") + (prefix / "file2").write_bytes(b"file") + + def map_prefix(path: str) -> str: + """maps / to some/common/prefix/""" + p = PurePath(path) + assert p.parts[: len(prefix.parts)] == prefix.parts, f"{path} is not under {prefix}" + return PurePath("some", "common", "prefix", *p.parts[len(prefix.parts) :]).as_posix() + + with tarfile.open(tmp_path / "example.tar", "w") as tar: + reproducible_tarfile_from_prefix( + tar, + str(tmp_path / "example"), + include_parent_directories=True, + path_to_name=map_prefix, + ) + + with tarfile.open(tmp_path / "example.tar", "r") as tar: + assert [t.name for t in tar.getmembers() if t.isdir()] == [ + "some", + "some/common", + "some/common/prefix", + ] + assert [t.name for t in tar.getmembers() if t.isfile()] == [ + "some/common/prefix/file1", + "some/common/prefix/file2", + ] diff --git a/lib/spack/spack/test/util/compression.py b/lib/spack/spack/test/util/compression.py index e4ff5746f74c67..4fbda590a7f6f8 100644 --- a/lib/spack/spack/test/util/compression.py +++ b/lib/spack/spack/test/util/compression.py @@ -20,12 +20,7 @@ datadir = os.path.join(spack_root, "lib", "spack", "spack", "test", "data", "compression") -ext_archive = {} -[ - ext_archive.update({ext: ".".join(["Foo", ext])}) - for ext in llnl.url.ALLOWED_ARCHIVE_TYPES - if "TAR" not in ext -] +ext_archive = {ext: f"Foo.{ext}" for ext in llnl.url.ALLOWED_ARCHIVE_TYPES if "TAR" not in ext} # Spack does not use Python native handling for tarballs or zip # Don't test tarballs or zip in native test native_archive_list = [ diff --git a/lib/spack/spack/test/util/editor.py b/lib/spack/spack/test/util/editor.py index d2d2a5402f79df..f244d4bd8cf97d 100644 --- a/lib/spack/spack/test/util/editor.py +++ b/lib/spack/spack/test/util/editor.py @@ -204,13 +204,13 @@ def test_no_editor(): def assert_exec(exe, args): assert False - with pytest.raises(EnvironmentError, match=r"No text editor found.*"): + with pytest.raises(OSError, match=r"No text editor found.*"): ed.editor("/path/to/file", exec_fn=assert_exec) def assert_exec(exe, args): return False - with pytest.raises(EnvironmentError, match=r"No text editor found.*"): + with pytest.raises(OSError, match=r"No text editor found.*"): ed.editor("/path/to/file", exec_fn=assert_exec) @@ -220,5 +220,5 @@ def test_exec_fn_executable(editor_var, good_exe, bad_exe): assert ed.editor(exec_fn=ed.executable) os.environ[editor_var] = bad_exe - with pytest.raises(EnvironmentError, match=r"No text editor found.*"): + with pytest.raises(OSError, match=r"No text editor found.*"): ed.editor(exec_fn=ed.executable) diff --git a/lib/spack/spack/test/util/elf.py b/lib/spack/spack/test/util/elf.py index 465985fb26d28b..f2fd00c44ad08b 100644 --- a/lib/spack/spack/test/util/elf.py +++ b/lib/spack/spack/test/util/elf.py @@ -201,3 +201,15 @@ def test_drop_redundant_rpath(tmpdir, binary_with_rpaths): new_rpaths = elf.get_rpaths(binary) assert set(existing_dirs).issubset(new_rpaths) assert set(non_existing_dirs).isdisjoint(new_rpaths) + + +def test_elf_invalid_e_shnum(tmp_path): + # from llvm/test/Object/Inputs/invalid-e_shnum.elf + path = tmp_path / "invalid-e_shnum.elf" + with open(path, "wb") as file: + file.write( + b"\x7fELF\x02\x010000000000\x03\x00>\x0000000000000000000000" + b"\x00\x00\x00\x00\x00\x00\x00\x000000000000@\x000000" + ) + with open(path, "rb") as file, pytest.raises(elf.ElfParsingError): + elf.parse_elf(file) diff --git a/lib/spack/spack/test/util/executable.py b/lib/spack/spack/test/util/executable.py index 510b7261c6c3cd..641ef9937537b2 100644 --- a/lib/spack/spack/test/util/executable.py +++ b/lib/spack/spack/test/util/executable.py @@ -110,3 +110,11 @@ def test_which(tmpdir, monkeypatch): exe = ex.which("spack-test-exe") assert exe is not None assert exe.path == path + + +def test_construct_from_pathlib(mock_executable): + """Tests that we can construct an executable from a pathlib.Path object""" + expected = "Hello world!" + path = mock_executable("hello", output=f"echo {expected}\n") + hello = ex.Executable(path) + assert expected in hello(output=str) diff --git a/lib/spack/spack/test/util/package_hash.py b/lib/spack/spack/test/util/package_hash.py index 9d46ff5c2520b0..ad35b66a86806a 100644 --- a/lib/spack/spack/test/util/package_hash.py +++ b/lib/spack/spack/test/util/package_hash.py @@ -7,7 +7,7 @@ import pytest -import spack.directives +import spack.concretize import spack.directives_meta import spack.paths import spack.repo @@ -91,8 +91,8 @@ def test_all_same_but_install(mock_packages, config): def test_content_hash_all_same_but_patch_contents(mock_packages, config): - spec1 = Spec("hash-test1@1.1").concretized() - spec2 = Spec("hash-test2@1.1").concretized() + spec1 = spack.concretize.concretize_one("hash-test1@1.1") + spec2 = spack.concretize.concretize_one("hash-test2@1.1") compare_hash_sans_name(False, spec1, spec2) @@ -117,8 +117,8 @@ def test_content_hash_not_concretized(mock_packages, config): def test_content_hash_different_variants(mock_packages, config): - spec1 = Spec("hash-test1@1.2 +variantx").concretized() - spec2 = Spec("hash-test2@1.2 ~variantx").concretized() + spec1 = spack.concretize.concretize_one("hash-test1@1.2 +variantx") + spec2 = spack.concretize.concretize_one("hash-test2@1.2 ~variantx") compare_hash_sans_name(True, spec1, spec2) @@ -132,19 +132,19 @@ def test_content_hash_cannot_get_details_from_ast(mock_packages, config): differ where Spack includes a phase on account of AST-examination failure. """ - spec3 = Spec("hash-test1@1.7").concretized() - spec4 = Spec("hash-test3@1.7").concretized() + spec3 = spack.concretize.concretize_one("hash-test1@1.7") + spec4 = spack.concretize.concretize_one("hash-test3@1.7") compare_hash_sans_name(False, spec3, spec4) def test_content_hash_all_same_but_archive_hash(mock_packages, config): - spec1 = Spec("hash-test1@1.3").concretized() - spec2 = Spec("hash-test2@1.3").concretized() + spec1 = spack.concretize.concretize_one("hash-test1@1.3") + spec2 = spack.concretize.concretize_one("hash-test2@1.3") compare_hash_sans_name(False, spec1, spec2) def test_content_hash_parse_dynamic_function_call(mock_packages, config): - spec = Spec("hash-test4").concretized() + spec = spack.concretize.concretize_one("hash-test4") spec.package.content_hash() diff --git a/lib/spack/spack/test/util/util_url.py b/lib/spack/spack/test/util/util_url.py index 3c7063c0c439f0..c859e05ddad626 100644 --- a/lib/spack/spack/test/util/util_url.py +++ b/lib/spack/spack/test/util/util_url.py @@ -4,7 +4,6 @@ """Test Spack's URL handling utility functions.""" import os -import os.path import urllib.parse import pytest diff --git a/lib/spack/spack/test/utilities.py b/lib/spack/spack/test/utilities.py index 5c38d191c767f0..85be6eb3f40577 100644 --- a/lib/spack/spack/test/utilities.py +++ b/lib/spack/spack/test/utilities.py @@ -2,8 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -"""Non-fixture utilities for test code. Must be imported. -""" +"""Non-fixture utilities for test code. Must be imported.""" from spack.main import make_argument_parser diff --git a/lib/spack/spack/test/variant.py b/lib/spack/spack/test/variant.py index 7e9f327cdfc0c2..1fb6a6ef973f49 100644 --- a/lib/spack/spack/test/variant.py +++ b/lib/spack/spack/test/variant.py @@ -5,6 +5,7 @@ import pytest +import spack.concretize import spack.error import spack.repo import spack.spec @@ -684,23 +685,6 @@ def test_str(self) -> None: c["shared"] = BoolValuedVariant("shared", True) assert str(c) == "+shared feebar=foo foo=bar,baz foobar=fee" - def test_concrete(self, mock_packages, config) -> None: - spec = Spec("pkg-a") - vm = VariantMap(spec) - assert not vm.concrete - - # concrete if associated spec is concrete - spec.concretize() - assert vm.concrete - - # concrete if all variants are present (even if spec not concrete) - spec._mark_concrete(False) - assert spec.variants.concrete - - # remove a variant to test the condition - del spec.variants["foo"] - assert not spec.variants.concrete - def test_disjoint_set_initialization_errors(): # Constructing from non-disjoint sets should raise an exception @@ -910,7 +894,7 @@ def test_concretize_variant_default_with_multiple_defs( pkg = spack.repo.PATH.get_pkg_class(pkg_name) pkg_defs = [vdef for _, vdef in pkg.variant_definitions("v")] - spec = spack.spec.Spec(f"{pkg_name}{spec}").concretized() + spec = spack.concretize.concretize_one(f"{pkg_name}{spec}") assert spec.satisfies(satisfies) assert spec.package.get_variant("v") is pkg_defs[def_id] diff --git a/lib/spack/spack/test/verification.py b/lib/spack/spack/test/verification.py index 57378fca32405a..768c95618a6d49 100644 --- a/lib/spack/spack/test/verification.py +++ b/lib/spack/spack/test/verification.py @@ -133,7 +133,7 @@ def test_check_prefix_manifest(tmpdir): spec = spack.spec.Spec("libelf") spec._mark_concrete() - spec.prefix = prefix + spec.set_prefix(prefix) results = spack.verify.check_spec_manifest(spec) assert results.has_errors() diff --git a/lib/spack/spack/test/versions.py b/lib/spack/spack/test/versions.py index 44d2623b7fb69b..66d21564e6072a 100644 --- a/lib/spack/spack/test/versions.py +++ b/lib/spack/spack/test/versions.py @@ -13,6 +13,7 @@ from llnl.util.filesystem import working_dir +import spack.concretize import spack.package_base import spack.spec import spack.version @@ -707,7 +708,9 @@ def test_git_hash_comparisons( spack.package_base.PackageBase, "git", pathlib.Path(repo_path).as_uri(), raising=False ) - spec = spack.spec.Spec(f"git-test-commit@{commits[commit_idx]}").concretized() + spec = spack.concretize.concretize_one( + spack.spec.Spec(f"git-test-commit@{commits[commit_idx]}") + ) for item in expected_satisfies: assert spec.satisfies(item) @@ -723,15 +726,13 @@ def test_git_ref_comparisons(mock_git_version_info, install_mockery, mock_packag ) # Spec based on tag v1.0 - spec_tag = spack.spec.Spec("git-test-commit@git.v1.0") - spec_tag.concretize() + spec_tag = spack.concretize.concretize_one("git-test-commit@git.v1.0") assert spec_tag.satisfies("@1.0") assert not spec_tag.satisfies("@1.1:") assert str(spec_tag.version) == "git.v1.0=1.0" # Spec based on branch 1.x - spec_branch = spack.spec.Spec("git-test-commit@git.1.x") - spec_branch.concretize() + spec_branch = spack.concretize.concretize_one("git-test-commit@git.1.x") assert spec_branch.satisfies("@1.2") assert spec_branch.satisfies("@1.1:1.3") assert str(spec_branch.version) == "git.1.x=1.2" @@ -1030,7 +1031,7 @@ def test_git_version_repo_attached_after_serialization( monkeypatch.setattr( spack.package_base.PackageBase, "git", "file://%s" % repo_path, raising=False ) - spec = spack.spec.Spec(f"git-test-commit@{commits[-2]}").concretized() + spec = spack.concretize.concretize_one(f"git-test-commit@{commits[-2]}") # Before serialization, the repo is attached assert spec.satisfies("@1.0") @@ -1050,7 +1051,7 @@ def test_resolved_git_version_is_shown_in_str( spack.package_base.PackageBase, "git", "file://%s" % repo_path, raising=False ) commit = commits[-3] - spec = spack.spec.Spec(f"git-test-commit@{commit}").concretized() + spec = spack.concretize.concretize_one(f"git-test-commit@{commit}") assert spec.version.satisfies(ver("1.0")) assert str(spec.version) == f"{commit}=1.0-git.1" diff --git a/lib/spack/spack/test/views.py b/lib/spack/spack/test/views.py index 38ca2ce6a3e303..4dbf167d24e2e9 100644 --- a/lib/spack/spack/test/views.py +++ b/lib/spack/spack/test/views.py @@ -6,6 +6,7 @@ import pytest +import spack.concretize from spack.directory_layout import DirectoryLayout from spack.filesystem_view import SimpleFilesystemView, YamlFilesystemView from spack.installer import PackageInstaller @@ -16,7 +17,7 @@ def test_remove_extensions_ordered(install_mockery, mock_fetch, tmpdir): view_dir = str(tmpdir.join("view")) layout = DirectoryLayout(view_dir) view = YamlFilesystemView(view_dir, layout) - e2 = Spec("extension2").concretized() + e2 = spack.concretize.concretize_one("extension2") PackageInstaller([e2.package], explicit=True).install() view.add_specs(e2) @@ -34,8 +35,8 @@ def test_view_with_spec_not_contributing_files(mock_packages, tmpdir): a = Spec("pkg-a") b = Spec("pkg-b") - a.prefix = os.path.join(tmpdir, "a") - b.prefix = os.path.join(tmpdir, "b") + a.set_prefix(os.path.join(tmpdir, "a")) + b.set_prefix(os.path.join(tmpdir, "b")) a._mark_concrete() b._mark_concrete() diff --git a/lib/spack/spack/tokenize.py b/lib/spack/spack/tokenize.py index f42ecb2e95c124..f5e9b37803e10b 100644 --- a/lib/spack/spack/tokenize.py +++ b/lib/spack/spack/tokenize.py @@ -50,7 +50,6 @@ class Tokenizer: def __init__(self, tokens: Type[TokenBase]): self.tokens = tokens self.regex = re.compile("|".join(f"(?P<{token}>{token.regex})" for token in tokens)) - self.full_match = True def tokenize(self, text: str) -> Generator[Token, None, None]: if not text: diff --git a/lib/spack/spack/user_environment.py b/lib/spack/spack/user_environment.py index 5c3cc5a6f879bd..90bb379b8e957c 100644 --- a/lib/spack/spack/user_environment.py +++ b/lib/spack/spack/user_environment.py @@ -68,7 +68,9 @@ def project_env_mods( *specs: spack.spec.Spec, view, env: environment.EnvironmentModifications ) -> None: """Given a list of environment modifications, project paths changes to the view.""" - prefix_to_prefix = {s.prefix: view.get_projection_for_spec(s) for s in specs if not s.external} + prefix_to_prefix = { + str(s.prefix): view.get_projection_for_spec(s) for s in specs if not s.external + } # Avoid empty regex if all external if not prefix_to_prefix: return diff --git a/lib/spack/spack/util/archive.py b/lib/spack/spack/util/archive.py index 20b78dd495e053..1088bf89727d53 100644 --- a/lib/spack/spack/util/archive.py +++ b/lib/spack/spack/util/archive.py @@ -172,10 +172,10 @@ def reproducible_tarfile_from_prefix( hardlink_to_tarinfo_name: Dict[Tuple[int, int], str] = dict() if include_parent_directories: - parent_dirs = reversed(pathlib.Path(prefix).parents) + parent_dirs = reversed(pathlib.PurePosixPath(path_to_name(prefix)).parents) next(parent_dirs) # skip the root: slices are supported from python 3.10 for parent_dir in parent_dirs: - dir_info = tarfile.TarInfo(path_to_name(str(parent_dir))) + dir_info = tarfile.TarInfo(str(parent_dir)) dir_info.type = tarfile.DIRTYPE dir_info.mode = 0o755 tar.addfile(dir_info) diff --git a/lib/spack/spack/util/editor.py b/lib/spack/spack/util/editor.py index 9702e31f00321f..11b40ec356b941 100644 --- a/lib/spack/spack/util/editor.py +++ b/lib/spack/spack/util/editor.py @@ -9,7 +9,7 @@ defined by the EDITOR environment variable if VISUAL is not set or the specified editor fails (e.g. no DISPLAY for a graphical editor). If neither variable is set, we fall back to one of several common editors, -raising an EnvironmentError if we are unable to find one. +raising an OSError if we are unable to find one. """ import os import shlex @@ -141,7 +141,7 @@ def try_env_var(var): return True # Fail if nothing could be found - raise EnvironmentError( + raise OSError( "No text editor found! Please set the VISUAL and/or EDITOR " "environment variable(s) to your preferred text editor." ) diff --git a/lib/spack/spack/util/elf.py b/lib/spack/spack/util/elf.py index 446603070433a0..ceeb6ef4ab6f61 100644 --- a/lib/spack/spack/util/elf.py +++ b/lib/spack/spack/util/elf.py @@ -195,7 +195,10 @@ def parse_program_headers(f: BinaryIO, elf: ElfFile) -> None: elf: ELF file parser data """ # Forward to the program header - f.seek(elf.elf_hdr.e_phoff) + try: + f.seek(elf.elf_hdr.e_phoff) + except OSError: + raise ElfParsingError("Could not seek to program header") # Here we have to make a mapping from virtual address to offset in the file. ph_fmt = elf.byte_order + ("LLQQQQQQ" if elf.is_64_bit else "LLLLLLLL") @@ -245,7 +248,10 @@ def parse_pt_interp(f: BinaryIO, elf: ElfFile) -> None: f: file handle elf: ELF file parser data """ - f.seek(elf.pt_interp_p_offset) + try: + f.seek(elf.pt_interp_p_offset) + except OSError: + raise ElfParsingError("Could not seek to PT_INTERP entry") data = read_exactly(f, elf.pt_interp_p_filesz, "Malformed PT_INTERP entry") elf.pt_interp_str = parse_c_string(data) @@ -264,7 +270,10 @@ def find_strtab_size_at_offset(f: BinaryIO, elf: ElfFile, offset: int) -> int: """ section_hdr_fmt = elf.byte_order + ("LLQQQQLLQQ" if elf.is_64_bit else "LLLLLLLLLL") section_hdr_size = calcsize(section_hdr_fmt) - f.seek(elf.elf_hdr.e_shoff) + try: + f.seek(elf.elf_hdr.e_shoff) + except OSError: + raise ElfParsingError("Could not seek to section header table") for _ in range(elf.elf_hdr.e_shnum): data = read_exactly(f, section_hdr_size, "Malformed section header") sh = SectionHeader(*unpack(section_hdr_fmt, data)) @@ -286,7 +295,10 @@ def retrieve_strtab(f: BinaryIO, elf: ElfFile, offset: int) -> bytes: Returns: file offset """ size = find_strtab_size_at_offset(f, elf, offset) - f.seek(offset) + try: + f.seek(offset) + except OSError: + raise ElfParsingError("Could not seek to string table") return read_exactly(f, size, "Could not read string table") @@ -319,7 +331,10 @@ def parse_pt_dynamic(f: BinaryIO, elf: ElfFile) -> None: count_runpath = 0 count_strtab = 0 - f.seek(elf.pt_dynamic_p_offset) + try: + f.seek(elf.pt_dynamic_p_offset) + except OSError: + raise ElfParsingError("Could not seek to PT_DYNAMIC entry") # In case of broken ELF files, don't read beyond the advertized size. for _ in range(elf.pt_dynamic_p_filesz // dynamic_array_size): @@ -478,7 +493,10 @@ def get_interpreter(path: str) -> Optional[str]: def _delete_dynamic_array_entry( f: BinaryIO, elf: ElfFile, should_delete: Callable[[int, int], bool] ) -> None: - f.seek(elf.pt_dynamic_p_offset) + try: + f.seek(elf.pt_dynamic_p_offset) + except OSError: + raise ElfParsingError("Could not seek to PT_DYNAMIC entry") dynamic_array_fmt = elf.byte_order + ("qQ" if elf.is_64_bit else "lL") dynamic_array_size = calcsize(dynamic_array_fmt) new_offset = elf.pt_dynamic_p_offset # points to the new dynamic array diff --git a/lib/spack/spack/util/environment.py b/lib/spack/spack/util/environment.py index 41d0622631943a..babb370ff48854 100644 --- a/lib/spack/spack/util/environment.py +++ b/lib/spack/spack/util/environment.py @@ -7,7 +7,6 @@ import inspect import json import os -import os.path import pickle import re import shlex diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py index 9502b0e63f06e4..e61a1af7ec56a6 100644 --- a/lib/spack/spack/util/executable.py +++ b/lib/spack/spack/util/executable.py @@ -7,7 +7,9 @@ import subprocess import sys from pathlib import Path, PurePath -from typing import Callable, Dict, Optional, Sequence, TextIO, Type, Union, overload +from typing import Callable, Dict, List, Optional, Sequence, TextIO, Type, Union, overload + +from typing_extensions import Literal import llnl.util.tty as tty @@ -20,9 +22,9 @@ class Executable: """Class representing a program that can be run on the command line.""" - def __init__(self, name: str) -> None: + def __init__(self, name: Union[str, Path]) -> None: file_path = str(Path(name)) - if sys.platform != "win32" and name.startswith("."): + if sys.platform != "win32" and isinstance(name, str) and name.startswith("."): # pathlib strips the ./ from relative paths so it must be added back file_path = os.path.join(".", file_path) @@ -338,10 +340,24 @@ def __str__(self): return " ".join(self.exe) -def which_string(*args, **kwargs): - """Like ``which()``, but return a string instead of an ``Executable``.""" - path = kwargs.get("path", os.environ.get("PATH", "")) - required = kwargs.get("required", False) +@overload +def which_string( + *args: str, path: Optional[Union[List[str], str]] = ..., required: Literal[True] +) -> str: ... + + +@overload +def which_string( + *args: str, path: Optional[Union[List[str], str]] = ..., required: bool = ... +) -> Optional[str]: ... + + +def which_string( + *args: str, path: Optional[Union[List[str], str]] = None, required: bool = False +) -> Optional[str]: + """Like ``which()``, but returns a string instead of an ``Executable``.""" + if path is None: + path = os.environ.get("PATH", "") if isinstance(path, list): paths = [Path(str(x)) for x in path] @@ -372,7 +388,6 @@ def add_extra_search_paths(paths): search_paths.insert(0, Path.cwd()) search_paths = add_extra_search_paths(search_paths) - search_item = Path(search_item) candidate_items = get_candidate_items(Path(search_item)) for candidate_item in candidate_items: @@ -385,29 +400,41 @@ def add_extra_search_paths(paths): pass if required: - raise CommandNotFoundError("spack requires '%s'. Make sure it is in your path." % args[0]) + raise CommandNotFoundError(f"spack requires '{args[0]}'. Make sure it is in your path.") return None -def which(*args, **kwargs): +@overload +def which( + *args: str, path: Optional[Union[List[str], str]] = ..., required: Literal[True] +) -> Executable: ... + + +@overload +def which( + *args: str, path: Optional[Union[List[str], str]] = ..., required: bool = ... +) -> Optional[Executable]: ... + + +def which( + *args: str, path: Optional[Union[List[str], str]] = None, required: bool = False +) -> Optional[Executable]: """Finds an executable in the path like command-line which. If given multiple executables, returns the first one that is found. If no executables are found, returns None. Parameters: - *args (str): One or more executables to search for - - Keyword Arguments: - path (list or str): The path to search. Defaults to ``PATH`` - required (bool): If set to True, raise an error if executable not found + *args: one or more executables to search for + path: the path to search. Defaults to ``PATH`` + required: if set to True, raise an error if executable not found Returns: Executable: The first executable that is found in the path """ - exe = which_string(*args, **kwargs) - return Executable(exe) if exe else None + exe = which_string(*args, path=path, required=required) + return Executable(exe) if exe is not None else None class ProcessError(spack.error.SpackError): diff --git a/lib/spack/spack/util/ld_so_conf.py b/lib/spack/spack/util/ld_so_conf.py index ca26f895b15617..7198deeba99f3e 100644 --- a/lib/spack/spack/util/ld_so_conf.py +++ b/lib/spack/spack/util/ld_so_conf.py @@ -46,7 +46,7 @@ def _process_ld_so_conf_queue(queue): try: with open(p, "rb") as f: lines = f.readlines() - except (IOError, OSError): + except OSError: continue for line in lines: @@ -132,7 +132,7 @@ def host_dynamic_linker_search_paths(): if os.path.exists(possible_conf): conf_file = possible_conf - except (IOError, OSError, elf_utils.ElfParsingError): + except (OSError, elf_utils.ElfParsingError): pass # Note: ld_so_conf doesn't error if the file does not exist. diff --git a/lib/spack/spack/util/libc.py b/lib/spack/spack/util/libc.py index 54ef2eab47c2fc..d38cd8158b09a7 100644 --- a/lib/spack/spack/util/libc.py +++ b/lib/spack/spack/util/libc.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import re import shlex import sys diff --git a/lib/spack/spack/util/module_cmd.py b/lib/spack/spack/util/module_cmd.py index ebd69f4fbeef37..eac754b6dfd9b9 100644 --- a/lib/spack/spack/util/module_cmd.py +++ b/lib/spack/spack/util/module_cmd.py @@ -24,10 +24,13 @@ def module( *args, module_template: Optional[str] = None, + module_src_cmd: Optional[str] = None, environb: Optional[MutableMapping[bytes, bytes]] = None, ): module_cmd = module_template or ("module " + " ".join(args)) environb = environb or os.environb + if b"MODULESHOME" in environb: + module_cmd = module_src_cmd or "source $MODULESHOME/init/bash; " + module_cmd if args[0] in module_change_commands: # Suppress module output diff --git a/lib/spack/spack/util/package_hash.py b/lib/spack/spack/util/package_hash.py index aebea7aa0430b5..41bcf1500a3e7d 100644 --- a/lib/spack/spack/util/package_hash.py +++ b/lib/spack/spack/util/package_hash.py @@ -8,7 +8,6 @@ import spack.directives_meta import spack.error import spack.fetch_strategy -import spack.package_base import spack.repo import spack.spec import spack.util.hash @@ -61,10 +60,18 @@ class RemoveDirectives(ast.NodeTransformer): """ def __init__(self, spec): - # list of URL attributes and metadata attributes - # these will be removed from packages. - self.metadata_attrs = [s.url_attr for s in spack.fetch_strategy.all_strategies] - self.metadata_attrs += spack.package_base.PackageBase.metadata_attrs + #: List of attributes to be excluded from a package's hash. + self.metadata_attrs = [s.url_attr for s in spack.fetch_strategy.all_strategies] + [ + "homepage", + "url", + "urls", + "list_url", + "extendable", + "parallel", + "make_jobs", + "maintainers", + "tags", + ] self.spec = spec self.in_classdef = False # used to avoid nested classdefs diff --git a/lib/spack/spack/util/path.py b/lib/spack/spack/util/path.py index 49a0b5e240bca8..87542415fd0e70 100644 --- a/lib/spack/spack/util/path.py +++ b/lib/spack/spack/util/path.py @@ -29,8 +29,8 @@ def architecture(): import spack.spec host_platform = spack.platforms.host() - host_os = host_platform.operating_system("default_os") - host_target = host_platform.target("default_target") + host_os = host_platform.default_operating_system() + host_target = host_platform.default_target() return spack.spec.ArchSpec((str(host_platform), str(host_os), str(host_target))) diff --git a/lib/spack/spack/util/spack_json.py b/lib/spack/spack/util/spack_json.py index c21fc7ff830881..40bd816c353bf1 100644 --- a/lib/spack/spack/util/spack_json.py +++ b/lib/spack/spack/util/spack_json.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -"""Simple wrapper around JSON to guarantee consistent use of load/dump. """ +"""Simple wrapper around JSON to guarantee consistent use of load/dump.""" import json from typing import Any, Dict, Optional diff --git a/lib/spack/spack/util/spack_yaml.py b/lib/spack/spack/util/spack_yaml.py index 6d15875ac3f7b1..de68ddda3f7257 100644 --- a/lib/spack/spack/util/spack_yaml.py +++ b/lib/spack/spack/util/spack_yaml.py @@ -11,8 +11,6 @@ default unorderd dict. """ -import collections -import collections.abc import ctypes import enum import functools @@ -32,23 +30,20 @@ # Make new classes so we can add custom attributes. -# Also, use OrderedDict instead of just dict. -class syaml_dict(collections.OrderedDict): - def __repr__(self): - mappings = (f"{k!r}: {v!r}" for k, v in self.items()) - return "{%s}" % ", ".join(mappings) +class syaml_dict(dict): + pass class syaml_list(list): - __repr__ = list.__repr__ + pass class syaml_str(str): - __repr__ = str.__repr__ + pass class syaml_int(int): - __repr__ = int.__repr__ + pass #: mapping from syaml type -> primitive type @@ -441,27 +436,20 @@ def _dump_annotated(handler, data, stream=None): width = max(clen(a) for a in _ANNOTATIONS) formats = ["%%-%ds %%s\n" % (width + cextra(a)) for a in _ANNOTATIONS] - for f, a, l in zip(formats, _ANNOTATIONS, lines): - stream.write(f % (a, l)) + for fmt, annotation, line in zip(formats, _ANNOTATIONS, lines): + stream.write(fmt % (annotation, line)) if getvalue: return getvalue() -def sorted_dict(dict_like): - """Return an ordered dict with all the fields sorted recursively. - - Args: - dict_like (dict): dictionary to be sorted - - Returns: - dictionary sorted recursively - """ - result = syaml_dict(sorted(dict_like.items())) - for key, value in result.items(): - if isinstance(value, collections.abc.Mapping): - result[key] = sorted_dict(value) - return result +def sorted_dict(data): + """Descend into data and sort all dictionary keys.""" + if isinstance(data, dict): + return type(data)((k, sorted_dict(v)) for k, v in sorted(data.items())) + elif isinstance(data, (list, tuple)): + return type(data)(sorted_dict(v) for v in data) + return data def extract_comments(data): diff --git a/lib/spack/spack/util/url.py b/lib/spack/spack/util/url.py index 7b1e8cba069ee2..2551bc5721ffe5 100644 --- a/lib/spack/spack/util/url.py +++ b/lib/spack/spack/util/url.py @@ -21,7 +21,7 @@ def validate_scheme(scheme): helps mostly in validation of paths vs urls, as Windows paths such as C:/x/y/z (with backward not forward slash) may parse as a URL with scheme C and path /x/y/z.""" - return scheme in ("file", "http", "https", "ftp", "s3", "gs", "ssh", "git") + return scheme in ("file", "http", "https", "ftp", "s3", "gs", "ssh", "git", "oci") def local_file_path(url): diff --git a/lib/spack/spack/util/web.py b/lib/spack/spack/util/web.py index 72a762a48cebc5..9c4f48d2e6fa67 100644 --- a/lib/spack/spack/util/web.py +++ b/lib/spack/spack/util/web.py @@ -7,7 +7,6 @@ import errno import json import os -import os.path import re import shutil import ssl @@ -209,7 +208,7 @@ def read_from_url(url, accept_content_type=None): try: response = urlopen(request) - except (TimeoutError, URLError) as e: + except OSError as e: raise SpackWebError(f"Download of {url.geturl()} failed: {e.__class__.__name__}: {e}") if accept_content_type: @@ -227,7 +226,7 @@ def read_from_url(url, accept_content_type=None): tty.debug(msg) return None, None, None - return response.geturl(), response.headers, response + return response.url, response.headers, response def push_to_url(local_file_path, remote_path, keep_original=True, extra_args=None): @@ -405,12 +404,6 @@ def fetch_url_text(url, curl: Optional[Executable] = None, dest_dir="."): try: _, _, response = read_from_url(url) - returncode = response.getcode() - if returncode and returncode != 200: - raise spack.error.FetchError( - "Urllib failed with error code {0}".format(returncode) - ) - output = codecs.getreader("utf-8")(response).read() if output: with working_dir(dest_dir, create=True): @@ -419,8 +412,8 @@ def fetch_url_text(url, curl: Optional[Executable] = None, dest_dir="."): return path - except SpackWebError as err: - raise spack.error.FetchError("Urllib fetch failed to verify url: {0}".format(str(err))) + except (SpackWebError, OSError, ValueError) as err: + raise spack.error.FetchError(f"Urllib fetch failed: {err}") return None @@ -464,7 +457,7 @@ def url_exists(url, curl=None): timeout=spack.config.get("config:connect_timeout", 10), ) return True - except (TimeoutError, URLError) as e: + except OSError as e: tty.debug(f"Failure reading {url}: {e}") return False @@ -746,7 +739,7 @@ def _spider(url: urllib.parse.ParseResult, collect_nested: bool, _visited: Set[s subcalls.append(abs_link) _visited.add(abs_link) - except (TimeoutError, URLError) as e: + except OSError as e: tty.debug(f"[SPIDER] Unable to read: {url}") tty.debug(str(e), level=2) if isinstance(e, URLError) and isinstance(e.reason, ssl.SSLError): diff --git a/lib/spack/spack/verify_libraries.py b/lib/spack/spack/verify_libraries.py new file mode 100644 index 00000000000000..aab38cff2bc91c --- /dev/null +++ b/lib/spack/spack/verify_libraries.py @@ -0,0 +1,212 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import fnmatch +import os +import re +from typing import IO, Dict, List + +from llnl.util.filesystem import BaseDirectoryVisitor +from llnl.util.lang import stable_partition + +import spack.util.elf as elf + +#: Patterns for names of libraries that are allowed to be unresolved when *just* looking at RPATHs +#: added by Spack. These are libraries outside of Spack's control, and assumed to be located in +#: default search paths of the dynamic linker. +ALLOW_UNRESOLVED = [ + # kernel + "linux-vdso.so.*", + "libselinux.so.*", + # musl libc + "ld-musl-*.so.*", + # glibc + "ld-linux*.so.*", + "ld64.so.*", + "libanl.so.*", + "libc.so.*", + "libdl.so.*", + "libm.so.*", + "libmemusage.so.*", + "libmvec.so.*", + "libnsl.so.*", + "libnss_compat.so.*", + "libnss_db.so.*", + "libnss_dns.so.*", + "libnss_files.so.*", + "libnss_hesiod.so.*", + "libpcprofile.so.*", + "libpthread.so.*", + "libresolv.so.*", + "librt.so.*", + "libSegFault.so.*", + "libthread_db.so.*", + "libutil.so.*", + # gcc -- this is required even with gcc-runtime, because e.g. libstdc++ depends on libgcc_s, + # but the binaries we copy from the compiler don't have an $ORIGIN rpath. + "libasan.so.*", + "libatomic.so.*", + "libcc1.so.*", + "libgcc_s.so.*", + "libgfortran.so.*", + "libgomp.so.*", + "libitm.so.*", + "liblsan.so.*", + "libquadmath.so.*", + "libssp.so.*", + "libstdc++.so.*", + "libtsan.so.*", + "libubsan.so.*", + # systemd + "libudev.so.*", + # cuda driver + "libcuda.so.*", + # intel-oneapi-runtime + "libur_loader.so.*", +] + + +def is_compatible(parent: elf.ElfFile, child: elf.ElfFile) -> bool: + return ( + child.elf_hdr.e_type == elf.ELF_CONSTANTS.ET_DYN + and parent.is_little_endian == child.is_little_endian + and parent.is_64_bit == child.is_64_bit + and parent.elf_hdr.e_machine == child.elf_hdr.e_machine + ) + + +def candidate_matches(current_elf: elf.ElfFile, candidate_path: bytes) -> bool: + try: + with open(candidate_path, "rb") as g: + return is_compatible(current_elf, elf.parse_elf(g)) + except (OSError, elf.ElfParsingError): + return False + + +class Problem: + def __init__( + self, resolved: Dict[bytes, bytes], unresolved: List[bytes], relative_rpaths: List[bytes] + ) -> None: + self.resolved = resolved + self.unresolved = unresolved + self.relative_rpaths = relative_rpaths + + +class ResolveSharedElfLibDepsVisitor(BaseDirectoryVisitor): + def __init__(self, allow_unresolved_patterns: List[str]) -> None: + self.problems: Dict[str, Problem] = {} + self._allow_unresolved_regex = re.compile( + "|".join(fnmatch.translate(x) for x in allow_unresolved_patterns) + ) + + def allow_unresolved(self, needed: bytes) -> bool: + try: + name = needed.decode("utf-8") + except UnicodeDecodeError: + return False + return bool(self._allow_unresolved_regex.match(name)) + + def visit_file(self, root: str, rel_path: str, depth: int) -> None: + # We work with byte strings for paths. + path = os.path.join(root, rel_path).encode("utf-8") + + # For $ORIGIN interpolation: should not have trailing dir seperator. + origin = os.path.dirname(path) + + # Retrieve the needed libs + rpaths. + try: + with open(path, "rb") as f: + parsed_elf = elf.parse_elf(f, interpreter=False, dynamic_section=True) + except (OSError, elf.ElfParsingError): + # Not dealing with an invalid ELF file. + return + + # If there's no needed libs all is good + if not parsed_elf.has_needed: + return + + # Get the needed libs and rpaths (notice: byte strings) + # Don't force an encoding cause paths are just a bag of bytes. + needed_libs = parsed_elf.dt_needed_strs + + rpaths = parsed_elf.dt_rpath_str.split(b":") if parsed_elf.has_rpath else [] + + # We only interpolate $ORIGIN, not $LIB and $PLATFORM, they're not really + # supported in general. Also remove empty paths. + rpaths = [x.replace(b"$ORIGIN", origin) for x in rpaths if x] + + # Do not allow relative rpaths (they are relative to the current working directory) + rpaths, relative_rpaths = stable_partition(rpaths, os.path.isabs) + + # If there's a / in the needed lib, it's opened directly, otherwise it needs + # a search. + direct_libs, search_libs = stable_partition(needed_libs, lambda x: b"/" in x) + + # Do not allow relative paths in direct libs (they are relative to the current working + # directory) + direct_libs, unresolved = stable_partition(direct_libs, os.path.isabs) + + resolved: Dict[bytes, bytes] = {} + + for lib in search_libs: + if self.allow_unresolved(lib): + continue + for rpath in rpaths: + candidate = os.path.join(rpath, lib) + if candidate_matches(parsed_elf, candidate): + resolved[lib] = candidate + break + else: + unresolved.append(lib) + + # Check if directly opened libs are compatible + for lib in direct_libs: + if candidate_matches(parsed_elf, lib): + resolved[lib] = lib + else: + unresolved.append(lib) + + if unresolved or relative_rpaths: + self.problems[rel_path] = Problem(resolved, unresolved, relative_rpaths) + + def visit_symlinked_file(self, root: str, rel_path: str, depth: int) -> None: + pass + + def before_visit_dir(self, root: str, rel_path: str, depth: int) -> bool: + # There can be binaries in .spack/test which shouldn't be checked. + if rel_path == ".spack": + return False + return True + + def before_visit_symlinked_dir(self, root: str, rel_path: str, depth: int) -> bool: + return False + + def write(self, output: IO[str], *, indent=0, brief: bool = False) -> None: + indent_str = " " * indent + for path, problem in self.problems.items(): + output.write(indent_str) + output.write(path) + output.write("\n") + if not brief: + for needed, full_path in problem.resolved.items(): + output.write(indent_str) + output.write(" ") + if needed == full_path: + output.write(_decode_or_raw(needed)) + else: + output.write(f"{_decode_or_raw(needed)} => {_decode_or_raw(full_path)}") + output.write("\n") + for not_found in problem.unresolved: + output.write(indent_str) + output.write(f" {_decode_or_raw(not_found)} => not found\n") + for relative_rpath in problem.relative_rpaths: + output.write(indent_str) + output.write(f" {_decode_or_raw(relative_rpath)} => relative rpath\n") + + +def _decode_or_raw(byte_str: bytes) -> str: + try: + return byte_str.decode("utf-8") + except UnicodeDecodeError: + return f"{byte_str!r}" diff --git a/lib/spack/spack/version/common.py b/lib/spack/spack/version/common.py index f285d7b9a7f514..7cac90ca86bb93 100644 --- a/lib/spack/spack/version/common.py +++ b/lib/spack/spack/version/common.py @@ -10,7 +10,7 @@ COMMIT_VERSION = re.compile(r"^[a-f0-9]{40}$") # Infinity-like versions. The order in the list implies the comparison rules -infinity_versions = ["stable", "trunk", "head", "master", "main", "develop"] +infinity_versions = ["stable", "nightly", "trunk", "head", "master", "main", "develop"] iv_min_len = min(len(s) for s in infinity_versions) diff --git a/lib/spack/spack/version/version_types.py b/lib/spack/spack/version/version_types.py index 8468e32245d931..6728d23e3e38ca 100644 --- a/lib/spack/spack/version/version_types.py +++ b/lib/spack/spack/version/version_types.py @@ -6,7 +6,6 @@ from bisect import bisect_left from typing import Dict, Iterable, Iterator, List, Optional, Tuple, Union -from spack.util.spack_yaml import syaml_dict from spack.util.typing import SupportsRichComparison from .common import ( @@ -490,6 +489,21 @@ def up_to(self, index: int) -> "StandardVersion": """ return self[:index] + @property + def up_to_1(self): + """The version truncated to the first component.""" + return self.up_to(1) + + @property + def up_to_2(self): + """The version truncated to the first two components.""" + return self.up_to(2) + + @property + def up_to_3(self): + """The version truncated to the first three components.""" + return self.up_to(3) + _STANDARD_VERSION_TYPEMIN = StandardVersion("", ((), (ALPHA,)), ("",)) @@ -1029,8 +1043,8 @@ def intersects(self, other: VersionType) -> bool: def to_dict(self) -> Dict: """Generate human-readable dict for YAML.""" if self.concrete: - return syaml_dict([("version", str(self[0]))]) - return syaml_dict([("versions", [str(v) for v in self])]) + return {"version": str(self[0])} + return {"versions": [str(v) for v in self]} @staticmethod def from_dict(dictionary) -> "VersionList": diff --git a/pyproject.toml b/pyproject.toml index be97f0421ed687..04dfa47ebcf155 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [project] name="spack" description="The spack package manager" +requires-python=">=3.6" dependencies=[ "clingo", "setuptools", @@ -67,9 +68,42 @@ features = [ "ci", ] +[tool.ruff] +line-length = 99 +extend-include = ["bin/spack"] +extend-exclude = ["lib/spack/external", "*.pyi"] + +[tool.ruff.format] +skip-magic-trailing-comma = true + +[tool.ruff.lint] +extend-select = ["I"] +ignore = ["E731", "E203"] + +[tool.ruff.lint.isort] +split-on-trailing-comma = false +section-order = [ + "future", + "standard-library", + "third-party", + "archspec", + "llnl", + "spack", + "first-party", + "local-folder", +] + +[tool.ruff.lint.isort.sections] +spack = ["spack"] +archspec = ["archspec"] +llnl = ["llnl"] + +[tool.ruff.lint.per-file-ignores] +"var/spack/repos/*/package.py" = ["F403", "F405", "F811", "F821"] +"*-ci-package.py" = ["F403", "F405", "F821"] + [tool.black] line-length = 99 -target-version = ['py36', 'py37', 'py38', 'py39', 'py310'] include = '(lib/spack|var/spack/repos)/.*\.pyi?$|bin/spack$' extend-exclude = 'lib/spack/external' skip_magic_trailing_comma = true @@ -92,7 +126,6 @@ src_paths = "lib" honor_noqa = true [tool.mypy] -python_version = 3.7 files = ['lib/spack/llnl/**/*.py', 'lib/spack/spack/**/*.py', './var/spack/repos/builtin/packages/*/package.py'] mypy_path = ['bin', 'lib/spack', 'lib/spack/external', 'var/spack/repos/builtin'] allow_redefinition = true diff --git a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml index 1ee81bf4b3a5f6..31e4407f2bdc58 100644 --- a/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml +++ b/share/spack/gitlab/cloud_pipelines/.gitlab-ci.yml @@ -59,11 +59,6 @@ default: SPACK_TARGET_PLATFORM: "linux" SPACK_TARGET_ARCH: "aarch64" -.linux_power: - variables: - SPACK_TARGET_PLATFORM: "linux" - SPACK_TARGET_ARCH: "ppc64le" - .win64-msvc2019: variables: SPACK_TARGET_PLATFORM: "win64" @@ -352,35 +347,6 @@ e4s-oneapi-build: - artifacts: True job: e4s-oneapi-generate -######################################## -# E4S on Power -######################################## -.e4s-power-generate-tags-and-image: - image: { "name": "ghcr.io/spack/ubuntu20.04-runner-ppc64-gcc-11.4:2023.08.01", "entrypoint": [""] } - tags: ["spack", "public", "large", "ppc64le"] - -.e4s-power: - extends: [".linux_power"] - variables: - SPACK_CI_STACK_NAME: e4s-power - -e4s-power-generate: - extends: [ ".e4s-power", ".generate-x86_64", ".e4s-power-generate-tags-and-image"] - variables: - # Override concretization pool for metal runners - SPACK_CONCRETIZE_JOBS: 16 - -e4s-power-build: - extends: [ ".e4s-power", ".build" ] - trigger: - include: - - artifact: jobs_scratch_dir/cloud-ci-pipeline.yml - job: e4s-power-generate - strategy: depend - needs: - - artifacts: True - job: e4s-power-generate - ######################################### # Build tests for different build-systems ######################################### @@ -573,57 +539,6 @@ data-vis-sdk-build: - artifacts: True job: data-vis-sdk-generate -######################################## -# AWS ISC Applications (x86_64) -######################################## - -# Call this AFTER .*-generate -.aws-isc-overrides: - # This controls image for generate step; build step is controlled by spack.yaml - # Note that generator emits OS info for build so these should be the same. - image: { "name": "ghcr.io/spack/e4s-amazonlinux-2:v2023-03-09", "entrypoint": [""] } - -.aws-isc: - extends: [ ".linux_x86_64_v3" ] - variables: - SPACK_CI_STACK_NAME: aws-isc - -aws-isc-generate: - extends: [ ".aws-isc", ".generate-x86_64", ".aws-isc-overrides", ".tags-x86_64_v4" ] - -aws-isc-build: - extends: [ ".aws-isc", ".build" ] - trigger: - include: - - artifact: jobs_scratch_dir/cloud-ci-pipeline.yml - job: aws-isc-generate - strategy: depend - needs: - - artifacts: True - job: aws-isc-generate - -# Parallel Pipeline for aarch64 (reuses override image, but generates and builds on aarch64) - -.aws-isc-aarch64: - extends: [ ".linux_aarch64" ] - variables: - SPACK_CI_STACK_NAME: aws-isc-aarch64 - -aws-isc-aarch64-generate: - extends: [ ".aws-isc-aarch64", ".generate-aarch64", ".aws-isc-overrides" ] - -aws-isc-aarch64-build: - extends: [ ".aws-isc-aarch64", ".build" ] - trigger: - include: - - artifact: jobs_scratch_dir/cloud-ci-pipeline.yml - job: aws-isc-aarch64-generate - strategy: depend - needs: - - artifacts: True - job: aws-isc-aarch64-generate - - ######################################## # Spack Tutorial ######################################## diff --git a/share/spack/gitlab/cloud_pipelines/configs/linux/ppc64le/ci.yaml b/share/spack/gitlab/cloud_pipelines/configs/linux/ppc64le/ci.yaml deleted file mode 100644 index 5a700395a06c49..00000000000000 --- a/share/spack/gitlab/cloud_pipelines/configs/linux/ppc64le/ci.yaml +++ /dev/null @@ -1,22 +0,0 @@ -ci: - pipeline-gen: - - build-job: - tags: ["ppc64le"] - # Power runners overrides the default script - # - don't download make - # - no intermediate keys - script:: - - uname -a || true - - grep -E 'vendor|model name' /proc/cpuinfo 2>/dev/null | sort -u || head -n10 /proc/cpuinfo 2>/dev/null || true - - nproc - - . "./share/spack/setup-env.sh" - - spack --version - - spack arch - - cd ${SPACK_CONCRETE_ENV_DIR} - - spack env activate --without-view . - - if [ -n "$SPACK_BUILD_JOBS" ]; then spack config add "config:build_jobs:$SPACK_BUILD_JOBS"; fi - - spack config add "config:install_tree:projections:${SPACK_JOB_SPEC_PKG_NAME}:'morepadding/{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}'" - - mkdir -p ${SPACK_ARTIFACTS_ROOT}/user_data - - if [[ -r /mnt/key/e4s.gpg ]]; then spack gpg trust /mnt/key/e4s.gpg; fi - - if [[ -r /mnt/key/spack_public_key.gpg ]]; then spack gpg trust /mnt/key/spack_public_key.gpg; fi - - spack --color=always --backtrace ci rebuild > >(tee ${SPACK_ARTIFACTS_ROOT}/user_data/pipeline_out.txt) 2> >(tee ${SPACK_ARTIFACTS_ROOT}/user_data/pipeline_err.txt >&2) diff --git a/share/spack/gitlab/cloud_pipelines/configs/linux/ppc64le/concretizer.yaml b/share/spack/gitlab/cloud_pipelines/configs/linux/ppc64le/concretizer.yaml deleted file mode 100644 index 3050c32a17c7f8..00000000000000 --- a/share/spack/gitlab/cloud_pipelines/configs/linux/ppc64le/concretizer.yaml +++ /dev/null @@ -1,3 +0,0 @@ -concretizer: - targets: - granularity: generic diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-isc-aarch64/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-isc-aarch64/spack.yaml deleted file mode 100644 index 3cb1090a1ab39f..00000000000000 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-isc-aarch64/spack.yaml +++ /dev/null @@ -1,141 +0,0 @@ -spack: - view: false - packages: - all: - providers: - blas: - - openblas - mkl: - - intel-oneapi-mkl - mpi: - - openmpi - - mpich - variants: +mpi - tbb: - require: intel-tbb - binutils: - variants: +ld +gold +headers +libiberty ~nls - version: - - 2.36.1 - doxygen: - version: - - 1.8.20 - elfutils: - variants: ~nls - hdf5: - variants: +fortran +hl +shared - libfabric: - variants: fabrics=efa,tcp,udp,sockets,verbs,shm,mrail,rxd,rxm - libunwind: - variants: +pic +xz - mesa: - variants: ~llvm - mpich: - variants: ~wrapperrpath netmod=ofi device=ch4 - ncurses: - variants: +termlib - openblas: - variants: threads=openmp - openmpi: - variants: fabrics=ofi +legacylaunchers - openturns: - version: - - '1.18' - relion: - variants: ~mklfft -# texlive: -# version: [20210325] - trilinos: - variants: +amesos +amesos2 +anasazi +aztec +belos +boost +epetra +epetraext - +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu - +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos - +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long - xz: - variants: +pic - - definitions: - - - compiler_specs: - - gcc@11.2 - # Licensing OK? - # - intel-oneapi-compilers@2022.1 - # - nvhpc - - - app_specs: - - bwa -# Depends on simde which requires newer compiler? - #- bowtie2 - # Requires x86_64 specific ASM - #- cistem - - cromwell - - fastqc - - flux-sched - - flux-core - - flux-pmix - - gatk - - gromacs - - lammps - - wrf build_type=dm+sm - - mfem - - mpas-model ^parallelio+pnetcdf - - nextflow - - octave - - openfoam - - osu-micro-benchmarks - - parallel - # - paraview - - picard - - quantum-espresso - - raja -# Depends on bowtie2 -> simde which requires newer compiler? - #- rsem - # Errors on texlive - #- rstudio - - salmon - - samtools - - seqtk - - snakemake - - star - # Requires gcc@9: - #- ufs-weather-model -# requires LLVM which fails without constraint - #- visit - - - lib_specs: - - openmpi fabrics=ofi - - openmpi fabrics=ofi +legacylaunchers - - openmpi fabrics=auto - - mpich - - libfabric - - - compiler: - - '%gcc@7.3.1' - - - target: - - target=aarch64 - - - specs: - - - matrix: - - - $app_specs - - - $compiler - - - $target - - - matrix: - - - $lib_specs - - - $compiler - - - $target - - - matrix: - - - $compiler_specs - - - $compiler - - - $target - - ci: - pipeline-gen: - - build-job: - image: {name: ghcr.io/spack/e4s-amazonlinux-2:v2023-03-09, entrypoint: ['']} - - cdash: - build-group: AWS Packages diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-isc/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-isc/spack.yaml deleted file mode 100644 index 2da054256c418c..00000000000000 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-isc/spack.yaml +++ /dev/null @@ -1,153 +0,0 @@ -spack: - view: false - packages: - all: - providers: - blas: - - openblas - mkl: - - intel-oneapi-mkl - mpi: - - openmpi - - mpich - variants: +mpi - tbb: - require: intel-tbb - binutils: - variants: +ld +gold +headers +libiberty ~nls - version: - - 2.36.1 - doxygen: - version: - - 1.8.20 - elfutils: - variants: ~nls - hdf5: - variants: +fortran +hl +shared - libfabric: - variants: fabrics=efa,tcp,udp,sockets,verbs,shm,mrail,rxd,rxm - libunwind: - variants: +pic +xz - mesa: - variants: ~llvm - mpich: - variants: ~wrapperrpath netmod=ofi device=ch4 - ncurses: - variants: +termlib - openblas: - variants: threads=openmp - openmpi: - variants: fabrics=ofi +legacylaunchers - openturns: - version: - - '1.18' - relion: - variants: ~mklfft -# texlive: -# version: [20210325] - trilinos: - variants: +amesos +amesos2 +anasazi +aztec +belos +boost +epetra +epetraext - +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu - +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos - +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long - xz: - variants: +pic - - definitions: - - - compiler_specs: - - gcc@11.2 - # Licensing OK? - # - intel-oneapi-compilers@2022.1 - # - nvhpc - - - cuda_specs: -# Disabled for consistency with aarch64 - #- relion +cuda cuda_arch=70 - - raja +cuda cuda_arch=70 - - mfem +cuda cuda_arch=70 - - - app_specs: - - bwa -# Disabled for consistency with aarch64 - #- bowtie2 -# Disabled for consistency with aarch64 - #- cistem - - cromwell - - fastqc - - flux-sched - - flux-core - - flux-pmix - - gatk - - gromacs - - lammps - - wrf build_type=dm+sm - - mfem - - mpas-model ^parallelio+pnetcdf - - nextflow - - octave - - openfoam - - osu-micro-benchmarks - - parallel - # - paraview - - picard - - quantum-espresso -# Build broken for gcc@7.3.1 x86_64_v4 (error: '_mm512_loadu_epi32' was not declared in this scope) - #- raja -# Disabled for consistency with aarch64 - #- rsem - # Errors on texlive - #- rstudio - - salmon - - samtools - - seqtk - - snakemake - - star - # Requires gcc@9: - #- ufs-weather-model -# Disabled for consistency with aarch64 - #- visit - - - lib_specs: - - openmpi fabrics=ofi - - openmpi fabrics=ofi +legacylaunchers - - openmpi fabrics=auto - - mpich - - libfabric - - - compiler: - - '%gcc@7.3.1' - - - target: - - target=x86_64_v3 - - - specs: - - - matrix: - - - $cuda_specs - - - $compiler - - - $target - - - matrix: - - - $app_specs - - - $compiler - - - $target - - - matrix: - - - $lib_specs - - - $compiler - - - $target - - - matrix: - - - $compiler_specs - - - $compiler - - - $target - - ci: - pipeline-gen: - - build-job: - image: {name: ghcr.io/spack/e4s-amazonlinux-2:v2023-03-09, entrypoint: ['']} - - cdash: - build-group: AWS Packages diff --git a/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-aarch64-linux-gnu/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-aarch64-linux-gnu/spack.yaml index 1c2e7439e0afde..4e2356c520ed1b 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-aarch64-linux-gnu/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-aarch64-linux-gnu/spack.yaml @@ -38,7 +38,7 @@ spack: - ripgrep - gh - fd - # - bfs # liburing: /usr/include/linux/ipv6.h:19:8: error: redefinition of 'struct in6_pktinfo' + - bfs - fzf - tree - jq @@ -82,4 +82,4 @@ spack: image: ghcr.io/spack/aarch64-linux-gnu:v2024-12-18 cdash: - build-group: Developer Tools aarch64-linux-gnu \ No newline at end of file + build-group: Developer Tools aarch64-linux-gnu diff --git a/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-darwin/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-darwin/spack.yaml index 4f3a61549e1aba..32c7c72426829c 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-darwin/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-darwin/spack.yaml @@ -37,7 +37,7 @@ spack: - ripgrep - gh - fd - # - bfs # liburing: /usr/include/linux/ipv6.h:19:8: error: redefinition of 'struct in6_pktinfo' + - bfs - fzf - tree - jq diff --git a/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-x86_64_v3-linux-gnu/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-x86_64_v3-linux-gnu/spack.yaml index b1b754daef17a4..48337e9cd46e58 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-x86_64_v3-linux-gnu/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/developer-tools-x86_64_v3-linux-gnu/spack.yaml @@ -2,10 +2,16 @@ spack: view: false packages: all: - require: target=x86_64_v3 + require: + - target=x86_64_v3 + - ~cuda + - ~rocm + concretizer: unify: true reuse: false + static_analysis: true + definitions: - default_specs: # editors @@ -38,7 +44,7 @@ spack: - ripgrep - gh - fd - # - bfs # liburing: /usr/include/linux/ipv6.h:19:8: error: redefinition of 'struct in6_pktinfo' + - bfs - fzf - tree - jq diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-neoverse-v2/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-neoverse-v2/spack.yaml index 1eb61ec5e93d23..ae996a4022b310 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-neoverse-v2/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-neoverse-v2/spack.yaml @@ -84,6 +84,7 @@ spack: - lammps - lbann - legion + - libceed - libnrm - libquo - libunwind @@ -192,6 +193,7 @@ spack: - hpx +cuda cuda_arch=90 - kokkos +wrapper +cuda cuda_arch=90 - kokkos-kernels +cuda cuda_arch=90 ^kokkos +wrapper +cuda cuda_arch=90 + - libceed +cuda cuda_arch=90 - magma +cuda cuda_arch=90 - mfem +cuda cuda_arch=90 - mgard +serial +openmp +timing +unstructured +cuda cuda_arch=90 diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml index 66214ecff9541e..ec2639ea0616be 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml @@ -113,6 +113,7 @@ spack: - laghos - lammps - legion + - libceed - libnrm - libpressio +bitgrooming +bzip2 ~cuda ~cusz +fpzip +hdf5 +libdistributed +lua +openmp +python +sz +sz3 +unix +zfp - libquo diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-power/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-power/spack.yaml deleted file mode 100644 index a770b0a299a13d..00000000000000 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-power/spack.yaml +++ /dev/null @@ -1,271 +0,0 @@ -spack: - view: false - - concretizer: - reuse: false - unify: false - - packages: - all: - require: "%gcc@9.4.0 target=ppc64le" - compiler: [gcc@9.4.0] - providers: - blas: [openblas] - mpi: [mpich] - variants: +mpi cuda_arch=70 - binutils: - variants: +ld +gold +headers +libiberty ~nls - hdf5: - variants: +fortran +hl +shared - libfabric: - variants: fabrics=sockets,tcp,udp,rxm - openblas: - variants: threads=openmp - trilinos: - variants: +amesos +amesos2 +anasazi +aztec +belos +boost +epetra +epetraext - +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu - +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos - +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long - xz: - variants: +pic - mpi: - require: mpich - mpich: - require: '~wrapperrpath ~hwloc %gcc@9.4.0 target=ppc64le' - ncurses: - require: '@6.3 +termlib %gcc@9.4.0 target=ppc64le' - faodel: - require: "~tcmalloc %gcc@9.4.0 target=ppc64le" - tbb: - require: intel-tbb - vtk-m: - require: "+examples %gcc@9.4.0 target=ppc64le" - cuda: - require: "@11.4.4 %gcc@9.4.0 target=ppc64le" - paraview: - require: "+examples %gcc@9.4.0 target=ppc64le" - - - specs: - # CPU - - adios - - alquimia - - aml - - amrex - - arborx - - argobots - - axom - - bolt - - boost - - bricks - - butterflypack - - cabana - - caliper - - chai - - chapel ~rocm ~cuda - - charliecloud - - conduit - - cp2k +mpi - - datatransferkit - - drishti - - dxt-explorer - - dyninst - - exaworks - - fftx - - flecsi - - flit - - flux-core - - fortrilinos - - gasnet - - ginkgo - - globalarrays - - gmp - - gotcha - - gptune - - gromacs +cp2k ^cp2k +mpi build_system=cmake - - h5bench - - hdf5-vol-async - - hdf5-vol-cache - - hdf5-vol-log - - heffte +fftw - - hpctoolkit - - hpx networking=mpi - - hypre - - kokkos +openmp - - kokkos-kernels +openmp - - laghos - - lammps - - lbann - - legion - - libnrm - - libquo - - libunwind - - loki - - mercury - - metall - - mfem - - mgard +serial +openmp +timing +unstructured ~cuda - - mpark-variant - - mpifileutils ~xattr - - nccmp - - nco - - netlib-scalapack - - nrm - - nvhpc - - nwchem - - omega-h - - openfoam - - openmpi - - openpmd-api - - papi - - papyrus - - paraview ~cuda ~rocm - - parsec ~cuda - - pdt - - petsc - - plasma - - plumed - - precice - - pruners-ninja - - pumi - - py-amrex - - py-h5py - - py-jupyterhub - - py-libensemble - - py-petsc4py - - qthreads scheduler=distrib - - quantum-espresso - - raja - - rempi - - scr - - slate ~cuda - - slepc - - stc - - strumpack ~slate - - sundials - - superlu - - superlu-dist - - swig@4.0.2-fortran - - sz3 - - tasmanian - - tau +mpi +python # +syscall fails: https://github.com/spack/spack/pull/40830#issuecomment-1790799772; tau: has issue with `spack env depfile` build - - trilinos +amesos +amesos2 +anasazi +aztec +belos +boost +epetra +epetraext +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long - - turbine - - umap - - umpire - - upcxx - - wannier90 - - warpx +python - - wps - - wrf - - xyce +mpi +shared +pymi +pymi_static_tpls - # INCLUDED IN ECP DAV CPU - - adios2 - - ascent - - darshan-runtime - - darshan-util - - faodel - - hdf5 - - libcatalyst - - parallel-netcdf - - py-cinemasci - - sz - - unifyfs - - veloc - # - visit # libext, libxkbfile, libxrender, libxt, silo (https://github.com/spack/spack/issues/39538), cairo - - vtk-m - - zfp - # - ecp-data-vis-sdk ~cuda ~rocm +adios2 +ascent +cinema +darshan +faodel +hdf5 ~paraview +pnetcdf +sz +unifyfs +veloc ~visit +vtkm +zfp # +visit: libext, libxkbfile, libxrender, libxt, silo (https://github.com/spack/spack/issues/39538), cairo - # -- - # - dealii # fltk: https://github.com/spack/spack/issues/38791 - # - geopm-runtime # cairo: *** No autoreconf found, please install it *** - # - glvis # glvis: https://github.com/spack/spack/issues/42839 - # - libpressio +bitgrooming +bzip2 ~cuda ~cusz +fpzip +hdf5 +libdistributed +lua +openmp +python +sz +sz3 +unix +zfp # py-numcodecs: gcc: error: unrecognized command line option '-mno-sse2'; did you mean '-mno-isel'? gcc: error: unrecognized command line option '-mno-avx2' - # - phist +mpi # ghost@develop: gcc-9: error: unrecognized command line option '-march=native'; did you mean '-mcpu=native'? - # - variorum # variorum: https://github.com/spack/spack/issues/38786 - - # PYTHON PACKAGES - - opencv +python3 - - py-jax - - py-jupyterlab - - py-matplotlib - - py-mpi4py - - py-notebook - - py-numba - - py-numpy - - py-openai - - py-pandas - - py-plotly - - py-pooch - - py-pytest - - py-scikit-learn - - py-scipy - - py-seaborn - # - py-horovod # py-torch, py-tensorflow - # - py-tensorflow # error - # - py-torch # error - - # CUDA NOARCH - - bricks +cuda - - cabana +cuda ^kokkos +wrapper +cuda_lambda +cuda cuda_arch=70 - - flux-core +cuda - - hpctoolkit +cuda - - papi +cuda - - tau +mpi +cuda - # -- - # - legion +cuda # legion: needs NVIDIA driver - - # CUDA 70 - - amrex +cuda cuda_arch=70 - - arborx +cuda cuda_arch=70 ^kokkos +wrapper - - caliper +cuda cuda_arch=70 - - chai +cuda cuda_arch=70 ^umpire ~shared - - ecp-data-vis-sdk ~rocm +adios2 ~ascent +hdf5 +vtkm +zfp ~paraview +cuda cuda_arch=70 - - exago +mpi +python +raja +hiop ~rocm +cuda cuda_arch=70 ~ipopt ^hiop@1.0.0 ~sparse +mpi +raja ~rocm +cuda cuda_arch=70 #^raja@0.14.0 - - flecsi +cuda cuda_arch=70 - - ginkgo +cuda cuda_arch=70 - - gromacs +cuda cuda_arch=70 - - heffte +cuda cuda_arch=70 - - hpx +cuda cuda_arch=70 - - hypre +cuda cuda_arch=70 - - kokkos +wrapper +cuda cuda_arch=70 - - kokkos-kernels +cuda cuda_arch=70 ^kokkos +wrapper +cuda cuda_arch=70 - - magma +cuda cuda_arch=70 - - mfem +cuda cuda_arch=70 - - mgard +serial +openmp +timing +unstructured +cuda cuda_arch=70 - - omega-h +cuda cuda_arch=70 - - parsec +cuda cuda_arch=70 - - petsc +cuda cuda_arch=70 - - raja +cuda cuda_arch=70 - - slate +cuda cuda_arch=70 - - slepc +cuda cuda_arch=70 - - strumpack ~slate +cuda cuda_arch=70 - - sundials +cuda cuda_arch=70 - - superlu-dist +cuda cuda_arch=70 - - tasmanian +cuda cuda_arch=70 - - umpire ~shared +cuda cuda_arch=70 - # INCLUDED IN ECP DAV CUDA - - adios2 +cuda cuda_arch=70 - # - ascent +cuda cuda_arch=70 # ascent: https://github.com/spack/spack/issues/38045 - - paraview +cuda cuda_arch=70 - - vtk-m +cuda cuda_arch=70 - - zfp +cuda cuda_arch=70 - # -- - # - axom +cuda cuda_arch=70 # axom: https://github.com/spack/spack/issues/29520 - # - cp2k +mpi +cuda cuda_arch=70 # dbcsr - # - cusz +cuda cuda_arch=70 # cusz: https://github.com/spack/spack/issues/38787 - # - dealii +cuda cuda_arch=70 # fltk: https://github.com/spack/spack/issues/38791 - # - lammps +cuda cuda_arch=70 # lammps: needs NVIDIA driver - # - lbann +cuda cuda_arch=70 # lbann: https://github.com/spack/spack/issues/38788 - # - libpressio +bitgrooming +bzip2 +fpzip +hdf5 +libdistributed +lua +openmp +python +sz +sz3 +unix +zfp +json +remote +netcdf +cusz +mgard +cuda cuda_arch=70 ^cusz +cuda cuda_arch=70 # depends_on("cuda@11.7.1:", when="+cuda") - # - py-torch +cuda cuda_arch=70 # skipped - # - trilinos +cuda cuda_arch=70 # trilinos: https://github.com/trilinos/Trilinos/issues/11630 - # - upcxx +cuda cuda_arch=70 # upcxx: needs NVIDIA driver - - ci: - pipeline-gen: - - build-job: - image: ghcr.io/spack/ubuntu20.04-runner-ppc64-gcc-11.4:2023.08.01 - - cdash: - build-group: E4S Power diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-rocm-external/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-rocm-external/spack.yaml index d83646f32a44b0..d765f8c7ae24f3 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-rocm-external/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-rocm-external/spack.yaml @@ -234,6 +234,7 @@ spack: - hypre +rocm amdgpu_target=gfx908 - kokkos +rocm amdgpu_target=gfx908 - legion +rocm amdgpu_target=gfx908 + - libceed +rocm amdgpu_target=gfx908 - magma ~cuda +rocm amdgpu_target=gfx908 - mfem +rocm amdgpu_target=gfx908 - raja ~openmp +rocm amdgpu_target=gfx908 @@ -279,6 +280,7 @@ spack: - hypre +rocm amdgpu_target=gfx90a - kokkos +rocm amdgpu_target=gfx90a - legion +rocm amdgpu_target=gfx90a + - libceed +rocm amdgpu_target=gfx90a - magma ~cuda +rocm amdgpu_target=gfx90a - mfem +rocm amdgpu_target=gfx90a - raja ~openmp +rocm amdgpu_target=gfx90a diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml index 48e1d975fffda2..deaca8913981ba 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml @@ -4,16 +4,32 @@ spack: concretizer: reuse: false unify: false + static_analysis: true packages: all: - require: '%gcc target=x86_64_v3' - providers: - blas: [openblas] - mpi: [mpich] + require: + - '%gcc target=x86_64_v3' variants: +mpi + mpi: + require: + - mpich + blas: + require: + - openblas + lapack: + require: + - openblas binutils: variants: +ld +gold +headers +libiberty ~nls + cmake: + require: + - "~qtgui" + - '%gcc target=x86_64_v3' + gmake: + require: + - "~guile" + - '%gcc target=x86_64_v3' hdf5: variants: +fortran +hl +shared libfabric: @@ -27,19 +43,25 @@ spack: +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long_long - mpi: - require: mpich mpich: - require: '~wrapperrpath ~hwloc target=x86_64_v3' + require: + - '~wrapperrpath ~hwloc' + - '%gcc target=x86_64_v3' tbb: - require: intel-tbb + require: + - intel-tbb vtk-m: - require: "+examples target=x86_64_v3" + require: + - "+examples" + - '%gcc target=x86_64_v3' visit: - require: "~gui target=x86_64_v3" + require: + - "~gui target=x86_64_v3" paraview: # Don't build GUI support or GLX rendering for HPC/container deployments - require: "+examples ~qt ^[virtuals=gl] osmesa target=x86_64_v3" + require: + - "+examples ~qt ^[virtuals=gl] osmesa target=x86_64_v3" + - '%gcc target=x86_64_v3' specs: # CPU @@ -99,6 +121,7 @@ spack: - lammps +amoeba +asphere +bocs +body +bpm +brownian +cg-dna +cg-spica +class2 +colloid +colvars +compress +coreshell +dielectric +diffraction +dipole +dpd-basic +dpd-meso +dpd-react +dpd-smooth +drude +eff +electrode +extra-compute +extra-dump +extra-fix +extra-molecule +extra-pair +fep +granular +interlayer +kspace +lepton +machdyn +manybody +mc +meam +mesont +misc +ml-iap +ml-pod +ml-snap +mofff +molecule +openmp-package +opt +orient +peri +phonon +plugin +poems +qeq +reaction +reaxff +replica +rigid +shock +sph +spin +srd +tally +uef +voronoi +yaff - lbann - legion + - libceed - libnrm - libpressio +bitgrooming +bzip2 ~cuda ~cusz +fpzip +hdf5 +libdistributed +lua +openmp +python +sz +sz3 +unix +zfp - libquo @@ -236,6 +259,7 @@ spack: - hypre +cuda cuda_arch=80 - kokkos +wrapper +cuda cuda_arch=80 - kokkos-kernels +cuda cuda_arch=80 ^kokkos +wrapper +cuda cuda_arch=80 + - libceed +cuda cuda_arch=80 - libpressio +bitgrooming +bzip2 +fpzip +hdf5 +libdistributed +lua +openmp +python +sz +sz3 +unix +zfp +json +remote +netcdf +cusz +mgard +cuda cuda_arch=80 ^cusz +cuda cuda_arch=80 - magma +cuda cuda_arch=80 - mfem +cuda cuda_arch=80 @@ -283,6 +307,7 @@ spack: - hypre +cuda cuda_arch=90 - kokkos +wrapper +cuda cuda_arch=90 - kokkos-kernels +cuda cuda_arch=90 ^kokkos +wrapper +cuda cuda_arch=90 + - libceed +cuda cuda_arch=90 - libpressio +bitgrooming +bzip2 +fpzip +hdf5 +libdistributed +lua +openmp +python +sz +sz3 +unix +zfp +json +remote +netcdf +cusz +mgard +cuda cuda_arch=90 ^cusz +cuda cuda_arch=90 - magma +cuda cuda_arch=90 - mfem +cuda cuda_arch=90 @@ -332,6 +357,7 @@ spack: - kokkos +rocm amdgpu_target=gfx90a - lammps +rocm amdgpu_target=gfx90a - legion +rocm amdgpu_target=gfx90a + - libceed +rocm amdgpu_target=gfx90a - magma ~cuda +rocm amdgpu_target=gfx90a - mfem +rocm amdgpu_target=gfx90a - raja ~openmp +rocm amdgpu_target=gfx90a diff --git a/share/spack/gitlab/cloud_pipelines/stacks/hep/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/hep/spack.yaml index b235b70493e342..ea9d630e604609 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/hep/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/hep/spack.yaml @@ -4,6 +4,7 @@ spack: concretizer: reuse: false unify: when_possible + static_analysis: true packages: all: @@ -13,44 +14,75 @@ spack: mpi: [mpich] tbb: [intel-tbb] variants: +mpi + acts: + require: +analysis +dd4hep +edm4hep +examples +fatras +geant4 +hepmc3 +podio +pythia8 +python ~svg +tgeo cxxstd=20 + celeritas: + require: +geant4 +hepmc3 +root +shared cxxstd=20 + hip: + require: '@5.7.1 +rocm' + rivet: + require: hepmc=3 + root: + require: +davix +dcache +examples +fftw +fits +fortran +gdml +graphviz +gsl +http +math +minuit +mlp +mysql +opengl +postgres +pythia8 +python +r +roofit +root7 +rpath ~shadow +spectrum +sqlite +ssl +tbb +threads +tmva +tmva-cpu +unuran +vc +vdt +veccore +webgui +x +xml +xrootd # cxxstd=20 + # note: root cxxstd=20 not concretizable within sherpa + vecgeom: + require: +gdml +geant4 +root +shared cxxstd=20 # Mark geant4 data as external to prevent wasting bandwidth on GB-scale files geant4-data: + buildable: false externals: - - spec: geant4-data@11.3.0 - prefix: /usr - - spec: geant4-data@11.2.2 - prefix: /usr - - spec: geant4-data@11.2.0 - prefix: /usr - - spec: geant4-data@11.1.0 - prefix: /usr - - spec: geant4-data@11.0.0 - prefix: /usr + - spec: geant4-data@11.3.0 + prefix: /usr + - spec: geant4-data@11.2.2 + prefix: /usr + - spec: geant4-data@11.2.0 + prefix: /usr + - spec: geant4-data@11.1.0 + prefix: /usr + - spec: geant4-data@11.0.0 + prefix: /usr specs: # CPU - - acts +analysis +dd4hep +edm4hep +examples +fatras +geant4 +hepmc3 +podio +pythia8 +python +tgeo cxxstd=20 - - celeritas +geant4 +hepmc3 +openmp +root +shared +vecgeom cxxstd=20 + - acts ~cuda + #- agile # fails on c++>11 compiler + - alpgen + - ampt + - apfel +lhapdf +python + - celeritas ~cuda +openmp ~rocm +vecgeom + - cepgen + - cernlib +shared + - collier - dd4hep +ddalign +ddcad +ddcond +dddetectors +dddigi +ddeve +ddg4 +ddrec +edm4hep +hepmc3 +lcio +utilityapps +xercesc - delphes +pythia8 - dpmjet - edm4hep - - fastjet + - evtgen +hepmc3 +photos +pythia8 +sherpa +tauola + - fastjet plugins=all + - feynhiggs - fjcontrib + #- garfieldpp - gaudi +aida +examples +heppdt +xercesc ^gdb +debuginfod +python - geant4 +opengl +qt +threads ~vtk ^[virtuals=qmake] qt + #- genie +atmo - hepmc - hepmc3 +interfaces +protobuf +python +rootio #- herwig3 +njet +vbfnlo # Note: herwig3 fails to find evtgen + - hztool - lcio -examples ~jar +rootdict # Note: lcio +examples ^ncurses -termlib, which leads to conflicts - lhapdf +python + - lhapdfsets sets=default - madgraph5amc + - njet - opendatadetector + - openloops - pandoramonitoring - pandorapfa - pandorasdk + - photos +hepmc3 - podio +rntuple +sio + #- professor - py-awkward - py-boost-histogram - py-hepunits @@ -64,17 +96,29 @@ spack: - py-uproot +lz4 +xrootd +zstd - py-vector - pythia8 +evtgen +fastjet +hdf5 +hepmc +hepmc3 +lhapdf ~madgraph5amc +python +rivet ~root # pythia8 and root circularly depend - - rivet hepmc=3 - - root +davix +dcache +examples +fftw +fits +fortran +gdml +graphviz +gsl +http +math +minuit +mlp +mysql +opengl +postgres +pythia8 +python +r +roofit +root7 +rpath ~shadow +spectrum +sqlite +ssl +tbb +threads +tmva +unuran +vc +vdt +veccore +webgui +x +xml +xrootd - - sherpa +analysis ~blackhat +gzip +hepmc3 +hepmc3root +lhapdf +lhole +openloops +pythia ~python ~recola ~rivet +root +ufo - - thepeg ~rivet - - vecgeom +gdml +geant4 +root + - rivet + - root ~cuda + - sherpa +analysis ~blackhat +gzip +hepmc3 +hepmc3root +lhapdf +lhole +openloops +pythia ~python ~recola ~rivet +root +ufo cxxstd=20 + - tauola +hepmc3 +lhapdf cxxstd=20 + - thepeg hepmc=3 ~rivet + - vecgeom ~cuda + - whizard +fastjet +gosam hepmc=3 +lcio +lhapdf +openloops +openmp +pythia8 - xrootd +davix +http +krb5 +python +readline +scitokens-cpp + - yoda +root + + # CUDA + #- acts +cuda +traccc cuda_arch=80 + #- celeritas +cuda ~openmp +vecgeom cuda_arch=80 + - root +cuda +cudnn +tmva-gpu + - vecgeom +cuda cuda_arch=80 + + # ROCm + - celeritas +rocm amdgpu_target=gfx90a ~openmp ~vecgeom # only available with ORANGE ci: pipeline-gen: - build-job: - image: "ghcr.io/spack/spack/ubuntu22.04-runner-amd64-gcc-11.4:2024.03.01" + image: ghcr.io/spack/spack/ubuntu22.04-runner-amd64-gcc-11.4:2024.03.01 cdash: build-group: HEP diff --git a/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-aarch64-cuda/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-aarch64-cuda/spack.yaml index 47f4eda0f12d0c..d37f8ec7d27499 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-aarch64-cuda/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-aarch64-cuda/spack.yaml @@ -12,6 +12,13 @@ spack: require: ~cuda mpi: require: openmpi + py-torch: + require: + - target=aarch64 + - ~rocm + - +cuda + - cuda_arch=80 + - ~flash_attention specs: # Horovod diff --git a/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-x86_64-cuda/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-x86_64-cuda/spack.yaml index 05b570f8f9a9a5..7b508debd371cf 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-x86_64-cuda/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-x86_64-cuda/spack.yaml @@ -12,6 +12,13 @@ spack: require: ~cuda mpi: require: openmpi + py-torch: + require: + - target=x86_64_v3 + - ~rocm + - +cuda + - cuda_arch=80 + - ~flash_attention specs: # Horovod diff --git a/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-x86_64-rocm/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-x86_64-rocm/spack.yaml index 4b66256255ab52..f3bdf578fa1d5e 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-x86_64-rocm/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/ml-linux-x86_64-rocm/spack.yaml @@ -11,6 +11,13 @@ spack: require: "osmesa" mpi: require: openmpi + py-torch: + require: + - target=x86_64_v3 + - ~cuda + - +rocm + - amdgpu_target=gfx90a + - ~flash_attention specs: # Horovod diff --git a/share/spack/gitlab/cloud_pipelines/stacks/tutorial/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/tutorial/spack.yaml index 9917841db5250b..58695a0717552a 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/tutorial/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/tutorial/spack.yaml @@ -18,7 +18,7 @@ spack: - hdf5+hl+mpi ^mpich - trilinos - trilinos +hdf5 ^hdf5+hl+mpi ^mpich - - gcc@12.3.0 + - gcc@12 - mpileaks - lmod@8.7.18 - environment-modules diff --git a/share/spack/qa/run-unit-tests b/share/spack/qa/run-unit-tests index daacd6978a15bf..266d7e0ea51447 100755 --- a/share/spack/qa/run-unit-tests +++ b/share/spack/qa/run-unit-tests @@ -36,7 +36,7 @@ bin/spack -h bin/spack help -a # Profile and print top 20 lines for a simple call to spack spec -spack -p --lines 20 spec mpileaks%gcc ^dyninst@10.0.0 ^elfutils@0.170 +spack -p --lines 20 spec mpileaks%gcc $coverage_run $(which spack) bootstrap status --dev --optional # Check that we can import Spack packages directly as a first import diff --git a/share/spack/setup-env.fish b/share/spack/setup-env.fish index d789056579aa18..a2a8d6734a048e 100644 --- a/share/spack/setup-env.fish +++ b/share/spack/setup-env.fish @@ -788,8 +788,7 @@ end # set -l fish_version (string split '.' $FISH_VERSION) if test $fish_version[1] -gt 3 - or test $fish_version[1] -eq 3 - and test $fish_version[2] -ge 2 + or begin ; test $fish_version[1] -eq 3 ; and test $fish_version[2] -ge 2 ; end source $sp_share_dir/spack-completion.fish end diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 69543ee8066f9e..9dcff5ddcd3a92 100644 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -706,7 +706,7 @@ _spack_ci_rebuild() { _spack_ci_reproduce_build() { if $list_options then - SPACK_COMPREPLY="-h --help --runtime --working-dir -s --autostart --gpg-file --gpg-url" + SPACK_COMPREPLY="-h --help --runtime --working-dir -s --autostart --use-local-head --gpg-file --gpg-url" else SPACK_COMPREPLY="" fi @@ -933,14 +933,10 @@ _spack_debug() { then SPACK_COMPREPLY="-h --help" else - SPACK_COMPREPLY="create-db-tarball report" + SPACK_COMPREPLY="report" fi } -_spack_debug_create_db_tarball() { - SPACK_COMPREPLY="-h --help" -} - _spack_debug_report() { SPACK_COMPREPLY="-h --help" } @@ -2033,6 +2029,15 @@ _spack_url_stats() { } _spack_verify() { + if $list_options + then + SPACK_COMPREPLY="-h --help" + else + SPACK_COMPREPLY="manifest libraries" + fi +} + +_spack_verify_manifest() { if $list_options then SPACK_COMPREPLY="-h --help -l --local -j --json -a --all -s --specs -f --files" @@ -2041,6 +2046,15 @@ _spack_verify() { fi } +_spack_verify_libraries() { + if $list_options + then + SPACK_COMPREPLY="-h --help" + else + _installed_packages + fi +} + _spack_versions() { if $list_options then diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index f19d9ee19a14c2..db04e62e9a4dae 100644 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -425,7 +425,7 @@ complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a uninstall -d 'rem complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a unit-test -d 'run spack'"'"'s unit tests (wrapper around pytest)' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a unload -d 'remove package from the user environment' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a url -d 'debugging tool for url parsing' -complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a verify -d 'check that all spack packages are on disk as installed' +complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a verify -d 'verify spack installations on disk' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a versions -d 'list available versions of a package' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a view -d 'project packages to a compact naming scheme on the filesystem' complete -c spack -n '__fish_spack_using_command ' -s h -l help -f -a help @@ -506,9 +506,9 @@ complete -c spack -n '__fish_spack_using_command arch' -s o -l operating-system complete -c spack -n '__fish_spack_using_command arch' -s t -l target -f -a target complete -c spack -n '__fish_spack_using_command arch' -s t -l target -d 'print only the target' complete -c spack -n '__fish_spack_using_command arch' -s f -l frontend -f -a frontend -complete -c spack -n '__fish_spack_using_command arch' -s f -l frontend -d 'print frontend' +complete -c spack -n '__fish_spack_using_command arch' -s f -l frontend -d 'print frontend (DEPRECATED)' complete -c spack -n '__fish_spack_using_command arch' -s b -l backend -f -a backend -complete -c spack -n '__fish_spack_using_command arch' -s b -l backend -d 'print backend' +complete -c spack -n '__fish_spack_using_command arch' -s b -l backend -d 'print backend (DEPRECATED)' # spack audit set -g __fish_spack_optspecs_spack_audit h/help @@ -999,7 +999,7 @@ complete -c spack -n '__fish_spack_using_command ci rebuild' -s j -l jobs -r -f complete -c spack -n '__fish_spack_using_command ci rebuild' -s j -l jobs -r -d 'explicitly set number of parallel jobs' # spack ci reproduce-build -set -g __fish_spack_optspecs_spack_ci_reproduce_build h/help runtime= working-dir= s/autostart gpg-file= gpg-url= +set -g __fish_spack_optspecs_spack_ci_reproduce_build h/help runtime= working-dir= s/autostart use-local-head gpg-file= gpg-url= complete -c spack -n '__fish_spack_using_command_pos 0 ci reproduce-build' -f complete -c spack -n '__fish_spack_using_command ci reproduce-build' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command ci reproduce-build' -s h -l help -d 'show this help message and exit' @@ -1009,6 +1009,8 @@ complete -c spack -n '__fish_spack_using_command ci reproduce-build' -l working- complete -c spack -n '__fish_spack_using_command ci reproduce-build' -l working-dir -r -d 'where to unpack artifacts' complete -c spack -n '__fish_spack_using_command ci reproduce-build' -s s -l autostart -f -a autostart complete -c spack -n '__fish_spack_using_command ci reproduce-build' -s s -l autostart -d 'Run docker reproducer automatically' +complete -c spack -n '__fish_spack_using_command ci reproduce-build' -l use-local-head -f -a use_local_head +complete -c spack -n '__fish_spack_using_command ci reproduce-build' -l use-local-head -d 'Use the HEAD of the local Spack instead of reproducing a commit' complete -c spack -n '__fish_spack_using_command ci reproduce-build' -l gpg-file -r -f -a gpg_file complete -c spack -n '__fish_spack_using_command ci reproduce-build' -l gpg-file -r -d 'Path to public GPG key for validating binary cache installs' complete -c spack -n '__fish_spack_using_command ci reproduce-build' -l gpg-url -r -f -a gpg_url @@ -1202,19 +1204,19 @@ complete -c spack -n '__fish_spack_using_command config' -l scope -r -d 'configu # spack config get set -g __fish_spack_optspecs_spack_config_get h/help -complete -c spack -n '__fish_spack_using_command_pos 0 config get' -f -a 'bootstrap cdash ci compilers concretizer config definitions develop mirrors modules packages repos upstreams view' +complete -c spack -n '__fish_spack_using_command_pos 0 config get' -f -a 'bootstrap cdash ci compilers concretizer config definitions develop env_vars mirrors modules packages repos upstreams view' complete -c spack -n '__fish_spack_using_command config get' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command config get' -s h -l help -d 'show this help message and exit' # spack config blame set -g __fish_spack_optspecs_spack_config_blame h/help -complete -c spack -n '__fish_spack_using_command_pos 0 config blame' -f -a 'bootstrap cdash ci compilers concretizer config definitions develop mirrors modules packages repos upstreams view' +complete -c spack -n '__fish_spack_using_command_pos 0 config blame' -f -a 'bootstrap cdash ci compilers concretizer config definitions develop env_vars mirrors modules packages repos upstreams view' complete -c spack -n '__fish_spack_using_command config blame' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command config blame' -s h -l help -d 'show this help message and exit' # spack config edit set -g __fish_spack_optspecs_spack_config_edit h/help print-file -complete -c spack -n '__fish_spack_using_command_pos 0 config edit' -f -a 'bootstrap cdash ci compilers concretizer config definitions develop mirrors modules packages repos upstreams view' +complete -c spack -n '__fish_spack_using_command_pos 0 config edit' -f -a 'bootstrap cdash ci compilers concretizer config definitions develop env_vars mirrors modules packages repos upstreams view' complete -c spack -n '__fish_spack_using_command config edit' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command config edit' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command config edit' -l print-file -f -a print_file @@ -1327,16 +1329,10 @@ complete -c spack -n '__fish_spack_using_command create' -s b -l batch -d 'don'" # spack debug set -g __fish_spack_optspecs_spack_debug h/help -complete -c spack -n '__fish_spack_using_command_pos 0 debug' -f -a create-db-tarball -d 'create a tarball of Spack'"'"'s installation metadata' complete -c spack -n '__fish_spack_using_command_pos 0 debug' -f -a report -d 'print information useful for bug reports' complete -c spack -n '__fish_spack_using_command debug' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command debug' -s h -l help -d 'show this help message and exit' -# spack debug create-db-tarball -set -g __fish_spack_optspecs_spack_debug_create_db_tarball h/help -complete -c spack -n '__fish_spack_using_command debug create-db-tarball' -s h -l help -f -a help -complete -c spack -n '__fish_spack_using_command debug create-db-tarball' -s h -l help -d 'show this help message and exit' - # spack debug report set -g __fish_spack_optspecs_spack_debug_report h/help complete -c spack -n '__fish_spack_using_command debug report' -s h -l help -f -a help @@ -3167,20 +3163,33 @@ complete -c spack -n '__fish_spack_using_command url stats' -l show-issues -f -a complete -c spack -n '__fish_spack_using_command url stats' -l show-issues -d 'show packages with issues (md5 hashes, http urls)' # spack verify -set -g __fish_spack_optspecs_spack_verify h/help l/local j/json a/all s/specs f/files -complete -c spack -n '__fish_spack_using_command_pos_remainder 0 verify' $__fish_spack_force_files -a '(__fish_spack_installed_specs)' +set -g __fish_spack_optspecs_spack_verify h/help +complete -c spack -n '__fish_spack_using_command_pos 0 verify' -f -a manifest -d 'verify that install directories have not been modified since installation' +complete -c spack -n '__fish_spack_using_command_pos 0 verify' -f -a libraries -d 'verify that shared libraries of install packages can be located in rpaths (Linux only)' complete -c spack -n '__fish_spack_using_command verify' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command verify' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command verify' -s l -l local -f -a local -complete -c spack -n '__fish_spack_using_command verify' -s l -l local -d 'verify only locally installed packages' -complete -c spack -n '__fish_spack_using_command verify' -s j -l json -f -a json -complete -c spack -n '__fish_spack_using_command verify' -s j -l json -d 'ouptut json-formatted errors' -complete -c spack -n '__fish_spack_using_command verify' -s a -l all -f -a all -complete -c spack -n '__fish_spack_using_command verify' -s a -l all -d 'verify all packages' -complete -c spack -n '__fish_spack_using_command verify' -s s -l specs -f -a type -complete -c spack -n '__fish_spack_using_command verify' -s s -l specs -d 'treat entries as specs (default)' -complete -c spack -n '__fish_spack_using_command verify' -s f -l files -f -a type -complete -c spack -n '__fish_spack_using_command verify' -s f -l files -d 'treat entries as absolute filenames' + +# spack verify manifest +set -g __fish_spack_optspecs_spack_verify_manifest h/help l/local j/json a/all s/specs f/files +complete -c spack -n '__fish_spack_using_command_pos_remainder 0 verify manifest' $__fish_spack_force_files -a '(__fish_spack_installed_specs)' +complete -c spack -n '__fish_spack_using_command verify manifest' -s h -l help -f -a help +complete -c spack -n '__fish_spack_using_command verify manifest' -s h -l help -d 'show this help message and exit' +complete -c spack -n '__fish_spack_using_command verify manifest' -s l -l local -f -a local +complete -c spack -n '__fish_spack_using_command verify manifest' -s l -l local -d 'verify only locally installed packages' +complete -c spack -n '__fish_spack_using_command verify manifest' -s j -l json -f -a json +complete -c spack -n '__fish_spack_using_command verify manifest' -s j -l json -d 'ouptut json-formatted errors' +complete -c spack -n '__fish_spack_using_command verify manifest' -s a -l all -f -a all +complete -c spack -n '__fish_spack_using_command verify manifest' -s a -l all -d 'verify all packages' +complete -c spack -n '__fish_spack_using_command verify manifest' -s s -l specs -f -a type +complete -c spack -n '__fish_spack_using_command verify manifest' -s s -l specs -d 'treat entries as specs (default)' +complete -c spack -n '__fish_spack_using_command verify manifest' -s f -l files -f -a type +complete -c spack -n '__fish_spack_using_command verify manifest' -s f -l files -d 'treat entries as absolute filenames' + +# spack verify libraries +set -g __fish_spack_optspecs_spack_verify_libraries h/help +complete -c spack -n '__fish_spack_using_command_pos_remainder 0 verify libraries' -f -a '(__fish_spack_installed_specs)' +complete -c spack -n '__fish_spack_using_command verify libraries' -s h -l help -f -a help +complete -c spack -n '__fish_spack_using_command verify libraries' -s h -l help -d 'show this help message and exit' # spack versions set -g __fish_spack_optspecs_spack_versions h/help s/safe r/remote n/new j/jobs= diff --git a/var/spack/repos/builtin.mock/packages/cmake/package.py b/var/spack/repos/builtin.mock/packages/cmake/package.py index 203b6815ad318e..12d229b1beebfd 100644 --- a/var/spack/repos/builtin.mock/packages/cmake/package.py +++ b/var/spack/repos/builtin.mock/packages/cmake/package.py @@ -20,6 +20,8 @@ class Cmake(Package): homepage = "https://www.cmake.org" url = "https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz" + tags = ["build-tools"] + version( "3.23.1", md5="4cb3ff35b2472aae70f542116d616e63", diff --git a/var/spack/repos/builtin.mock/packages/extension1/package.py b/var/spack/repos/builtin.mock/packages/extension1/package.py index 5ba3cf7a197b6e..8598338d430d51 100644 --- a/var/spack/repos/builtin.mock/packages/extension1/package.py +++ b/var/spack/repos/builtin.mock/packages/extension1/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin.mock/packages/extension2/package.py b/var/spack/repos/builtin.mock/packages/extension2/package.py index 8357cb82ab8de1..85a1f37a35815d 100644 --- a/var/spack/repos/builtin.mock/packages/extension2/package.py +++ b/var/spack/repos/builtin.mock/packages/extension2/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin.mock/packages/flatten-deps/package.py b/var/spack/repos/builtin.mock/packages/flatten-deps/package.py deleted file mode 100644 index 774e70d5175c66..00000000000000 --- a/var/spack/repos/builtin.mock/packages/flatten-deps/package.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class FlattenDeps(Package): - """Example install that flattens dependencies.""" - - homepage = "http://www.example.com" - url = "http://www.example.com/a-1.0.tar.gz" - - version("1.0", md5="0123456789abcdef0123456789abcdef") - - depends_on("dependency-install") - - install = install_dependency_symlinks diff --git a/var/spack/repos/builtin.mock/packages/libtool-deletion/package.py b/var/spack/repos/builtin.mock/packages/libtool-deletion/package.py index c9031f10ab5459..36391b3f29f820 100644 --- a/var/spack/repos/builtin.mock/packages/libtool-deletion/package.py +++ b/var/spack/repos/builtin.mock/packages/libtool-deletion/package.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import spack.build_systems.autotools from spack.package import * diff --git a/var/spack/repos/builtin.mock/packages/perl-extension/package.py b/var/spack/repos/builtin.mock/packages/perl-extension/package.py index ee5ee8a55b109a..0ff499184c8c40 100644 --- a/var/spack/repos/builtin.mock/packages/perl-extension/package.py +++ b/var/spack/repos/builtin.mock/packages/perl-extension/package.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin.mock/packages/py-extension1/package.py b/var/spack/repos/builtin.mock/packages/py-extension1/package.py index 8923349aef473a..c6f7713a08f477 100644 --- a/var/spack/repos/builtin.mock/packages/py-extension1/package.py +++ b/var/spack/repos/builtin.mock/packages/py-extension1/package.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin.mock/packages/py-extension2/package.py b/var/spack/repos/builtin.mock/packages/py-extension2/package.py index ec4486f05fef03..f87f29508467a2 100644 --- a/var/spack/repos/builtin.mock/packages/py-extension2/package.py +++ b/var/spack/repos/builtin.mock/packages/py-extension2/package.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin.mock/packages/view-not-ignored/package.py b/var/spack/repos/builtin.mock/packages/view-not-ignored/package.py index 15de0dc5289796..c24305568a93f3 100644 --- a/var/spack/repos/builtin.mock/packages/view-not-ignored/package.py +++ b/var/spack/repos/builtin.mock/packages/view-not-ignored/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/7zip/package.py b/var/spack/repos/builtin/packages/7zip/package.py index 8dd9d89caf95e0..2f69729e47de4c 100644 --- a/var/spack/repos/builtin/packages/7zip/package.py +++ b/var/spack/repos/builtin/packages/7zip/package.py @@ -100,10 +100,8 @@ def install(self, spec, prefix): for ext in exts: glob_str = os.path.join(pth, ext) files = glob.glob(glob_str) - [ + for x in files: shutil.copy( os.path.join(self._7z_src_dir, x), os.path.join(prefix, os.path.basename(x)), ) - for x in files - ] diff --git a/var/spack/repos/builtin/packages/abinit/package.py b/var/spack/repos/builtin/packages/abinit/package.py index 9eb6c528291356..d2ba73c8723a56 100644 --- a/var/spack/repos/builtin/packages/abinit/package.py +++ b/var/spack/repos/builtin/packages/abinit/package.py @@ -179,7 +179,7 @@ def configure_args(self): if spec.satisfies("@:8"): oapp("--with-dft-flavor=atompaw+libxc") else: - "--without-wannier90", + oapp("--without-wannier90") if spec.satisfies("+mpi"): oapp(f"CC={spec['mpi'].mpicc}") diff --git a/var/spack/repos/builtin/packages/ace/package.py b/var/spack/repos/builtin/packages/ace/package.py index 343556a35cacc3..d465d04eee2ac8 100644 --- a/var/spack/repos/builtin/packages/ace/package.py +++ b/var/spack/repos/builtin/packages/ace/package.py @@ -32,7 +32,7 @@ def edit(self, spec, prefix): # Dictionary mapping: compiler-name : ACE config-label supported = {"intel": "_icc", "gcc": ""} - if not (self.compiler.name in supported): + if self.compiler.name not in supported: raise Exception( "compiler " + self.compiler.name + " not supported in ace spack-package" ) diff --git a/var/spack/repos/builtin/packages/acts/package.py b/var/spack/repos/builtin/packages/acts/package.py index 7e814342793bb0..cef5358bf64fde 100644 --- a/var/spack/repos/builtin/packages/acts/package.py +++ b/var/spack/repos/builtin/packages/acts/package.py @@ -40,6 +40,8 @@ class Acts(CMakePackage, CudaPackage): # Supported Acts versions version("main", branch="main") version("master", branch="main", deprecated=True) # For compatibility + version("39.1.0", commit="09225b0d0bba24d57a696e347e3027b39404bb75", submodules=True) + version("39.0.0", commit="b055202e2fbdd509bc186eb4782714bc46f38f3f", submodules=True) version("38.2.0", commit="9cb8f4494656553fd9b85955938b79b2fac4c9b0", submodules=True) version("38.1.0", commit="8a20c88808f10bf4fcdfd7c6e077f23614c3ab90", submodules=True) version("38.0.0", commit="0a6b5155e29e3b755bf351b8a76067fff9b4214b", submodules=True) @@ -193,7 +195,8 @@ class Acts(CMakePackage, CudaPackage): version("0.08.1", commit="289bdcc320f0b3ff1d792e29e462ec2d3ea15df6") version("0.08.0", commit="99eedb38f305e3a1cd99d9b4473241b7cd641fa9") - depends_on("cxx", type="build") # generated + depends_on("c", type="build", when="+dd4hep") # DD4hep requires C + depends_on("cxx", type="build") # Variants that affect the core Acts library variant( @@ -432,6 +435,8 @@ class Acts(CMakePackage, CudaPackage): conflicts("%gcc@:7", when="@0.23:") # When using C++20, disable gcc 9 and lower. conflicts("%gcc@:9", when="cxxstd=20") + # See https://github.com/acts-project/acts/pull/3362 + conflicts("^geant4@11.3:", when="@:35") # See https://github.com/acts-project/acts/pull/3512 conflicts("^boost@1.85.0") # See https://github.com/acts-project/acts/pull/3921 diff --git a/var/spack/repos/builtin/packages/additivefoam/package.py b/var/spack/repos/builtin/packages/additivefoam/package.py index 5512578bf70640..69280e20bf069b 100644 --- a/var/spack/repos/builtin/packages/additivefoam/package.py +++ b/var/spack/repos/builtin/packages/additivefoam/package.py @@ -5,11 +5,8 @@ import inspect import os -import llnl.util.tty as tty - import spack.pkg.builtin.openfoam as openfoam from spack.package import * -from spack.version import Version class Additivefoam(Package): diff --git a/var/spack/repos/builtin/packages/affinity/package.py b/var/spack/repos/builtin/packages/affinity/package.py new file mode 100644 index 00000000000000..fcfd04c0431a6a --- /dev/null +++ b/var/spack/repos/builtin/packages/affinity/package.py @@ -0,0 +1,25 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Affinity(CMakePackage, CudaPackage): + """Simple applications for determining Linux thread and gpu affinity.""" + + homepage = "https://github.com/bcumming/affinity" + git = "https://github.com/bcumming/affinity.git" + version("master", branch="master") + + maintainers("bcumming", "nhanford") + + license("BSD-3-Clause", checked_by="nhanford") + + variant("mpi", default=False, description="Build MPI support") + variant("rocm", default=False, description="Build ROCm Support") + + depends_on("mpi", when="+mpi") + depends_on("hip", when="+rocm") + depends_on("mpi", when="+mpi") + depends_on("mpi", when="+cuda") diff --git a/var/spack/repos/builtin/packages/alps/package.py b/var/spack/repos/builtin/packages/alps/package.py new file mode 100644 index 00000000000000..7b1be15a83c39d --- /dev/null +++ b/var/spack/repos/builtin/packages/alps/package.py @@ -0,0 +1,95 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Alps(CMakePackage): + """ + The ALPS project (Algorithms and Libraries for Physics Simulations) aims at providing generic + parallel algorithms for classical and quantum lattice models and provides utility classes and + algorithm for many others. + """ + + homepage = "https://github.com/ALPSim/ALPS" + url = "https://github.com/ALPSim/ALPS/archive/refs/tags/v2.3.3-beta.5.tar.gz" + + maintainers("Sinan81") + + license("BSL-1.0", checked_by="Sinan81") + + version( + "2.3.3-beta.6", sha256="eb0c8115b034dd7a9dd585d277c4f86904ba374cdbdd130545aca1c432583b68" + ) + + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + + # update version constraint on every boost release after providing version & checksum info + # in resources dictionary below + depends_on( + "boost@:1.87 +chrono +date_time +filesystem +iostreams +mpi +numpy" + "+program_options +python +regex +serialization +system +test +thread +timer" + ) + depends_on("fftw") + depends_on("hdf5 ~mpi+hl") + depends_on("lapack") + depends_on("python", type=("build", "link", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("py-scipy", type=("build", "run")) + depends_on("py-matplotlib", type=("build", "run")) + + extends("python") + + # See https://github.com/ALPSim/ALPS/issues/6#issuecomment-2604912169 + # for why this is needed + resources = { + # boost version, shasum + "1.87.0": "af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89", + "1.86.0": "1bed88e40401b2cb7a1f76d4bab499e352fa4d0c5f31c0dbae64e24d34d7513b", + "1.85.0": "7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617", + "1.84.0": "cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454", + "1.83.0": "6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e", + "1.82.0": "a6e1ab9b0860e6a2881dd7b21fe9f737a095e5f33a3a874afc6a345228597ee6", + "1.81.0": "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa", + "1.80.0": "1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0", + } + + for boost_version, boost_checksum in resources.items(): + resource( + when="^boost@{0}".format(boost_version), + name="boost_source_files", + url="https://downloads.sourceforge.net/project/boost/boost/{0}/boost_{1}.tar.bz2".format( + boost_version, boost_version.replace(".", "_") + ), + sha256=boost_checksum, + destination="", + placement="boost_source_files", + ) + + def cmake_args(self): + args = [] + # Boost_ROOT_DIR option is replaced by Boost_SRC_DIR as of 2.3.3-beta.6 + args.append( + "-DCMAKE_CXX_FLAGS={0}".format( + self.compiler.cxx14_flag + + " -fpermissive -DBOOST_NO_AUTO_PTR -DBOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF" + + " -DBOOST_TIMER_ENABLE_DEPRECATED" + ) + ) + args.append( + "-DBoost_SRC_DIR={0}".format(join_path(self.stage.source_path, "boost_source_files")) + ) + return args + + @run_after("install") + def relocate_python_stuff(self): + pyalps_dir = join_path(python_platlib, "pyalps") + with working_dir(self.prefix): + copy_tree("pyalps", pyalps_dir) + with working_dir(self.prefix.lib): + copy_tree("pyalps", pyalps_dir) + # in pip installed pyalps package, xml dir is provided under platlib/pyalps + copy_tree("xml", join_path(pyalps_dir, "xml")) diff --git a/var/spack/repos/builtin/packages/amdfftw/package.py b/var/spack/repos/builtin/packages/amdfftw/package.py index 9e4cd107c8fabe..39b6b479889ac4 100644 --- a/var/spack/repos/builtin/packages/amdfftw/package.py +++ b/var/spack/repos/builtin/packages/amdfftw/package.py @@ -4,7 +4,6 @@ import os -from spack.build_environment import optimization_flags from spack.package import * from spack.pkg.builtin.fftw import FftwBase @@ -95,14 +94,14 @@ class Amdfftw(FftwBase): ) variant( "amd-dynamic-dispatcher", - default=True, + default=False, when="@4.1: %aocc@4.1.0:", description="Single portable optimized library" " to execute on different x86 CPU architectures", ) variant( "amd-dynamic-dispatcher", - default=True, + default=False, when="@3.2: %gcc", description="Single portable optimized library" " to execute on different x86 CPU architectures", @@ -203,11 +202,10 @@ def configure(self, spec, prefix): if not self.compiler.f77 or not self.compiler.fc: options.append("--disable-fortran") - # Cross compilation is supported in amd-fftw by making use of target - # variable to set AMD_ARCH configure option. - # Spack user can not directly use AMD_ARCH for this purpose but should - # use target variable to set appropriate -march option in AMD_ARCH. - options.append(f"AMD_ARCH={optimization_flags(self.compiler, spec.target)}") + if "avx512" in spec.target: + options.append("CFLAGS=-mprefer-vector-width=512") + else: + options.append("CFLAGS=-mprefer-vector-width=256") # Specific SIMD support. # float and double precisions are supported diff --git a/var/spack/repos/builtin/packages/amdlibflame/package.py b/var/spack/repos/builtin/packages/amdlibflame/package.py index 4ceac71f7b9dda..3c07796f70a495 100644 --- a/var/spack/repos/builtin/packages/amdlibflame/package.py +++ b/var/spack/repos/builtin/packages/amdlibflame/package.py @@ -202,8 +202,8 @@ def configure_args(self): args.append("--enable-void-return-complex") if spec.satisfies("@3.0:3.1 %aocc"): - """To enabled Fortran to C calling convention for - complex types when compiling with aocc flang""" + # To enable Fortran to C calling convention for complex types when compiling with + # aocc flang args.append("--enable-f2c-dotc") if spec.satisfies("@3.0.1: +ilp64"): diff --git a/var/spack/repos/builtin/packages/amdsmi/package.py b/var/spack/repos/builtin/packages/amdsmi/package.py index 4292104630e164..8f454e4d7cf12d 100644 --- a/var/spack/repos/builtin/packages/amdsmi/package.py +++ b/var/spack/repos/builtin/packages/amdsmi/package.py @@ -19,6 +19,8 @@ class Amdsmi(CMakePackage): libraries = ["libamd_smi"] license("MIT") + version("6.3.2", sha256="1ed452eedfe51ac6e615d7bfe0bd7a0614f21113874ae3cbea7df72343cc2d13") + version("6.3.1", sha256="a3a5a711052e813b9be9304d5e818351d3797f668ec2a455e61253a73429c355") version("6.3.0", sha256="7234c46648938239385cd5db57516ed53985b8c09d2f0828ae8f446386d8bd1e") version("6.2.4", sha256="5ebe8d0f176bf4a73b0e7000d9c47cb7f65ecca47011d3f9b08b93047dcf7ac5") version("6.2.1", sha256="136941e3f13e0d373ee3698bd60d4fc36353a2df6406e5a50b6ac78f1b639698") @@ -41,6 +43,11 @@ class Amdsmi(CMakePackage): depends_on("pkgconfig") depends_on("libdrm") depends_on("py-pyyaml") + patch( + "https://github.com/ROCm/amdsmi/commit/2858e51b4e8ff124ed67e23e0cd131e8b2140fae.patch?full_index=1", + sha256="1cac40d057cb19f0cfac83ea427c8e98f7808be9a2778cd53cdbf963910798e8", + when="@6.2", + ) @classmethod def determine_version(cls, lib): diff --git a/var/spack/repos/builtin/packages/ampliconnoise/package.py b/var/spack/repos/builtin/packages/ampliconnoise/package.py index 53dcc2f545bc77..cb20ccc542cc06 100644 --- a/var/spack/repos/builtin/packages/ampliconnoise/package.py +++ b/var/spack/repos/builtin/packages/ampliconnoise/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/amr-wind/package.py b/var/spack/repos/builtin/packages/amr-wind/package.py index fbb66f6435ea03..c1af337c74a2d2 100644 --- a/var/spack/repos/builtin/packages/amr-wind/package.py +++ b/var/spack/repos/builtin/packages/amr-wind/package.py @@ -20,6 +20,7 @@ class AmrWind(CMakePackage, CudaPackage, ROCmPackage): license("BSD-3-Clause") version("main", branch="main", submodules=True) + version("3.4.0", tag="v3.4.0", submodules=True) version("3.3.1", tag="v3.3.1", submodules=True) version("3.3.0", tag="v3.3.0", submodules=True) version("3.2.3", tag="v3.2.3", submodules=True) @@ -121,6 +122,9 @@ class AmrWind(CMakePackage, CudaPackage, ROCmPackage): conflicts("+openmp", when="+cuda") conflicts("+shared", when="+cuda") conflicts("@:2.0", when="+waves2amr") + conflicts( + "openfast@4.0.0:4.0.1", msg="OpenFAST 4.0.0:4.0.1 contains a bug. Use OpenFAST >= 4.0.2." + ) def setup_build_environment(self, env): # Avoid compile errors with Intel interprocedural optimization diff --git a/var/spack/repos/builtin/packages/amrex/package.py b/var/spack/repos/builtin/packages/amrex/package.py index 4e2f61f8e19598..41694a4abbddb1 100644 --- a/var/spack/repos/builtin/packages/amrex/package.py +++ b/var/spack/repos/builtin/packages/amrex/package.py @@ -25,6 +25,7 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage): license("BSD-3-Clause") version("develop", branch="development") + version("25.02", sha256="2680a5a9afba04e211cd48d27799c5a25abbb36c6c3d2b6c13cd4757c7176b23") version("25.01", sha256="29eb35cf67d66b0fd0654282454c210abfadf27fcff8478b256e3196f237c74f") version("24.12", sha256="ca4b41ac73fabb9cf3600b530c9823eb3625f337d9b7b9699c1089e81c67fc67") version("24.11", sha256="31cc37b39f15e02252875815f6066046fc56a479bf459362b9889b0d6a202df6") @@ -157,6 +158,7 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage): with when("+fft"): depends_on("rocfft", when="+rocm") depends_on("fftw@3", when="~cuda ~rocm ~sycl") + depends_on("pkgconfig", type="build") with when("+ascent"): depends_on("ascent") depends_on("ascent +cuda", when="+cuda") @@ -360,7 +362,7 @@ def cmake_args(self): args.append("-DAMReX_GPU_BACKEND=SYCL") # SYCL GPU backend only supported with Intel's oneAPI or DPC++ compilers sycl_compatible_compilers = ["icpx"] - if not (os.path.basename(self.compiler.cxx) in sycl_compatible_compilers): + if os.path.basename(self.compiler.cxx) not in sycl_compatible_compilers: raise InstallError( "AMReX's SYCL GPU Backend requires the oneAPI CXX (icpx) compiler." ) diff --git a/var/spack/repos/builtin/packages/anaconda3/package.py b/var/spack/repos/builtin/packages/anaconda3/package.py index 6c7505d41a0163..06cdd527f8f157 100644 --- a/var/spack/repos/builtin/packages/anaconda3/package.py +++ b/var/spack/repos/builtin/packages/anaconda3/package.py @@ -6,7 +6,6 @@ from os.path import split from spack.package import * -from spack.util.environment import EnvironmentModifications class Anaconda3(Package): diff --git a/var/spack/repos/builtin/packages/aocc/package.py b/var/spack/repos/builtin/packages/aocc/package.py index 9d62defb9e2321..242895a3cadf40 100644 --- a/var/spack/repos/builtin/packages/aocc/package.py +++ b/var/spack/repos/builtin/packages/aocc/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from llnl.util import tty from spack.package import * from spack.pkg.builtin.llvm import LlvmDetection diff --git a/var/spack/repos/builtin/packages/aocl-da/package.py b/var/spack/repos/builtin/packages/aocl-da/package.py index cf61b5e2623fa7..53beca51837aa9 100644 --- a/var/spack/repos/builtin/packages/aocl-da/package.py +++ b/var/spack/repos/builtin/packages/aocl-da/package.py @@ -5,7 +5,6 @@ import os from spack.package import * -from spack.util.environment import EnvironmentModifications class AoclDa(CMakePackage): diff --git a/var/spack/repos/builtin/packages/aotriton/package.py b/var/spack/repos/builtin/packages/aotriton/package.py new file mode 100644 index 00000000000000..ce8a53b48c2a42 --- /dev/null +++ b/var/spack/repos/builtin/packages/aotriton/package.py @@ -0,0 +1,66 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class Aotriton(CMakePackage): + """Ahead of Time (AOT) Triton Math Library.""" + + homepage = "https://github.com/ROCm/aotriton" + git = "https://github.com/ROCm/aotriton.git" + url = "https://github.com/ROCm/aotriton/archive/refs/tags/0.8.2b.tar.gz" + + maintainers("afzpatel", "srekolam", "renjithravindrankannath") + + license("MIT") + + version( + "0.8.2b", tag="0.8.2b", commit="b24f43a9771622faa157155568b9a200c3b49e41", submodules=True + ) + version( + "0.8.1b", tag="0.8.1b", commit="3a80554a88ae3b1bcf4b27bc74ad9d7b913b58f6", submodules=True + ) + version("0.8b", tag="0.8b", commit="6f8cbcac8a92775291bb1ba8f514d4beb350baf4", submodules=True) + + generator("ninja") + depends_on("c", type="build") # generated + depends_on("cxx", type="build") # generated + + depends_on("py-setuptools@40.8:", type="build") + depends_on("py-filelock", type=("build", "run")) + + depends_on("cmake@3.26:", type="build") + depends_on("python", type="build") + depends_on("z3", type="link") + depends_on("zlib-api", type="link") + depends_on("xz", type="link") + depends_on("pkgconfig", type="build") + conflicts("^openssl@3.3.0") + + # ROCm dependencies + depends_on("hip", type="build") + depends_on("llvm-amdgpu", type="build") + depends_on("comgr", type="build") + depends_on("hsa-rocr-dev", type="build") + + def patch(self): + if self.spec.satisfies("^hip"): + filter_file( + "/opt/rocm/llvm/bin/ld.lld", + f'{self.spec["llvm-amdgpu"].prefix}/bin/ld.lld', + "third_party/triton/third_party/amd/backend/compiler.py", + string=True, + ) + + def setup_build_environment(self, env): + """Set environment variables used to control the build""" + if self.spec.satisfies("%clang"): + env.set("TRITON_HIP_LLD_PATH", self.spec["llvm-amdgpu"].prefix / bin / ld.lld) + + def cmake_args(self): + args = [] + args.append(self.define("AOTRITON_GPU_BUILD_TIMEOUT", 0)) + return args diff --git a/var/spack/repos/builtin/packages/apcomp/package.py b/var/spack/repos/builtin/packages/apcomp/package.py index 0ca63872df8093..347e34eba234cf 100644 --- a/var/spack/repos/builtin/packages/apcomp/package.py +++ b/var/spack/repos/builtin/packages/apcomp/package.py @@ -6,8 +6,6 @@ import os import socket -import llnl.util.tty as tty - from spack.build_systems.cmake import CMakeBuilder from spack.package import * diff --git a/var/spack/repos/builtin/packages/aperture-photometry/package.py b/var/spack/repos/builtin/packages/aperture-photometry/package.py index d79d623ac0a3ac..3df4934874657f 100644 --- a/var/spack/repos/builtin/packages/aperture-photometry/package.py +++ b/var/spack/repos/builtin/packages/aperture-photometry/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/apfel/package.py b/var/spack/repos/builtin/packages/apfel/package.py index 1bb9f6167d2c46..b229f31ef46ed8 100644 --- a/var/spack/repos/builtin/packages/apfel/package.py +++ b/var/spack/repos/builtin/packages/apfel/package.py @@ -27,6 +27,7 @@ class Apfel(AutotoolsPackage, CMakePackage): version("3.0.6", sha256="7063c9eee457e030b97926ac166cdaedd84625b31397e1dfd01ae47371fb9f61") version("3.0.4", sha256="c7bfae7fe2dc0185981850f2fe6ae4842749339d064c25bf525b4ef412bbb224") + depends_on("c", type="build") depends_on("cxx", type="build") depends_on("fortran", type="build") diff --git a/var/spack/repos/builtin/packages/apple-clang/package.py b/var/spack/repos/builtin/packages/apple-clang/package.py index 491d8d4574d2f2..a4636a9ee0e639 100644 --- a/var/spack/repos/builtin/packages/apple-clang/package.py +++ b/var/spack/repos/builtin/packages/apple-clang/package.py @@ -16,6 +16,8 @@ class AppleClang(BundlePackage, LlvmDetection, CompilerPackage): compiler_languages = ["c", "cxx"] compiler_version_regex = r"^Apple (?:LLVM|clang) version ([^ )]+)" + requires("platform=darwin") + @classmethod def validate_detected_spec(cls, spec, extra_attributes): msg = f'the extra attribute "compilers" must be set for the detected spec "{spec}"' diff --git a/var/spack/repos/builtin/packages/apple-libunwind/package.py b/var/spack/repos/builtin/packages/apple-libunwind/package.py index 31f650442bb34b..09b4a3db95d361 100644 --- a/var/spack/repos/builtin/packages/apple-libunwind/package.py +++ b/var/spack/repos/builtin/packages/apple-libunwind/package.py @@ -5,47 +5,16 @@ from spack.package import * -class AppleLibunwind(Package): - """Placeholder package for Apple's analogue to non-GNU libunwind""" +class AppleLibunwind(BundlePackage): + """This package is intended to be a placeholder for Apple's system-provided, + non-GNU-compatible libunwind library. + """ homepage = "https://opensource.apple.com/source/libunwind/libunwind-35.3/" provides("unwind") - # The 'conflicts' directive only accepts valid spack specs; - # platforms cannot be negated -- 'platform!=darwin' is not a valid - # spec -- so expressing a conflict for any platform that isn't - # Darwin must be expressed by listing a conflict with every - # platform that isn't Darwin/macOS - conflicts("platform=linux") - - # Override the fetcher method to throw a useful error message; - # avoids GitHub issue (#7061) in which the opengl placeholder - # package threw a generic, uninformative error during the `fetch` - # step, - @property - def fetcher(self): - msg = """This package is intended to be a placeholder for Apple's - system-provided, non-GNU-compatible libunwind library. - - Add to your packages.yaml: - - packages: - apple-libunwind: - buildable: False - externals: - - spec: apple-libunwind@35.3 - prefix: /usr - """ - raise InstallError(msg) - - @fetcher.setter # Since fetcher is read-write, must override both - def fetcher(self): - _ = self.fetcher - - def install(self, spec, prefix): - # sanity_check_prefix requires something in the install directory - mkdirp(prefix.lib) + requires("platform=darwin") @property def libs(self): diff --git a/var/spack/repos/builtin/packages/apple-libuuid/package.py b/var/spack/repos/builtin/packages/apple-libuuid/package.py index e376527078bccb..8aed0710ee56db 100644 --- a/var/spack/repos/builtin/packages/apple-libuuid/package.py +++ b/var/spack/repos/builtin/packages/apple-libuuid/package.py @@ -15,8 +15,7 @@ class AppleLibuuid(BundlePackage): provides("uuid") # Only supported on 'platform=darwin' - conflicts("platform=linux") - conflicts("platform=windows") + requires("platform=darwin") @property def headers(self): diff --git a/var/spack/repos/builtin/packages/apptainer/package.py b/var/spack/repos/builtin/packages/apptainer/package.py index 814c886cd9b5df..97b7d512b353df 100644 --- a/var/spack/repos/builtin/packages/apptainer/package.py +++ b/var/spack/repos/builtin/packages/apptainer/package.py @@ -36,7 +36,7 @@ class Apptainer(SingularityBase): checked_by="tgamblin", ) - version("main", branch="main") + version("main", branch="main", get_full_repo=True) # apptainer version uses git describe version("1.3.6", sha256="b5343369e7fdf67572f887d81f8d2b938f099fb39c876d96430d747935960d51") version("1.3.5", sha256="fe1c977da952edf1056915b2df67ae2203ef06065d4e4901a237c902329306b2") version("1.3.4", sha256="c6ccfdd7c967e5c36dde8711f369c4ac669a16632b79fa0dcaf7e772b7a47397") diff --git a/var/spack/repos/builtin/packages/apr-util/package.py b/var/spack/repos/builtin/packages/apr-util/package.py index e1ebe57aaaa39c..b9517ee4c2d163 100644 --- a/var/spack/repos/builtin/packages/apr-util/package.py +++ b/var/spack/repos/builtin/packages/apr-util/package.py @@ -36,6 +36,7 @@ class AprUtil(AutotoolsPackage): depends_on("sqlite", when="+sqlite") depends_on("unixodbc", when="+odbc") depends_on("pkgconfig", type="build", when="+crypto ^openssl~shared") + depends_on("libxcrypt", when="platform=linux") @property def libs(self): diff --git a/var/spack/repos/builtin/packages/aqlprofile/package.py b/var/spack/repos/builtin/packages/aqlprofile/package.py index fc04690419258b..b0769f7129b7fa 100644 --- a/var/spack/repos/builtin/packages/aqlprofile/package.py +++ b/var/spack/repos/builtin/packages/aqlprofile/package.py @@ -8,6 +8,34 @@ from spack.package import * _versions = { + "6.3.2": { + "apt": ( + "bef302bf344c9297f9fb64a4a93f360721a467185bc4fefbeecb307dd956c504", + "https://repo.radeon.com/rocm/apt/6.3.2/pool/main/h/hsa-amd-aqlprofile/hsa-amd-aqlprofile_1.0.0.60302-66~20.04_amd64.deb", + ), + "yum": ( + "1e01de060073cb72a97fcddf0f3b637b48cf89a08b34f2447d010031abc0e099", + "https://repo.radeon.com/rocm/rhel8/6.3.2/main/hsa-amd-aqlprofile-1.0.0.60302-66.el8.x86_64.rpm", + ), + "zyp": ( + "408fb29e09ba59a9e83e8f7d703ba53e1ef3b3acbae1103b2a82d4f87f321752", + "https://repo.radeon.com/rocm/zyp/6.3.2/main/hsa-amd-aqlprofile-1.0.0.60302-sles155.66.x86_64.rpm", + ), + }, + "6.3.1": { + "apt": ( + "76b129345a1a7caa04859fd738e0ba5bfa6f7bc1ad11171f1a7b2d46e0c0b158", + "https://repo.radeon.com/rocm/apt/6.3.1/pool/main/h/hsa-amd-aqlprofile/hsa-amd-aqlprofile_1.0.0.60301-48~20.04_amd64.deb", + ), + "yum": ( + "b5694cdfe4db22bd1172564b28d67f34a369a0ca24770c70e36d08517fa2ce7c", + "https://repo.radeon.com/rocm/rhel8/6.3.1/main/hsa-amd-aqlprofile-1.0.0.60301-48.el8.x86_64.rpm", + ), + "zyp": ( + "9d885380631a5b04444b09f30e0390f5a34e9940759ea16a97dd9f10bcb2fe87", + "https://repo.radeon.com/rocm/zyp/6.3.1/main/hsa-amd-aqlprofile-1.0.0.60301-sles155.48.x86_64.rpm", + ), + }, "6.3.0": { "apt": ( "af03118e2606aeae0da636af17221fe124d5b955ebf40f0e2518f4a427a0c9bc", @@ -260,6 +288,8 @@ class Aqlprofile(Package): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/arborx/package.py b/var/spack/repos/builtin/packages/arborx/package.py index 20dcbe17f192b9..3099e5f11cc8e5 100644 --- a/var/spack/repos/builtin/packages/arborx/package.py +++ b/var/spack/repos/builtin/packages/arborx/package.py @@ -110,22 +110,15 @@ class Arborx(CMakePackage, CudaPackage, ROCmPackage): conflicts("~serial", when="+trilinos") def cmake_args(self): - spec = self.spec - - if "+trilinos" in spec: - kokkos_spec = spec["trilinos"] - else: - kokkos_spec = spec["kokkos"] - + kokkos_pkg = self["trilinos"] if self.spec.satisfies("+trilinos") else self["kokkos"] options = [ - f"-DKokkos_ROOT={kokkos_spec.prefix}", + self.define("Kokkos_ROOT", kokkos_pkg.prefix), self.define_from_variant("ARBORX_ENABLE_MPI", "mpi"), ] - - if spec.satisfies("+cuda"): - options.append(f"-DCMAKE_CXX_COMPILER={kokkos_spec.kokkos_cxx}") - if spec.satisfies("+rocm"): - options.append("-DCMAKE_CXX_COMPILER=%s" % spec["hip"].hipcc) + if self.spec.satisfies("+cuda"): + options.append(self.define("CMAKE_CXX_COMPILER", kokkos_pkg.kokkos_cxx)) + if self.spec.satisfies("+rocm"): + options.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)) return options diff --git a/var/spack/repos/builtin/packages/arkouda/makefile-fpic-2024.06.21.patch b/var/spack/repos/builtin/packages/arkouda/makefile-fpic-2024.06.21.patch new file mode 100644 index 00000000000000..ef88b1209fd9df --- /dev/null +++ b/var/spack/repos/builtin/packages/arkouda/makefile-fpic-2024.06.21.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index e607bb3cb..a4752dff6 100644 +--- a/Makefile ++++ b/Makefile +@@ -203,7 +203,7 @@ endif + + .PHONY: compile-arrow-cpp + compile-arrow-cpp: +- $(CHPL_CXX) -O3 -std=c++17 -c $(ARROW_CPP) -o $(ARROW_O) $(INCLUDE_FLAGS) $(ARROW_SANITIZE) ++ $(CHPL_CXX) -fPIC -O3 -std=c++17 -c $(ARROW_CPP) -o $(ARROW_O) $(INCLUDE_FLAGS) $(ARROW_SANITIZE) + + $(ARROW_O): $(ARROW_CPP) $(ARROW_H) + make compile-arrow-cpp diff --git a/var/spack/repos/builtin/packages/arkouda/makefile-fpic-2024.10.02.patch b/var/spack/repos/builtin/packages/arkouda/makefile-fpic-2024.10.02.patch new file mode 100644 index 00000000000000..48beb345b565d4 --- /dev/null +++ b/var/spack/repos/builtin/packages/arkouda/makefile-fpic-2024.10.02.patch @@ -0,0 +1,23 @@ +diff --git a/Makefile b/Makefile +index 13a9c4be1..099896ec9 100644 +--- a/Makefile ++++ b/Makefile +@@ -236,15 +236,15 @@ compile-arrow-cpp: + + .PHONY: compile-arrow-write + compile-arrow-write: +- $(CHPL_CXX) -O3 -std=c++17 -c $(ARROW_WRITE_CPP) -o $(ARROW_WRITE_O) $(INCLUDE_FLAGS) $(ARROW_SANITIZE) ++ $(CHPL_CXX) -O3 -std=c++17 -fPIC -c $(ARROW_WRITE_CPP) -o $(ARROW_WRITE_O) $(INCLUDE_FLAGS) $(ARROW_SANITIZE) + + .PHONY: compile-arrow-read + compile-arrow-read: +- $(CHPL_CXX) -O3 -std=c++17 -c $(ARROW_READ_CPP) -o $(ARROW_READ_O) $(INCLUDE_FLAGS) $(ARROW_SANITIZE) ++ $(CHPL_CXX) -O3 -std=c++17 -fPIC -c $(ARROW_READ_CPP) -o $(ARROW_READ_O) $(INCLUDE_FLAGS) $(ARROW_SANITIZE) + + .PHONY: compile-arrow-util + compile-arrow-util: +- $(CHPL_CXX) -O3 -std=c++17 -c $(ARROW_UTIL_CPP) -o $(ARROW_UTIL_O) $(INCLUDE_FLAGS) $(ARROW_SANITIZE) ++ $(CHPL_CXX) -O3 -std=c++17 -fPIC -c $(ARROW_UTIL_CPP) -o $(ARROW_UTIL_O) $(INCLUDE_FLAGS) $(ARROW_SANITIZE) + + $(ARROW_UTIL_O): $(ARROW_UTIL_CPP) $(ARROW_UTIL_H) + make compile-arrow-util diff --git a/var/spack/repos/builtin/packages/arkouda/package.py b/var/spack/repos/builtin/packages/arkouda/package.py new file mode 100644 index 00000000000000..f528ada2b80b52 --- /dev/null +++ b/var/spack/repos/builtin/packages/arkouda/package.py @@ -0,0 +1,107 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * +from spack.util.environment import set_env + + +class Arkouda(MakefilePackage): + """Arkouda is a NumPy-like library for distributed data with a focus on + large-scale data science applications.""" + + homepage = "https://github.com/Bears-R-Us/arkouda" + + # Arkouda does not have a current PyPI package, so we use the GitHub tarball + url = "https://github.com/Bears-R-Us/arkouda/archive/refs/tags/v2024.10.02.tar.gz" + git = "https://github.com/Bears-R-Us/arkouda.git" + + # See https://spdx.org/licenses/ for a list. + license("MIT") + + # A list of GitHub accounts to notify when the package is updated. + # TODO: add arkouda devs github account + maintainers("arezaii") + + version("master", branch="master") + + version( + "2024.10.02", sha256="00671a89a08be57ff90a94052f69bfc6fe793f7b50cf9195dd7ee794d6d13f23" + ) + version( + "2024.06.21", sha256="ab7f753befb3a0b8e27a3d28f3c83332d2c6ae49678877a7456f0fcfe42df51c" + ) + + variant( + "distributed", + default=False, + description="Build Arkouda for multi-locale execution on a cluster or supercomputer", + ) + + depends_on("chapel@2.1: +hdf5 +zmq", type=("build", "link", "run", "test")) + depends_on("cmake@3.13.4:", type="build") + depends_on("python@3.9:", type=("build", "link", "run", "test")) + depends_on("libzmq@4.2.5:", type=("build", "link", "run", "test")) + depends_on("hdf5+hl~mpi", type=("build", "link", "run", "test")) + depends_on("libiconv", type=("build", "link", "run", "test")) + depends_on("libidn2", type=("build", "link", "run", "test")) + depends_on( + "arrow +parquet +snappy +zlib +brotli +bz2 +lz4 +zstd", + type=("build", "link", "run", "test"), + ) + + requires("^chapel comm=none", when="~distributed") + requires("^chapel +python-bindings", when="@2024.10.02:") + requires( + "^chapel comm=gasnet", + "^chapel comm=ugni", + "^chapel comm=ofi", + policy="one_of", + when="+distributed", + ) + + # Some systems need explicit -fPIC flag when building the Arrow functions + patch("makefile-fpic-2024.06.21.patch", when="@2024.06.21") + patch("makefile-fpic-2024.10.02.patch", when="@2024.10.02:") + + sanity_check_is_file = [join_path("bin", "arkouda_server")] + + def check(self): + # skip b/c we need the python client + pass + + # override the default edit method to apply the patch + def edit(self, spec, prefix): + self.update_makefile_paths(spec, prefix) + + def update_makefile_paths(self, spec, prefix): + # add to the Makefile.paths file for all of the dependencies installed by spack + # in the form $(eval $(call add-path,)) + with open("Makefile.paths", "w") as f: + f.write("$(eval $(call add-path,{0}))\n".format(spec["hdf5"].prefix)) + f.write("$(eval $(call add-path,{0}))\n".format(spec["libzmq"].prefix)) + f.write("$(eval $(call add-path,{0}))\n".format(spec["arrow"].prefix)) + f.write("$(eval $(call add-path,{0}))\n".format(spec["libiconv"].prefix)) + f.write("$(eval $(call add-path,{0}))\n".format(spec["libidn2"].prefix)) + + def build(self, spec, prefix): + # Detect distributed builds and skip the dependency checks built into + # the Arkouda Makefile. These checks will try to spawn multiple jobs which may + # cause the build to fail in situations where the user is constrained + # to a limited number of simultaneous jobs. + if spec.satisfies("+distributed"): + with set_env(ARKOUDA_SKIP_CHECK_DEPS="1"): + tty.warn("Distributed build detected. Skipping dependency checks") + make() + else: + make() + + # Arkouda does not have an install target in its Makefile + def install(self, spec, prefix): + mkdir(prefix.bin) + install("arkouda_server", prefix.bin) + # Arkouda can have two executables depending on if Chapel is compiled in + # single-locale or multi-locale mode + if spec.satisfies("+distributed"): + install("arkouda_server_real", prefix.bin) diff --git a/var/spack/repos/builtin/packages/armadillo/package.py b/var/spack/repos/builtin/packages/armadillo/package.py index 9087449faf16e5..c6318d499e901c 100644 --- a/var/spack/repos/builtin/packages/armadillo/package.py +++ b/var/spack/repos/builtin/packages/armadillo/package.py @@ -16,6 +16,7 @@ class Armadillo(CMakePackage): license("Apache-2.0") + version("14.2.3", sha256="fc70c3089a8d2bb7f2510588597d4b35b4323f6d4be5db5c17c6dba20ab4a9cc") version("14.2.2", sha256="3054c8e63db3abdf1a5c8f9fdb7e6b4ad833f9bcfb58324c0ff86de0784c70e0") version("14.0.3", sha256="ebd6215eeb01ee412fed078c8a9f7f87d4e1f6187ebcdc1bc09f46095a4f4003") version("14.0.2", sha256="248e2535fc092add6cb7dea94fc86ae1c463bda39e46fd82d2a7165c1c197dff") diff --git a/var/spack/repos/builtin/packages/ascent/package.py b/var/spack/repos/builtin/packages/ascent/package.py index ebca681c922381..9de2d4a9a14ffb 100644 --- a/var/spack/repos/builtin/packages/ascent/package.py +++ b/var/spack/repos/builtin/packages/ascent/package.py @@ -9,8 +9,6 @@ import sys from os import environ as env -import llnl.util.tty as tty - from spack.package import * @@ -150,6 +148,14 @@ class Ascent(CMakePackage, CudaPackage): # https://github.com/Alpine-DAV/ascent/pull/1123 patch("ascent-find-raja-pr1123.patch", when="@0.9.0") + # patch for fix typo in coord_type + # https://github.com/Alpine-DAV/ascent/pull/1408 + patch( + "https://github.com/Alpine-DAV/ascent/pull/1408.patch?full_index=1", + when="@0.9.3 %oneapi@2025:", + sha256="7de7f51e57f3d743c39ad80d8783a4eb482be1def51eb2d3f9259246c661f164", + ) + ########################################################################## # package dependencies ########################################################################### @@ -470,6 +476,9 @@ def hostconfig(self): if cflags: cfg.write(cmake_cache_entry("CMAKE_C_FLAGS", cflags)) cxxflags = cppflags + " ".join(spec.compiler_flags["cxxflags"]) + if spec.satisfies("%oneapi@2025:"): + cxxflags += "-Wno-error=missing-template-arg-list-after-template-kw " + cxxflags += "-Wno-missing-template-arg-list-after-template-kw" if cxxflags: cfg.write(cmake_cache_entry("CMAKE_CXX_FLAGS", cxxflags)) fflags = " ".join(spec.compiler_flags["fflags"]) diff --git a/var/spack/repos/builtin/packages/asio/package.py b/var/spack/repos/builtin/packages/asio/package.py index 532446a07a0ba9..b13b6577ab5a00 100644 --- a/var/spack/repos/builtin/packages/asio/package.py +++ b/var/spack/repos/builtin/packages/asio/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * @@ -18,6 +18,7 @@ class Asio(AutotoolsPackage): license("BSL-1.0") # As uneven minor versions of asio are not considered stable, they wont be added anymore + version("1.32.0", sha256="f1b94b80eeb00bb63a3c8cef5047d4e409df4d8a3fe502305976965827d95672") version("1.30.2", sha256="755bd7f85a4b269c67ae0ea254907c078d408cce8e1a352ad2ed664d233780e8") version("1.30.1", sha256="94b121cc2016680f2314ef58eadf169c2d34fff97fba01df325a192d502d3a58") version("1.30.0", sha256="df6674bd790842b3a7422e9cc4c5d3212ac268cebdb5d38f3e783e4918313c7b") diff --git a/var/spack/repos/builtin/packages/astral/package.py b/var/spack/repos/builtin/packages/astral/package.py index f81d044ff46657..789ab126cab98c 100644 --- a/var/spack/repos/builtin/packages/astral/package.py +++ b/var/spack/repos/builtin/packages/astral/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/autodock-vina/package.py b/var/spack/repos/builtin/packages/autodock-vina/package.py index 77cfb0aa948a86..78a1469104cb77 100644 --- a/var/spack/repos/builtin/packages/autodock-vina/package.py +++ b/var/spack/repos/builtin/packages/autodock-vina/package.py @@ -16,6 +16,7 @@ class AutodockVina(MakefilePackage): license("Apache-2.0") + version("1.2.6", sha256="9a3b888feaab511e3188b012bde1d41be0d72b54aa9516465b383f31dc394743") version("1.2.3", sha256="22f85b2e770b6acc363429153b9551f56e0a0d88d25f747a40d2f55a263608e0") version("1.2.2", sha256="b9c28df478f90d64dbbb5f4a53972bddffffb017b7bb58581a1a0034fff1b400") version("1.2.1", sha256="2d8d9871a5a95265c03c621c0584d9f06b202303116e6c87e23c935f7b694f74") @@ -33,7 +34,12 @@ class AutodockVina(MakefilePackage): when="@1.1.2", ) depends_on( - "boost@1.54.0: +filesystem +program_options +serialization +system +thread", when="@1.2.0:" + "boost@1.54.0:1.82.0 +filesystem +program_options +serialization +system +thread", + when="@1.2.0:1.2.3", + ) + depends_on( + "boost@1.54.0:1.86.0 +filesystem +program_options +serialization +system +thread", + when="@1.2.6:", ) @property diff --git a/var/spack/repos/builtin/packages/bash/package.py b/var/spack/repos/builtin/packages/bash/package.py index cbd11cac59c155..2f46b4fec71af1 100644 --- a/var/spack/repos/builtin/packages/bash/package.py +++ b/var/spack/repos/builtin/packages/bash/package.py @@ -23,6 +23,10 @@ class Bash(AutotoolsPackage, GNUMirrorPackage): depends_on("c", type="build") # generated + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("libtool", type="build") + depends_on("ncurses") depends_on("readline@8.2:", when="@5.2:") depends_on("readline@5.0:") diff --git a/var/spack/repos/builtin/packages/bcftools/package.py b/var/spack/repos/builtin/packages/bcftools/package.py index 19b47155576783..94565417ca05a5 100644 --- a/var/spack/repos/builtin/packages/bcftools/package.py +++ b/var/spack/repos/builtin/packages/bcftools/package.py @@ -19,6 +19,8 @@ class Bcftools(AutotoolsPackage): license("GPL-3.0-or-later") + version("1.21", sha256="528a4cc1d3555368db75a700b22a3c95da893fd1827f6d304716dfd45ea4e282") + version("1.20", sha256="312b8329de5130dd3a37678c712951e61e5771557c7129a70a327a300fda8620") version("1.19", sha256="782b5f1bc690415192231e82213b3493b047f45e630dc8ef6f154d6126ab3e68") version("1.18", sha256="d9b9d36293e4cc62ab7473aa2539389d4e1de79b1a927d483f6e91f3c3ceac7e") version("1.17", sha256="01f75d8e701d85b2c759172412009cc04f29b61616ace2fa75116123de4596cc") @@ -58,6 +60,9 @@ class Bcftools(AutotoolsPackage): depends_on("perl", when="@1.8:~perl-filters", type="run") depends_on("perl", when="@1.8:+perl-filters", type=("build", "run")) + depends_on("htslib") + depends_on("htslib@1.21", when="@1.21") + depends_on("htslib@1.20", when="@1.20") depends_on("htslib@1.19", when="@1.19") depends_on("htslib@1.18", when="@1.18") depends_on("htslib@1.17", when="@1.17") diff --git a/var/spack/repos/builtin/packages/bcl2fastq2/package.py b/var/spack/repos/builtin/packages/bcl2fastq2/package.py index fb9b47022fd3cc..1e9a97e8b2f0ba 100644 --- a/var/spack/repos/builtin/packages/bcl2fastq2/package.py +++ b/var/spack/repos/builtin/packages/bcl2fastq2/package.py @@ -5,8 +5,6 @@ import glob import os -import llnl.util.tty as tty - from spack.package import * from spack.pkg.builtin.boost import Boost diff --git a/var/spack/repos/builtin/packages/beagle/package.py b/var/spack/repos/builtin/packages/beagle/package.py index 1ad102805f5d4a..2a166b2e3c576a 100644 --- a/var/spack/repos/builtin/packages/beagle/package.py +++ b/var/spack/repos/builtin/packages/beagle/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/berkeleygw/package.py b/var/spack/repos/builtin/packages/berkeleygw/package.py index 8fa3fe12f45809..2c24029c883e4f 100644 --- a/var/spack/repos/builtin/packages/berkeleygw/package.py +++ b/var/spack/repos/builtin/packages/berkeleygw/package.py @@ -118,7 +118,7 @@ class Berkeleygw(MakefilePackage): def edit(self, spec, prefix): # archive is a tar file, despite the .gz expension tar = which("tar") - tar("-x", "-f", self.stage.archive_file, "--strip-components=1") + tar("-x", "-o", "-f", self.stage.archive_file, "--strip-components=1") # get generic arch.mk template if spec.satisfies("+mpi"): diff --git a/var/spack/repos/builtin/packages/bfs/package.py b/var/spack/repos/builtin/packages/bfs/package.py index 45308b57069056..4555d444071756 100644 --- a/var/spack/repos/builtin/packages/bfs/package.py +++ b/var/spack/repos/builtin/packages/bfs/package.py @@ -6,15 +6,21 @@ class Bfs(MakefilePackage): - """A breadth-first version of the UNIX find command.""" + """BFS is a breadth-first variant of the UNIX find command that offers + consistent, intuitive behavior and improved performance.""" homepage = "https://github.com/tavianator/bfs" url = "https://github.com/tavianator/bfs/archive/refs/tags/3.0.1.tar.gz" + git = "https://github.com/tavianator/bfs.git" maintainers("alecbcs") license("0BSD") + sanity_check_is_file = ["bin/bfs"] + + version("main", branch="main") + version("4.0.5", sha256="f7d9ebff00d9a010a5d6cc9b7bf1933095d7e5c0b11a8ec48c96c7ed8f993e5f") version("4.0.4", sha256="209da9e9f43d8fe30fd689c189ea529e9d6b5358ce84a63a44721003aea3e1ca") version("4.0.1", sha256="8117b76b0a967887278a11470cbfa9e7aeae98f11a7eeb136f456ac462e5ba23") version("3.1.1", sha256="d73f345c1021e0630e0db930a3fa68dd1f968833037d8471ee1096e5040bf91b") @@ -23,12 +29,16 @@ class Bfs(MakefilePackage): version("3.0.2", sha256="d3456a9aeecc031064db0dbe012e55a11eb97be88d0ab33a90e570fe66457f92") version("3.0.1", sha256="a38bb704201ed29f4e0b989fb2ab3791ca51c3eff90acfc31fff424579bbf962") + # Build dependencies depends_on("c", type="build") + # System dependencies depends_on("acl", when="platform=linux") depends_on("attr", when="platform=linux") depends_on("libcap", when="platform=linux") - depends_on("liburing", when="platform=linux @3.1:") + depends_on("liburing@2.4:", when="platform=linux @3.1:") + + # Required dependencies depends_on("oniguruma") @run_before("build", when="@4:") @@ -39,6 +49,7 @@ def configure(self): configure_exe(*args) def install(self, spec, prefix): + """Install the package.""" if spec.satisfies("@:3"): make("install", f"PREFIX={prefix}") else: diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py index 7381c1bb9223f7..2662f370ac6440 100644 --- a/var/spack/repos/builtin/packages/binutils/package.py +++ b/var/spack/repos/builtin/packages/binutils/package.py @@ -91,8 +91,8 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): deprecated=True, ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("plugins", default=True, description="enable plugins, needed for gold linker") # When you build ld.gold you automatically get ld, even when you add the @@ -126,6 +126,12 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): description="Enable debug section compression by default in ld, gas, gold.", when="@2.26:", ) + variant( + "debuginfod", + default=False, + description="Enable debuginfod HTTP server support for readelf and objdump", + when="@2.34:", + ) patch("cr16.patch", when="@:2.29.1") patch("update_symbol-2.26.patch", when="@2.26") @@ -144,12 +150,15 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): depends_on("libtool", when="@2.39") # compression libs for debug symbols. - # pkg-config is used to find zstd in gas/configure - depends_on("pkgconfig", type="build") depends_on("zstd@1.4.0:", when="@2.40:") depends_on("zlib-api") + depends_on("elfutils+debuginfod", when="+debuginfod") + + # pkg-config is used to locate zstd, libdebuginfod + depends_on("pkgconfig", type="build") depends_on("diffutils", type="build") + depends_on("gettext", when="+nls") # PGO runs tests, which requires `runtest` from dejagnu @@ -170,8 +179,11 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage): with when("platform=darwin"): conflicts("+gold", msg="Binutils cannot build linkers on macOS") + # 2.41 doesn't seem to have any problems. conflicts( - "libs=shared", when="@2.37:2.40", msg="https://github.com/spack/spack/issues/35817" + "libs=shared", + when="@2.37:2.40,2.42:", + msg="https://github.com/spack/spack/issues/35817", ) conflicts( @@ -293,17 +305,18 @@ def configure_args(self): "--enable-targets={}".format(targets), "--with-sysroot=/", "--with-system-zlib", + *self.enable_or_disable("gas"), + *self.enable_or_disable("gold"), + *self.enable_or_disable("gprofng"), + *self.enable_or_disable("install-libiberty", variant="libiberty"), + *self.enable_or_disable("interwork"), + *self.enable_or_disable("ld"), + *self.enable_or_disable("libs"), + *self.enable_or_disable("lto"), + *self.enable_or_disable("nls"), + *self.enable_or_disable("plugins"), + *self.with_or_without("debuginfod"), ] - args += self.enable_or_disable("gas") - args += self.enable_or_disable("gold") - args += self.enable_or_disable("gprofng") - args += self.enable_or_disable("install-libiberty", variant="libiberty") - args += self.enable_or_disable("interwork") - args += self.enable_or_disable("ld") - args += self.enable_or_disable("libs") - args += self.enable_or_disable("lto") - args += self.enable_or_disable("nls") - args += self.enable_or_disable("plugins") if self.spec.satisfies("+pgo"): args.append("--enable-pgo-build=lto") else: diff --git a/var/spack/repos/builtin/packages/bioconductor-dupradar/package.py b/var/spack/repos/builtin/packages/bioconductor-dupradar/package.py deleted file mode 100644 index 150af07e528b4b..00000000000000 --- a/var/spack/repos/builtin/packages/bioconductor-dupradar/package.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class BioconductorDupradar(RPackage): - """Assessment of duplication rates in RNA-Seq datasets""" - - homepage = "https://bioconductor.org/packages/3.16/bioc/html/dupRadar.html" - url = "https://bioconductor.org/packages/release/bioc/src/contrib/dupRadar_1.30.0.tar.gz" - maintainers("pabloaledo") - - bioc = "dupradar" - - version( - "1.30.0", - sha256="a299d7a4578047dfc19237e34255b0f50f70ce41d29762ef9f5a7741ba35aa3d", - deprecated=True, - ) - - depends_on("r-kernsmooth") - depends_on("subread") - depends_on("bioconductor-rsubread") diff --git a/var/spack/repos/builtin/packages/bioconductor-ebseq/package.py b/var/spack/repos/builtin/packages/bioconductor-ebseq/package.py deleted file mode 100644 index 7cb12de29f9065..00000000000000 --- a/var/spack/repos/builtin/packages/bioconductor-ebseq/package.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class BioconductorEbseq(RPackage): - """An R package for gene and isoform differential expression analysis of RNA-seq data. - - R/EBSeq is an R package for identifying genes and isoforms differentially - expressed (DE) across two or more biological conditions in an RNA-seq - experiment. Details can be found in Leng et al., 2013. It provides the syntax - required for identifying DE genes and isoforms in a two-group RNA-seq - experiment as well for identifying DE genes across more than two conditions - (the commands for identifying DE isoforms across more than two conditions - are the same as those required for gene-level analysis).""" - - homepage = "https://www.biostat.wisc.edu/~kendzior/EBSEQ/" - url = "https://bioconductor.org/packages/release/bioc/src/contrib/EBSeq_1.40.0.tar.gz" - maintainers("pabloaledo") - - bioc = "ebseq" - - version( - "1.40.0", - sha256="a5d3a88743d61062c6d68a426b19c53a4afd2fa216abc884d42c187780994378", - deprecated=True, - ) - - depends_on("r-blockmodeling") - depends_on("r-gplots") - depends_on("r-testthat") diff --git a/var/spack/repos/builtin/packages/bioconductor-rsubread/package.py b/var/spack/repos/builtin/packages/bioconductor-rsubread/package.py deleted file mode 100644 index 793583aaeca8a7..00000000000000 --- a/var/spack/repos/builtin/packages/bioconductor-rsubread/package.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class BioconductorRsubread(RPackage): - """Mapping, quantification and variant analysis of sequencing data""" - - homepage = "https://bioconductor.org/packages/3.16/bioc/html/Rsubread.html" - url = "https://bioconductor.org/packages/release/bioc/src/contrib/Rsubread_2.14.2.tar.gz" - - bioc = "rsubread" - - depends_on("r-matrix") - depends_on("zlib-api") - - version( - "2.14.2", - sha256="ac8be0fad0eb2743443e3a60a9a94eec78c746638aaccca70e7166d034dcebb5", - deprecated=True, - ) diff --git a/var/spack/repos/builtin/packages/bioconductor-tximeta/package.py b/var/spack/repos/builtin/packages/bioconductor-tximeta/package.py deleted file mode 100644 index a79d8a138e1f54..00000000000000 --- a/var/spack/repos/builtin/packages/bioconductor-tximeta/package.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - - -class BioconductorTximeta(RPackage): - """Transcript Quantification Import with Automatic Metadata - - Transcript quantification import from Salmon and alevin with automatic - attachment of transcript ranges and release information, and other associated - metadata. De novo transcriptomes can be linked to the appropriate sources with - linkedTxomes and shared for computational reproducibility.""" - - homepage = "https://bioconductor.org/packages/release/bioc/html/tximeta.html" - url = "https://bioconductor.org/packages/release/bioc/src/contrib/tximeta_1.18.1.tar.gz" - - bioc = "tximeta" - - version( - "1.18.1", - sha256="ee486fc4b2352e2998a3c0c2064449ebcf09b5815f982597ea58311dc8064408", - deprecated=True, - ) - - depends_on("r", type=("build", "run")) - depends_on("r-annotationdbi") - depends_on("r-annotationhub") - depends_on("r-biocfilecache") - depends_on("r-biostrings") - depends_on("r-ensembldb") - depends_on("r-genomeinfodb") - depends_on("r-genomicfeatures") - depends_on("r-genomicranges") - depends_on("r-iranges") - depends_on("r-s4vectors") - depends_on("r-summarizedexperiment") - depends_on("r-tximport") - depends_on("r-jsonlite") - depends_on("r-matrix") - depends_on("r-tibble") diff --git a/var/spack/repos/builtin/packages/bohrium/package.py b/var/spack/repos/builtin/packages/bohrium/package.py index 83d771c8d4702f..c40c64d8add6a1 100644 --- a/var/spack/repos/builtin/packages/bohrium/package.py +++ b/var/spack/repos/builtin/packages/bohrium/package.py @@ -4,8 +4,6 @@ import os -import llnl.util.tty as tty - from spack.package import * from spack.package_test import compare_output from spack.pkg.builtin.boost import Boost diff --git a/var/spack/repos/builtin/packages/bpp-popgen/package.py b/var/spack/repos/builtin/packages/bpp-popgen/package.py index 643fda208f85b2..4de9ad75cc984f 100644 --- a/var/spack/repos/builtin/packages/bpp-popgen/package.py +++ b/var/spack/repos/builtin/packages/bpp-popgen/package.py @@ -8,7 +8,7 @@ class BppPopgen(CMakePackage): """The Bio++ Population Genetics Library""" - homepage = "https://https://github.com/BioPP/bpp-popgen" + homepage = "https://github.com/BioPP/bpp-popgen" url = "https://github.com/BioPP/bpp-popgen/archive/refs/tags/v2.4.1.tar.gz" maintainers("snehring") diff --git a/var/spack/repos/builtin/packages/bref3/package.py b/var/spack/repos/builtin/packages/bref3/package.py index 0079657001855c..0b40ca527c119b 100644 --- a/var/spack/repos/builtin/packages/bref3/package.py +++ b/var/spack/repos/builtin/packages/bref3/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/bubblewrap/package.py b/var/spack/repos/builtin/packages/bubblewrap/package.py index 588feab3180e0b..3785f7ac44fe55 100644 --- a/var/spack/repos/builtin/packages/bubblewrap/package.py +++ b/var/spack/repos/builtin/packages/bubblewrap/package.py @@ -2,10 +2,12 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import spack.build_systems.autotools +import spack.build_systems.meson from spack.package import * -class Bubblewrap(AutotoolsPackage): +class Bubblewrap(AutotoolsPackage, MesonPackage): """Unprivileged sandboxing tool""" homepage = "https://github.com/containers/bubblewrap" @@ -16,8 +18,18 @@ class Bubblewrap(AutotoolsPackage): license("LGPL-2.0-or-later") + build_system( + conditional("autotools", when="@:0.10"), + conditional("meson", when="@0.6:"), + default="meson", + ) + + version("0.11.0", sha256="988fd6b232dafa04b8b8198723efeaccdb3c6aa9c1c7936219d5791a8b7a8646") + version("0.10.0", sha256="65d92cf44a63a51e1b7771f70c05013dce5bd6b0b2841c4b4be54b0c45565471") + version("0.9.0", sha256="c6347eaced49ac0141996f46bba3b089e5e6ea4408bc1c43bab9f2d05dd094e1") version("0.8.0", sha256="957ad1149db9033db88e988b12bcebe349a445e1efc8a9b59ad2939a113d333a") version("0.7.0", sha256="764ab7100bd037ea53d440d362e099d7a425966bc62d1f00ab26b8fbb882a9dc") + version("0.6.3", sha256="d8cab8943a36cd1bc1b8c63596c6ef6b29b12883d90ed9b14a969795ac60ddef") version("0.6.2", sha256="8a0ec802d1b3e956c5bb0a40a81c9ce0b055a31bf30a8efa547433603b8af20b") version("0.6.1", sha256="9609c7dc162bc68abc29abfab566934fdca37520a15ed01b675adcf3a4303282") version("0.6.0", sha256="11393cf2058f22e6a6c6e9cca3c85ff4c4239806cb28fee657c62a544df35693") @@ -27,10 +39,29 @@ class Bubblewrap(AutotoolsPackage): version("0.3.3", sha256="c6a45f51794a908b76833b132471397a7413f07620af08e76c273d9f7b364dff") version("0.3.1", sha256="deca6b608c54df4be0669b8bb6d254858924588e9f86e116eb04656a3b6d4bf8") - depends_on("c", type="build") # generated - - def configure_args(self): - return ["--disable-sudo", "--disable-man", "--without-bash-completion-dir"] + depends_on("c", type="build") + with when("build_system=autotools"): + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("libtool", type="build") + with when("build_system=meson"): + depends_on("meson@0.49:", type="build") depends_on("pkgconfig", type="build") - depends_on("libcap") + depends_on("libcap", type="link") + + +class MesonBuilder(spack.build_systems.meson.MesonBuilder): + def meson_args(self): + return ["-Dman=disabled", "-Dselinux=disabled"] + + +class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder): + def configure_args(self): + return [ + "--disable-sudo", + "--disable-man", + "--disable-selinux", + "--with-bash-completion-dir=" + + join_path(self.spec.prefix, "share", "bash-completion", "completions"), + ] diff --git a/var/spack/repos/builtin/packages/ca-certificates-mozilla/package.py b/var/spack/repos/builtin/packages/ca-certificates-mozilla/package.py index f1874e236f7ac3..108fdbbb0cce55 100644 --- a/var/spack/repos/builtin/packages/ca-certificates-mozilla/package.py +++ b/var/spack/repos/builtin/packages/ca-certificates-mozilla/package.py @@ -14,116 +14,97 @@ class CaCertificatesMozilla(Package): maintainers("haampie") version( - "2023-05-30", - sha256="5fadcae90aa4ae041150f8e2d26c37d980522cdb49f923fc1e1b5eb8d74e71ad", - expand=False, - ) - version( - "2023-01-10", - sha256="fb1ecd641d0a02c01bc9036d513cb658bbda62a75e246bedbc01764560a639f0", - expand=False, - ) - version( - "2022-10-11", - sha256="2cff03f9efdaf52626bd1b451d700605dc1ea000c5da56bd0fc59f8f43071040", - expand=False, - ) - version( - "2022-07-19", - sha256="6ed95025fba2aef0ce7b647607225745624497f876d74ef6ec22b26e73e9de77", - expand=False, - ) - version( - "2022-04-26", - sha256="08df40e8f528ed283b0e480ba4bcdbfdd2fdcf695a7ada1668243072d80f8b6f", - expand=False, - ) - version( - "2022-03-29", - sha256="1979e7fe618c51ed1c9df43bba92f977a0d3fe7497ffa2a5e80dfc559a1e5a29", - expand=False, - ) - version( - "2022-03-18", - sha256="2d0575e481482551a6a4f9152e7d2ab4bafaeaee5f2606edb829c2fdb3713336", - expand=False, - ) - version( - "2022-02-01", - sha256="1d9195b76d2ea25c2b5ae9bee52d05075244d78fcd9c58ee0b6fac47d395a5eb", - expand=False, - ) - version( - "2021-10-26", - sha256="ae31ecb3c6e9ff3154cb7a55f017090448f88482f0e94ac927c0c67a1f33b9cf", - expand=False, - ) - version( - "2021-09-30", - sha256="f524fc21859b776e18df01a87880efa198112214e13494275dbcbd9bcb71d976", - expand=False, - ) - version( - "2021-07-05", - sha256="a3b534269c6974631db35f952e8d7c7dbf3d81ab329a232df575c2661de1214a", - expand=False, - ) - version( - "2021-05-25", - sha256="3a32ad57e7f5556e36ede625b854057ac51f996d59e0952c207040077cbe48a9", - expand=False, - ) - version( - "2021-04-13", - sha256="533610ad2b004c1622a40622f86ced5e89762e1c0e4b3ae08b31b240d863e91f", - expand=False, - ) - version( - "2021-01-19", - sha256="e010c0c071a2c79a76aa3c289dc7e4ac4ed38492bfda06d766a80b707ebd2f29", - expand=False, - ) - version( - "2020-12-08", - sha256="313d562594ebd07846ad6b840dd18993f22e0f8b3f275d9aacfae118f4f00fb7", - expand=False, - ) - version( - "2020-10-14", - sha256="bb28d145ed1a4ee67253d8ddb11268069c9dafe3db25a9eee654974c4e43eee5", - expand=False, - ) - version( - "2020-07-22", - sha256="2782f0f8e89c786f40240fc1916677be660fb8d8e25dede50c9f6f7b0c2c2178", - expand=False, - ) - version( - "2020-06-24", - sha256="726889705b00f736200ed7999f7a50021b8735d53228d679c4e6665aa3b44987", - expand=False, - ) - version( - "2020-01-01", - sha256="adf770dfd574a0d6026bfaa270cb6879b063957177a991d453ff1d302c02081f", - expand=False, - ) - version( - "2019-11-27", - sha256="0d98a1a961aab523c9dc547e315e1d79e887dea575426ff03567e455fc0b66b4", - expand=False, - ) - version( - "2019-10-16", - sha256="5cd8052fcf548ba7e08899d8458a32942bf70450c9af67a0850b4c711804a2e4", - expand=False, - ) - version( - "2019-08-28", - sha256="38b6230aa4bee062cd34ee0ff6da173250899642b1937fc130896290b6bd91e3", + "2024-12-31", + sha256="a3f328c21e39ddd1f2be1cea43ac0dec819eaa20a90425d7da901a11531b3aa5", expand=False, ) + with default_args(deprecated=True, expand=False): + version( + "2024-11-26", sha256="bb1782d281fe60d4a2dcf41bc229abe3e46c280212597d4abcc25bddf667739b" + ) + version( + "2024-09-24", sha256="189d3cf6d103185fba06d76c1af915263c6d42225481a1759e853b33ac857540" + ) + version( + "2024-07-02", sha256="1bf458412568e134a4514f5e170a328d11091e071c7110955c9884ed87972ac9" + ) + version( + "2024-03-11", sha256="1794c1d4f7055b7d02c2170337b61b48a2ef6c90d77e95444fd2596f4cac609f" + ) + version( + "2023-12-12", sha256="ccbdfc2fe1a0d7bbbb9cc15710271acf1bb1afe4c8f1725fe95c4c7733fcbe5a" + ) + version( + "2023-08-22", sha256="23c2469e2a568362a62eecf1b49ed90a15621e6fa30e29947ded3436422de9b9" + ) + version( + "2023-05-30", sha256="5fadcae90aa4ae041150f8e2d26c37d980522cdb49f923fc1e1b5eb8d74e71ad" + ) + version( + "2023-01-10", sha256="fb1ecd641d0a02c01bc9036d513cb658bbda62a75e246bedbc01764560a639f0" + ) + version( + "2022-10-11", sha256="2cff03f9efdaf52626bd1b451d700605dc1ea000c5da56bd0fc59f8f43071040" + ) + version( + "2022-07-19", sha256="6ed95025fba2aef0ce7b647607225745624497f876d74ef6ec22b26e73e9de77" + ) + version( + "2022-04-26", sha256="08df40e8f528ed283b0e480ba4bcdbfdd2fdcf695a7ada1668243072d80f8b6f" + ) + version( + "2022-03-29", sha256="1979e7fe618c51ed1c9df43bba92f977a0d3fe7497ffa2a5e80dfc559a1e5a29" + ) + version( + "2022-03-18", sha256="2d0575e481482551a6a4f9152e7d2ab4bafaeaee5f2606edb829c2fdb3713336" + ) + version( + "2022-02-01", sha256="1d9195b76d2ea25c2b5ae9bee52d05075244d78fcd9c58ee0b6fac47d395a5eb" + ) + version( + "2021-10-26", sha256="ae31ecb3c6e9ff3154cb7a55f017090448f88482f0e94ac927c0c67a1f33b9cf" + ) + version( + "2021-09-30", sha256="f524fc21859b776e18df01a87880efa198112214e13494275dbcbd9bcb71d976" + ) + version( + "2021-07-05", sha256="a3b534269c6974631db35f952e8d7c7dbf3d81ab329a232df575c2661de1214a" + ) + version( + "2021-05-25", sha256="3a32ad57e7f5556e36ede625b854057ac51f996d59e0952c207040077cbe48a9" + ) + version( + "2021-04-13", sha256="533610ad2b004c1622a40622f86ced5e89762e1c0e4b3ae08b31b240d863e91f" + ) + version( + "2021-01-19", sha256="e010c0c071a2c79a76aa3c289dc7e4ac4ed38492bfda06d766a80b707ebd2f29" + ) + version( + "2020-12-08", sha256="313d562594ebd07846ad6b840dd18993f22e0f8b3f275d9aacfae118f4f00fb7" + ) + version( + "2020-10-14", sha256="bb28d145ed1a4ee67253d8ddb11268069c9dafe3db25a9eee654974c4e43eee5" + ) + version( + "2020-07-22", sha256="2782f0f8e89c786f40240fc1916677be660fb8d8e25dede50c9f6f7b0c2c2178" + ) + version( + "2020-06-24", sha256="726889705b00f736200ed7999f7a50021b8735d53228d679c4e6665aa3b44987" + ) + version( + "2020-01-01", sha256="adf770dfd574a0d6026bfaa270cb6879b063957177a991d453ff1d302c02081f" + ) + version( + "2019-11-27", sha256="0d98a1a961aab523c9dc547e315e1d79e887dea575426ff03567e455fc0b66b4" + ) + version( + "2019-10-16", sha256="5cd8052fcf548ba7e08899d8458a32942bf70450c9af67a0850b4c711804a2e4" + ) + version( + "2019-08-28", sha256="38b6230aa4bee062cd34ee0ff6da173250899642b1937fc130896290b6bd91e3" + ) + # Make spack checksum work def url_for_version(self, version): return "https://curl.se/ca/cacert-{0}.pem".format(version) diff --git a/var/spack/repos/builtin/packages/cairo/package.py b/var/spack/repos/builtin/packages/cairo/package.py index 2167081d77497f..ed87b8d6476b15 100644 --- a/var/spack/repos/builtin/packages/cairo/package.py +++ b/var/spack/repos/builtin/packages/cairo/package.py @@ -2,10 +2,11 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.build_systems import autotools, meson from spack.package import * -class Cairo(AutotoolsPackage): +class Cairo(AutotoolsPackage, MesonPackage): """Cairo is a 2D graphics library with support for multiple output devices.""" @@ -14,6 +15,7 @@ class Cairo(AutotoolsPackage): license("LGPL-2.1-or-later OR MPL-1.1", checked_by="tgamblin") + version("1.18.2", sha256="a62b9bb42425e844cc3d6ddde043ff39dbabedd1542eba57a2eb79f85889d45a") version("1.18.0", sha256="243a0736b978a33dee29f9cca7521733b78a65b5418206fef7bd1c3d4cf10b64") version( "1.17.4", @@ -25,11 +27,7 @@ class Cairo(AutotoolsPackage): sha256="6b70d4655e2a47a22b101c666f4b29ba746eda4aa8a0f7255b32b2e9408801df", url="https://cairographics.org/snapshots/cairo-1.17.2.tar.xz", ) # Snapshot - version( - "1.16.0", - sha256="5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331", - preferred=True, - ) + version("1.16.0", sha256="5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331") version("1.14.12", sha256="8c90f00c500b2299c0a323dd9beead2a00353752b2092ead558139bd67f7bf16") version("1.14.8", sha256="d1f2d98ae9a4111564f6de4e013d639cf77155baf2556582295a0f00a9bc5e20") version("1.14.0", sha256="2cf5f81432e77ea4359af9dcd0f4faf37d015934501391c311bfd2d19a0134b7") @@ -37,44 +35,197 @@ class Cairo(AutotoolsPackage): depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated + # 1.17.4 is the last autotools based version. From 1.18.0 onward it is meson only + build_system( + conditional("meson", when="@1.18.0:"), + conditional("autotools", when="@:1.17.4"), + default="meson", + ) + variant("X", default=False, description="Build with X11 support") - variant("pdf", default=False, description="Enable cairo's PDF surface backend feature") variant("gobject", default=False, description="Enable cairo's gobject functions feature") - variant("ft", default=False, description="Enable cairo's FreeType font backend feature") - variant("fc", default=False, description="Enable cairo's Fontconfig font backend feature") - variant("png", default=False, description="Enable cairo's PNG functions feature") - variant("svg", default=False, description="Enable cairo's SVG functions feature") - variant("shared", default=True, description="Build shared libraries") - variant("pic", default=True, description="Enable position-independent code (PIC)") - - depends_on("libx11", when="+X") - depends_on("libxext", when="+X") - depends_on("libxrender", when="+X") - depends_on("libxcb", when="+X") - depends_on("python", when="+X", type="build") - depends_on("libpng", when="+png") - depends_on("glib") - depends_on("pixman@0.36.0:", when="@1.17.2:") - depends_on("pixman") - depends_on("automake", type="build") - depends_on("autoconf", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - depends_on("freetype build_system=autotools", when="+ft") + + # variants and build system depends for the autotools builds + with when("build_system=autotools"): + variant("png", default=False, description="Enable cairo's PNG functions feature") + variant("svg", default=False, description="Enable cairo's SVG functions feature") + variant("pic", default=True, description="Enable position-independent code (PIC)") + variant("pdf", default=False, description="Enable cairo's PDF surface backend feature") + variant("ft", default=False, description="Enable cairo's FreeType font backend feature") + variant("fc", default=False, description="Enable cairo's Fontconfig font backend feature") + + # seems to be an older cairo limitation as cairo@1.18.2 seems to build fine against libpng + conflicts("+png", when="platform=darwin") + conflicts("+svg", when="platform=darwin") + + # meson build already defines these and maps them to args + # variant("shared", default=True, description="Build shared libraries") + variant("shared", default=True, description="Build shared libraries") + conflicts("+shared~pic") + + depends_on("automake", type="build") + depends_on("autoconf", type="build") + depends_on("libtool", type="build") + depends_on("m4", type="build") + depends_on("which", type="build") + + # variants and build system depends for the autotools builds + # these names follow those listed here + # https://gitlab.freedesktop.org/cairo/cairo/-/blob/1.18.2/meson_options.txt + with when("build_system=meson"): + variant("dwrite", default=False, description="Microsoft Windows DWrite font backend") + + # doesn't exist @1.17.8: but kept as compatibility + variant( + "pdf", + default=False, + description="""+pdf is combined into +zlib now, kept seperate for compatibility. + +pdf implies +zlib now. Please use the updated variants""", + ) + # svg is combined into png now, kept seperate for compatibility + variant( + "svg", + default=False, + description="""+svg is combined into +png now, kept seperate for compatibility. + +svg implies +png now. Please use the updated variants""", + ) + + # meson seems to have assumptions about what is enabled/disabled + # these four compile best if +variant in unison, otherwise various errors happen + # if these aren't in sync. It is easier to have a sane default. conflicts below + # to try to protect known incompatibilities + variant("png", default=True, description="Enable cairo's PNG and SVG functions feature") + variant("ft", default=True, description="Enable cairo's FreeType font backend feature") + variant("fc", default=True, description="Enable cairo's Fontconfig font backend feature") + variant( + "zlib", + default=True, + description="Enable cairo's script, ps, pdf, xml functions feature", + ) + + variant("quartz", default=False, description="Enable cairo's Quartz functions feature") + variant("tee", default=False, description="Enable cairo's tee functions feature") + + # not in spack + variant( + "spectre", + default=False, + description="Not available. Enable cairo's spectre functions feature", + ) + + # (bfd might be too old) with binutils 2.43.1 on macos + # so not sure how this is supposed to work + variant( + "symbol-lookup", + default=False, + description="Not available. Enable cairo's symbol lookup functions feature", + ) + + # not currently supported variants + conflicts("+spectre", msg="Not currently supported") + conflicts("+symbol-lookup", msg="Not currently supported") + + # meson seems to have assumptions about what is enabled/disabled + # so this protects against incompatible combinations + conflicts("~zlib+png", msg="+png requires +zlib") + conflicts("~ft+fc", msg="+fc requires +ft") + conflicts("+ft~fc", msg="+ft requires +fc") + conflicts("+ft+fc~zlib", msg="+fc+ft requires +zlib") + conflicts("+fc+ft~png+zlib", msg="+ft+fc+zlib requires +png") + + # +pdf implies zlib now + requires("+zlib", when="+pdf") + requires("~zlib", when="~pdf", msg="+pdf implies +zlib now") + # +svg implies png now + requires("+svg", when="+png") + requires("~png", when="~svg", msg="+svg implies +png now") + + # https://gitlab.freedesktop.org/cairo/cairo/-/blob/1.18.2/meson.build?ref_type=tags#L2 + depends_on("meson@1.3.0:", type="build") + + # both autotools and meson need this for auto discovery of depends depends_on("pkgconfig", type="build") - depends_on("fontconfig@2.10.91:", when="+fc") # Require newer version of fontconfig. - depends_on("which", type="build") - conflicts("+png", when="platform=darwin") - conflicts("+svg", when="platform=darwin") - conflicts("+shared~pic") + # non build system specific depends + # versions that use (the old) autotools build + with when("@:1.17.4"): + depends_on("pixman@0.36.0:", when="@1.17.2:") + depends_on("freetype", when="+ft") + depends_on("fontconfig@2.10.91:", when="+fc") + depends_on("libpng", when="+png") + depends_on("glib") + + # non build system specific depends + # versions that use (the new) meson build + with when("@1.18.0:"): + depends_on("binutils", when="+symbol-lookup") + depends_on("freetype@2.13.0:", when="+ft") + depends_on("libpng@1.4.0:", when="+png") + depends_on("glib@2.14:", when="+gobject") + depends_on("pixman@0.40.0:") + depends_on("fontconfig@2.13.0:", when="+fc") + + # lzo is not strictly required, but cannot be disabled and may be pulled in accidentally + # https://github.com/mesonbuild/meson/issues/8224 + # https://github.com/microsoft/vcpkg/pull/38313 + depends_on("lzo") + + # needed for both meson and autotools builds when including X + with when("+X"): + depends_on("libx11") + depends_on("libxext") + + depends_on("libxrender") + depends_on("libxrender@0.6:", when="@1.17.8:") + + depends_on("libxcb") + depends_on("libxcb@1.6:", when="@1.17.8:") + + depends_on("python", type="build") # patch from https://gitlab.freedesktop.org/cairo/cairo/issues/346 patch("fontconfig.patch", when="@1.16.0:1.17.2") # Don't regenerate docs to avoid a dependency on gtk-doc - patch("disable-gtk-docs.patch", when="^autoconf@2.70:") + patch("disable-gtk-docs.patch", when="build_system=autotools ^autoconf@2.70:") + + +class MesonBuilder(meson.MesonBuilder): + def enable_or_disable(self, feature_name, variant=None): + if variant is None: + variant = feature_name + return ( + f"-D{feature_name}=enabled" + if self.spec.satisfies(f"+{variant}") + else f"-D{feature_name}=disabled" + ) + + def meson_args(self): + args = [] + + args.append(self.enable_or_disable("dwrite")) + args.append(self.enable_or_disable("fontconfig", variant="ft")) + args.append(self.enable_or_disable("freetype", variant="fc")) + + args.append(self.enable_or_disable("png")) + + args.append(self.enable_or_disable("quartz")) + args.append(self.enable_or_disable("tee")) + args.append(self.enable_or_disable("xcb")) + + args.append(self.enable_or_disable("xlib", variant="X")) + args.append(self.enable_or_disable("xlib-xcb", variant="X")) + + args.append(self.enable_or_disable("zlib")) + + args.append(self.enable_or_disable("glib", variant="gobject")) + args.append(self.enable_or_disable("spectre")) + args.append(self.enable_or_disable("symbol-lookup")) + + return args + - def autoreconf(self, spec, prefix): +class AutotoolsBuilder(autotools.AutotoolsBuilder): + def autoreconf(self, pkg, spec, prefix): # Regenerate, directing the script *not* to call configure before Spack # does which("sh")("./autogen.sh", extra_env={"NOCONFIGURE": "1"}) diff --git a/var/spack/repos/builtin/packages/catch2/package.py b/var/spack/repos/builtin/packages/catch2/package.py index ffe903b79edfbd..d6b237bddbe351 100644 --- a/var/spack/repos/builtin/packages/catch2/package.py +++ b/var/spack/repos/builtin/packages/catch2/package.py @@ -21,6 +21,7 @@ class Catch2(CMakePackage): version("develop", branch="devel") # Releases + version("3.8.0", sha256="1ab2de20460d4641553addfdfe6acd4109d871d5531f8f519a52ea4926303087") version("3.7.1", sha256="c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c") version("3.6.0", sha256="485932259a75c7c6b72d4b874242c489ea5155d17efa345eb8cc72159f49f356") version("3.5.4", sha256="b7754b711242c167d8f60b890695347f90a1ebc95949a045385114165d606dbb") @@ -115,6 +116,7 @@ class Catch2(CMakePackage): version("1.3.0", sha256="245f6ee73e2fea66311afa1da59e5087ddab8b37ce64994ad88506e8af28c6ac") depends_on("cxx", type="build") # generated + depends_on("cmake@3.16:", type="build", when="@3.8:") variant( "cxxstd", diff --git a/var/spack/repos/builtin/packages/cbtf-krell/package.py b/var/spack/repos/builtin/packages/cbtf-krell/package.py index 6b44d508d22b61..defba31c0ed94d 100644 --- a/var/spack/repos/builtin/packages/cbtf-krell/package.py +++ b/var/spack/repos/builtin/packages/cbtf-krell/package.py @@ -4,7 +4,6 @@ import spack.store from spack.package import * -from spack.pkg.builtin.boost import Boost class CbtfKrell(CMakePackage): @@ -51,9 +50,17 @@ class CbtfKrell(CMakePackage): description="build only the FE tool using the runtime_dir to point to target build.", ) + # Fix build errors with gcc >= 10 + patch( + "https://github.com/OpenSpeedShop/cbtf-krell/commit/7d47761c6cd9110883bff9ca1e694af1475676f5.patch?full_index=1", + sha256="64ed80d18163ca04a67be4a13ac2d2553243fc24c6274d26981472e6e2050b8a", + ) + # Dependencies for cbtf-krell depends_on("cmake@3.0.2:", type="build") + depends_on("gotcha") + # For rpcgen depends_on("rpcsvc-proto", type="build") @@ -64,16 +71,11 @@ class CbtfKrell(CMakePackage): depends_on("binutils@2.32") # For boost - depends_on("boost@1.70.0:") - - # TODO: replace this with an explicit list of components of Boost, - # for instance depends_on('boost +filesystem') - # See https://github.com/spack/spack/pull/22303 for reference - depends_on(Boost.with_default_variants) + depends_on("boost@1.70.0:+filesystem+graph+program_options+python+test+thread") # For Dyninst - depends_on("dyninst@10.1.0", when="@develop") - depends_on("dyninst@10.1.0", when="@1.9.3:9999") + depends_on("dyninst@10.1.0:", when="@develop") + depends_on("dyninst@10.1.0:", when="@1.9.3:9999") # For MRNet depends_on("mrnet@5.0.1-3:+lwthreads", when="@develop", type=("build", "link", "run")) diff --git a/var/spack/repos/builtin/packages/cdo/package.py b/var/spack/repos/builtin/packages/cdo/package.py index 572b79646874d3..abfdf31094be57 100644 --- a/var/spack/repos/builtin/packages/cdo/package.py +++ b/var/spack/repos/builtin/packages/cdo/package.py @@ -19,6 +19,11 @@ class Cdo(AutotoolsPackage): maintainers("skosukhin", "Try2Code") + version( + "2.5.0", + sha256="e865c05c1b52fd76b80e33421554db81b38b75210820bdc40e8690f4552f68e2", + url="https://code.mpimet.mpg.de/attachments/download/29786/cdo-2.5.0.tar.gz", + ) version( "2.4.4", sha256="49f50bd18dacd585e9518cfd4f55548f692426edfb3b27ddcd1c653eab53d063", diff --git a/var/spack/repos/builtin/packages/celeritas/package.py b/var/spack/repos/builtin/packages/celeritas/package.py index 8df190e75d3756..e2e24ec4ce0aa8 100644 --- a/var/spack/repos/builtin/packages/celeritas/package.py +++ b/var/spack/repos/builtin/packages/celeritas/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.build_systems.cmake import CMakeBuilder from spack.package import * @@ -12,18 +13,18 @@ class Celeritas(CMakePackage, CudaPackage, ROCmPackage): """ homepage = "https://github.com/celeritas-project/celeritas" + git = "https://github.com/celeritas-project/celeritas.git" url = "https://github.com/celeritas-project/celeritas/releases/download/v0.1.0/celeritas-0.1.0.tar.gz" maintainers("sethrj") license("Apache-2.0") + version("develop", branch="develop", get_full_repo=True) + + version("0.5.1", sha256="182d5466fbd98ba9400b343b55f6a06e03b77daed4de1dd16f632ac0a3620249") version("0.5.0", sha256="4a8834224d96fd01897e5872ac109f60d91ef0bd7b63fac05a73dcdb61a5530e") - version( - "0.4.4", - sha256="8b5ae63aa2d50c2ecf48d752424e4a33c50c07d9f0f5ca5448246de3286fd836", - deprecated=True, - ) + version("0.4.4", sha256="8b5ae63aa2d50c2ecf48d752424e4a33c50c07d9f0f5ca5448246de3286fd836") version( "0.4.3", sha256="b4f603dce1dc9c4894ea4c86f6574026ea8536714982e7dc6dff7472c925c892", @@ -72,25 +73,39 @@ class Celeritas(CMakePackage, CudaPackage, ROCmPackage): depends_on("cmake@3.22:", type="build", when="+rocm") depends_on("nlohmann-json") - depends_on("geant4@10.5:", when="@0.4.2: +geant4") depends_on("geant4@10.5:11.1", when="@0.3.1:0.4.1 +geant4") + depends_on("geant4@10.5:11.2", when="@0.4.2:0.4 +geant4") + depends_on("geant4@10.5:", when="@0.5: +geant4") + depends_on("g4vg@1.0.2:", when="@0.6: +geant4 +vecgeom") depends_on("hepmc3", when="+hepmc3") depends_on("root", when="+root") depends_on("swig@4.1:", when="+swig") depends_on("vecgeom@1.2.5:", when="+vecgeom") + depends_on("vecgeom@1.2.8:", when="@0.6: +vecgeom") + depends_on("vecgeom@1.2.10:", when="@0.6: +vecgeom +cuda") depends_on("python", type="build") depends_on("doxygen", type="build", when="+doc") depends_on("py-breathe", type="build", when="+doc") depends_on("py-sphinx", type="build", when="+doc") + with when("+cuda"): + depends_on("thrust") + with when("+rocm"): + depends_on("hiprand") + depends_on("rocprim") + depends_on("rocrand") + depends_on("rocthrust") + + # Ensure consistent C++ standards for _std in _cxxstd_values: - depends_on("geant4 cxxstd=" + _std, when="+geant4 cxxstd=" + _std) - depends_on("root cxxstd=" + _std, when="+root cxxstd=" + _std) - depends_on("vecgeom cxxstd=" + _std, when="+vecgeom cxxstd=" + _std) + for _pkg in ["geant4", "root", "vecgeom"]: + depends_on(f"{_pkg} cxxstd={_std}", when=f"+{_pkg} cxxstd={_std}") + # Ensure consistent CUDA architectures + depends_on("vecgeom +cuda cuda_arch=none", when="+vecgeom +cuda cuda_arch=none") for _arch in CudaPackage.cuda_arch_values: - depends_on("vecgeom+cuda cuda_arch=" + _arch, when="+vecgeom +cuda cuda_arch=" + _arch) + depends_on(f"vecgeom +cuda cuda_arch={_arch}", when=f"+vecgeom +cuda cuda_arch={_arch}") conflicts("+rocm", when="+cuda", msg="AMD and NVIDIA accelerators are incompatible") conflicts("+rocm", when="+vecgeom", msg="HIP support is only available with ORANGE") @@ -101,9 +116,6 @@ class Celeritas(CMakePackage, CudaPackage, ROCmPackage): sha256="1161c4f1166860d35d2a3f103236a63acd6a35aee2d2c27561cb929941d1c170", when="@0.5.0 +geant4 ^geant4@11.3.0:", ) - conflicts( - "^geant4@11.3.0:", when="@:0.4 +geant4", msg="geant4@11.3.0: requires at least 0.5.0" - ) def cmake_args(self): define = self.define @@ -114,13 +126,41 @@ def cmake_args(self): from_variant("CELERITAS_BUILD_DOCS", "doc"), define("CELERITAS_BUILD_DEMOS", False), define("CELERITAS_BUILD_TESTS", False), - from_variant("Celeritas_USE_HIP", "rocm"), + from_variant("CELERITAS_USE_HIP", "rocm"), define("CELERITAS_USE_MPI", False), - define("CELERITAS_USE_JSON", True), define("CELERITAS_USE_Python", True), ] for pkg in ["CUDA", "Geant4", "HepMC3", "OpenMP", "ROOT", "SWIG", "VecGeom"]: args.append(from_variant("CELERITAS_USE_" + pkg, pkg.lower())) + if self.spec.satisfies("+cuda"): + args.append(CMakeBuilder.define_cuda_architectures(self)) + if self.spec.satisfies("+rocm"): + args.append(CMakeBuilder.define_hip_architectures(self)) + args.append( + define( + "CMAKE_HIP_FLAGS", + " ".join( + [ + f"-I{self.spec[p].prefix.include}" + for p in ["hiprand", "rocprim", "rocrand", "rocthrust"] + ] + ), + ) + ) + + if self.spec.satisfies("@:0.4"): + # Explicitly activate JSON for older versions + args.append(define("CELERITAS_USE_JSON", True)) + + if self.spec.satisfies("@0.6:"): + # Protect against accidentally using vendored instead of spack + args.extend( + ( + define(f"CELERITAS_BUILTIN_{pkg}", False) + for pkg in ["GTest", "nlohmann_json", "G4VG"] + ) + ) + return args diff --git a/var/spack/repos/builtin/packages/cepgen/package.py b/var/spack/repos/builtin/packages/cepgen/package.py index 7ac3b8431d76e0..548568cd89307f 100644 --- a/var/spack/repos/builtin/packages/cepgen/package.py +++ b/var/spack/repos/builtin/packages/cepgen/package.py @@ -21,8 +21,9 @@ class Cepgen(CMakePackage): "1.0.2patch1", sha256="333bba0cb1965a98dec127e00c150eab1a515cd348a90f7b1d66d5cd8d206d21" ) - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") generator("ninja") diff --git a/var/spack/repos/builtin/packages/cgns/package.py b/var/spack/repos/builtin/packages/cgns/package.py index 9e36a2e0667847..ed034cdbfd2fff 100644 --- a/var/spack/repos/builtin/packages/cgns/package.py +++ b/var/spack/repos/builtin/packages/cgns/package.py @@ -25,6 +25,7 @@ class Cgns(CMakePackage): version("develop", branch="develop") version("master", branch="master") + version("4.5.0", sha256="c72355219318755ba0a8646a8e56ee1c138cf909c1d738d258d2774fa4b529e9") version("4.4.0", sha256="3b0615d1e6b566aa8772616ba5fd9ca4eca1a600720e36eadd914be348925fe2") version("4.3.0", sha256="7709eb7d99731dea0dd1eff183f109eaef8d9556624e3fbc34dc5177afc0a032") version("4.2.0", sha256="090ec6cb0916d90c16790183fc7c2bd2bd7e9a5e3764b36c8196ba37bf1dc817") @@ -54,6 +55,7 @@ class Cgns(CMakePackage): variant("tools", default=False, description="Enable CGNS tools") variant("pic", default=False, description="Produce position-independent code") + depends_on("cmake@3.20:", when="@4.5:", type="build") depends_on("cmake@3.12:", when="@4.3:", type="build") depends_on("cmake@3.8:", when="@4.2:", type="build") depends_on("cmake@2.8:", when="@:4.1", type="build") diff --git a/var/spack/repos/builtin/packages/chafa/package.py b/var/spack/repos/builtin/packages/chafa/package.py new file mode 100644 index 00000000000000..a370c1420b7d6e --- /dev/null +++ b/var/spack/repos/builtin/packages/chafa/package.py @@ -0,0 +1,79 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Chafa(AutotoolsPackage): + """A library and command-line utility that converts image data, including + animated GIFs, into graphics formats or ANSI/Unicode character art + suitable for display in a terminal.""" + + homepage = "https://hpjansson.org/chafa/" + url = "https://hpjansson.org/chafa/releases/chafa-1.14.5.tar.xz" + git = "https://github.com/hpjansson/chafa.git" + + license("LGPL-3.0-or-later", checked_by="Buldram") + maintainers("Buldram") + + version("master", branch="master") + version("1.14.5", sha256="7b5b384d5fb76a641d00af0626ed2115fb255ea371d9bef11f8500286a7b09e5") + version("1.14.4", sha256="d0708a63f05b79269dae862a42671e38aece47fbd4fc852904bca51a65954454") + version("1.14.3", sha256="f3d5530a96c8e55eea180448896e973093e0302f4cbde45d028179af8cfd90f3") + version("1.14.2", sha256="8a28d308074e25597e21bf280747461ac695ae715f2f327eb0e0f0435967f8b3") + version("1.14.1", sha256="24707f59e544cec85d7a1993854672136b05271f86954248c5d8a42e221f6f25") + version("1.14.0", sha256="670e55c28b5ecd4c8187bd97f0898762712a480ec8ea439dae4a4836b178e084") + + variant("shared", default=True, description="Build shared libraries") + variant("static", default=True, description="Build static libraries") + variant("tools", default=True, description="Build command-line tool") + variant("man", default=True, when="@1 +tools", description="Install man page") + variant("jpeg", default=True, when="+tools", description="Enable JPEG loader") + variant("tiff", default=False, when="+tools", description="Enable TIFF loader") + variant("svg", default=False, when="+tools", description="Enable SVG loader") + variant("webp", default=False, when="+tools", description="Enable WebP loader") + variant("avif", default=False, when="+tools", description="Enable AVIF loader") + variant("jxl", default=False, when="@1.14.1: +tools", description="Enable JPEG XL loader") + + conflicts("~shared~static") + + depends_on("c", type="build") + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("libtool", type="build") + depends_on("pkgconfig", type="build") + depends_on("libxml2", type="build") + depends_on("glib", type="link") + depends_on("freetype", type="link", when="+tools") + depends_on("jpeg", type="link", when="+jpeg") + depends_on("libtiff", type="link", when="+tiff") + depends_on("librsvg", type="link", when="+svg") + depends_on("libwebp +libwebpdemux", type="link", when="+webp") + depends_on("libavif", type="link", when="+avif") + depends_on("libjxl", type="link", when="+jxl") + + @when("@master") + def autoreconf(self, spec, prefix): + Executable("./autogen.sh")(extra_env={"NOCONFIGURE": "1"}) + + def configure_args(self): + return [ + "--disable-silent-rules", + "--disable-dependency-tracking", + "--disable-man", + *self.enable_or_disable("shared"), + *self.enable_or_disable("static"), + *self.with_or_without("tools"), + *self.with_or_without("jpeg"), + *self.with_or_without("tiff"), + *self.with_or_without("svg"), + *self.with_or_without("webp"), + *self.with_or_without("avif"), + *self.with_or_without("jxl"), + ] + + @run_after("install", when="+man") + def install_man(self): + mkdirp(prefix.share.man.man1) + install("docs/chafa.1", prefix.share.man.man1) diff --git a/var/spack/repos/builtin/packages/chameleon/package.py b/var/spack/repos/builtin/packages/chameleon/package.py index cfd1603745da1e..90c3e6e9bfdff5 100644 --- a/var/spack/repos/builtin/packages/chameleon/package.py +++ b/var/spack/repos/builtin/packages/chameleon/package.py @@ -10,11 +10,12 @@ class Chameleon(CMakePackage, CudaPackage): """Dense Linear Algebra for Scalable Multi-core Architectures and GPGPUs""" homepage = "https://gitlab.inria.fr/solverstack/chameleon" - url = "https://gitlab.inria.fr/api/v4/projects/616/packages/generic/source/v1.2.0/chameleon-1.2.0.tar.gz" + url = "https://gitlab.inria.fr/api/v4/projects/616/packages/generic/source/v1.3.0/chameleon-1.3.0.tar.gz" git = "https://gitlab.inria.fr/solverstack/chameleon.git" maintainers("fpruvost") version("master", branch="master", submodules=True) + version("1.3.0", sha256="2725d2d2a9885e619e0c8d41306b9b9dc6d5df635b710cf8d077a14803ea26cd") version("1.2.0", sha256="b8988ecbff19c603ae9f61441653c21bba18d040bee9bb83f7fc9077043e50b4") version("1.1.0", sha256="e64d0438dfaf5effb3740e53f3ab017d12744b85a138b2ef702a81df559126df") diff --git a/var/spack/repos/builtin/packages/chapel/fix_checkChplInstall.patch b/var/spack/repos/builtin/packages/chapel/fix_checkChplInstall.patch new file mode 100644 index 00000000000000..a82c0c39a6186d --- /dev/null +++ b/var/spack/repos/builtin/packages/chapel/fix_checkChplInstall.patch @@ -0,0 +1,35 @@ +commit ba58b4edc86dfcf0b2bdb9f3c910a2181a21060a +Author: Jade Abraham +Date: Mon Nov 25 08:19:07 2024 -0800 + + fix make check for gpu + + Signed-off-by: Jade Abraham + +diff --git a/util/test/checkChplInstall b/util/test/checkChplInstall +index e0e82a471e..5b1c638835 100755 +--- a/util/test/checkChplInstall ++++ b/util/test/checkChplInstall +@@ -213,12 +213,18 @@ else + fi + + # Find number of locales and .good file ++NUMLOCALES=1 ++GOOD=${TEST_DIR}/${TEST_JOB}.good + if [ ${chpl_comm} == "none" ]; then +- NUMLOCALES=1 +- GOOD=${TEST_DIR}/${TEST_JOB}.comm-none.good ++ # use comm-none specific good file if it exists ++ if [ -f ${TEST_DIR}/${TEST_JOB}.comm-none.good ]; then ++ GOOD=${TEST_DIR}/${TEST_JOB}.comm-none.good ++ fi + else +- NUMLOCALES="$(cat ${TEST_DIR}/NUMLOCALES)" +- GOOD=${TEST_DIR}/${TEST_JOB}.good ++ # use specific NUMLOCALES if it exists ++ if [ -f ${TEST_DIR}/NUMLOCALES ]; then ++ NUMLOCALES="$(cat ${TEST_DIR}/NUMLOCALES)" ++ fi + fi + + # Check for valid launchers diff --git a/var/spack/repos/builtin/packages/chapel/fix_chpl_line_length.patch b/var/spack/repos/builtin/packages/chapel/fix_chpl_line_length.patch new file mode 100644 index 00000000000000..da9cf61c496dc2 --- /dev/null +++ b/var/spack/repos/builtin/packages/chapel/fix_chpl_line_length.patch @@ -0,0 +1,13 @@ +diff --git a/compiler/util/files.cpp b/compiler/util/files.cpp +index 4183614988..9746baf935 100644 +--- a/compiler/util/files.cpp ++++ b/compiler/util/files.cpp +@@ -211,7 +211,7 @@ void restoreDriverTmp(const char* tmpFilePath, + + fileinfo* tmpFile = openTmpFile(tmpFilePath, "r"); + +- char strBuf[4096]; ++ char strBuf[8192]; + while (fgets(strBuf, sizeof(strBuf), tmpFile->fptr)) { + // Note: Using strlen here (instead of strnlen) is safe because fgets + // guarantees null termination. diff --git a/var/spack/repos/builtin/packages/chapel/fix_chpl_shared_lib_path.patch b/var/spack/repos/builtin/packages/chapel/fix_chpl_shared_lib_path.patch new file mode 100644 index 00000000000000..047a657d6ef11f --- /dev/null +++ b/var/spack/repos/builtin/packages/chapel/fix_chpl_shared_lib_path.patch @@ -0,0 +1,59 @@ +diff --git a/tools/chapel-py/setup.py b/tools/chapel-py/setup.py +index bee452790c..58ec46d7e6 100644 +--- a/tools/chapel-py/setup.py ++++ b/tools/chapel-py/setup.py +@@ -46,7 +46,37 @@ host_cc = str(chpl_variables.get("CHPL_HOST_CC")) + host_cxx = str(chpl_variables.get("CHPL_HOST_CXX")) + + host_bin_subdir = str(chpl_variables.get("CHPL_HOST_BIN_SUBDIR")) ++ ++# construct the chpl_lib_path from chpl_home, or use the configured-prefix if it exists ++ + chpl_lib_path = os.path.join(chpl_home, "lib", "compiler", host_bin_subdir) ++chpl_install_lib_path = None ++if os.path.exists(os.path.join(chpl_home, "configured-prefix")): ++ with open(os.path.join(chpl_home, "CMakeLists.txt"), "r") as f: ++ # read CMakeLists.txt to get the CHPL_MAJOR_VERSION and CHPL_MINOR_VERSION ++ # and then construct the path from that ++ chpl_major_version = None ++ chpl_minor_version = None ++ for line in f: ++ if "set(CHPL_MAJOR_VERSION" in line: ++ chpl_major_version = line.split()[1].strip(')') ++ if "set(CHPL_MINOR_VERSION" in line: ++ chpl_minor_version = line.split()[1].strip(')') ++ if chpl_major_version is not None and chpl_minor_version is not None: ++ break ++ assert(chpl_major_version is not None and chpl_minor_version is not None) ++ chpl_version_string = "{}.{}".format(chpl_major_version, chpl_minor_version) ++ chpl_prefix = None ++ with open(os.path.join(chpl_home, "configured-prefix"), "r") as f: ++ chpl_prefix = f.read().strip() ++ assert(chpl_prefix is not None) ++ chpl_install_lib_path = os.path.join( ++ chpl_prefix, ++ "lib", ++ "chapel", ++ chpl_version_string, ++ "compiler" ++ ) + + CXXFLAGS = [] + if have_llvm and have_llvm != "none": +@@ -64,10 +94,14 @@ CXXFLAGS += ["-std=c++17", "-I{}/frontend/include".format(chpl_home)] + LDFLAGS = [] + LDFLAGS += [ + "-L{}".format(chpl_lib_path), ++ "-Wl,-rpath,{}".format(chpl_lib_path), + "-lChplFrontendShared", +- "-Wl,-rpath", +- chpl_lib_path, + ] ++if chpl_install_lib_path is not None: ++ LDFLAGS += [ ++ "-L{}".format(chpl_install_lib_path), ++ "-Wl,-rpath,{}".format(chpl_install_lib_path), ++ ] + + if str(chpl_variables.get("CHPL_SANITIZE")) == "address": + if str(chpl_variables.get("CHPL_HOST_PLATFORM")) == "darwin": diff --git a/var/spack/repos/builtin/packages/chapel/fix_chpl_shared_lib_path_2.3.patch b/var/spack/repos/builtin/packages/chapel/fix_chpl_shared_lib_path_2.3.patch new file mode 100644 index 00000000000000..c566c7329f7f84 --- /dev/null +++ b/var/spack/repos/builtin/packages/chapel/fix_chpl_shared_lib_path_2.3.patch @@ -0,0 +1,54 @@ +diff --git a/tools/chapel-py/setup.py b/tools/chapel-py/setup.py +index 30c2708724..3921143def 100644 +--- a/tools/chapel-py/setup.py ++++ b/tools/chapel-py/setup.py +@@ -47,6 +47,36 @@ host_cxx = str(chpl_variables.get("CHPL_HOST_CXX")) + + host_bin_subdir = str(chpl_variables.get("CHPL_HOST_BIN_SUBDIR")) + chpl_lib_path = os.path.join(chpl_home, "lib", "compiler", host_bin_subdir) ++# For installations using --prefix, the lib final lib path is going to be different ++# figure it out now and write it to the rpath ++chpl_install_lib_path = None ++if os.path.exists(os.path.join(chpl_home, "configured-prefix")): ++ with open(os.path.join(chpl_home, "CMakeLists.txt"), "r") as f: ++ # read CMakeLists.txt to get the CHPL_MAJOR_VERSION and CHPL_MINOR_VERSION ++ # and then construct the path from that ++ chpl_major_version = None ++ chpl_minor_version = None ++ for line in f: ++ if "set(CHPL_MAJOR_VERSION" in line: ++ chpl_major_version = line.split()[1].strip(')') ++ if "set(CHPL_MINOR_VERSION" in line: ++ chpl_minor_version = line.split()[1].strip(')') ++ if chpl_major_version is not None and chpl_minor_version is not None: ++ break ++ assert(chpl_major_version is not None and chpl_minor_version is not None) ++ chpl_version_string = "{}.{}".format(chpl_major_version, chpl_minor_version) ++ chpl_prefix = None ++ with open(os.path.join(chpl_home, "configured-prefix"), "r") as f: ++ chpl_prefix = f.read().strip() ++ assert(chpl_prefix is not None) ++ chpl_install_lib_path = os.path.join( ++ chpl_prefix, ++ "lib", ++ "chapel", ++ chpl_version_string, ++ "compiler" ++ ) ++ + + CXXFLAGS = [] + if have_llvm and have_llvm != "none": +@@ -68,6 +98,12 @@ LDFLAGS += [ + "-lChplFrontendShared", + ] + ++if chpl_install_lib_path is not None: ++ LDFLAGS += [ ++ "-L{}".format(chpl_install_lib_path), ++ "-Wl,-rpath,{}".format(chpl_install_lib_path), ++ ] ++ + if str(chpl_variables.get("CHPL_SANITIZE")) == "address": + if str(chpl_variables.get("CHPL_HOST_PLATFORM")) == "darwin": + sys.exit( diff --git a/var/spack/repos/builtin/packages/chapel/fix_llvm_include_path_2.3.patch b/var/spack/repos/builtin/packages/chapel/fix_llvm_include_path_2.3.patch new file mode 100644 index 00000000000000..9368b57b9422a2 --- /dev/null +++ b/var/spack/repos/builtin/packages/chapel/fix_llvm_include_path_2.3.patch @@ -0,0 +1,61 @@ +commit 687e1c9c1f33d4479b40f49fb23d73424fbebce8 +Author: Jade Abraham +Date: Fri Dec 13 08:54:37 2024 -0800 + + specialize idirafter + + Signed-off-by: Jade Abraham + +diff --git a/util/chplenv/chpl_llvm.py b/util/chplenv/chpl_llvm.py +index 673a9e97f2..b5e9b30796 100755 +--- a/util/chplenv/chpl_llvm.py ++++ b/util/chplenv/chpl_llvm.py +@@ -1027,7 +1027,7 @@ def get_clang_prgenv_args(): + # Filters out C++ compilation flags from llvm-config. + # The flags are passed as a list of strings. + # Returns a list of strings containing the kept flags. +-def filter_llvm_config_flags(flags): ++def filter_llvm_config_flags(llvm_val, flags): + ret = [ ] + + platform_val = chpl_platform.get('host') +@@ -1047,11 +1047,19 @@ def filter_llvm_config_flags(flags): + flag == '-std=c++14'): + continue # filter out these flags + +- # change -I flags to -idirafter flags ++ # ++ # include LLVM headers as system headers + # this avoids warnings inside of LLVM headers by treating LLVM headers +- # as system headers without perturbing the include search path ++ # ++ # when adding LLVM=system as system headers, we should not perturb the ++ # include search path, so use -isystem-after/-idirafter ++ # ++ # when adding LLVM=bundled, we should include the LLVM headers as system ++ # headers and prefer the bundled headers, so use -isystem ++ # ++ include_flag = '-idirafter' if llvm_val == 'system' else '-isystem' + if flag.startswith('-I'): +- ret.append('-idirafter' + flag[2:]) ++ ret.append(include_flag + flag[2:]) + continue + + if flag.startswith('-W'): +@@ -1118,14 +1126,14 @@ def get_host_compile_args(): + + # Note, the cxxflags should include the -I for the include dir + cxxflags = run_command([llvm_config, '--cxxflags']) +- system.extend(filter_llvm_config_flags(cxxflags.split())) ++ system.extend(filter_llvm_config_flags('system', cxxflags.split())) + + elif llvm_support_val == 'bundled': + # don't try to run llvm-config if it's not built yet + if is_included_llvm_built(llvm_val): + # Note, the cxxflags should include the -I for the include dir + cxxflags = run_command([llvm_config, '--cxxflags']) +- bundled.extend(filter_llvm_config_flags(cxxflags.split())) ++ bundled.extend(filter_llvm_config_flags('bundled', cxxflags.split())) + + # TODO: is this still needed? + bundled.append('-Wno-comment') diff --git a/var/spack/repos/builtin/packages/chapel/package.py b/var/spack/repos/builtin/packages/chapel/package.py index 149e8fe55c1b8b..08bf0d15c7ae05 100644 --- a/var/spack/repos/builtin/packages/chapel/package.py +++ b/var/spack/repos/builtin/packages/chapel/package.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os +import re import subprocess import llnl.util.lang @@ -38,7 +39,7 @@ class Chapel(AutotoolsPackage, CudaPackage, ROCmPackage): homepage = "https://chapel-lang.org/" - url = "https://github.com/chapel-lang/chapel/archive/refs/tags/2.2.0.tar.gz" + url = "https://github.com/chapel-lang/chapel/releases/download/2.3.0/chapel-2.3.0.tar.gz" git = "https://github.com/chapel-lang/chapel.git" test_requires_compiler = True @@ -57,15 +58,24 @@ class Chapel(AutotoolsPackage, CudaPackage, ROCmPackage): version("main", branch="main") - version("2.2.0", sha256="9b0ce16ed0b1c777647c3aa852d8d8cacea2c3d8a952548a238f07c0f357a0f9") - version("2.1.0", sha256="8e164d9a9e705e6b816857e84833b0922ce0bde6a36a9f3a29734830aac168ef") - version("2.0.1", sha256="47e1f3789478ea870bd4ecdf52acbe469d171b89b663309325431f3da7c75008") - version("2.0.0", sha256="a8cab99fd034c7b7229be8d4626ec95cf02072646fb148c74b4f48c460c6059c") + version("2.3.0", sha256="0185970388aef1f1fae2a031edf060d5eac4eb6e6b1089e7e3b15a130edd8a31") + version("2.2.0", sha256="bb16952a87127028031fd2b56781bea01ab4de7c3466f7b6a378c4d8895754b6") + version("2.1.0", sha256="72593c037505dd76e8b5989358b7580a3fdb213051a406adb26a487d26c68c60") + version("2.0.1", sha256="19ebcd88d829712468cfef10c634c3e975acdf78dd1a57671d11657574636053") + version("2.0.0", sha256="b5387e9d37b214328f422961e2249f2687453c2702b2633b7d6a678e544b9a02") + + sanity_check_is_dir = ["bin", join_path("lib", "chapel"), join_path("share", "chapel")] + sanity_check_is_file = [join_path("bin", "chpl")] depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated patch("fix_spack_cc_wrapper_in_cray_prgenv.patch", when="@2.0.0:") + patch("fix_chpl_shared_lib_path.patch", when="@2.1:2.2 +python-bindings") + patch("fix_chpl_shared_lib_path_2.3.patch", when="@2.2.1: +python-bindings") + patch("fix_chpl_line_length.patch") + patch("fix_checkChplInstall.patch", when="@:2.3.0") # PR 26317 + patch("fix_llvm_include_path_2.3.patch", when="@=2.3.0 llvm=bundled") # PR 26402 launcher_names = ( "amudprun", @@ -325,6 +335,13 @@ class Chapel(AutotoolsPackage, CudaPackage, ROCmPackage): values=("bundled", "none", "spack"), ) + variant( + "python-bindings", + description="Also build the Python bindings for Chapel frontend (requires LLVM)", + default=False, + when="@2.2:", + ) + variant( "re2", description="Build with re2 support", @@ -406,6 +423,7 @@ class Chapel(AutotoolsPackage, CudaPackage, ROCmPackage): "CHPL_GPU", "CHPL_GPU_ARCH", "CHPL_GPU_MEM_STRATEGY", + "CHPL_HOME", "CHPL_HOST_ARCH", # "CHPL_HOST_CC", "CHPL_HOST_COMPILER", @@ -494,6 +512,11 @@ class Chapel(AutotoolsPackage, CudaPackage, ROCmPackage): with when("llvm=none"): conflicts("+cuda", msg="Cuda support requires building with LLVM") conflicts("+rocm", msg="ROCm support requires building with LLVM") + conflicts( + "+python-bindings", + msg="Python bindings require building with LLVM, see " + "https://chapel-lang.org/docs/tools/chapel-py/chapel-py.html#installation", + ) # Add dependencies @@ -502,7 +525,8 @@ class Chapel(AutotoolsPackage, CudaPackage, ROCmPackage): # TODO: keep up to date with util/chplenv/chpl_llvm.py with when("llvm=spack ~rocm"): depends_on("llvm@11:17", when="@:2.0.1") - depends_on("llvm@11:18", when="@2.1.0:") + depends_on("llvm@11:18", when="@2.1:2.2") + depends_on("llvm@11:19", when="@2.3:") # Based on docs https://chapel-lang.org/docs/technotes/gpu.html#requirements depends_on("llvm@16:", when="llvm=spack +cuda ^cuda@12:") @@ -535,8 +559,12 @@ class Chapel(AutotoolsPackage, CudaPackage, ROCmPackage): depends_on("gasnet conduits=none", when="gasnet=spack") depends_on("gasnet@2024.5.0: conduits=none", when="@2.1.0: gasnet=spack") + with when("+python-bindings"): + extends("python") + depends_on("python@3.7:") depends_on("cmake@3.16:") + depends_on("cmake@3.20:", when="llvm=bundled") # ensure we can map the spack compiler name to one of the ones we recognize requires( @@ -564,9 +592,29 @@ def unset_chpl_env_vars(self, env): env.unset(var) def build(self, spec, prefix): - make() - if spec.variants["chpldoc"].value: - make("chpldoc") + with set_env(CHPL_MAKE_THIRD_PARTY=join_path(self.build_directory, "third-party")): + make() + with set_env(CHPL_HOME=self.build_directory): + if spec.satisfies("+chpldoc"): + make("chpldoc") + if spec.satisfies("+python-bindings"): + make("chapel-py-venv") + python("-m", "ensurepip", "--default-pip") + python("-m", "pip", "install", "tools/chapel-py") + + def install(self, spec, prefix): + make("install") + # We install CMakeLists.txt so we can later lookup the version number + # if working from a non-versioned release/branch (such as main) + if not self.is_versioned_release(): + install("CMakeLists.txt", join_path(prefix.share, "chapel")) + install_tree( + "doc", join_path(self.prefix.share, "chapel", self._output_version_short, "doc") + ) + install_tree( + "examples", + join_path(self.prefix.share, "chapel", self._output_version_short, "examples"), + ) def setup_chpl_platform(self, env): if self.spec.variants["host_platform"].value == "unset": @@ -655,6 +703,9 @@ def setup_env_vars(self, env): if self.spec.satisfies("+developer"): env.set("CHPL_DEVELOPER", "true") + else: + # CHPL_DEVELOPER needs to be unset, the value "False" is mishandled + env.unset("CHPL_DEVELOPER") if not self.spec.satisfies("llvm=none"): # workaround Spack issue #44746: @@ -677,8 +728,10 @@ def setup_env_vars(self, env): if self.spec.variants["hwloc"].value == "spack": self.update_lib_path(env, self.spec["hwloc"].prefix) - # Need this for the test env, where it does not appear automatic: - env.prepend_path("PKG_CONFIG_PATH", self.spec["libpciaccess"].prefix.lib.pkgconfig) + # Need hwloc opt deps for test env, where it does not appear automatic: + for dep in ["libpciaccess", "libxml2"]: + if dep in self.spec: + self.update_lib_path(env, self.spec[dep].prefix) # TODO: unwind builds but resulting binaries fail to run, producing linker errors if self.spec.variants["unwind"].value == "spack": @@ -725,23 +778,68 @@ def setup_build_environment(self, env): def setup_run_environment(self, env): self.setup_env_vars(env) - env.prepend_path( - "PATH", join_path(self.prefix.share, "chapel", self._output_version_short, "util") + chpl_home = join_path(self.prefix.share, "chapel", self._output_version_short) + env.prepend_path("PATH", join_path(chpl_home, "util")) + env.set( + "CHPL_MAKE_THIRD_PARTY", + join_path(self.prefix.lib, "chapel", self._output_version_short), + ) + env.set("CHPL_HOME", chpl_home) + + def get_chpl_version_from_cmakelists(self) -> str: + cmake_lists = None + if os.path.exists(join_path(self.prefix.share, "chapel", "CMakeLists.txt")): + cmake_lists = join_path(self.prefix.share, "chapel", "CMakeLists.txt") + else: + cmake_lists = join_path(self.build_directory, "CMakeLists.txt") + assert cmake_lists is not None and os.path.exists(cmake_lists) + with open(cmake_lists, "r") as f: + # read CMakeLists.txt to get the CHPL_MAJOR_VERSION and CHPL_MINOR_VERSION + # and then construct the path from that + chpl_major_version = None + chpl_minor_version = None + chpl_patch_version = None + for line in f: + if "set(CHPL_MAJOR_VERSION" in line: + chpl_major_version = line.split()[1].strip(")") + if "set(CHPL_MINOR_VERSION" in line: + chpl_minor_version = line.split()[1].strip(")") + if "set(CHPL_PATCH_VERSION" in line: + chpl_patch_version = line.split()[1].strip(")") + if ( + chpl_major_version is not None + and chpl_minor_version is not None + and chpl_patch_version is not None + ): + break + assert ( + chpl_major_version is not None + and chpl_minor_version is not None + and chpl_patch_version is not None ) + chpl_version_string = "{}.{}.{}".format( + chpl_major_version, chpl_minor_version, chpl_patch_version + ) + return chpl_version_string + + def is_versioned_release(self) -> bool: + # detect main or possibly other branch names + matches = re.findall(r"[^0-9.]", str(self.spec.version)) + return len(matches) == 0 @property @llnl.util.lang.memoized - def _output_version_long(self): - if str(self.spec.version).lower() == "main": - return "2.3.0" + def _output_version_long(self) -> str: + if not self.is_versioned_release(): + return self.get_chpl_version_from_cmakelists() spec_vers_str = str(self.spec.version.up_to(3)) return spec_vers_str @property @llnl.util.lang.memoized - def _output_version_short(self): - if str(self.spec.version).lower() == "main": - return "2.3" + def _output_version_short(self) -> str: + if not self.is_versioned_release(): + return self.get_chpl_version_from_cmakelists()[-2] spec_vers_str = str(self.spec.version.up_to(2)) return spec_vers_str @@ -795,7 +893,7 @@ def test_hello(self): """Run the hello world test""" with working_dir(self.test_suite.current_test_cache_dir): with set_env(CHPL_CHECK_HOME=self.test_suite.current_test_cache_dir): - with test_part(self, "test_hello", purpose="test hello world"): + with test_part(self, "test_hello_checkChplInstall", purpose="test hello world"): if self.spec.satisfies("+cuda") or self.spec.satisfies("+rocm"): with set_env(COMP_FLAGS="--no-checks --no-compiler-driver"): res = self.check_chpl_install() @@ -815,85 +913,18 @@ def test_chpldoc(self): # TODO: Need to update checkChplDoc to work in the spack testing environment pass - # TODO: In order to run these tests, there's a lot of infrastructure to copy - # from the Chapel test suite and there are conflicts with CHPL_HOME needing - # to match the compiler's directory and the test suite's directory - # def test_package_modules(self): - # """Test that the package modules are available""" - # # if not self.spec.satisfies("+module_tests"): - # # print("Skipping module tests as module_tests variant is not set") - # # return - # tests_to_run = [] - # with working_dir(self.test_suite.current_test_cache_dir): - # with set_env(CHPL_HOME=join_path(self.spec.prefix.share, - # "chapel", self._output_version_short)): - # with test_part(self, "test_package_modules", purpose="test package modules"): - # if self.spec.satisfies("+yaml"): - # tests_to_run.append("test/library/packages/Yaml/writeAndParse.chpl") - # if self.spec.satisfies("+zmq"): - # tests_to_run.append("test/library/packages/ZMQ/weather.chpl") - # if self.spec.satisfies("+ssl"): - # tests_to_run.append("test/library/packages/Crypto/") - # # TODO: These tests fail with llvm, unable to find C variable CURLPAUSE_CONT - # if ( - # self.spec.satisfies("+curl") - # and self.spec.variants["llvm"].value == "none" - # ): - # with set_env(CHPL_NIGHTLY_TEST_CONFIG_NAME="networking-packages"): - # print("Running package module test for package 'curl'") - # res = subprocess.run( - # ["util/start_test", "test/library/packages/Curl/"] - # ) - # assert res.returncode == 0 - # print("Running package module test for package 'url'") - # res = subprocess.run(["util/start_test", - # "test/library/packages/URL/"]) - # assert res.returncode == 0 - # if self.spec.satisfies("+hdf5"): - # tests_to_run.append("test/library/packages/HDF5/") - # if self.spec.satisfies("+protobuf"): - # tests_to_run.append("test/library/packages/ProtobufProtocolSupport/") - # if len(tests_to_run) > 0: - # with set_env(CHPL_HOME=self.test_suite.current_test_cache_dir): - # compiler = join_path(self.spec.prefix.bin,'chpl') - # print("Running package module tests for packages...") - # print(f" command to run: util/start_test --compiler {compiler}") - # tests_to_run.insert(0, "util/start_test") - # tests_to_run.insert(1, "--compiler") - # tests_to_run.insert(2, compiler) - # res = subprocess.run([t for t in tests_to_run]) - # assert res.returncode == 0 - @run_after("install") def copy_test_files(self): """Copy test files to the install directory""" test_files = [ - "test/release/examples", + "examples/", "util/start_test", "util/test", "util/chplenv", "util/config", "util/printchplenv", - # "test/library/packages/Curl", - # "test/library/packages/URL/", - # "test/library/packages/ProtobufProtocolSupport/", - # "test/library/packages/Crypto/", - # "test/library/packages/Yaml/", - # "test/library/packages/ZMQ/", - # "test/library/packages/HDF5/", "chplconfig", "make", "third-party/chpl-venv/", ] cache_extra_test_sources(self, test_files) - - # @run_after("install") - # @on_package_attributes(run_tests=True) - # def self_check(self): - # """Run the self-check after installing the package""" - # path_put_first("PATH", [self.prefix.bin]) - # self.test_version() - # self.test_hello() - # if self.spec.satisfies("+chpldoc"): - # make("check-chpldoc") - # self.test_package_modules() diff --git a/var/spack/repos/builtin/packages/charmpp/package.py b/var/spack/repos/builtin/packages/charmpp/package.py index 075c3279d001c3..5ab829ada8d151 100644 --- a/var/spack/repos/builtin/packages/charmpp/package.py +++ b/var/spack/repos/builtin/packages/charmpp/package.py @@ -276,7 +276,7 @@ def charmarch(self): # build-target=LIBS backend={0}'.format(b)) def install(self, spec, prefix): - if not ("backend=mpi" in self.spec) or not ("backend=netlrts" in self.spec): + if "backend=mpi" not in self.spec or "backend=netlrts" not in self.spec: if self.spec.satisfies("+pthreads"): raise InstallError( "The pthreads option is only available on the Netlrts and MPI network layers." @@ -396,7 +396,7 @@ def install(self, spec, prefix): copy(filepath, tmppath) os.remove(filepath) os.rename(tmppath, filepath) - except (IOError, OSError): + except OSError: pass tmp_path = join_path(builddir, "tmp") diff --git a/var/spack/repos/builtin/packages/chez-scheme/package.py b/var/spack/repos/builtin/packages/chez-scheme/package.py new file mode 100644 index 00000000000000..11adcfab0e6ffc --- /dev/null +++ b/var/spack/repos/builtin/packages/chez-scheme/package.py @@ -0,0 +1,74 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class ChezScheme(AutotoolsPackage): + """Compiler and run-time system for the language of the Revised^6 Report + on Scheme (R6RS), with numerous extensions.""" + + homepage = "https://cisco.github.io/ChezScheme/" + url = "https://github.com/cisco/ChezScheme/releases/download/v10.1.0/csv10.1.0.tar.gz" + git = "https://github.com/cisco/ChezScheme.git" + + license("Apache-2.0", checked_by="Buldram") + maintainers("Buldram") + + version("main", branch="main", submodules=True) + version("10.1.0", sha256="9181a6c8c4ab5e5d32d879ff159d335a50d4f8b388611ae22a263e932c35398b") + version("10.0.0", sha256="d37199012b5ed1985c4069d6a87ff18e5e1f5a2df27e402991faf45dc4f2232c") + + variant("threads", default=False, description="Enable multithreading support") + variant("libffi", default=False, description="Use libffi") + variant("iconv", default=True, description="Use iconv") + variant("curses", default=True, description="Use ncurses") + variant("x11", default=True, description="Use libx11") + + depends_on("c", type="build") + depends_on("zuo", type="build", when="@10.1.0:") + depends_on("lz4", type="build") + depends_on("zlib-api", type="build") + depends_on("uuid", type="build") + depends_on("uuid", type="link", when="platform=windows") + depends_on("libffi", type="link", when="+libffi") + depends_on("iconv", type="link", when="+iconv") + depends_on("ncurses", type="link", when="+curses") + depends_on("libx11", type="build", when="+x11") + + conflicts("^[virtuals=iconv] libiconv", when="platform=linux") + conflicts("+iconv", when="platform=windows") + conflicts("+curses", when="platform=windows") + + def setup_build_environment(self, env): + env.set("ZUO_JOBS", make_jobs) + + def patch(self): + true = which_string("true", required=True) + if true not in ["/bin/true", "/usr/bin/true"]: + filter_file("/bin/true", f"'{true}'", "makefiles/installsh", string=True) + if self.spec.satisfies("+curses"): + filter_file( + "-lncurses", f"'{self.spec['ncurses'].libs.link_flags}'", "configure", string=True + ) + + def configure_args(self): + spec = self.spec + args = [ + f"LZ4={spec['lz4'].libs.link_flags}", + f"ZLIB={spec['zlib-api'].libs.link_flags}", + "--as-is", + "--threads" if spec.satisfies("+threads") else "--nothreads", + ] + if spec.satisfies("@10.1.0:"): + args.append(f"ZUO={spec['zuo'].prefix.bin.join('zuo')}") + if spec.satisfies("+libffi"): + args.append("--enable-libffi") + if spec.satisfies("~iconv"): + args.append("--disable-iconv") + if spec.satisfies("~curses"): + args.append("--disable-curses") + if spec.satisfies("~x11"): + args.append("--disable-x11") + return args diff --git a/var/spack/repos/builtin/packages/clhep/package.py b/var/spack/repos/builtin/packages/clhep/package.py index 22f24c55430a69..fb7bc05564fbb6 100644 --- a/var/spack/repos/builtin/packages/clhep/package.py +++ b/var/spack/repos/builtin/packages/clhep/package.py @@ -52,7 +52,8 @@ class Clhep(CMakePackage): version("2.2.0.4", sha256="9bf7fcd9892313c8d1436bc4a4a285a016c4f8e81e1fc65bdf6783207ae57550") version("2.1.2.3", sha256="4353231be09c134507092161cd3ced27a065ca0ebb31ee0256e60a8163c47c3b") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant( "cxxstd", diff --git a/var/spack/repos/builtin/packages/clingo-bootstrap/package.py b/var/spack/repos/builtin/packages/clingo-bootstrap/package.py index a643867d6319cf..6e679e20ee9e06 100644 --- a/var/spack/repos/builtin/packages/clingo-bootstrap/package.py +++ b/var/spack/repos/builtin/packages/clingo-bootstrap/package.py @@ -8,7 +8,6 @@ import spack.user_environment from spack.package import * from spack.pkg.builtin.clingo import Clingo -from spack.util.environment import EnvironmentModifications class ClingoBootstrap(Clingo): @@ -93,9 +92,9 @@ def pgo_train(self): # Set PGO training flags. generate_mods = EnvironmentModifications() - generate_mods.append_flags("CFLAGS", "-fprofile-generate={}".format(reports)) - generate_mods.append_flags("CXXFLAGS", "-fprofile-generate={}".format(reports)) - generate_mods.append_flags("LDFLAGS", "-fprofile-generate={} --verbose".format(reports)) + generate_mods.append_flags("CFLAGS", f"-fprofile-generate={reports}") + generate_mods.append_flags("CXXFLAGS", f"-fprofile-generate={reports}") + generate_mods.append_flags("LDFLAGS", f"-fprofile-generate={reports}") with working_dir(self.build_directory, create=True): cmake(*cmake_options, sources, extra_env=generate_mods) @@ -119,14 +118,14 @@ def pgo_train(self): # Clean the build dir. rmtree(self.build_directory, ignore_errors=True) - if self.spec.satisfies("%clang") or self.spec.satisfies("apple-clang"): + if self.spec.satisfies("%clang") or self.spec.satisfies("%apple-clang"): # merge reports use_report = join_path(reports, "merged.prof") raw_files = glob.glob(join_path(reports, "*.profraw")) - llvm_profdata("merge", "--output={}".format(use_report), *raw_files) - use_flag = "-fprofile-instr-use={}".format(use_report) + llvm_profdata("merge", f"--output={use_report}", *raw_files) + use_flag = f"-fprofile-instr-use={use_report}" else: - use_flag = "-fprofile-use={}".format(reports) + use_flag = f"-fprofile-use={reports}" # Set PGO use flags for next cmake phase. use_mods = EnvironmentModifications() diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index 2d167f251d2880..64f4794f000457 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -30,11 +30,13 @@ class Cmake(Package): license("BSD-3-Clause") version("master", branch="master") + version("3.31.5", sha256="66fb53a145648be56b46fa9e8ccade3a4d0dfc92e401e52ce76bdad1fea43d27") version("3.31.4", sha256="a6130bfe75f5ba5c73e672e34359f7c0a1931521957e8393a5c2922c8b0f7f25") version("3.31.3", sha256="fac45bc6d410b49b3113ab866074888d6c9e9dc81a141874446eb239ac38cb87") version("3.31.2", sha256="42abb3f48f37dbd739cdfeb19d3712db0c5935ed5c2aef6c340f9ae9114238a2") version("3.31.1", sha256="c4fc2a9bd0cd5f899ccb2fb81ec422e175090bc0de5d90e906dd453b53065719") version("3.31.0", sha256="300b71db6d69dcc1ab7c5aae61cbc1aa2778a3e00cbd918bc720203e311468c3") + version("3.30.7", sha256="470e44d9c7caa3bd869ef953071b84f565b5d378d0a9eccbbbcd72031f21b9de") version("3.30.6", sha256="a7aa25cdd8545156fe0fec95ebbd53cb2b5173a8717e227f6e8a755185c168cf") version("3.30.5", sha256="9f55e1a40508f2f29b7e065fa08c29f82c402fa0402da839fffe64a25755a86d") version("3.30.4", sha256="c759c97274f1e7aaaafcb1f0d261f9de9bf3a5d6ecb7e2df616324a46fe704b2") @@ -75,45 +77,6 @@ class Cmake(Package): version("3.0.2", sha256="6b4ea61eadbbd9bec0ccb383c29d1f4496eacc121ef7acf37c7a24777805693e") version("2.8.10.2", sha256="ce524fb39da06ee6d47534bbcec6e0b50422e18b62abc4781a4ba72ea2910eb1") - with default_args(deprecated=True): - version( - "3.29.3", sha256="252aee1448d49caa04954fd5e27d189dd51570557313e7b281636716a238bccb" - ) - version( - "3.29.2", sha256="36db4b6926aab741ba6e4b2ea2d99c9193222132308b4dc824d4123cb730352e" - ) - version( - "3.29.1", sha256="7fb02e8f57b62b39aa6b4cf71e820148ba1a23724888494735021e32ab0eefcc" - ) - version( - "3.29.0", sha256="a0669630aae7baa4a8228048bf30b622f9e9fd8ee8cedb941754e9e38686c778" - ) - version( - "3.28.4", sha256="eb9c787e078848dc493f4f83f8a4bbec857cd1f38ab6425ce8d2776a9f6aa6fb" - ) - version( - "3.28.3", sha256="72b7570e5c8593de6ac4ab433b73eab18c5fb328880460c86ce32608141ad5c1" - ) - version( - "3.28.2", sha256="1466f872dc1c226f373cf8fba4230ed216a8f108bd54b477b5ccdfd9ea2d124a" - ) - version( - "3.28.1", sha256="15e94f83e647f7d620a140a7a5da76349fc47a1bfed66d0f5cdee8e7344079ad" - ) - version( - "3.28.0", sha256="e1dcf9c817ae306e73a45c2ba6d280c65cf4ec00dd958eb144adaf117fb58e71" - ) - # used in py-cmake, to be removed in Spack 0.23 - version( - "3.22.2", sha256="3c1c478b9650b107d452c5bd545c72e2fad4e37c09b89a1984b9a2f46df6aced" - ) - version( - "3.21.4", sha256="d9570a95c215f4c9886dd0f0564ca4ef8d18c30750f157238ea12669c2985978" - ) - version( - "3.18.0", sha256="83b4ffcb9482a73961521d2bafe4a16df0168f03f56e6624c419c461e5317e29" - ) - depends_on("c", type="build") depends_on("cxx", type="build") @@ -162,9 +125,9 @@ class Cmake(Package): patch("mr-9623.patch", when="@3.22.0:3.30") depends_on("ninja", when="platform=windows") - depends_on("gmake", when="platform=linux") - depends_on("gmake", when="platform=darwin") - depends_on("gmake", when="platform=freebsd") + depends_on("gmake", type=("build", "run"), when="platform=linux") + depends_on("gmake", type=("build", "run"), when="platform=darwin") + depends_on("gmake", type=("build", "run"), when="platform=freebsd") depends_on("qt", when="+qtgui") # Qt depends on libmng, which is a CMake package; diff --git a/var/spack/repos/builtin/packages/code-server/package.py b/var/spack/repos/builtin/packages/code-server/package.py index e63e6d001e57ee..82172a988f75ef 100644 --- a/var/spack/repos/builtin/packages/code-server/package.py +++ b/var/spack/repos/builtin/packages/code-server/package.py @@ -12,58 +12,11 @@ class CodeServer(Package): homepage = "https://coder.com/docs/code-server/latest" url = "https://github.com/coder/code-server/releases/download/v4.4.0/code-server-4.4.0-linux-amd64.tar.gz" - version("4.12.0", sha256="d50ee947c4144a6ff2656e664ecbb3f70b75168b8a6e8c3eef47787f3c240c26") - version("4.11.0", sha256="4eb233054941ec298caec6fc84dfba0a72c1bc5fadc0fe4896b10f3f4a291d51") - version("4.10.1", sha256="f34ce611a9c058982a5e9d200fdf009788e3a564e970b053f4145574bce21b09") - version("4.4.0", sha256="e3dd265acb18c2230c72d19bbce619ac5c1bd800ebb26e5e169c4d613069500d") - version("4.3.0", sha256="42c71e98de85270b164b023ef8eb0692cf7700c03081ba5a44eaca014a92eb57") - version("4.2.0", sha256="98be5bc43ac604c49ae11da259e318b581757a59a25edeee5cf55317ca589ec6") - version("4.1.0", sha256="f720b20d1f615b78f3a1be9b1614f3d99ed722b8da3047a4143dbe5835e52ce3") - version("4.0.2", sha256="68c11afa3288707a6880920013d8bac7404cd590eb4f63cac92979d0b0bf4fd1") - version("4.0.1", sha256="5fe6d26e9d19e685946f0f392d9c822e5303a800cac3ac54a6a2c26104d239fd") - version("3.12.0", sha256="d3ca41a55e36d73d80300702af2687e25d440cff6b613bb58a2c88d9b8a0a38f") - version("3.11.1", sha256="d34b0b79582196d59d44ac971aabb7f15cb05d837318b94f62470dc8475665e9") - version("3.11.0", sha256="dddb97f044ed615a4b8a526328fca6ad703b9c671a28a6090d84668a18755589") - version("3.10.2", sha256="47154a6b9e61a0313ba499dd5d948613a17841c2f580612f9721c31964622bf5") - version("3.10.1", sha256="18175624df78976488dbcc2a26f2582a71cef5ca0a419e691b1b70da0b27c7ef") - version("3.10.0", sha256="5dfce848747f3dd5074cba435cca6730ac99d6d3aa3f50e0a9bf222ad12d3e97") - version("3.9.3", sha256="eba42eaf868c2144795b1ac54929e3b252ae35403bf8553b3412a5ac4f365a41") - version("3.9.2", sha256="5dbda5ac598223006f72bcb700b133a752aabe4468ed8105806d1d69b5364408") - version("3.9.1", sha256="f2648a4387c5a5be8666fb82a7b8a58274c45b91942251ab337e202e078ae8a5") - version("3.9.0", sha256="229b0fb95d78a7f7ff0dd55bc151a7521fcd699af50151faf67f6c7ce51110f4") - version("3.8.1", sha256="130cf94e3921d0e2adfa33e875bf1aa81fd28548aac94fd31fbc589baa68d45f") - version("3.8.0", sha256="70b069f26b30c38cca5fa07b5f25db4d15976de80af3a644b9105d1b5e23e7d5") - version("3.7.4", sha256="01ca0e48df44df70cdf702644b013102024a5b30edf6c1fbb2e10b0310056382") - version("3.7.3", sha256="7a90f3171c9bc6f65266066e35cc34d48a032910c136ea21116d28f3d7214547") - version("3.7.2", sha256="c3054f214392b1b2eb4c77c57cb950ac5d733d349a426975e8bf32028e65a226") - version("3.7.1", sha256="bebd9e0c46e0fd4b4f295fd91fc2db135a694614db972095e9842bf7969f4cee") - version("3.7.0", sha256="5f8df8ed3924e8e594674d73fb50b00a06efa529f96a0495a5ee8c39c68f3ce1") - version("3.6.2", sha256="fd4ac7d61f3e1b2a5034f1706e409c77fad299adef0ede204828d8ecfe317e45") - version("3.6.1", sha256="bbe4ef9585e093b3521deb34a0820d2136172271862d6396df21c2e9a26c6374") - version("3.6.0", sha256="d1ae4f7263741e0551358d3ed77dad587b33b352d827623d4df25e98f9e21019") - version("3.5.0", sha256="90c19c84611becac4af1fb0bd5324ab30f9200769fa7914cd10ccb6b88c657bb") - version("3.4.1", sha256="afdb89f4dc7201c03cb35d4f8dc1ccb6060bd0da324a6789089de264d3406817") - version("3.4.0", sha256="918c28696b73b96dc9361977f93e788d5c8884b5d4a088d206f05d5b8bccb738") - version("3.3.1", sha256="57b9855b20f511e22776ee8a53d1ff30f864498814c4c0b0af3510f71d7a2969") - version("3.3.0", sha256="6ca5148a447b41753d5151c5a49a8af24122c7b0808609782aec454e66be4f2c") - version("3.2.0", sha256="a8157e8766d6a0e255c72db25e8677a57adb8d889d653e78750b4d26a6ff7400") - version("3.1.1", sha256="5dd922d28b2e351c146081849d987fb1e439ee7d53b941434b2eecb2a194da71") - version("3.1.0", sha256="5ef85c8f280ce781a176a8b77386b333efe892755a5c325a1782e4eac6016e59") - version("3.0.2", sha256="04367cfeb23991f3dc3f1ef8e3dfe5e9d683bb50c9e1fa69e3c21757facfd7ee") + version("4.96.4", sha256="b3f9025d00f2cdf61caf83945ef7225d4a3eb576c4c007e45868f45713e39c8e") depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated - def url_for_version(self, version): - if version <= Version("3.2.0"): - return "https://github.com/coder/code-server/releases/download/{0}/code-server-{0}-linux-x86_64.tar.gz".format( - version - ) - else: - return "https://github.com/coder/code-server/releases/download/v{0}/code-server-{0}-linux-amd64.tar.gz".format( - version - ) - def install(self, spec, prefix): install_tree(".", prefix) diff --git a/var/spack/repos/builtin/packages/collier/package.py b/var/spack/repos/builtin/packages/collier/package.py index 4fe6ba33f724c5..45f53fd81c723c 100644 --- a/var/spack/repos/builtin/packages/collier/package.py +++ b/var/spack/repos/builtin/packages/collier/package.py @@ -31,7 +31,9 @@ class Collier(CMakePackage): version("1.1", sha256="80fd54e2c30029d3d7d646738ae9469ad3a6f5ea7aa1179b951030df048e36bc") version("1.0", sha256="54f40c1ed07a6829230af400abfe48791e74e56eac2709c0947cec3410a4473d") - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") @property def parallel(self): diff --git a/var/spack/repos/builtin/packages/comgr/package.py b/var/spack/repos/builtin/packages/comgr/package.py index 9b07c94ad9f5a1..df11eb0cdb10d5 100644 --- a/var/spack/repos/builtin/packages/comgr/package.py +++ b/var/spack/repos/builtin/packages/comgr/package.py @@ -29,6 +29,8 @@ def url_for_version(self, version): license("NCSA") version("master", branch="amd-stg-open") + version("6.3.2", sha256="1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827") + version("6.3.1", sha256="e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c") version("6.3.0", sha256="79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c") version("6.2.4", sha256="7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528") version("6.2.1", sha256="4840f109d8f267c28597e936c869c358de56b8ad6c3ed4881387cf531846e5a7") @@ -86,6 +88,8 @@ def url_for_version(self, version): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: # llvm libs are linked statically, so this *could* be a build dep @@ -112,6 +116,8 @@ def url_for_version(self, version): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/compadre/package.py b/var/spack/repos/builtin/packages/compadre/package.py index bb9776f991ad5a..943b369ae79bfd 100644 --- a/var/spack/repos/builtin/packages/compadre/package.py +++ b/var/spack/repos/builtin/packages/compadre/package.py @@ -66,7 +66,7 @@ def cmake_args(self): [ "-DKokkosCore_PREFIX={0}".format(kokkos.prefix), "-DKokkosKernels_PREFIX={0}".format(kokkos_kernels.prefix), - "-DCMAKE_CXX_COMPILER:STRING={0}".format(spec["kokkos"].kokkos_cxx), + "-DCMAKE_CXX_COMPILER:STRING={0}".format(self["kokkos"].kokkos_cxx), # Compadre_USE_PYTHON is OFF by default "-DCompadre_USE_PYTHON=OFF", ] diff --git a/var/spack/repos/builtin/packages/composable-kernel/package.py b/var/spack/repos/builtin/packages/composable-kernel/package.py index 11827f5aadf6bd..d4b76d0444643e 100644 --- a/var/spack/repos/builtin/packages/composable-kernel/package.py +++ b/var/spack/repos/builtin/packages/composable-kernel/package.py @@ -18,6 +18,8 @@ class ComposableKernel(CMakePackage): license("MIT") version("master", branch="develop") + version("6.3.2", sha256="875237fe493ff040f8f63b827cddf2ff30a8d3aa18864f87d0e35323c7d62a2d") + version("6.3.1", sha256="3e8c8c832ca3f9ceb99ab90f654b93b7db876f08d90eda87a70bc629c854052a") version("6.3.0", sha256="274f87fc27ec2584c76b5bc7ebdbe172923166b6b93e66a24f98475b44be272d") version("6.2.4", sha256="5598aea4bce57dc95b60f2029831edfdade80b30a56e635412cc02b2a6729aa6") version("6.2.1", sha256="708ff25218dc5fa977af4a37105b380d7612a70c830fa7977b40b3df8b8d3162") @@ -59,6 +61,8 @@ class ComposableKernel(CMakePackage): for ver in [ "master", + "6.3.2", + "6.3.1", "6.3.0", "6.2.4", "6.2.1", diff --git a/var/spack/repos/builtin/packages/conda4aarch64/package.py b/var/spack/repos/builtin/packages/conda4aarch64/package.py index 595b631dfe4868..dc0f0e79c2db39 100644 --- a/var/spack/repos/builtin/packages/conda4aarch64/package.py +++ b/var/spack/repos/builtin/packages/conda4aarch64/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * -from spack.util.environment import EnvironmentModifications class Conda4aarch64(Package): diff --git a/var/spack/repos/builtin/packages/conduit/package.py b/var/spack/repos/builtin/packages/conduit/package.py index 7d9d343570fcef..1ab662acdeca02 100644 --- a/var/spack/repos/builtin/packages/conduit/package.py +++ b/var/spack/repos/builtin/packages/conduit/package.py @@ -8,8 +8,6 @@ import socket from os import environ as env -import llnl.util.tty as tty - from spack.package import * diff --git a/var/spack/repos/builtin/packages/covfie/package.py b/var/spack/repos/builtin/packages/covfie/package.py index 2d23e4430e34e8..4147bb9ed4b3d3 100644 --- a/var/spack/repos/builtin/packages/covfie/package.py +++ b/var/spack/repos/builtin/packages/covfie/package.py @@ -19,6 +19,8 @@ class Covfie(CMakePackage, CudaPackage): maintainers("stephenswat") + version("0.12.1", sha256="c33d7707ee30ab5fa8df686a780600343760701023ac0b23355627e1f2f044de") + version("0.12.0", sha256="e35e94075a40e89c4691ff373e3061577295d583a2546c682b2d652d9fce7828") version("0.11.0", sha256="39fcd0f218d3b4f3aacc6af497a8cda8767511efae7a72b47781f10fd4340f4f") version("0.10.0", sha256="d44142b302ffc193ad2229f1d2cc6d8d720dd9da8c37989ada4f23018f86c964") diff --git a/var/spack/repos/builtin/packages/cp2k/package.py b/var/spack/repos/builtin/packages/cp2k/package.py index c80959d59901b1..daa3832f6b573e 100644 --- a/var/spack/repos/builtin/packages/cp2k/package.py +++ b/var/spack/repos/builtin/packages/cp2k/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import copy import os -import os.path import sys import spack.util.environment @@ -39,10 +38,11 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage): git = "https://github.com/cp2k/cp2k.git" list_url = "https://github.com/cp2k/cp2k/releases" - maintainers("dev-zero", "mtaillefumier") + maintainers("dev-zero", "mtaillefumier", "RMeli", "abussy") license("GPL-2.0-or-later") + version("2025.1", sha256="65c8ad5488897b0f995919b9fa77f2aba4b61677ba1e3c19bb093d5c08a8ce1d") version("2024.3", sha256="a6eeee773b6b1fb417def576e4049a89a08a0ed5feffcd7f0b33c7d7b48f19ba") version("2024.2", sha256="cc3e56c971dee9e89b705a1103765aba57bf41ad39a11c89d3de04c8b8cdf473") version("2024.1", sha256="a7abf149a278dfd5283dc592a2c4ae803b37d040df25d62a5e35af5c4557668f") @@ -116,8 +116,26 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage): ) variant("pytorch", default=False, description="Enable libtorch support") variant("quip", default=False, description="Enable quip support") + variant("dftd4", when="@2024.2:", default=False, description="Enable DFT-D4 support") variant("mpi_f08", default=False, description="Use MPI F08 module") - + variant("smeagol", default=False, description="Enable libsmeagol support", when="@2025.2:") + variant( + "pw_gpu", default=True, description="Enable FFT calculations on GPU", when="@2025.2: +cuda" + ) + variant("grid_gpu", default=True, description="Enable grid GPU backend", when="@2025.2:") + variant("dbm_gpu", default=True, description="Enable DBM GPU backend", when="@2025.2:") + variant( + "pw_gpu", + default=False, + description="Enable FFT calculations on GPU", + when="@2025.2: +rocm", + ) + variant( + "hip_backend_cuda", + default=False, + description="Enable HIP backend on Nvidia GPU", + when="@2025.2: +cuda", + ) variant( "enable_regtests", default=False, @@ -146,6 +164,12 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage): description="Use CUBLAS for general matrix operations in DBCSR", ) + with when("+hip_backend_cuda"): + depends_on("hipcc") + depends_on("hip+cuda") + depends_on("hipfft+cuda") + depends_on("hipblas+cuda") + HFX_LMAX_RANGE = range(4, 8) variant( @@ -157,6 +181,7 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage): ) depends_on("python@3", type="build") + depends_on("pkgconfig", type="build", when="build_system=cmake") depends_on("blas") depends_on("lapack") @@ -194,13 +219,14 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage): ) with when("+libxc"): - depends_on("pkgconfig", type="build", when="@7.0:") + depends_on("pkgconfig", type="build", when="@7.0: ^libxc@:6") depends_on("libxc@4.0.3:4", when="@7.0:8.1") depends_on("libxc@5.1.3:5.1", when="@8.2:8") depends_on("libxc@5.1.7:5.1", when="@9:2022.2") depends_on("libxc@6.1:", when="@2023.1:") depends_on("libxc@6.2:", when="@2023.2:") depends_on("libxc@:6", when="@:2024.3") + depends_on("libxc@7 build_system=cmake", when="@2025.2:") with when("+spla"): depends_on("spla+cuda+fortran", when="+cuda") @@ -261,6 +287,8 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage): depends_on("plumed+mpi", when="+mpi") depends_on("plumed~mpi", when="~mpi") + depends_on("libsmeagol", when="+smeagol") + # while we link statically against PEXSI, its own deps may be linked in # dynamically, therefore can't set this as pure build-type dependency. depends_on("pexsi+fortran@0.10.0:", when="+pexsi") @@ -291,6 +319,8 @@ class Cp2k(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage): depends_on("spglib", when="+spglib") + depends_on("dftd4@3.6.0: build_system=cmake", when="+dftd4") + with when("build_system=cmake"): depends_on("cmake@3.22:", type="build") @@ -622,6 +652,18 @@ def edit(self, pkg, spec, prefix): ldflags += [spglib.search_flags] libs.append(spglib.ld_flags) + if spec.satisfies("+dftd4"): + cppflags += ["-D__DFTD4"] + dftd4 = spec["dftd4"].libs + ldflags += [dftd4.search_flags] + libs.append(dftd4.ld_flags) + + if spec.satisfies("+smeagol"): + cppflags += ["-D__SMEAGOL"] + smeagol = spec["libsmeagol"].libs + ldflags += [smeagol.search_flags] + libs.append(smeagol.ld_flags) + cc = spack_cc if "~mpi" in spec else spec["mpi"].mpicc cxx = spack_cxx if "~mpi" in spec else spec["mpi"].mpicxx fc = spack_fc if "~mpi" in spec else spec["mpi"].mpifc @@ -764,8 +806,8 @@ def edit(self, pkg, spec, prefix): "Point environment variable LIBSMM_PATH to " "the absolute path of the libsmm.a file" ) - except IOError: - raise IOError( + except OSError: + raise OSError( "The file LIBSMM_PATH pointed to does not " "exist. Note that it must be absolute path." ) @@ -963,10 +1005,15 @@ def cmake_args(self): raise InstallError("CP2K supports only one cuda_arch at a time.") else: gpu_ver = GPU_MAP[spec.variants["cuda_arch"].value[0]] - args += [ - self.define("CP2K_USE_ACCEL", "CUDA"), - self.define("CP2K_WITH_GPU", gpu_ver), - ] + if spec.satisfies("+hip_backend_cuda"): + args += [ + self.define("CP2K_USE_ACCEL", "HIP"), + self.define("CMAKE_HIP_PLATFORM", "nvidia"), + ] + else: + args += [self.define("CP2K_USE_ACCEL", "CUDA")] + + args += [self.define("CP2K_WITH_GPU", gpu_ver)] if spec.satisfies("+rocm"): if len(spec.variants["amdgpu_target"].value) > 1: @@ -995,7 +1042,12 @@ def cmake_args(self): self.define_from_variant("CP2K_USE_VORI", "libvori"), self.define_from_variant("CP2K_USE_SPLA", "spla"), self.define_from_variant("CP2K_USE_QUIP", "quip"), + self.define_from_variant("CP2K_USE_DFTD4", "dftd4"), self.define_from_variant("CP2K_USE_MPI_F08", "mpi_f08"), + self.define_from_variant("CP2K_USE_LIBSMEAGOL", "smeagol"), + self.define_from_variant("CP2K_ENABLE_GRID_GPU", "grid_gpu"), + self.define_from_variant("CP2K_ENABLE_DBM_GPU", "dbm_gpu"), + self.define_from_variant("CP2K_ENABLE_PW_GPU", "pw_gpu"), ] # we force the use elpa openmp threading support. might need to be revisited though diff --git a/var/spack/repos/builtin/packages/cppgsl/package.py b/var/spack/repos/builtin/packages/cppgsl/package.py index 379e5f97fc1c07..21a015d9b7ff89 100644 --- a/var/spack/repos/builtin/packages/cppgsl/package.py +++ b/var/spack/repos/builtin/packages/cppgsl/package.py @@ -15,6 +15,7 @@ class Cppgsl(CMakePackage): license("MIT") version("main", branch="main") + version("4.1.0", sha256="0a227fc9c8e0bf25115f401b9a46c2a68cd28f299d24ab195284eb3f1d7794bd") version("4.0.0", sha256="f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9") version("3.1.0", sha256="d3234d7f94cea4389e3ca70619b82e8fb4c2f33bb3a070799f1e18eef500a083") version("2.1.0", sha256="ef73814657b073e1be86c8f7353718771bf4149b482b6cb54f99e79b23ff899d") @@ -32,6 +33,7 @@ class Cppgsl(CMakePackage): ) depends_on("cmake@3.1.3:", type="build") + depends_on("cmake@3.14:", type="build", when="@4.1:") def cmake_args(self): return [ diff --git a/var/spack/repos/builtin/packages/cpuinfo/package.py b/var/spack/repos/builtin/packages/cpuinfo/package.py index 15cbb7ffa0d5ae..c98679da9e2de8 100644 --- a/var/spack/repos/builtin/packages/cpuinfo/package.py +++ b/var/spack/repos/builtin/packages/cpuinfo/package.py @@ -18,7 +18,8 @@ class Cpuinfo(CMakePackage): license("BSD-2-Clause") version("main", branch="main") - version("2024-09-06", commit="094fc30b9256f54dad5ad23bcbfb5de74781422f") # py-torch@2.5.1: + version("2024-09-26", commit="1e83a2fdd3102f65c6f1fb602c1b320486218a99") # py-torch@2.6: + version("2024-09-06", commit="094fc30b9256f54dad5ad23bcbfb5de74781422f") # py-torch@2.5.1 version("2024-08-30", commit="fa1c679da8d19e1d87f20175ae1ec10995cd3dd3") # py-torch@2.5.0 version("2023-11-04", commit="d6860c477c99f1fce9e28eb206891af3c0e1a1d7") # py-torch@2.3:2.4 version("2023-01-13", commit="6481e8bef08f606ddd627e4d3be89f64d62e1b8a") # py-torch@2.1:2.2 diff --git a/var/spack/repos/builtin/packages/cray-mpich/package.py b/var/spack/repos/builtin/packages/cray-mpich/package.py index 288a8ebeee49ce..485ca4da6eb8ad 100644 --- a/var/spack/repos/builtin/packages/cray-mpich/package.py +++ b/var/spack/repos/builtin/packages/cray-mpich/package.py @@ -4,20 +4,24 @@ import os +import llnl.util.tty as tty + from spack.package import * from spack.pkg.builtin.mpich import MpichEnvironmentModifications from spack.util.module_cmd import get_path_args_from_module_line, module -class CrayMpich(MpichEnvironmentModifications, Package): +class CrayMpich(MpichEnvironmentModifications, Package, CudaPackage, ROCmPackage): """Cray's MPICH is a high performance and widely portable implementation of the Message Passing Interface (MPI) standard.""" homepage = "https://docs.nersc.gov/development/compilers/wrappers/" has_code = False # Skip attempts to fetch source that is not available - maintainers("haampie") + maintainers("etiennemlb", "haampie") + version("8.1.30") + version("8.1.28") version("8.1.25") version("8.1.24") version("8.1.21") @@ -123,3 +127,86 @@ def libs(self): libs += find_libraries(libraries, root=self.prefix.lib64, recursive=True) return libs + + @property + def gtl_lib(self): + # GPU transport Layer (GTL) handling background: + # - The cray-mpich module defines an environment variable per supported + # GPU (say, PE_MPICH_GTL_LIBS_amd_gfx942). So we should read the + # appropriate variable. + # In practice loading a module and checking its content is a PITA. We + # simplify by assuming that the GTL for a given vendor (say, AMD), is + # one and the same for all the targets of this vendor (one GTL for all + # Nvidia or one GTL for all AMD devices). + # - Second, except if you have a very weird mpich layout, the GTL are + # located in /opt/cray/pe/mpich//gtl/lib when the + # MPI libraries are in + # /opt/cray/pe/mpich//ofi//. + # Example: + # /opt/cray/pe/mpich/8.1.28/gtl/lib + # /opt/cray/pe/mpich/8.1.28/ofi// + # /opt/cray/pe/mpich/8.1.28/ofi///../../../gtl/lib + + gtl_kinds = { + "cuda": { + "lib": "libmpi_gtl_cuda", + "variant": "cuda_arch", + "values": {"70", "80", "90"}, + }, + "rocm": { + "lib": "libmpi_gtl_hsa", + "variant": "amdgpu_target", + "values": {"gfx906", "gfx908", "gfx90a", "gfx940", "gfx942"}, + }, + } + + for variant, gtl_kind in gtl_kinds.items(): + arch_variant = gtl_kind["variant"] + arch_values = gtl_kind["values"] + gtl_lib = gtl_kind["lib"] + + if self.spec.satisfies(f"+{variant} {arch_variant}=*"): + accelerator_architecture_set = set(self.spec.variants[arch_variant].value) + + if len( + accelerator_architecture_set + ) >= 1 and not accelerator_architecture_set.issubset(arch_values): + raise InstallError( + f"cray-mpich variant '+{variant} {arch_variant}'" + " was specified but no GTL support could be found for it." + ) + + mpi_root = os.path.abspath( + os.path.join(self.prefix, os.pardir, os.pardir, os.pardir) + ) + + gtl_root = os.path.join(mpi_root, "gtl", "lib") + + gtl_shared_libraries = find_libraries( + [gtl_lib], root=gtl_root, shared=True, recursive=False + ) + + if len(gtl_shared_libraries) != 1: + raise InstallError( + f"cray-mpich variant '+{variant} {arch_variant}'" + " was specified and GTL support was found for it but" + f" the '{gtl_lib}' could not be correctly found on disk." + ) + + gtl_library_fullpath = list(gtl_shared_libraries)[0] + tty.debug(f"Selected GTL: {gtl_library_fullpath}") + + gtl_library_directory = os.path.dirname(gtl_library_fullpath) + gtl_library_name = os.path.splitext( + os.path.basename(gtl_library_fullpath).split("lib")[1] + )[0] + + # Early break. Only one GTL can be active at a given time. + return { + "ldflags": [ + f"-L{gtl_library_directory}", + f"-Wl,-rpath,{gtl_library_directory}", + ], + "ldlibs": [f"-l{gtl_library_name}"], + } + return {} diff --git a/var/spack/repos/builtin/packages/creduce/package.py b/var/spack/repos/builtin/packages/creduce/package.py index ff20404d8fc253..a9f8275b0dfc73 100644 --- a/var/spack/repos/builtin/packages/creduce/package.py +++ b/var/spack/repos/builtin/packages/creduce/package.py @@ -25,7 +25,7 @@ class Creduce(CMakePackage): depends_on("flex") depends_on("libxml2") depends_on("llvm") - depends_on("llvm@8.0.0", when="@:2.10") + depends_on("llvm@8.0", when="@:2.10") depends_on("perl") depends_on("perl-exporter-lite") depends_on("perl-file-which") diff --git a/var/spack/repos/builtin/packages/cromwell-womtool/package.py b/var/spack/repos/builtin/packages/cromwell-womtool/package.py index 6e75f9ee1807ac..dda9e14cd5678c 100644 --- a/var/spack/repos/builtin/packages/cromwell-womtool/package.py +++ b/var/spack/repos/builtin/packages/cromwell-womtool/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/cromwell/package.py b/var/spack/repos/builtin/packages/cromwell/package.py index 22ef937364e3c1..99566a1c986eea 100644 --- a/var/spack/repos/builtin/packages/cromwell/package.py +++ b/var/spack/repos/builtin/packages/cromwell/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/crtm-fix/package.py b/var/spack/repos/builtin/packages/crtm-fix/package.py index 9a69119ac8a14a..6a19bcc7b8f8e6 100644 --- a/var/spack/repos/builtin/packages/crtm-fix/package.py +++ b/var/spack/repos/builtin/packages/crtm-fix/package.py @@ -17,6 +17,7 @@ class CrtmFix(Package): "BenjaminTJohnson", "edwardhartnett", "AlexanderRichert-NOAA", "Hang-Lei-NOAA", "climbfuji" ) + version("3.1.1.2", sha256="c2e289f690d82a3aa82d2239cbb567cd514fa0f476a8b498ceba11670685ca66") version( "2.4.0.1_emc", sha256="6e4005b780435c8e280d6bfa23808d8f12609dfd72f77717d046d4795cac0457" ) @@ -26,6 +27,7 @@ class CrtmFix(Package): variant("big_endian", default=True, description="Install big_endian fix files") variant("little_endian", default=False, description="Install little endian fix files") variant("netcdf", default=True, description="Install netcdf fix files") + variant("testfiles", default=False, description="Install test files", when="@3:") conflicts("+big_endian", when="+little_endian", msg="big_endian and little_endian conflict") @@ -51,7 +53,11 @@ def install(self, spec, prefix): fix_files = [] for d in endian_dirs: - fix_files = fix_files + find(".", "*/{}/*".format(d)) + fix_files = fix_files + find(".", "*/{}/*".format(d), recursive=False) + fix_files = fix_files + find(".", "*/*/{}/*".format(d), recursive=False) + if self.spec.satisfies("~testfiles"): + fix_files = [f for f in fix_files if "/fix/test_data/" not in f] + fix_files = [f for f in fix_files if os.path.isfile(f)] # Big_Endian amsua_metop-c.SpcCoeff.bin is incorrect # Little_Endian amsua_metop-c_v2.SpcCoeff.bin is what it's supposed to be. diff --git a/var/spack/repos/builtin/packages/crtm/package.py b/var/spack/repos/builtin/packages/crtm/package.py index 09f31ad3f35a8e..b146df9f78a565 100644 --- a/var/spack/repos/builtin/packages/crtm/package.py +++ b/var/spack/repos/builtin/packages/crtm/package.py @@ -50,6 +50,9 @@ class Crtm(CMakePackage): license("CC0-1.0") + version( + "v3.1.1-build1", sha256="1ed49e594da5d3769cbaa52cc7fc19c1bb0325ee6324f6057227c31e2d95ca67" + ) version( "v3.1.0-skylabv8", sha256="a475c8a444072aef1e8c2babba3d12f13ab0fb6c7ecab88edad57130839e29ff", @@ -80,8 +83,9 @@ class Crtm(CMakePackage): depends_on("fortran", type="build") # generated def url_for_version(self, version): - if self.spec.satisfies("@v3") or version >= Version("3.0.0"): - return f"https://github.com/JCSDA/crtmv3/archive/refs/tags/{version}.tar.gz" + if version > Version("v3") or version >= Version("3"): + fmtversion = str(version).replace("-build", "+build") + return f"https://github.com/JCSDA/CRTMv3/archive/refs/tags/{fmtversion}.tar.gz" else: return f"https://github.com/JCSDA/crtm/archive/refs/tags/{version}.tar.gz" diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py index 6d3ae0e81c379b..72dd1cc560405c 100644 --- a/var/spack/repos/builtin/packages/cuda/package.py +++ b/var/spack/repos/builtin/packages/cuda/package.py @@ -7,8 +7,6 @@ import re from glob import glob -import llnl.util.tty as tty - from spack.package import * # FIXME Remove hack for polymorphic versions @@ -23,6 +21,16 @@ # format returned by platform.system() and 'arch' by platform.machine() _versions = { + "12.8.0": { + "Linux-aarch64": ( + "5bc211f00c4f544da6e3fc3a549b3eb0a7e038439f5f3de71caa688f2f6b132c", + "https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_570.86.10_linux_sbsa.run", + ), + "Linux-x86_64": ( + "610867dcd6d94c4e36c4924f1d01b9db28ec08164e8af6c764f21b84200695f8", + "https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_570.86.10_linux.run", + ), + }, "12.6.3": { "Linux-aarch64": ( "213ea63a6357020978a8b0a79a8c9d12a2a5941afa1cdc69d5a3f933fa8bed04", @@ -741,7 +749,7 @@ def install(self, spec, prefix): os.remove("/tmp/cuda-installer.log") except OSError: if spec.satisfies("@10.1:"): - tty.die( + raise InstallError( "The cuda installer will segfault due to the " "presence of /tmp/cuda-installer.log " "please remove the file and try again " diff --git a/var/spack/repos/builtin/packages/cusz/package.py b/var/spack/repos/builtin/packages/cusz/package.py index 99f111365558d2..661083863990a3 100644 --- a/var/spack/repos/builtin/packages/cusz/package.py +++ b/var/spack/repos/builtin/packages/cusz/package.py @@ -19,7 +19,10 @@ class Cusz(CMakePackage, CudaPackage): conflicts("cuda_arch=none", when="+cuda") version("develop", branch="develop") - version("0.6.0", commit="cafed521dc338fe2159ebb5b09a36fc318524bf7") + version("0.14.0", commit="e57fd7cd9df923164af9dd307b0b3d37dd9df137") + version("0.9.0rc3", commit="c3c3a74d006c6de3c145255241fb181682bd1492") + # 0.9.0rc1 was listed as 0.6.0 for a while in spack + version("0.9.0rc1", commit="cafed521dc338fe2159ebb5b09a36fc318524bf7") version("0.3.1", commit="02be3cbd07db467decaf45ec9eb593ba6173c809") version("0.3", sha256="0feb4f7fd64879fe147624dd5ad164adf3983f79b2e0383d35724f8d185dcb11") @@ -31,6 +34,10 @@ class Cusz(CMakePackage, CudaPackage): depends_on("cub", when="^cuda@:10.2.89") + patch("thrust-includes.patch", when="@0.10:0.14 ^cuda@12.8:") + patch("thrust-includes-0.9.patch", when="@0.9 ^cuda@12.8:") + conflicts("^cuda@12.8:", when="@:0.8") + def cmake_args(self): cuda_arch = self.spec.variants["cuda_arch"].value args = ["-DBUILD_TESTING=OFF", ("-DCMAKE_CUDA_ARCHITECTURES=%s" % cuda_arch)] diff --git a/var/spack/repos/builtin/packages/cusz/thrust-includes-0.9.patch b/var/spack/repos/builtin/packages/cusz/thrust-includes-0.9.patch new file mode 100644 index 00000000000000..c8038e41aa2636 --- /dev/null +++ b/var/spack/repos/builtin/packages/cusz/thrust-includes-0.9.patch @@ -0,0 +1,27 @@ +diff --git a/src/stat/detail/compare.thrust.inl b/src/stat/detail/compare.thrust.inl +index ce49408..ec8d650 100644 +--- a/src/stat/detail/compare.thrust.inl ++++ b/src/stat/detail/compare.thrust.inl +@@ -18,6 +18,9 @@ + // #include + #include + #include ++#include ++#include ++#include + #include + + #include "cusz/type.h" +diff --git a/src/stat/detail/maxerr.thrust.inl b/src/stat/detail/maxerr.thrust.inl +index 2415655..9b31e88 100644 +--- a/src/stat/detail/maxerr.thrust.inl ++++ b/src/stat/detail/maxerr.thrust.inl +@@ -18,6 +18,8 @@ + // #include + #include + #include ++#include ++#include + + #include "cusz/type.h" + diff --git a/var/spack/repos/builtin/packages/cusz/thrust-includes.patch b/var/spack/repos/builtin/packages/cusz/thrust-includes.patch new file mode 100644 index 00000000000000..107e6b1248ffa8 --- /dev/null +++ b/var/spack/repos/builtin/packages/cusz/thrust-includes.patch @@ -0,0 +1,27 @@ +diff --git a/psz/src/stat/detail/compare.thrust.inl b/psz/src/stat/detail/compare.thrust.inl +index f35c7df..719d68f 100644 +--- a/psz/src/stat/detail/compare.thrust.inl ++++ b/psz/src/stat/detail/compare.thrust.inl +@@ -11,6 +11,9 @@ + + #include + #include ++#include ++#include ++#include + #include + + #include "cusz/type.h" +diff --git a/psz/src/stat/detail/maxerr.thrust.inl b/psz/src/stat/detail/maxerr.thrust.inl +index f7a4db5..ce7925a 100644 +--- a/psz/src/stat/detail/maxerr.thrust.inl ++++ b/psz/src/stat/detail/maxerr.thrust.inl +@@ -11,6 +11,8 @@ + + #include + #include ++#include ++#include + + #include "cusz/type.h" + #include "port.hh" diff --git a/var/spack/repos/builtin/packages/cyrus-sasl/package.py b/var/spack/repos/builtin/packages/cyrus-sasl/package.py index 521899be4b0d05..66d0cf72238bc9 100644 --- a/var/spack/repos/builtin/packages/cyrus-sasl/package.py +++ b/var/spack/repos/builtin/packages/cyrus-sasl/package.py @@ -30,10 +30,12 @@ class CyrusSasl(AutotoolsPackage): ) conflicts("%gcc@14:", when="@:2.1.26") - depends_on("c", type="build") # generated + depends_on("c", type="build") depends_on("m4", type="build") depends_on("autoconf", type="build") depends_on("automake", type="build") depends_on("libtool", type="build") depends_on("groff", type="build") + depends_on("openssl", type="link") + depends_on("libxcrypt", type="link") diff --git a/var/spack/repos/builtin/packages/damaris/package.py b/var/spack/repos/builtin/packages/damaris/package.py index cc26d91ed6c0a6..30e22acc1d37cb 100644 --- a/var/spack/repos/builtin/packages/damaris/package.py +++ b/var/spack/repos/builtin/packages/damaris/package.py @@ -12,11 +12,13 @@ class Damaris(CMakePackage): homepage = "https://project.inria.fr/damaris/" git = "https://gitlab.inria.fr/Damaris/damaris.git" - maintainers("jcbowden") + maintainers("endamlabin") license("LGPL-3.0-or-later") version("master", branch="master") + version("1.12.0", tag="v1.12.0", commit="62599496ea208788530a952fdf0037495a6b6270") + version("1.11.1", tag="v1.11.1", commit="a7954bbeed999bbf04305e2f6855bc7ddade78fd") version("1.11.0", tag="v1.11.0", commit="1aee2a8971584712d81323d77f9805448fe54947") version("1.10.0", tag="v1.10.0", commit="4e6b2641be1f7ded379312a8e7f4644ebe009ec9") version("1.9.2", tag="v1.9.2", commit="22c146b4b4ca047d4d36fd904d248e0280b3c0ea") diff --git a/var/spack/repos/builtin/packages/dav-sdk/package.py b/var/spack/repos/builtin/packages/dav-sdk/package.py index 936fe791ca6c71..5d660fd772d6ea 100644 --- a/var/spack/repos/builtin/packages/dav-sdk/package.py +++ b/var/spack/repos/builtin/packages/dav-sdk/package.py @@ -30,7 +30,7 @@ def dav_sdk_depends_on(spec, when=None, propagate=None): # Map the propagated variants to the dependency variant. Some packages may need # overrides to propagate a dependency as something else, e.g., {"visit": "libsim"}. # Most call-sites will just use a list. - if not type(propagate) is dict: + if type(propagate) is not dict: propagate = dict([(v, v) for v in propagate]) # Determine the base variant diff --git a/var/spack/repos/builtin/packages/davix/package.py b/var/spack/repos/builtin/packages/davix/package.py index 6017c81e48cbb8..52e69cc535323c 100644 --- a/var/spack/repos/builtin/packages/davix/package.py +++ b/var/spack/repos/builtin/packages/davix/package.py @@ -15,6 +15,9 @@ class Davix(CMakePackage): license("LGPL-2.1-or-later") + version("0.8.10", sha256="66aa9adadee6ff2bae14caba731597ba7a7cd158763d9d80a9cfe395afc17403") + version("0.8.9", sha256="0dc7e3702500fc4a88e037ababf096e8c1cad2532c34e08add043d4dc84283f6") + version("0.8.8", sha256="7ff139babf39030dd9984ad5ff8cd5da1ced2963f53f04efc387101840ff3458") version("0.8.7", sha256="78c24e14edd7e4e560392d67147ec8658c2aa0d3640415bdf6bc513afcf695e6") version("0.8.6", sha256="7383b6f6595c77a9dc8c03c5483c67dc32bd6d23751e956cf9c174768e7eeb5b") version("0.8.5", sha256="f9ce21bcc2ed248f7825059d17577876616258c35177d74fad8f854a818a87f9") @@ -57,25 +60,31 @@ class Davix(CMakePackage): description="Use the specified C++ standard when building.", ) + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("pkgconfig", type="build") depends_on("libxml2") depends_on("uuid") depends_on("openssl") - depends_on("curl") + depends_on("curl", when="@0.8.1:") depends_on("rapidjson", when="@0.8.7:") + depends_on("googletest", type="test", when="@0.8.8:") + variant("thirdparty", default=False, description="Build vendored libraries") depends_on("gsoap", when="+thirdparty") + def url_for_version(self, v): + return f"https://github.com/cern-fts/davix/releases/download/R_{v.underscored}/davix-{v}.tar.gz" + def cmake_args(self): - cmake_args = [ + return [ self.define_from_variant("CMAKE_CXX_STANDARD", variant="cxxstd"), self.define_from_variant("ENABLE_THIRD_PARTY_COPY", variant="thirdparty"), + self.define("DAVIX_TESTS", self.run_tests), + # Disable the use of embedded packages; use Spack to fetch them instead + self.define("EMBEDDED_LIBCURL", False), + self.define("EMBEDDED_RAPIDJSON", False), + self.define("CMAKE_MACOSX_RPATH", self.spec.satisfies("platform=darwin")), ] - - # Disable the use of embedded packages; use Spack to fetch them instead. - cmake_args.append("-DEMBEDDED_LIBCURL=OFF") - - if "darwin" in self.spec.architecture: - cmake_args.append("-DCMAKE_MACOSX_RPATH=ON") - return cmake_args diff --git a/var/spack/repos/builtin/packages/dcap/package.py b/var/spack/repos/builtin/packages/dcap/package.py index 6be67d31a62e36..91a083f3a36b3f 100644 --- a/var/spack/repos/builtin/packages/dcap/package.py +++ b/var/spack/repos/builtin/packages/dcap/package.py @@ -25,6 +25,7 @@ class Dcap(AutotoolsPackage): depends_on("m4", type="build") depends_on("openssl") + depends_on("libxcrypt") depends_on("zlib-api") variant("plugins", default=True, description="Build plugins") diff --git a/var/spack/repos/builtin/packages/dd4hep/package.py b/var/spack/repos/builtin/packages/dd4hep/package.py index 933cf250f51f32..6ea608a00c3efe 100644 --- a/var/spack/repos/builtin/packages/dd4hep/package.py +++ b/var/spack/repos/builtin/packages/dd4hep/package.py @@ -25,6 +25,7 @@ class Dd4hep(CMakePackage): license("LGPL-3.0-or-later") version("master", branch="master") + version("1.31", sha256="9c06a1b4462fc1b51161404889c74b37350162d0b0ac2154db27e3f102670bd1") version("1.30", sha256="02de46151e945eff58cffd84b4b86d35051f4436608199c3efb4d2e1183889fe") version("1.29", sha256="435d25a7ef093d8bf660f288b5a89b98556b4c1c293c55b93bf641fb4cba77e9") version("1.28", sha256="b28d671eda0154073873a044a384486e66f1f200065deca99537aa84f07328ad") @@ -46,7 +47,8 @@ class Dd4hep(CMakePackage): version("1.17", sha256="036a9908aaf1e13eaf5f2f43b6f5f4a8bdda8183ddc5befa77a4448dbb485826") version("1.16.1", sha256="c8b1312aa88283986f89cc008d317b3476027fd146fdb586f9f1fbbb47763f1a") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") generator("ninja") @@ -99,12 +101,12 @@ class Dd4hep(CMakePackage): depends_on("root @6.08: +gdml +math +python") depends_on("root @6.12.2: +root7", when="@1.26:") # DDCoreGraphics needs ROOT::ROOTHistDraw with when("+ddeve"): - depends_on("root @6.08: +x +opengl") + depends_on("root @6.08: +geom +opengl +x") depends_on("root @:6.27", when="@:1.23") conflicts("^root ~webgui", when="^root@6.28:") # For DD4hep >= 1.24, DDEve_Interface needs ROOT::ROOTGeomViewer only if ROOT >= 6.27 requires("^root +root7 +webgui", when="@1.24: ^root @6.27:") - depends_on("root @6.08: +gdml +math +python +x +opengl", when="+utilityapps") + depends_on("root @6.08: +gdml +geom +math +python +x +opengl", when="+utilityapps") extends("python") depends_on("xerces-c", when="+xercesc") @@ -118,13 +120,16 @@ class Dd4hep(CMakePackage): depends_on("tbb", when="+tbb") depends_on("intel-tbb@:2020.3", when="+tbb @:1.23") depends_on("lcio", when="+lcio") - depends_on("edm4hep", when="+edm4hep") - depends_on("podio", when="+edm4hep") - depends_on("podio@:0.16.03", when="@:1.23 +edm4hep") - depends_on("podio@0.16:", when="@1.24: +edm4hep") - depends_on("podio@0.16.3:", when="@1.26: +edm4hep") - depends_on("podio@:0", when="@:1.29 +edm4hep") depends_on("py-pytest", type=("build", "test")) + with when("+edm4hep"): + depends_on("edm4hep") + depends_on("edm4hep@0.10.5:", when="@1.31:") + depends_on("podio") + depends_on("podio@:0.16.03", when="@:1.23") + depends_on("podio@:0", when="@:1.29") + depends_on("podio@0.16:", when="@1.24:") + depends_on("podio@0.16.3:", when="@1.26:") + depends_on("podio@0.16.7:", when="@1.31:") # See https://github.com/AIDASoft/DD4hep/pull/771 and https://github.com/AIDASoft/DD4hep/pull/876 conflicts( diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index b08a5942f9443d..c75ccfe3de08f5 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -27,6 +27,8 @@ class Dealii(CMakePackage, CudaPackage): generator("make") version("master", branch="master") + version("9.6.2", sha256="1051e332de3822488e91c2b0460681052a3c4c5ac261cdd7a6af784869a25523") + version("9.6.1", sha256="9fcaa3968ac2eab41573b3614756a898a3ea91afcd9f3477ab2f30bb19aa669a") version("9.6.0", sha256="675323f0eb8eed2cfc93e2ced07a0ec5727c6a566ff9e7786c01a2ddcde17bed") version("9.5.2", sha256="7930e5218a9807d60cc05c300a3b70f36f4af22c3551a2cd1141fbab013bbaf1") version("9.5.1", sha256="a818b535e6488d3aef7853311657c7b4fadc29a9abe91b7b202b131aad630f5e") @@ -256,7 +258,7 @@ class Dealii(CMakePackage, CudaPackage): arch_str = f"+cuda cuda_arch={_arch}" trilinos_spec = f"trilinos +wrapper {arch_str}" depends_on(trilinos_spec, when=f"@9.5:+trilinos {arch_str}") - depends_on("vtk", when="@9.6:+vtk") + depends_on("vtk@9:", when="@9.6:+vtk") # Explicitly provide a destructor in BlockVector, # otherwise deal.II may fail to build with Intel compilers. @@ -550,7 +552,7 @@ def cmake_args(self): ) # Make sure we use the same compiler that Trilinos uses if spec.satisfies("+trilinos"): - options.extend([self.define("CMAKE_CXX_COMPILER", spec["trilinos"].kokkos_cxx)]) + options.extend([self.define("CMAKE_CXX_COMPILER", self["trilinos"].kokkos_cxx)]) # Complex support options.append(self.define_from_variant("DEAL_II_WITH_COMPLEX_VALUES", "complex")) diff --git a/var/spack/repos/builtin/packages/delphes/package.py b/var/spack/repos/builtin/packages/delphes/package.py index b7f542f95d5274..6cd566cd50f904 100644 --- a/var/spack/repos/builtin/packages/delphes/package.py +++ b/var/spack/repos/builtin/packages/delphes/package.py @@ -48,7 +48,7 @@ class Delphes(CMakePackage): variant("pythia8", default=True, description="build with pythia8") depends_on("cmake", type="build") - depends_on("root") + depends_on("root +geom +opengl") depends_on("pythia8", when="+pythia8") def cmake_args(self): diff --git a/var/spack/repos/builtin/packages/detray/package.py b/var/spack/repos/builtin/packages/detray/package.py index b9181784ca3ae8..31477bc0871eed 100644 --- a/var/spack/repos/builtin/packages/detray/package.py +++ b/var/spack/repos/builtin/packages/detray/package.py @@ -19,6 +19,8 @@ class Detray(CMakePackage): license("MPL-2.0", checked_by="stephenswat") + version("0.88.1", sha256="89134c86c6857cb3a821181e3bb0565ebb726dd8b1245678db1681483d792cf9") + version("0.88.0", sha256="bda15501c9c96af961e24ce243982f62051c535b9fe458fb28336a19b54eb47d") version("0.87.0", sha256="2d4a76432dd6ddbfc00b88b5d482072e471fefc264b60748bb1f9a123963576e") version("0.86.0", sha256="98350c94e8a2395b8712b7102fd449536857e8158b38a96cc913c79b70301170") version("0.85.0", sha256="a0121a27fd08243d4a6aab060e8ab379ad5129e96775b45f6a683835767fa8e7") diff --git a/var/spack/repos/builtin/packages/dftd4/package.py b/var/spack/repos/builtin/packages/dftd4/package.py index 992a1e40f20fc8..9e36bf3e8da818 100644 --- a/var/spack/repos/builtin/packages/dftd4/package.py +++ b/var/spack/repos/builtin/packages/dftd4/package.py @@ -2,10 +2,11 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.build_systems import cmake, meson from spack.package import * -class Dftd4(MesonPackage): +class Dftd4(MesonPackage, CMakePackage): """Generally Applicable Atomic-Charge Dependent London Dispersion Correction""" homepage = "https://www.chemie.uni-bonn.de/pctc/mulliken-center/software/dftd4" @@ -16,6 +17,8 @@ class Dftd4(MesonPackage): license("LGPL-3.0-only") + build_system("cmake", "meson", default="meson") + version("main", branch="main") version("3.7.0", sha256="4e8749df6852bf863d5d1831780a2d30e9ac4afcfebbbfe5f6a6a73d06d6c6ee") version("3.6.0", sha256="56b3b4650853a34347d3d56c93d7596ecbe2208c4a14dbd027959fd4a009679d") @@ -26,22 +29,39 @@ class Dftd4(MesonPackage): version("3.1.0", sha256="b652aa7cbf8d087c91bcf80f2d5801459ecf89c5d4176ebb39e963ee740ed54b") version("3.0.0", sha256="a7539d68d48d851bf37b79e37ea907c9da5eee908d0aa58a0a7dc15f04f8bc35") - depends_on("c", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("fortran", type="build") variant("openmp", default=True, description="Use OpenMP parallelisation") - variant("python", default=False, description="Build Python extension module") + variant( + "python", + default=False, + when="build_system=meson", + description="Build Python extension module", + ) + + depends_on("meson@0.57.1:", type="build", when="build_system=meson") # mesonbuild/meson#8377 depends_on("blas") depends_on("lapack") - depends_on("mctc-lib") - depends_on("meson@0.57.1:", type="build") # mesonbuild/meson#8377 depends_on("pkgconfig", type="build") + depends_on("py-cffi", when="+python") depends_on("python@3.6:", when="+python") + for build_system in ["cmake", "meson"]: + depends_on(f"mctc-lib build_system={build_system}", when=f"build_system={build_system}") + depends_on(f"multicharge build_system={build_system}", when=f"build_system={build_system}") + extends("python", when="+python") + def url_for_version(self, version): + if version <= Version("3.6.0"): + return f"https://github.com/dftd4/dftd4/releases/download/v{version}/dftd4-{version}-source.tar.xz" + return super().url_for_version(version) + + +class MesonBuilder(meson.MesonBuilder): def meson_args(self): lapack = self.spec["lapack"].libs.names[0] if lapack == "lapack": @@ -57,7 +77,7 @@ def meson_args(self): "-Dpython={0}".format(str("+python" in self.spec).lower()), ] - def url_for_version(self, version): - if version <= Version("3.6.0"): - return f"https://github.com/dftd4/dftd4/releases/download/v{version}/dftd4-{version}-source.tar.xz" - return super().url_for_version(version) + +class CMakeBuilder(cmake.CMakeBuilder): + def cmake_args(self): + return [self.define_from_variant("WITH_OPENMP", "openmp")] diff --git a/var/spack/repos/builtin/packages/direnv/package.py b/var/spack/repos/builtin/packages/direnv/package.py index d70d0f1ddb6aae..8eb26698cca267 100644 --- a/var/spack/repos/builtin/packages/direnv/package.py +++ b/var/spack/repos/builtin/packages/direnv/package.py @@ -6,15 +6,20 @@ class Direnv(GoPackage): - """direnv is an environment switcher for the shell.""" + """Direnv is an environment switcher for the shell that can load and unload + environment variables depending on the current directory. This allows project-specific + environment variables without cluttering the ~/.profile file.""" homepage = "https://direnv.net/" url = "https://github.com/direnv/direnv/archive/v2.11.3.tar.gz" + git = "https://github.com/direnv/direnv.git" maintainers("acastanedam", "alecbcs") license("MIT") + # Versions (newest to oldest) + version("master", branch="master") version("2.35.0", sha256="a7aaec49d1b305f0745dad364af967fb3dc9bb5befc9f29d268d528b5a474e57") version("2.34.0", sha256="3d7067e71500e95d69eac86a271a6b6fc3f2f2817ba0e9a589524bf3e73e007c") version("2.33.0", sha256="8ef18051aa6bdcd6b59f04f02acdd0b78849b8ddbdbd372d4957af7889c903ea") @@ -26,5 +31,6 @@ class Direnv(GoPackage): version("2.20.0", sha256="cc72525b0a5b3c2ab9a52a3696e95562913cd431f923bcc967591e75b7541bff") version("2.11.3", sha256="2d34103a7f9645059270763a0cfe82085f6d9fe61b2a85aca558689df0e7b006") - depends_on("go@1.16:", type="build", when="@2.28:") + # Build dependencies depends_on("go@1.20:", type="build", when="@2.33:") + depends_on("go@1.16:", type="build", when="@2.28:") diff --git a/var/spack/repos/builtin/packages/dla-future-fortran/package.py b/var/spack/repos/builtin/packages/dla-future-fortran/package.py index 2772673ed1d77a..85e84aa65af254 100644 --- a/var/spack/repos/builtin/packages/dla-future-fortran/package.py +++ b/var/spack/repos/builtin/packages/dla-future-fortran/package.py @@ -20,6 +20,7 @@ class DlaFutureFortran(CMakePackage): license("BSD-3-Clause") version("main", branch="main") + version("0.3.0", sha256="404ce0d2d3df9317764450158901fd6cb2198b37f5687e9616519100ad6e9ece") version("0.2.0", sha256="7fd3e1779c111b35f0d2701a024398b4f6e8dea4af523b6c8617d28c0b7ae61a") version("0.1.0", sha256="9fd8a105cbb2f3e1daf8a49910f98fce68ca0b954773dba98a91464cf2e7c1da") @@ -36,6 +37,7 @@ class DlaFutureFortran(CMakePackage): depends_on("dla-future@0.4.1:0.5 +scalapack", when="@0.1.0") depends_on("dla-future@0.6.0: +scalapack", when="@0.2.0:") + depends_on("dla-future@0.7.3: +scalapack", when="@0.3:") depends_on("dla-future +shared", when="+shared") depends_on("mpi", when="+test") diff --git a/var/spack/repos/builtin/packages/dla-future/package.py b/var/spack/repos/builtin/packages/dla-future/package.py index 865eef85a99104..8917ed61845d79 100644 --- a/var/spack/repos/builtin/packages/dla-future/package.py +++ b/var/spack/repos/builtin/packages/dla-future/package.py @@ -73,7 +73,7 @@ class DlaFuture(CMakePackage, CudaPackage, ROCmPackage): generator("ninja") depends_on("cmake@3.22:", type="build") - depends_on("pkgconfig", type="build") + depends_on("pkgconfig", type=("build", "link")) depends_on("doxygen", type="build", when="+doc") depends_on("mpi") diff --git a/var/spack/repos/builtin/packages/dorado/package.py b/var/spack/repos/builtin/packages/dorado/package.py index 47e37b31be0a80..0ed5e4dfd786c9 100644 --- a/var/spack/repos/builtin/packages/dorado/package.py +++ b/var/spack/repos/builtin/packages/dorado/package.py @@ -26,7 +26,7 @@ class Dorado(CMakePackage, CudaPackage): depends_on("git", type="build") depends_on("curl", type="build") depends_on("cuda") - depends_on("hdf5@1.17:+hl+cxx+szip") + depends_on("hdf5@:1+hl+cxx+szip") depends_on("htslib@1.15.1") depends_on("openssl") depends_on("zstd") diff --git a/var/spack/repos/builtin/packages/dray/package.py b/var/spack/repos/builtin/packages/dray/package.py index 6c7fea12231df4..9f3b8437e657bb 100644 --- a/var/spack/repos/builtin/packages/dray/package.py +++ b/var/spack/repos/builtin/packages/dray/package.py @@ -5,8 +5,6 @@ import os import socket -import llnl.util.tty as tty - from spack.build_systems.cmake import CMakeBuilder from spack.package import * diff --git a/var/spack/repos/builtin/packages/duckdb/package.py b/var/spack/repos/builtin/packages/duckdb/package.py index 311ff05f9a7dd0..889713330d32a8 100644 --- a/var/spack/repos/builtin/packages/duckdb/package.py +++ b/var/spack/repos/builtin/packages/duckdb/package.py @@ -17,6 +17,7 @@ class Duckdb(MakefilePackage): maintainers("glentner", "teaguesterling") version("master", branch="master") + version("1.2.0", sha256="f22c97e18c071fa8e43b5e150c03c6ab4bcc510cca6e6b50cbe13af8535fa701") version("1.1.3", sha256="2aea0af898ad753fee82b776fea1bf78ccbc9648986e7f7a87372df5e74cdb98") version("1.1.2", sha256="a3319a64c390ed0454c869b2e4fc0af2413cd49f55cd0f1400aaed9069cdbc4c") version("1.1.1", sha256="a764cef80287ccfd8555884d8facbe962154e7c747043c0842cd07873b4d6752") @@ -92,7 +93,6 @@ class Duckdb(MakefilePackage): # Extensions variant("autocomplete", default=True, description="Include autocomplete for CLI in build") variant("excel", default=True, description="Include Excel formatting extension in build") - variant("fts", default=True, description="Include FTS (full text search) support in build") variant("httpfs", default=True, description="Include HTTPFS (& S3) support in build") variant("inet", default=True, description="Include INET (ip address) support in build") variant("json", default=True, description="Include JSON support in build") @@ -100,6 +100,14 @@ class Duckdb(MakefilePackage): variant("tpce", default=False, description="Include TPCE in build") variant("tpch", default=False, description="Include TPCH in build") + # FTS was moved to an out-of-tree extension after v1.1.3 + variant( + "fts", + default=True, + description="Include FTS (full text search) support in build", + when="@:1.1", + ) + # APIs variant("python", default=True, description="Build with Python driver") extends("python", when="+python") diff --git a/var/spack/repos/builtin/packages/dyninst/package.py b/var/spack/repos/builtin/packages/dyninst/package.py index 0d260321018516..1d4b22477bb1ff 100644 --- a/var/spack/repos/builtin/packages/dyninst/package.py +++ b/var/spack/repos/builtin/packages/dyninst/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * @@ -33,59 +33,30 @@ class Dyninst(CMakePackage): version("10.2.1", sha256="8077c6c7a12577d2ffdcd07521c1eb1b7367da94d9a7ef10bf14053aeaae7ba1") version("10.2.0", sha256="4212b93bef4563c7de7dce4258e899bcde52315a571087e87fde9f8040123b43") version("10.1.0", sha256="4a121d70c1bb020408a7a697d74602e18250c3c85800f230566fcccd593c0129") - version("10.0.0", sha256="542fccf5c57c4fe784b1a9a9e3db01d40b16ad04e7174dc6f7eb23440485ba06") - version( - "9.3.2", tag="v9.3.2", commit="5d2ddacb273682daa014ae22f17f3575e05b411e", deprecated=True - ) - version( - "9.3.0", tag="v9.3.0", commit="9b8e9c1f16d4616b827d2d36955604a8e3fb915c", deprecated=True - ) - version( - "9.2.0", tag="v9.2.0", commit="3a6ad66df7294417cf61618acdcfcc0fecccb045", deprecated=True - ) - version( - "9.1.0", tag="v9.1.0", commit="df6d090061bae7ff2ba5a6bd57bb2ecbf538ef7a", deprecated=True - ) - version( - "8.2.1", tag="v8.2.1", commit="939afcbad1a8273636a3686a31b51dae4f1f0c11", deprecated=True - ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") - variant( - "openmp", - default=True, - description="Enable OpenMP support for ParseAPI " "(version 10.0.0 or later)", - ) + variant("openmp", default=True, description="Enable OpenMP support for ParseAPI ") variant("static", default=False, description="Build static libraries") variant("stat_dysect", default=False, description="Patch for STAT's DySectAPI") - boost_libs = "+atomic+chrono+date_time+filesystem+system+thread+timer" - "+container+random+exception" - - depends_on("boost@1.61.0:" + boost_libs, when="@10.1.0:") - depends_on("boost@1.61.0:1.69" + boost_libs, when="@:10.0") - depends_on("boost@1.67.0:" + boost_libs, when="@11.0.0:") - depends_on("boost@1.70.0:" + boost_libs, when="@12:12.3.0") - depends_on("boost@1.71.0:" + boost_libs, when="@13:") + depends_on( + "boost+atomic+chrono+date_time+filesystem+system+thread+timer+container+random+exception" + ) + depends_on("boost@1.61.0:", when="@10.1.0:") + depends_on("boost@1.67.0:", when="@11.0.0:") + depends_on("boost@1.70.0:", when="@12:12.3.0") + depends_on("boost@1.71.0:", when="@13:") depends_on("libiberty+pic") - # Dyninst uses elfutils starting with 9.3.0, and used libelf - # before that. - # NB: Parallel DWARF parsing in Dyninst 10.2.0 requires a thread- - # safe libdw + # Parallel DWARF parsing requires a thread-safe libdw + depends_on("elfutils", type="link") depends_on("elfutils@0.186:", type="link", when="@12.0.1:") depends_on("elfutils@0.178:", type="link", when="@10.2.0:") - depends_on("elfutils", type="link", when="@9.3.0:10.1") - depends_on("libelf", type="link", when="@:9.2") - - # Dyninst uses libdw from elfutils starting with 10.0, and used - # libdwarf before that. - depends_on("libdwarf", when="@:9") with when("@:12.3.0"): # findtbb.cmake in the dynist repo does not work with recent tbb @@ -94,21 +65,16 @@ class Dyninst(CMakePackage): conflicts("^intel-oneapi-tbb@2021.1:") conflicts("^intel-parallel-studio") - depends_on("intel-tbb@2019.9:", when="@13.0.0:") - depends_on("tbb@2018.6.0:", when="@10.0.0:12.3.0") + depends_on("tbb") + requires("^[virtuals=tbb] intel-tbb@2019.9:", when="@13.0.0:") with when("@13.0.0:"): depends_on("cmake@3.14.0:", type="build") conflicts("cmake@3.19.0") depends_on("cmake@3.4.0:", type="build", when="@10.1.0:") - depends_on("cmake@3.0.0:", type="build", when="@10.0.0:10.0") - depends_on("cmake@2.8:", type="build", when="@:9") patch("stat_dysect.patch", when="+stat_dysect") - patch("stackanalysis_h.patch", when="@9.2.0") - patch("v9.3.2-auto.patch", when="@9.3.2 %gcc@:4.7") - patch("tribool.patch", when="@9.3.0:10.0.0 ^boost@1.69:") patch( "missing_include_deque.patch", when="@10.0.0:12.2.0", @@ -123,92 +89,21 @@ class Dyninst(CMakePackage): # Version 11.0 requires a C++11-compliant ABI conflicts("%gcc@:5", when="@11.0.0:") - # Versions 9.3.x used cotire, but have no knob to turn it off. - # Cotire has no real use for one-time builds and can break - # parallel builds with both static and shared libs. - @when("@9.3.0:9.3") - def patch(self): - filter_file("USE_COTIRE true", "USE_COTIRE false", "cmake/shared.cmake") - - # New style cmake args, starting with 10.1. - @when("@10.1.0:") def cmake_args(self): spec = self.spec - args = [ - "-DBoost_ROOT_DIR=%s" % spec["boost"].prefix, - "-DElfUtils_ROOT_DIR=%s" % spec["elf"].prefix, - "-DLibIberty_ROOT_DIR=%s" % spec["libiberty"].prefix, - "-DTBB_ROOT_DIR=%s" % spec["tbb"].prefix, + self.define("Boost_ROOT_DIR", spec["boost"].prefix), + self.define("ElfUtils_ROOT_DIR", spec["elfutils"].prefix), + self.define("LibIberty_ROOT_DIR", spec["libiberty"].prefix), + self.define("TBB_ROOT_DIR", spec["tbb"].prefix), self.define("LibIberty_LIBRARIES", spec["libiberty"].libs), + self.define_from_variant("USE_OpenMP", "openmp"), + self.define_from_variant("ENABLE_STATIC_LIBS", "static"), ] - if spec.satisfies("+openmp"): - args.append("-DUSE_OpenMP=ON") - else: - args.append("-DUSE_OpenMP=OFF") - - if spec.satisfies("+static"): - args.append("-DENABLE_STATIC_LIBS=YES") - else: - args.append("-DENABLE_STATIC_LIBS=NO") - - # Make sure Dyninst doesn't try to build its own dependencies - # outside of Spack + # Make sure Dyninst doesn't try to build its own dependencies outside of Spack if spec.satisfies("@10.2.0:12.3.0"): - args.append("-DSTERILE_BUILD=ON") - - return args - - # Old style cmake args, up through 10.0. - @when("@:10.0") - def cmake_args(self): - spec = self.spec - - # Elf -- the directory containing libelf.h. - elf = spec["elf"].prefix - elf_include = os.path.dirname(find_headers("libelf", elf.include, recursive=True)[0]) - - # Dwarf -- the directory containing elfutils/libdw.h or - # libdwarf.h, and the path to libdw.so or libdwarf.so. - if spec.satisfies("@10.0.0:"): - dwarf_include = elf.include - dwarf_lib = find_libraries("libdw", elf, recursive=True) - else: - dwarf_include = spec["libdwarf"].prefix.include - dwarf_lib = spec["libdwarf"].libs - - args = [ - "-DPATH_BOOST=%s" % spec["boost"].prefix, - "-DIBERTY_LIBRARIES=%s" % spec["libiberty"].libs, - "-DLIBELF_INCLUDE_DIR=%s" % elf_include, - "-DLIBELF_LIBRARIES=%s" % spec["elf"].libs, - "-DLIBDWARF_INCLUDE_DIR=%s" % dwarf_include, - "-DLIBDWARF_LIBRARIES=%s" % dwarf_lib, - ] - - # TBB include and lib directories, version 10.x or later. - if spec.satisfies("@10.0.0:"): - args.extend( - [ - "-DTBB_INCLUDE_DIRS=%s" % spec["tbb"].prefix.include, - "-DTBB_LIBRARY=%s" % spec["tbb"].prefix.lib, - ] - ) - - # Openmp applies to version 10.x or later. - if spec.satisfies("@10.0.0:"): - if spec.satisfies("+openmp"): - args.append("-DUSE_OpenMP=ON") - else: - args.append("-DUSE_OpenMP=OFF") - - # Static libs started with version 9.1.0. - if spec.satisfies("@9.1.0:"): - if spec.satisfies("+static"): - args.append("-DENABLE_STATIC_LIBS=1") - else: - args.append("-DENABLE_STATIC_LIBS=NO") + args.append(self.define("STERILE_BUILD", True)) return args diff --git a/var/spack/repos/builtin/packages/dyninst/stackanalysis_h.patch b/var/spack/repos/builtin/packages/dyninst/stackanalysis_h.patch deleted file mode 100644 index 2c04d935d92b42..00000000000000 --- a/var/spack/repos/builtin/packages/dyninst/stackanalysis_h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/dataflowAPI/h/stackanalysis.h 2016-06-29 14:54:14.000000000 -0700 -+++ b/dataflowAPI/h/stackanalysis.h 2016-08-02 09:50:13.619079000 -0700 -@@ -331,7 +331,7 @@ - - // To build intervals, we must replay the effect of each instruction. - // To avoid sucking enormous time, we keep those transfer functions around... -- typedef std::map> -+ typedef std::map > - InstructionEffects; - - DATAFLOW_EXPORT StackAnalysis(); diff --git a/var/spack/repos/builtin/packages/dyninst/tribool.patch b/var/spack/repos/builtin/packages/dyninst/tribool.patch deleted file mode 100644 index fa7bd3882cdcd0..00000000000000 --- a/var/spack/repos/builtin/packages/dyninst/tribool.patch +++ /dev/null @@ -1,34 +0,0 @@ -Add explicit casts from boost::tribool to bool. Starting with 1.69, -tribool added 'explicit' to the conversion operator to bool, and this -was breaking the build when using boost >= 1.69. - -Patch is from: https://github.com/dyninst/dyninst/commit/54a2debd9 - - -diff --git a/dataflowAPI/rose/util/Message.C b/dataflowAPI/rose/util/Message.C -index a8a66ad4c..5e276f97d 100644 ---- a/dataflowAPI/rose/util/Message.C -+++ b/dataflowAPI/rose/util/Message.C -@@ -1123,7 +1123,7 @@ StreamBuf::bake() { - destination_->bakeDestinations(message_.properties(), baked_/*out*/); - anyUnbuffered_ = false; - for (BakedDestinations::const_iterator bi=baked_.begin(); bi!=baked_.end() && !anyUnbuffered_; ++bi) -- anyUnbuffered_ = !bi->second.isBuffered; -+ anyUnbuffered_ = static_cast(!bi->second.isBuffered); - isBaked_ = true; - } - } -diff --git a/dataflowAPI/rose/util/Message.h b/dataflowAPI/rose/util/Message.h -index 816f68d2e..03592cb97 100644 ---- a/dataflowAPI/rose/util/Message.h -+++ b/dataflowAPI/rose/util/Message.h -@@ -386,7 +386,8 @@ struct SAWYER_EXPORT ColorSpec { - ColorSpec(AnsiColor fg, AnsiColor bg, bool bold): foreground(fg), background(bg), bold(bold) {} - - /** Returns true if this object is in its default-constructed state. */ -- bool isDefault() const { return COLOR_DEFAULT==foreground && COLOR_DEFAULT==background && !bold; } -+ bool isDefault() const { return COLOR_DEFAULT==foreground && COLOR_DEFAULT==background -+ && static_cast(!bold); } - }; - - /** Colors to use for each message importance. diff --git a/var/spack/repos/builtin/packages/dyninst/v9.3.2-auto.patch b/var/spack/repos/builtin/packages/dyninst/v9.3.2-auto.patch deleted file mode 100644 index 74fa2dfeab43be..00000000000000 --- a/var/spack/repos/builtin/packages/dyninst/v9.3.2-auto.patch +++ /dev/null @@ -1,73 +0,0 @@ -Change some 'for (const auto& t: type)' usage to the older but -equivalent 'for (auto t = type.begin(); ...)'. This patch allows -dyninst 9.3.2 to build with gcc 4.4 which doesn't support the newer -syntax. - - -diff --git a/dyninstAPI/src/BPatch.C b/dyninstAPI/src/BPatch.C -index ebf7db0c4..49fe69f9a 100644 ---- a/dyninstAPI/src/BPatch.C -+++ b/dyninstAPI/src/BPatch.C -@@ -166,16 +166,16 @@ BPatch::BPatch() - stdTypes = BPatch_typeCollection::getGlobalTypeCollection(); - vector *sTypes = Symtab::getAllstdTypes(); - BPatch_type* type = NULL; -- for(const auto& t: *sTypes) { -- stdTypes->addType(type = new BPatch_type(t)); -+ for(auto t = sTypes->begin(); t != sTypes->end(); ++t) { -+ stdTypes->addType(type = new BPatch_type(*t)); - type->decrRefCount(); - } - delete sTypes; - - builtInTypes = new BPatch_builtInTypeCollection; - sTypes = Symtab::getAllbuiltInTypes(); -- for(const auto& t: *sTypes) { -- builtInTypes->addBuiltInType(type = new BPatch_type(t)); -+ for(auto t = sTypes->begin(); t != sTypes->end(); ++t) { -+ builtInTypes->addBuiltInType(type = new BPatch_type(*t)); - type->decrRefCount(); - } - delete sTypes; -diff --git a/dyninstAPI/src/BPatch_collections.C b/dyninstAPI/src/BPatch_collections.C -index f4e2986a3..129f8b74a 100644 ---- a/dyninstAPI/src/BPatch_collections.C -+++ b/dyninstAPI/src/BPatch_collections.C -@@ -172,12 +172,12 @@ BPatch_typeCollection::~BPatch_typeCollection() - assert(refcount == 0 || - refcount == 1); - -- for(const auto& t: typesByName) { -- t.second->decrRefCount(); -+ for(auto t = typesByName.begin(); t != typesByName.end(); ++t) { -+ t->second->decrRefCount(); - } - -- for(const auto& t: typesByID) { -- t.second->decrRefCount(); -+ for(auto t = typesByID.begin(); t != typesByID.end(); ++t) { -+ t->second->decrRefCount(); - } - } - -diff --git a/symtabAPI/src/Collections.C b/symtabAPI/src/Collections.C -index 7431dd6bf..43c339f45 100644 ---- a/symtabAPI/src/Collections.C -+++ b/symtabAPI/src/Collections.C -@@ -318,12 +318,12 @@ typeCollection::typeCollection() : - typeCollection::~typeCollection() - { - // delete all of the types -- for(const auto& t: typesByName) { -- t.second->decrRefCount(); -+ for(auto t = typesByName.begin(); t != typesByName.end(); ++t) { -+ t->second->decrRefCount(); - } - -- for(const auto& t: typesByID) { -- t.second->decrRefCount(); -+ for(auto t = typesByID.begin(); t != typesByID.end(); ++t) { -+ t->second->decrRefCount(); - } - } - diff --git a/var/spack/repos/builtin/packages/easi/package.py b/var/spack/repos/builtin/packages/easi/package.py index 066ec5b1cd8986..993f5ba5bbc10c 100644 --- a/var/spack/repos/builtin/packages/easi/package.py +++ b/var/spack/repos/builtin/packages/easi/package.py @@ -20,6 +20,8 @@ class Easi(CMakePackage): license("BSD-3-Clause") version("master", branch="master") + version("1.5.2", tag="v1.5.2", commit="0d87b1a7db31e453d52c7213cb9b31bda88cbf40") + version("1.5.1", tag="v1.5.1", commit="d12f3371ed26c7371e4efcc11e3cd468063ffdda") version("1.5.0", tag="v1.5.0", commit="391698ab0072f66280d08441974c2bdb04a65ce0") version("1.4.0", tag="v1.4.0", commit="0d8fcf936574d93ddbd1d9222d46a93d4b119231") version("1.3.0", tag="v1.3.0", commit="99309a0fa78bf11d668c599b3ee469224f04d55b") @@ -36,17 +38,19 @@ class Easi(CMakePackage): variant("asagi", default=True, description="build with ASAGI support") variant( "jit", - default="impalajit,lua", + default="lua", description="build with JIT support", values=("impalajit", "impalajit-llvm", "lua"), multi=True, ) depends_on("asagi +mpi +mpi3", when="+asagi") - depends_on("yaml-cpp@0.6.2") + depends_on("yaml-cpp@0.6:") + + conflicts("yaml-cpp@0.7", when="@1.4.0:1.5.0") depends_on("impalajit@llvm-1.0.0", when="jit=impalajit-llvm") - depends_on("lua@5.3.2", when="jit=lua") + depends_on("lua@5.3:5.4", when="jit=lua") depends_on("impalajit@main", when="jit=impalajit") depends_on("py-pybind11@2.6.2:", type="build", when="+python") diff --git a/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py b/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py index c2771e281bdc72..5976957e03eae3 100644 --- a/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py +++ b/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py @@ -30,7 +30,7 @@ def dav_sdk_depends_on(spec, when=None, propagate=None): # Map the propagated variants to the dependency variant. Some packages may need # overrides to propagate a dependency as something else, e.g., {"visit": "libsim"}. # Most call-sites will just use a list. - if not type(propagate) is dict: + if type(propagate) is not dict: propagate = dict([(v, v) for v in propagate]) # Determine the base variant diff --git a/var/spack/repos/builtin/packages/ectrans/package.py b/var/spack/repos/builtin/packages/ectrans/package.py index b9901ff345eb47..34f46e8b53e4ce 100644 --- a/var/spack/repos/builtin/packages/ectrans/package.py +++ b/var/spack/repos/builtin/packages/ectrans/package.py @@ -59,7 +59,11 @@ class Ectrans(CMakePackage): depends_on("fiat+mpi", when="+mpi") # https://github.com/ecmwf-ifs/ectrans/issues/194 - conflicts("%oneapi@2025:", when="@1.3.1:1.5.1") + patch( + "https://github.com/ecmwf-ifs/ectrans/commit/98f0d505d5b0866cab68a15e86e1a495bafd93d2.patch?full_index=1", + sha256="17999486a320a5c6a1a442adcdf2c341b49d005f45d09ad0e525594d50bdc39c", + when="@1.3.1:1.5.1", + ) def cmake_args(self): args = [ @@ -70,5 +74,10 @@ def cmake_args(self): self.define_from_variant("ENABLE_FFTW", "fftw"), self.define_from_variant("ENABLE_MKL", "mkl"), self.define_from_variant("ENABLE_TRANSI", "transi"), + # Turn off use of contiguous keyword in Fortran because a number + # of compilers have issues with it, and the hardcoded list of "bad" + # compilers in ectrans is incomplete and isn't kept up to date + # https://github.com/JCSDA/spack-stack/issues/1522 + "-DECTRANS_HAVE_CONTIGUOUS_ISSUE=ON", ] return args diff --git a/var/spack/repos/builtin/packages/elemental/package.py b/var/spack/repos/builtin/packages/elemental/package.py index bfa75cd2f57ac7..cb1aa30e3fc5fc 100644 --- a/var/spack/repos/builtin/packages/elemental/package.py +++ b/var/spack/repos/builtin/packages/elemental/package.py @@ -150,7 +150,7 @@ def cmake_args(self): ), "-DCUSTOM_BLAS_SUFFIX:BOOL=TRUE", ] - ), + ) if spec.satisfies("+scalapack"): args.extend( [ @@ -159,7 +159,7 @@ def cmake_args(self): ), "-DCUSTOM_LAPACK_SUFFIX:BOOL=TRUE", ] - ), + ) else: math_libs = spec["lapack"].libs + spec["blas"].libs diff --git a/var/spack/repos/builtin/packages/elfutils/package.py b/var/spack/repos/builtin/packages/elfutils/package.py index ea5121f10def82..946ef7a94c2cd9 100644 --- a/var/spack/repos/builtin/packages/elfutils/package.py +++ b/var/spack/repos/builtin/packages/elfutils/package.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import glob -import os.path +import os from spack.package import * from spack.util.environment import is_system_path @@ -26,6 +26,7 @@ class Elfutils(AutotoolsPackage, SourcewarePackage): license("GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )") + version("0.192", sha256="616099beae24aba11f9b63d86ca6cc8d566d968b802391334c91df54eab416b4") version("0.191", sha256="df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871") version("0.190", sha256="8e00a3a9b5f04bc1dc273ae86281d2d26ed412020b391ffcc23198f10231d692") version("0.189", sha256="39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8") @@ -49,8 +50,8 @@ class Elfutils(AutotoolsPackage, SourcewarePackage): version("0.168", sha256="b88d07893ba1373c7dd69a7855974706d05377766568a7d9002706d5de72c276") version("0.163", sha256="7c774f1eef329309f3b05e730bdac50013155d437518a2ec0e24871d312f2e23") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") # Native language support from libintl. variant("nls", default=True, description="Enable Native Language Support.") @@ -81,14 +82,20 @@ class Elfutils(AutotoolsPackage, SourcewarePackage): depends_on("pkgconfig@0.9.0:", type=("build", "link")) # debuginfod has extra dependencies - # NB: Waiting on an elfutils patch before we can use libmicrohttpd@0.9.51 - depends_on("libmicrohttpd@0.9.33:0.9.50", type="link", when="+debuginfod") - depends_on("libarchive@3.1.2:", type="link", when="+debuginfod") - depends_on("sqlite@3.7.17:", type="link", when="+debuginfod") - depends_on("curl@7.29.0:", type="link", when="+debuginfod") + with when("+debuginfod"), default_args(type="link"): + depends_on("libmicrohttpd@0.9.33:") + depends_on("libarchive@3.1.2:") + depends_on("sqlite@3.7.17:") + depends_on("curl@7.29.0:") + depends_on("json-c@0.11:", when="@0.192:") conflicts("%gcc@7.2.0:", when="@0.163") + # https://sourceware.org/bugzilla/show_bug.cgi?id=32684 elfutils on aarch64 requires + # linux-headers 5.0 or higher, which is a dependency of glibc we don't model. So this is a more + # strict constraint than necessary. + conflicts("@0.192 arch=aarch64:") + provides("elf@1") # libarchive with iconv doesn't configure (still broken as of libarchive@3.7.1) @@ -155,6 +162,10 @@ def configure_args(self): if spec.satisfies("@0.181:"): args.append("--disable-libdebuginfod") + if spec.satisfies("@0.192:"): + # only relevant for rhel/fedora, disabled cause it requires a dependency on rpm. + args.append("--disable-debuginfod-ima-verification") + return args # Install elf.h to include directory. diff --git a/var/spack/repos/builtin/packages/elk/package.py b/var/spack/repos/builtin/packages/elk/package.py index ff33496521af83..4364beba11f891 100644 --- a/var/spack/repos/builtin/packages/elk/package.py +++ b/var/spack/repos/builtin/packages/elk/package.py @@ -14,6 +14,9 @@ class Elk(MakefilePackage): license("LGPL-3.0-or-later") + version("10.2.4", sha256="015e1d2a04a6c8335af2e5f5adaae143c6c0287f34772e069834a691bb15ac9d") + version("9.6.8", sha256="d5b60406744a13be42a258a6efd9545ce38a7006d8e76e40e3770368e05c1dae") + version("8.8.26", sha256="f0d397a0e2fd8b6f74bc9fccc03fae701bb348e3f08ca143d41757f5f6cf794a") version("8.3.22", sha256="1c31f09b7c09d6b24e775d4f0d5e1e8871f95a7656ee4ca21ac17dbe7ea16277") version("7.2.42", sha256="73f03776dbf9b2147bfcc5b7c062af5befa0944608f6fc4b6a1e590615400fc6") version("7.1.14", sha256="7c2ff30f4b1d72d5dc116de9d70761f2c206700c69d85dd82a17a5a6374453d2") @@ -36,7 +39,7 @@ class Elk(MakefilePackage): # blis - use internal lapack and blas implementation from blis variant( "linalg", - default="internal", + default="generic", multi=False, description="Build with custom BLAS library", values=("internal", "generic", "openblas", "mkl", "blis"), @@ -48,7 +51,7 @@ class Elk(MakefilePackage): # should be used with linalg=mkls variant( "fft", - default="internal", + default="fftw", multi=False, description="Build with custom FFT library", values=("internal", "fftw", "mkl"), @@ -63,6 +66,11 @@ class Elk(MakefilePackage): conflicts("fft=mkl", when="linalg=openblas") conflicts("fft=mkl", when="linalg=blis") + conflicts("linalg=internal", when="@8.6:", msg="Internal BLAS is not supported") + conflicts("fft=internal", when="@8.6:", msg="Internal FFTW is not supported") + conflicts("libxc@:6", when="@10:", msg="Versions >= 10 requires libxc >= 7") + conflicts("libxc@7:", when="@:9", msg="Versions <=9 requires libxc =< 6") + variant("mpi", default=True, description="Enable MPI parallelism") variant("openmp", default=True, description="Enable OpenMP support") variant("libxc", default=True, description="Link to Libxc functional library") @@ -90,7 +98,9 @@ class Elk(MakefilePackage): depends_on("mkl", when="fft=mkl") depends_on("mpi@2:", when="+mpi") - depends_on("libxc@5:", when="@7:+libxc") + depends_on("libxc@7:", when="@10:+libxc") + depends_on("libxc@6:", when="@:9+libxc") + depends_on("libxc@5:", when="@:7+libxc") depends_on("libxc@:3", when="@:3+libxc") depends_on("wannier90", when="+w90") @@ -98,6 +108,13 @@ class Elk(MakefilePackage): parallel = False def edit(self, spec, prefix): + if spec.satisfies("@8.6:"): + libxc_env_var_src = "SRC_LIBXC" + libxc_env_var_lib = "LIB_LIBXC" + else: + libxc_env_var_src = "SRC_libxc" + libxc_env_var_lib = "LIB_libxc" + # Dictionary of configuration options with default values assigned config = { "MAKE": "make", @@ -109,7 +126,7 @@ def edit(self, spec, prefix): "SRC_OBLAS": "oblas_stub.f90", "SRC_OMP": "omp_stub.f90", "SRC_BLIS": "blis_stub.f90", - "SRC_libxc": "libxcifc_stub.f90", + libxc_env_var_src: "libxcifc_stub.f90", "SRC_FFT": "zfftifc.f90", "SRC_W90S": "w90_stub.f90", "F90": spack_fc, @@ -173,9 +190,14 @@ def edit(self, spec, prefix): elif spec.satisfies("fft=fftw"): config["LIB_FFT"] = spec["fftw"].libs.ld_flags config["SRC_FFT"] = "zfftifc_fftw.f90" + if spec.satisfies("@8.6:"): + config["LIB_FFT"] += " -lfftw3f" + config["SRC_FFT"] += " cfftifc_fftw.f90" elif spec.satisfies("fft=mkl"): config["LIB_FFT"] = spec["mkl"].libs.ld_flags config["SRC_FFT"] = "mkl_dfti.f90 zfftifc_mkl.f90" + if spec.satisfies("@8.6:"): + config["SRC_FFT"] += " cfftifc_mkl.f90" cp = which("cp") mkl_prefix = spec["mkl"].prefix if spec.satisfies("^intel-mkl"): @@ -185,21 +207,29 @@ def edit(self, spec, prefix): join_path(self.build_directory, "src"), ) + if spec.satisfies("@8.6:"): + config["F90_LIB"] = " ".join([config["LIB_LPK"], config["LIB_FFT"]]) + del config["LIB_LPK"] + del config["LIB_FFT"] + # Define targets self.build_targets.append("elk") print(self.build_targets) # Libxc support if spec.satisfies("+libxc"): - config["LIB_libxc"] = " ".join( - [ - join_path(spec["libxc"].prefix.lib, "libxcf90.so"), - join_path(spec["libxc"].prefix.lib, "libxc.so"), - ] - ) - if self.spec.satisfies("@7:"): - config["SRC_libxc"] = "libxcf90.f90 libxcifc.f90" + if self.spec.satisfies("@10:"): + config[libxc_env_var_lib] = join_path(spec["libxc"].prefix.lib, "libxcf03.so") + else: + config[libxc_env_var_lib] = join_path(spec["libxc"].prefix.lib, "libxcf90.so") + _libxc_lib = join_path(spec["libxc"].prefix.lib, "libxc.so") + config[libxc_env_var_lib] += f" {_libxc_lib}" + + if self.spec.satisfies("@10:"): + config[libxc_env_var_src] = "libxcf03.f90 libxcifc.f90" + elif self.spec.satisfies("@7:9"): + config[libxc_env_var_src] = "libxcf90.f90 libxcifc.f90" else: - config["SRC_libxc"] = "libxc_funcs.f90 libxc.f90 libxcifc.f90" + config[libxc_env_var_src] = "libxc_funcs.f90 libxc.f90 libxcifc.f90" # Write configuration options to include file with open("make.inc", "w") as inc: @@ -222,3 +252,9 @@ def install(self, spec, prefix): install_tree("examples", join_path(prefix, "examples")) install_tree("species", join_path(prefix, "species")) + + @on_package_attributes(run_tests=True) + def check(self): + with working_dir("{0}/tests".format(self.build_directory)): + bash = which("bash") + bash("./test.sh") diff --git a/var/spack/repos/builtin/packages/elsi/package.py b/var/spack/repos/builtin/packages/elsi/package.py index 24414f2a8602d1..8cedf803ff14d7 100644 --- a/var/spack/repos/builtin/packages/elsi/package.py +++ b/var/spack/repos/builtin/packages/elsi/package.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * @@ -25,9 +25,9 @@ class Elsi(CMakePackage, CudaPackage): ) version("master", branch="master") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") generator("ninja") diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py index 0823b7d2992d5a..2592c7f1b25402 100644 --- a/var/spack/repos/builtin/packages/emacs/package.py +++ b/var/spack/repos/builtin/packages/emacs/package.py @@ -9,18 +9,23 @@ class Emacs(AutotoolsPackage, GNUMirrorPackage): - """The Emacs programmable text editor.""" + """Emacs is an extensible, customizable, free/libre text editor. + At its core is an interpreter for Emacs Lisp, a dialect of the Lisp + programming language with extensions to support text editing.""" homepage = "https://www.gnu.org/software/emacs" - git = "https://git.savannah.gnu.org/git/emacs.git" gnu_mirror_path = "emacs/emacs-24.5.tar.gz" - list_url = " https://ftpmirror.gnu.org/emacs/" + git = "https://git.savannah.gnu.org/git/emacs.git" + list_url = "https://ftpmirror.gnu.org/emacs/" list_depth = 0 maintainers("alecbcs") license("GPL-3.0-or-later", checked_by="wdconinc") + sanity_check_is_file = ["bin/emacs"] + sanity_check_is_dir = ["share/emacs"] + version("master", branch="master") version("29.4", sha256="1adb1b9a2c6cdb316609b3e86b0ba1ceb523f8de540cfdda2aec95b6a5343abf") version("29.3", sha256="2de8df5cab8ac697c69a1c46690772b0cf58fe7529f1d1999582c67d927d22e4") @@ -38,35 +43,51 @@ class Emacs(AutotoolsPackage, GNUMirrorPackage): version("25.1", sha256="763344b90db4d40e9fe90c5d14748a9dbd201ce544e2cf0835ab48a0aa4a1c67") version("24.5", sha256="2737a6622fb2d9982e9c47fb6f2fb297bda42674e09db40fc9bcc0db4297c3b6") - variant("gui", default=False, description="Enable GUI build on Mac") - variant("json", default=False, when="@27:", description="Build with json support") - variant("native", default=False, when="@28:", description="enable native compilation of elisp") - variant("tls", default=True, description="Build Emacs with gnutls") - variant("treesitter", default=False, when="@29:", description="Build with tree-sitter support") - variant("X", default=False, description="Enable an X toolkit") + variant( + "gui", + default="none", + values=("none", "x11", "cocoa"), + description="GUI support (none=terminal only, x11=X11, cocoa=macOS)", + ) variant( "toolkit", default="gtk", values=("gtk", "athena"), - description="Select an X toolkit (gtk, athena)", + description="X11 toolkit when gui=x11 (gtk, athena)", + when="gui=x11", ) + variant("json", default=False, when="@27:", description="Build with json support") + variant("native", default=False, when="@28:", description="Enable native compilation of elisp") + variant("tls", default=True, description="Build with gnutls support") + variant("treesitter", default=False, when="@29:", description="Build with tree-sitter support") + # Build dependencies depends_on("c", type="build") + depends_on("pkgconfig", type="build") depends_on("gzip", type="build") depends_on("texinfo", type="build", when="@29.4:") + depends_on("m4", type="build", when="@master:") + depends_on("autoconf", type="build", when="@master:") + depends_on("automake", type="build", when="@master:") + depends_on("libtool", type="build", when="@master:") + + # Required dependencies depends_on("ncurses") depends_on("pcre") depends_on("zlib-api") depends_on("libxml2") depends_on("jpeg") + + # Optional dependencies depends_on("gnutls", when="+tls") depends_on("tree-sitter", when="+treesitter") depends_on("gcc@11: +strip languages=jit", when="+native") depends_on("jansson@2.7:", when="+json") - with when("+X"): + # GUI dependencies + with when("gui=x11"): depends_on("libtiff") depends_on("libpng") depends_on("libxpm") @@ -75,64 +96,46 @@ class Emacs(AutotoolsPackage, GNUMirrorPackage): depends_on("libxaw", when="toolkit=athena") depends_on("gtkplus", when="toolkit=gtk") - # the following dependencies are required when building from a git ref - # so that we can run reconfigure to generate a ./configure script - depends_on("m4", type="build", when="@master:") - depends_on("autoconf", type="build", when="@master:") - depends_on("automake", type="build", when="@master:") - depends_on("libtool", type="build", when="@master:") - + # Platform-specific conflicts + conflicts("gui=cocoa", when="platform=linux", msg="Use gui=x11 for Linux GUI support") + conflicts("gui=cocoa", when="platform=cray", msg="Use gui=x11 for Linux/Cray GUI support") + conflicts("gui=x11", when="platform=darwin", msg="Use gui=cocoa for macOS GUI support") conflicts("@:26.3", when="platform=darwin os=catalina") - @when("platform=darwin") - def setup_build_environment(self, env): - # on macOS, emacs' config does search hard enough for ncurses' - # termlib `-ltinfo` lib, which results in linker errors - if "+termlib" in self.spec["ncurses"]: - env.append_flags("LDFLAGS", "-ltinfo") - def configure_args(self): - spec = self.spec - - toolkit = spec.variants["toolkit"].value - if spec.satisfies("+X"): - args = ["--with-x", "--with-x-toolkit={0}".format(toolkit)] + args = [] + + gui = self.spec.variants["gui"].value + if gui == "x11": + toolkit = self.spec.variants["toolkit"].value + args.extend(["--with-x", f"--with-x-toolkit={toolkit}"]) + elif gui == "cocoa": + args.append("--without-x") + args.append("--disable-ns-self-contained") else: - args = ["--without-x"] - - if sys.platform == "darwin": - if spec.satisfies("+gui"): - # Do not build the self-contained "nextstep/Emacs.app" - args.append("--disable-ns-self-contained") - else: - # Do not build "nextstep/Emacs.app" at all + args.append("--without-x") + if sys.platform == "darwin": args.append("--without-ns") - args += self.with_or_without("native-compilation", variant="native") - args += self.with_or_without("gnutls", variant="tls") - args += self.with_or_without("tree-sitter", variant="treesitter") - args += self.with_or_without("json") + args.extend(self.with_or_without("native-compilation", variant="native")) + args.extend(self.with_or_without("gnutls", variant="tls")) + args.extend(self.with_or_without("tree-sitter", variant="treesitter")) + args.extend(self.with_or_without("json")) return args - @run_after("install") + @when("platform=darwin") + def setup_build_environment(self, env): + if self.spec.satisfies("^ncurses+termlib"): + env.append_flags("LDFLAGS", "-ltinfo") + + @run_after("install", when="gui=cocoa") def move_macos_app(self): - """Move the Emacs.app build on MacOS to /Applications. + """Move the Emacs.app build on macOS to /Applications. From there users can move it or link it in ~/Applications.""" - if sys.platform == "darwin" and "+gui" in self.spec: - apps_dir = join_path(self.prefix, "Applications") - mkdir(apps_dir) - move("nextstep/Emacs.app", apps_dir) - - def run_version_check(self, bin): - """Runs and checks output of the installed binary.""" - exe_path = join_path(self.prefix.bin, bin) - if not os.path.exists(exe_path): - raise SkipTest(f"{exe_path} is not installed") - - exe = which(exe_path) - out = exe("--version", output=str.split, error=str.split) - assert str(self.spec.version) in out + apps_dir = join_path(self.prefix, "Applications") + mkdir(apps_dir) + move("nextstep/Emacs.app", apps_dir) def test_ctags(self): """check ctags version""" @@ -153,3 +156,13 @@ def test_emacsclient(self): def test_etags(self): """check etags version""" self.run_version_check("etags") + + def run_version_check(self, bin): + """Runs and checks output of the installed binary.""" + exe_path = join_path(self.prefix.bin, bin) + if not os.path.exists(exe_path): + raise SkipTest(f"{exe_path} is not installed") + + exe = which(exe_path) + out = exe("--version", output=str.split, error=str.split) + assert str(self.spec.version) in out diff --git a/var/spack/repos/builtin/packages/embree/package.py b/var/spack/repos/builtin/packages/embree/package.py index d12f2007d8a1ec..6224ede5faf31a 100644 --- a/var/spack/repos/builtin/packages/embree/package.py +++ b/var/spack/repos/builtin/packages/embree/package.py @@ -12,7 +12,7 @@ class Embree(CMakePackage): url = "https://github.com/embree/embree/archive/v3.7.0.tar.gz" maintainers("aumuell") - license("Apache-2.0") + license("Apache-2.0", checked_by="wdconinc") version("4.3.3", sha256="8a3bc3c3e21aa209d9861a28f8ba93b2f82ed0dc93341dddac09f1f03c36ef2d") version("4.3.2", sha256="dc7bb6bac095b2e7bc64321435acd07c6137d6d60e4b79ec07bb0b215ddf81cb") @@ -60,9 +60,10 @@ def cmake_args(self): spec = self.spec args = [ - "-DBUILD_TESTING=OFF", - "-DEMBREE_TUTORIALS=OFF", - "-DEMBREE_IGNORE_CMAKE_CXX_FLAGS=ON", + self.define("BUILD_TESTING", self.run_tests), + self.define("EMBREE_TUTORIALS", self.run_tests), + self.define("EMBREE_TUTORIALS_GLFW", False), + self.define("EMBREE_IGNORE_CMAKE_CXX_FLAGS", True), self.define_from_variant("EMBREE_ISPC_SUPPORT", "ispc"), ] @@ -80,7 +81,7 @@ def cmake_args(self): avx512_suffix = "" if spec.satisfies("@:3.12"): avx512_suffix = "SKX" - args.append(self.define("EMBREE_ISA_AVX512" + avx512_suffix, True)), + args.append(self.define("EMBREE_ISA_AVX512" + avx512_suffix, True)) if spec.satisfies("%gcc@:7"): # remove unsupported -mprefer-vector-width=256, otherwise copied # from common/cmake/gnu.cmake diff --git a/var/spack/repos/builtin/packages/enzyme/package.py b/var/spack/repos/builtin/packages/enzyme/package.py index 1e45a774563523..1497da1a884cf2 100644 --- a/var/spack/repos/builtin/packages/enzyme/package.py +++ b/var/spack/repos/builtin/packages/enzyme/package.py @@ -14,7 +14,7 @@ class Enzyme(CMakePackage): """ homepage = "https://enzyme.mit.edu" - url = "https://github.com/wsmoses/Enzyme/archive/v0.0.15.tar.gz" + url = "https://github.com/wsmoses/Enzyme/archive/v0.0.172.tar.gz" list_url = "https://github.com/wsmoses/Enzyme/releases" git = "https://github.com/wsmoses/Enzyme" @@ -23,6 +23,7 @@ class Enzyme(CMakePackage): root_cmakelists_dir = "enzyme" version("main", branch="main") + version("0.0.172", sha256="688200164787d543641cb446cff20f6a8e8b5c92bb7032ebe7f867efa67ceafb") version("0.0.135", sha256="49c798534faec7ba524a3ed053dd4352d690a44d3cad5a14915c9398dc9b175b") version("0.0.100", sha256="fbc53ec02adc0303ff200d7699afface2d9fbc7350664e6c6d4c527ef11c2e82") version("0.0.81", sha256="4c17d0c28f0572a3ab97a60f1e56bbc045ed5dd64c2daac53ae34371ca5e8b34") @@ -42,7 +43,8 @@ class Enzyme(CMakePackage): depends_on("llvm@7:14", when="@0.0.48:0.0.68") depends_on("llvm@9:16", when="@0.0.69:0.0.79") depends_on("llvm@11:16", when="@0.0.80:0.0.99") - depends_on("llvm@11:19", when="@0.0.100:") + depends_on("llvm@11:19", when="@0.0.100:0.0.148") + depends_on("llvm@15:19", when="@0.0.149:") depends_on("cmake@3.13:", type="build") def cmake_args(self): diff --git a/var/spack/repos/builtin/packages/evtgen/package.py b/var/spack/repos/builtin/packages/evtgen/package.py index 5d9afa2b772bd9..dcb2d70f366b35 100644 --- a/var/spack/repos/builtin/packages/evtgen/package.py +++ b/var/spack/repos/builtin/packages/evtgen/package.py @@ -22,7 +22,8 @@ class Evtgen(CMakePackage): version("02.02.00", sha256="0c626e51cb17e799ad0ffd0beea5cb94d7ac8a5f8777b746aa1944dd26071ecf") version("02.00.00", sha256="02372308e1261b8369d10538a3aa65fe60728ab343fcb64b224dac7313deb719") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("pythia8", default=True, description="Build with pythia8") variant("tauola", default=False, description="Build with tauola") diff --git a/var/spack/repos/builtin/packages/exawind/package.py b/var/spack/repos/builtin/packages/exawind/package.py index 89b5aae76fa4b6..42ada8b54313df 100644 --- a/var/spack/repos/builtin/packages/exawind/package.py +++ b/var/spack/repos/builtin/packages/exawind/package.py @@ -121,9 +121,9 @@ def setup_build_environment(self, env): # Manually turn off device self.defines to solve Kokkos issues in Nalu-Wind headers env.append_flags("CXXFLAGS", "-U__HIP_DEVICE_COMPILE__ -DDESUL_HIP_RDC") if self.spec.satisfies("+cuda"): - env.set("OMPI_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx) - env.set("MPICH_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx) - env.set("MPICXX_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("OMPI_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("MPICH_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("MPICXX_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) if self.spec.satisfies("+rocm"): env.set("OMPI_CXX", self.spec["hip"].hipcc) env.set("MPICH_CXX", self.spec["hip"].hipcc) diff --git a/var/spack/repos/builtin/packages/express/package.py b/var/spack/repos/builtin/packages/express/package.py index 32a36e6df64a66..099f1d548632a5 100644 --- a/var/spack/repos/builtin/packages/express/package.py +++ b/var/spack/repos/builtin/packages/express/package.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import glob -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/extrae/package.py b/var/spack/repos/builtin/packages/extrae/package.py index cbc849e8f2c6f7..11f151b6364328 100644 --- a/var/spack/repos/builtin/packages/extrae/package.py +++ b/var/spack/repos/builtin/packages/extrae/package.py @@ -73,10 +73,6 @@ class Extrae(AutotoolsPackage): depends_on("mpi") depends_on("libunwind") - # TODO: replace this with an explicit list of components of Boost, - # for instance depends_on('boost +filesystem') - # See https://github.com/spack/spack/pull/22303 for reference - depends_on(Boost.with_default_variants) depends_on("libdwarf") depends_on("elf", type="link") depends_on("libxml2") @@ -92,6 +88,10 @@ class Extrae(AutotoolsPackage): variant("dyninst", default=False, description="Use dyninst for dynamic code installation") with when("+dyninst"): depends_on("dyninst@10.1.0:") + # TODO: replace this with an explicit list of components of Boost, + # for instance depends_on('boost +filesystem') + # See https://github.com/spack/spack/pull/22303 for reference + depends_on(Boost.with_default_variants) depends_on("elfutils", when="@4.1.2:") depends_on("intel-oneapi-tbb", when="@4.1.2:") @@ -127,7 +127,6 @@ def configure_args(self): args = [ "--with-mpi=%s" % mpiroot, "--with-unwind=%s" % spec["libunwind"].prefix, - "--with-boost=%s" % spec["boost"].prefix, "--with-dwarf=%s" % spec["libdwarf"].prefix, "--with-elf=%s" % spec["elf"].prefix, "--with-xml-prefix=%s" % spec["libxml2"].prefix, @@ -141,7 +140,10 @@ def configure_args(self): ) if spec.satisfies("+dyninst"): - args += ["--with-dyninst={spec['dyninst'].prefix}"] + args += [ + f"--with-dyninst={spec['dyninst'].prefix}", + f"--with-boost={spec['boost'].prefix}", + ] if spec.satisfies("@4.1.2:"): args += [ diff --git a/var/spack/repos/builtin/packages/fairmq/package.py b/var/spack/repos/builtin/packages/fairmq/package.py index 1bf45e49ec6474..e62da904745697 100644 --- a/var/spack/repos/builtin/packages/fairmq/package.py +++ b/var/spack/repos/builtin/packages/fairmq/package.py @@ -20,6 +20,7 @@ class Fairmq(CMakePackage): # depends on the git metadata, see also # https://github.com/spack/spack/issues/19972 # https://github.com/spack/spack/issues/14344 + version("1.9.1", tag="v1.9.1", commit="c11506e95878a39837c5af92dc99b4a1248c13ac") version("1.8.1", tag="v1.8.1", commit="961eca52761a31a0200c567b44e2b2d6d6e50df3") version("1.7.0", tag="v1.7.0", commit="d1c99f7e150c1177dc1cab1b2adc16475cade24e") version("1.6.0", tag="v1.6.0", commit="42d27af20fb5cbbbc0b0fdfef1c981d51a8baf87") diff --git a/var/spack/repos/builtin/packages/fargparse/package.py b/var/spack/repos/builtin/packages/fargparse/package.py index 376f63ddd3cf37..a8f29f59345f95 100644 --- a/var/spack/repos/builtin/packages/fargparse/package.py +++ b/var/spack/repos/builtin/packages/fargparse/package.py @@ -19,6 +19,7 @@ class Fargparse(CMakePackage): version("develop", branch="develop") version("main", branch="main") + version("1.9.0", sha256="c83c13fa90b6b45adf8d84fe00571174acfa118d2a0d1e8c467f74bbd7dec49d") version("1.8.0", sha256="37108bd3c65d892d8c24611ce4d8e5451767e4afe81445fde67eab652178dd01") version("1.7.0", sha256="9889e7eca9c020b742787fba2be0ba16edcc3fcf52929261ccb7d09996a35f89") version("1.6.0", sha256="055a0af44f50c302f8f20a8bcf3d26c5bbeacf5222cdbaa5b19da4cff56eb9c0") diff --git a/var/spack/repos/builtin/packages/fasta/package.py b/var/spack/repos/builtin/packages/fasta/package.py index 9c8dd6ccb6c641..6c8885b43928cc 100644 --- a/var/spack/repos/builtin/packages/fasta/package.py +++ b/var/spack/repos/builtin/packages/fasta/package.py @@ -41,7 +41,7 @@ def makefile_name(self): elif self.spec.satisfies("platform=linux target=x86_64:"): name = "Makefile.linux64_sse2" else: - tty.die( + raise InstallError( """Unsupported platform/target, must be Darwin (assumes 64-bit) Linux x86_64 diff --git a/var/spack/repos/builtin/packages/fastjet/package.py b/var/spack/repos/builtin/packages/fastjet/package.py index 69bf54b93b1c76..2e2f3b462f0be8 100644 --- a/var/spack/repos/builtin/packages/fastjet/package.py +++ b/var/spack/repos/builtin/packages/fastjet/package.py @@ -59,6 +59,7 @@ class Fastjet(AutotoolsPackage): version("2.3.0", sha256="e452fe4a9716627bcdb726cfb0917f46a7ac31f6006330a6ccc1abc43d9c2d53") # older version use .tar instead of .tar.gz extension, to be added + depends_on("c", type="build") depends_on("cxx", type="build") depends_on("fortran", type="build", when="plugins=all") depends_on("fortran", type="build", when="plugins=pxcone") diff --git a/var/spack/repos/builtin/packages/fcgi/package.py b/var/spack/repos/builtin/packages/fcgi/package.py index 93ea27524d06e1..cef3a397717941 100644 --- a/var/spack/repos/builtin/packages/fcgi/package.py +++ b/var/spack/repos/builtin/packages/fcgi/package.py @@ -14,12 +14,10 @@ class Fcgi(AutotoolsPackage): homepage = "https://fastcgi-archives.github.io/" url = "https://github.com/FastCGI-Archives/fcgi2/archive/refs/tags/2.4.2.tar.gz" - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - license("OML") + version("2.4.4", sha256="c0e0d9cc7d1e456d7278c974e2826f593ef5ca555783eba81e7e9c1a07ae0ecc") + version("2.4.3", sha256="5273bc54c28215d81b9bd78f937a9bcdd4fe94e41ccd8d7c991aa8a01b50b70e") version("2.4.2", sha256="1fe83501edfc3a7ec96bb1e69db3fd5ea1730135bd73ab152186fd0b437013bc") version( "2.4.1-SNAP-0910052249", @@ -27,7 +25,10 @@ class Fcgi(AutotoolsPackage): url="https://github.com/FastCGI-Archives/FastCGI.com/raw/master/original_snapshot/fcgi-2.4.1-SNAP-0910052249.tar.gz", ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("libtool", type="build") parallel = False diff --git a/var/spack/repos/builtin/packages/fckit/package.py b/var/spack/repos/builtin/packages/fckit/package.py index d13aab278c82eb..cbd8612356e60e 100644 --- a/var/spack/repos/builtin/packages/fckit/package.py +++ b/var/spack/repos/builtin/packages/fckit/package.py @@ -50,17 +50,6 @@ class Fckit(CMakePackage): depends_on("llvm-openmp", when="+openmp %apple-clang", type=("build", "run")) variant("shared", default=True, description="Build shared libraries") variant("fismahigh", default=False, description="Apply patching for FISMA-high compliance") - variant( - "finalize_ddts", - default="auto", - description="Enable / disable automatic finalization of derived types", - values=("auto", "no", "yes"), - ) - - # fckit fails to auto-detect/switch off finalization - # of derived types for latest Intel compilers. If set - # to auto, turn off in cmake_args. If set to yes, abort. - conflicts("%intel@2021.8:", when="finalize_ddts=yes") def cmake_args(self): args = [ @@ -72,11 +61,11 @@ def cmake_args(self): if self.spec.satisfies("~shared"): args.append("-DBUILD_SHARED_LIBS=OFF") - if "finalize_ddts=auto" not in self.spec: - args.append(self.define_from_variant("ENABLE_FINAL", "finalize_ddts")) - elif "finalize_ddts=auto" in self.spec and self.spec.satisfies("%intel@2021.8:"): - # See comment above (conflicts for finalize_ddts) - args.append("-DENABLE_FINAL=OFF") + # Turn off finalization of derived data types (DDTs) because it is + # flaky and we can't rely on fckit to auto-detect if the compiler + # supports the feature or not. + # https://github.com/JCSDA/spack-stack/issues/1521 + args.append("-DENABLE_FINAL=OFF") if ( self.spec.satisfies("%intel") diff --git a/var/spack/repos/builtin/packages/fd/package.py b/var/spack/repos/builtin/packages/fd/package.py index fb24492f07d9bb..b7d0290af1d1e5 100644 --- a/var/spack/repos/builtin/packages/fd/package.py +++ b/var/spack/repos/builtin/packages/fd/package.py @@ -6,15 +6,22 @@ class Fd(CargoPackage): - """A simple, fast and user-friendly alternative to 'find'""" + """fd is a program to find entries in your filesystem. It is a simple, fast + and user-friendly alternative to the traditional 'find' command. While it + does not aim to support all of find's powerful functionality, it provides + sensible defaults for most use cases. + """ homepage = "https://github.com/sharkdp/fd" url = "https://github.com/sharkdp/fd/archive/refs/tags/v8.4.0.tar.gz" + git = "https://github.com/sharkdp/fd.git" maintainers("alecbcs", "ashermancinelli") license("Apache-2.0 OR MIT") + # Versions from newest to oldest + version("master", branch="master") version("10.2.0", sha256="73329fe24c53f0ca47cd0939256ca5c4644742cb7c14cf4114c8c9871336d342") version("10.1.0", sha256="ee4b2403388344ff60125c79ff25b7895a170e7960f243ba2b5d51d2c3712d97") version("9.0.0", sha256="306d7662994e06e23d25587246fa3fb1f528579e42a84f5128e75feec635a370") @@ -22,24 +29,28 @@ class Fd(CargoPackage): version("8.4.0", sha256="d0c2fc7ddbe74e3fd88bf5bb02e0f69078ee6d2aeea3d8df42f508543c9db05d") version("7.4.0", sha256="33570ba65e7f8b438746cb92bb9bc4a6030b482a0d50db37c830c4e315877537") - depends_on("rust@1.64:", type="build", when="@8.7:") - depends_on("rust@1.70:", type="build", when="@8.7.1:") - depends_on("rust@1.77.2:", type="build", when="@10:") - + # Build dependencies depends_on("c", type="build") + depends_on("rust@1.77.2:", type="build", when="@10:") + depends_on("rust@1.70:", type="build", when="@8.7.1:") + depends_on("rust@1.64:", type="build", when="@8.7:") @run_after("install") def install_completions(self): + """Install shell completion files for bash, fish, and zsh.""" fd = Executable(self.prefix.bin.fd) + # Install bash completions mkdirp(bash_completion_path(self.prefix)) with open(bash_completion_path(self.prefix) / "fd", "w") as file: fd("--gen-completions", "bash", output=file) + # Install fish completions mkdirp(fish_completion_path(self.prefix)) with open(fish_completion_path(self.prefix) / "fd.fish", "w") as file: fd("--gen-completions", "fish", output=file) + # Install zsh completions mkdirp(zsh_completion_path(self.prefix)) with open(zsh_completion_path(self.prefix) / "_fd", "w") as file: fd("--gen-completions", "zsh", output=file) diff --git a/var/spack/repos/builtin/packages/fftw/package.py b/var/spack/repos/builtin/packages/fftw/package.py index 2ec990097a4079..938f6eb88d5975 100644 --- a/var/spack/repos/builtin/packages/fftw/package.py +++ b/var/spack/repos/builtin/packages/fftw/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import llnl.util.lang diff --git a/var/spack/repos/builtin/packages/fftx/package.py b/var/spack/repos/builtin/packages/fftx/package.py index c8103c39ae32bf..4477a965284084 100644 --- a/var/spack/repos/builtin/packages/fftx/package.py +++ b/var/spack/repos/builtin/packages/fftx/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/fjcontrib/configure-1.100.patch b/var/spack/repos/builtin/packages/fjcontrib/configure-1.100.patch new file mode 100644 index 00000000000000..34600428486ac9 --- /dev/null +++ b/var/spack/repos/builtin/packages/fjcontrib/configure-1.100.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 879d44f..b4bab5f 100755 +--- a/configure ++++ b/configure +@@ -352,7 +352,7 @@ else + #dynlibopt="-shared" + # the following more elaborate set of options requested by Alexander Puck Neuwirth + # for compatibility with gentoo, cf. https://github.com/fjcontrib/fjcontrib/issues/4 +- dynlibopt="-shared -Wl,--as-needed -Wl,-soname,fastjetcontribfragile.so.0" ++ dynlibopt="-shared -Wl,--as-needed -Wl,-soname,libfastjetcontribfragile.so" + dynlibext="so" + dynlibpostproc="" # some dummy command needed + fi diff --git a/var/spack/repos/builtin/packages/fjcontrib/package.py b/var/spack/repos/builtin/packages/fjcontrib/package.py index 0caf472830b0f5..afb247b15727bd 100644 --- a/var/spack/repos/builtin/packages/fjcontrib/package.py +++ b/var/spack/repos/builtin/packages/fjcontrib/package.py @@ -15,6 +15,9 @@ class Fjcontrib(AutotoolsPackage): license("GPL-2.0-or-later") + version("1.100", sha256="52ad945d9195c40f347958dc04041e41c7130e845ebdf0c13f1bbdd5b6d2429b") + version("1.056", sha256="fc31544424dece0d0676ea2433ad1e96fd9db82920bc7a7ef6294ce94e659d6e") + version("1.055", sha256="d9aa46560fdfd85082f202a5a9ce64768fe0c598660f013206a8c9c17ecd0f36") version("1.054", sha256="1ef922d4c45863e5fe7a3b64dc441703db6b1c2cc92d4160125dc629b05ac331") version("1.052", sha256="bde63c28cbdf992bedea4ddedfc3cd52c9fec241a767cc455dd4ad10e8210c39") version("1.051", sha256="76a2ec612c768db3eb6bbaf686d02b05ddb64dde477d185e20df563b52308473") @@ -67,6 +70,9 @@ class Fjcontrib(AutotoolsPackage): version("0.001", sha256="51f24ad55e28fb1f9d698270602e5077c920fcf58d8ccfd274efbe829d7dd821") version("0.000", sha256="9486b11201e6b6e181b8a3abecd929403ae9aa67de0eb8b7353fb82ab4b89f41") + # fix incorrect soname in 1.100 + patch("configure-1.100.patch", when="@1.100") + depends_on("cxx", type="build") # generated depends_on("fastjet") diff --git a/var/spack/repos/builtin/packages/flecsi/package.py b/var/spack/repos/builtin/packages/flecsi/package.py index da9285e5b73f85..c37fd487005d06 100644 --- a/var/spack/repos/builtin/packages/flecsi/package.py +++ b/var/spack/repos/builtin/packages/flecsi/package.py @@ -20,12 +20,16 @@ class Flecsi(CMakePackage, CudaPackage, ROCmPackage): tags = ["e4s"] - version("develop", branch="develop", deprecated=True) + version("2.3.1", tag="v2.3.1", commit="6c04b9b21790533e457764bd7f8f26757db1552f") version("2.3.0", tag="v2.3.0", commit="90bc8267fceb02060e54646f73b45d4252aef491") version("2.2.1", tag="v2.2.1", commit="84b5b232aebab40610f57387778db80f6c8c84c5") version("2.2.0", tag="v2.2.0", commit="dd531ac16c5df124d76e385c6ebe9b9589c2d3ad") - version("2.1.0", tag="v2.1.0", commit="533df139c267e2a93c268dfe68f9aec55de11cf0") - version("2.0.0", tag="v2.0.0", commit="5ceebadf75d1c98999ea9e9446926722d061ec22") + version( + "2.1.0", tag="v2.1.0", commit="533df139c267e2a93c268dfe68f9aec55de11cf0", deprecated=True + ) + version( + "2.0.0", tag="v2.0.0", commit="5ceebadf75d1c98999ea9e9446926722d061ec22", deprecated=True + ) variant( "backend", @@ -46,8 +50,8 @@ class Flecsi(CMakePackage, CudaPackage, ROCmPackage): description="Set Caliper Profiling Detail", multi=False, ) - variant("kokkos", default=False, description="Enable Kokkos Support") - variant("openmp", default=False, description="Enable OpenMP Support") + variant("kokkos", default=False, description="Enable Kokkos Support", when="@:2.3.1") + variant("openmp", default=False, description="Enable OpenMP Support", when="@:2.3.1") depends_on("c", type="build") depends_on("cxx", type="build") @@ -69,18 +73,22 @@ class Flecsi(CMakePackage, CudaPackage, ROCmPackage): depends_on("boost@1.79.0:", when="@2.2:") depends_on("kokkos@3.2.00:", when="+kokkos") depends_on("kokkos@3.7:", when="+kokkos @2.3:") - depends_on("kokkos +cuda +cuda_constexpr +cuda_lambda", when="+kokkos +cuda") + depends_on("kokkos@3.7:", when="@2.4:") + depends_on("kokkos +cuda", when="+kokkos +cuda") + requires("^kokkos +cuda_constexpr +cuda_lambda", when="^kokkos +cuda") depends_on("kokkos +rocm", when="+kokkos +rocm") depends_on("kokkos +openmp", when="+kokkos +openmp") - depends_on("legion@cr-20210122", when="backend=legion @2.0:2.2.1") + requires("+openmp", when="@:2.3.1 ^kokkos +openmp") + depends_on("legion@cr-20210122", when="backend=legion @2.0:2.1.0") depends_on("legion@cr-20230307", when="backend=legion @2.2.0:2.2.1") depends_on("legion@24.03.0:", when="backend=legion @2.2.2:") + depends_on("legion@24.09.0:", when="backend=legion @2.3.1:") depends_on("legion+shared", when="backend=legion +shared") depends_on("legion+hdf5", when="backend=legion +hdf5") - depends_on("legion+kokkos", when="backend=legion +kokkos") - depends_on("legion+openmp", when="backend=legion +openmp") - depends_on("legion+cuda", when="backend=legion +cuda") - depends_on("legion+rocm", when="backend=legion +rocm") + depends_on("legion+kokkos", when="backend=legion ^kokkos") + depends_on("legion+openmp", when="backend=legion ^kokkos+openmp") + depends_on("legion+cuda", when="backend=legion ^kokkos+cuda") + depends_on("legion+rocm", when="backend=legion ^kokkos+rocm") depends_on("hdf5@1.10.7:", when="backend=legion +hdf5") depends_on("hpx@1.10.0: cxxstd=17 malloc=system", when="backend=hpx") depends_on("mpi") @@ -97,11 +105,13 @@ class Flecsi(CMakePackage, CudaPackage, ROCmPackage): # Propagate cuda_arch requirement to dependencies for _flag in CudaPackage.cuda_arch_values: + requires(f"+cuda cuda_arch={_flag}", when=f"^kokkos +cuda cuda_arch={_flag}") depends_on(f"kokkos cuda_arch={_flag}", when=f"+cuda+kokkos cuda_arch={_flag}") depends_on(f"legion cuda_arch={_flag}", when=f"backend=legion +cuda cuda_arch={_flag}") # Propagate amdgpu_target requirement to dependencies for _flag in ROCmPackage.amdgpu_targets: + requires(f"+rocm amdgpu_target={_flag}", when=f"^kokkos +rocm amdgpu_target={_flag}") depends_on(f"kokkos amdgpu_target={_flag}", when=f"+kokkos +rocm amdgpu_target={_flag}") depends_on( f"legion amdgpu_target={_flag}", when=f"backend=legion +rocm amdgpu_target={_flag}" @@ -130,14 +140,14 @@ def cmake_args(self): self.define_from_variant("ENABLE_DOCUMENTATION", "doc"), ] - if self.spec.satisfies("+rocm"): + if self.spec.satisfies("^kokkos +rocm"): options.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)) options.append(self.define("CMAKE_C_COMPILER", self.spec["hip"].hipcc)) if self.spec.satisfies("backend=legion"): # CMake pulled in via find_package(Legion) won't work without this options.append(self.define("HIP_PATH", "{0}/hip".format(spec["hip"].prefix))) - elif self.spec.satisfies("+kokkos"): - options.append(self.define("CMAKE_CXX_COMPILER", self.spec["kokkos"].kokkos_cxx)) + elif self.spec.satisfies("^kokkos"): + options.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx)) else: # kept for supporing version prior to 2.2 options = [ diff --git a/var/spack/repos/builtin/packages/fluidnumerics-self/package.py b/var/spack/repos/builtin/packages/fluidnumerics-self/package.py new file mode 100644 index 00000000000000..daf4e93b5c8dd0 --- /dev/null +++ b/var/spack/repos/builtin/packages/fluidnumerics-self/package.py @@ -0,0 +1,63 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class FluidnumericsSelf(CMakePackage): + """Spectral Element Library in Fortran.""" + + homepage = "https://self.fluidnumerics.com" + url = "https://github.com/FluidNumerics/SELF/archive/refs/tags/v0.0.1.tar.gz" + + maintainers("fluidnumerics_joe", "garrettbyrd") + + license("BSD-3-Clause-Attribution", checked_by="fluidnumerics_joe") + + version("0.0.1", sha256="c3d4ab7d12f18b9d5864c5f9d7a91c86ebc3b7ff0fec4fa56b5c34b325344259") + + variant( + "build_type", + default="Release", + description="The build type to build", + values=("Debug", "Release", "Coverage", "Profile"), + ) + variant( + "fp64", default=True, description="Enables double precision floating point arithmetic." + ) + variant( + "multithreading", + default=False, + description="Enables multithreading of do concurrent loops", + ) + variant( + "nthreads", + default="4", + description="Sets the number of threads for do concurrent loops", + values=("2", "4", "6", "8"), + multi=False, + ) + variant("examples", default=True, description="Enables build and installation of examples") + variant("tests", default=False, description="Enables build and installation of unit tests") + + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + depends_on("ninja", type="build") + depends_on("hdf5+fortran+mpi@1.14:") + depends_on("feq-parse@2.2.2:") + depends_on("mpi") + + generator("ninja") + + def cmake_args(self): + args = [ + self.define_from_variant("SELF_ENABLE_EXAMPLES", "examples"), + self.define_from_variant("SELF_ENABLE_TESTING", "tests"), + self.define_from_variant("SELF_ENABLE_DOUBLE_PRECISION", "fp64"), + self.define_from_variant("SELF_ENABLE_MULTITHREADING", "multithreading"), + self.define_from_variant("SELF_MULTITHREADING_NTHREADS", "nthreads"), + ] + + return args diff --git a/var/spack/repos/builtin/packages/flux-pmix/package.py b/var/spack/repos/builtin/packages/flux-pmix/package.py index 5584958c1925b6..f1b50972af683e 100644 --- a/var/spack/repos/builtin/packages/flux-pmix/package.py +++ b/var/spack/repos/builtin/packages/flux-pmix/package.py @@ -17,6 +17,7 @@ class FluxPmix(AutotoolsPackage): maintainers("grondo") version("main", branch="main") + version("0.6.0", sha256="31f9d9b99f8a75c05e2fd183a35998f104d8e80bd819c57252aca477be0d4c6e") version("0.5.0", sha256="f382800b1a342df0268146ea7ce33011299bf0c69a46ac8a52e87de6026c9322") version("0.4.0", sha256="f7f58891fc9d9a97a0399b3ab186f2cae30a75806ba0b4d4c1307f07b3f6d1bc") version("0.3.0", sha256="88edb2afaeb6058b56ff915105a36972acc0d83204cff7f4a4d2f65a5dee9d34") diff --git a/var/spack/repos/builtin/packages/flux-sched/package.py b/var/spack/repos/builtin/packages/flux-sched/package.py index d89d58c1f54098..3a682697ccb714 100644 --- a/var/spack/repos/builtin/packages/flux-sched/package.py +++ b/var/spack/repos/builtin/packages/flux-sched/package.py @@ -22,6 +22,8 @@ class FluxSched(CMakePackage, AutotoolsPackage): license("LGPL-3.0-only") version("master", branch="master") + version("0.42.1", sha256="ab56b257e4918ad7e26ef6a375d0ea500a4929bf6633937f0c11c06e21db56b9") + version("0.41.0", sha256="c89baf72867031847748c157aa99f3b36755f2801df917aae66010d2112e10fe") version("0.40.0", sha256="1484befcf8628b0af7833bf550d0bb3864db32b70f2c1bb363c35e30ada1ecc5") version("0.39.0", sha256="7e87029f8ad17b9286096e4e2d44982b5d6634908aefde3282497bdd3f44f2f8") version("0.38.0", sha256="0cb3efbd490256b28df580bb14f8e89c02084a9126e0b1754d6334a99ecfa969") diff --git a/var/spack/repos/builtin/packages/fms/package.py b/var/spack/repos/builtin/packages/fms/package.py index 042ef0cc121fed..89d33d89586169 100644 --- a/var/spack/repos/builtin/packages/fms/package.py +++ b/var/spack/repos/builtin/packages/fms/package.py @@ -18,6 +18,8 @@ class Fms(CMakePackage): license("LGPL-3.0-or-later") maintainers("AlexanderRichert-NOAA", "Hang-Lei-NOAA", "edwardhartnett", "rem1776", "climbfuji") + version("2025.01", sha256="19997ef5468a06c60c1e7af3a56ab7f8a33da814a30827293ca34df5bd888d6f") + version("2024.03", sha256="4c1e6bdfafcfec19a4a1c08770c313ab3135d47ec8319f6b07f24d2589caf44d") version("2024.02", sha256="47e5740bb066f5eb032e1de163eb762c7258880a2932f4cc4e34e769e0cc2b0e") version( "2024.01.01", sha256="41c8686bad2b1aed76275e35cbe1af855f7dfce9b6d8907744ea2e8174758f6a" @@ -64,6 +66,13 @@ class Fms(CMakePackage): when="@2023.03", ) + variant( + "portable_kinds", + description="Use iso_c_binding variable kinds", + when="@2025.01:", + default=False, + ) + variant("shared", description="Build shared libraries", when="@2024.02:", default=False) # What the following patch is providing is available in version 2024.03 # and newer so it is only needed to 2024.02 @@ -131,6 +140,7 @@ def cmake_args(self): self.define_from_variant("OPENMP"), self.define_from_variant("ENABLE_QUAD_PRECISION", "quad_precision"), self.define_from_variant("SHARED_LIBS", "shared"), + self.define_from_variant("PORTABLE_KINDS", "portable_kinds"), self.define_from_variant("WITH_YAML", "yaml"), self.define_from_variant("CONSTANTS"), self.define_from_variant("LARGEFILE", "large_file"), diff --git a/var/spack/repos/builtin/packages/fmt/package.py b/var/spack/repos/builtin/packages/fmt/package.py index e0b5edbf8a1a53..004658cad756b2 100644 --- a/var/spack/repos/builtin/packages/fmt/package.py +++ b/var/spack/repos/builtin/packages/fmt/package.py @@ -17,6 +17,9 @@ class Fmt(CMakePackage): license("MIT") + version("11.1.3", sha256="7df2fd3426b18d552840c071c977dc891efe274051d2e7c47e2c83c3918ba6df") + version("11.1.2", sha256="ef54df1d4ba28519e31bf179f6a4fb5851d684c328ca051ce5da1b52bf8b1641") + version("11.1.1", sha256="a25124e41c15c290b214c4dec588385153c91b47198dbacda6babce27edc4b45") version("11.0.2", sha256="40fc58bebcf38c759e11a7bd8fdc163507d2423ef5058bba7f26280c5b9c5465") version("11.0.1", sha256="62ca45531814109b5d6cef0cf2fd17db92c32a30dd23012976e768c685534814") version("11.0.0", sha256="583ce480ef07fad76ef86e1e2a639fc231c3daa86c4aa6bcba524ce908f30699") @@ -115,12 +118,7 @@ def cmake_args(self): args.append("-DBUILD_SHARED_LIBS=ON") if spec.satisfies("+pic"): - args.extend( - [ - "-DCMAKE_C_FLAGS={0}".format(self.compiler.cc_pic_flag), - "-DCMAKE_CXX_FLAGS={0}".format(self.compiler.cxx_pic_flag), - ] - ) + args.append(self.define("CMAKE_POSITION_INDEPENDENT_CODE", True)) args.append("-DCMAKE_CXX_STANDARD={0}".format(spec.variants["cxxstd"].value)) # Require standard at configure time to guarantee the diff --git a/var/spack/repos/builtin/packages/foam-extend/package.py b/var/spack/repos/builtin/packages/foam-extend/package.py index 997d2433d68851..adad6aa4ad6b26 100644 --- a/var/spack/repos/builtin/packages/foam-extend/package.py +++ b/var/spack/repos/builtin/packages/foam-extend/package.py @@ -32,8 +32,6 @@ import os import re -import llnl.util.tty as tty - from spack.package import * from spack.pkg.builtin.openfoam import ( OpenfoamArch, @@ -41,7 +39,6 @@ rewrite_environ_files, write_environ, ) -from spack.util.environment import EnvironmentModifications class FoamExtend(Package): @@ -173,7 +170,7 @@ def setup_run_environment(self, env): if minimal: # pre-build or minimal environment tty.info("foam-extend minimal env {0}".format(self.prefix)) - env.set("FOAM_INST_DIR", os.path.dirname(self.projectdir)), + env.set("FOAM_INST_DIR", os.path.dirname(self.projectdir)) env.set("FOAM_PROJECT_DIR", self.projectdir) env.set("WM_PROJECT_DIR", self.projectdir) for d in ["wmake", self.archbin]: # bin added automatically diff --git a/var/spack/repos/builtin/packages/fpart/package.py b/var/spack/repos/builtin/packages/fpart/package.py index 19c8acb98072c7..18d332abc5af98 100644 --- a/var/spack/repos/builtin/packages/fpart/package.py +++ b/var/spack/repos/builtin/packages/fpart/package.py @@ -19,6 +19,7 @@ class Fpart(AutotoolsPackage): license("BSD-2-Clause", checked_by="drkrynstrng") version("master", branch="master") + version("1.7.0", sha256="e5f82dd90001ed53200b2383bcfd520b1d8ee06d6a2a75b39d37d68daef20c88") version("1.6.0", sha256="ed1fac2853fc421071b72e4c5d8455a231bc30e50034db14af8b0485ece6e097") version("1.5.1", sha256="c353a28f48e4c08f597304cb4ebb88b382f66b7fabfc8d0328ccbb0ceae9220c") diff --git a/var/spack/repos/builtin/packages/freeipmi/package.py b/var/spack/repos/builtin/packages/freeipmi/package.py index 56165e53b2ed1d..b8b3f9350e62ff 100644 --- a/var/spack/repos/builtin/packages/freeipmi/package.py +++ b/var/spack/repos/builtin/packages/freeipmi/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.tty as tty from spack.package import * diff --git a/var/spack/repos/builtin/packages/freesurfer/package.py b/var/spack/repos/builtin/packages/freesurfer/package.py index 91b310c3a176d8..1d9be48082a842 100644 --- a/var/spack/repos/builtin/packages/freesurfer/package.py +++ b/var/spack/repos/builtin/packages/freesurfer/package.py @@ -6,7 +6,6 @@ import os from spack.package import * -from spack.util.environment import EnvironmentModifications class Freesurfer(Package): diff --git a/var/spack/repos/builtin/packages/fsl/package.py b/var/spack/repos/builtin/packages/fsl/package.py index f29c854d26c3b5..058e1b4449a18e 100644 --- a/var/spack/repos/builtin/packages/fsl/package.py +++ b/var/spack/repos/builtin/packages/fsl/package.py @@ -7,7 +7,6 @@ import spack.util.environment from spack.package import * -from spack.util.environment import EnvironmentModifications class Fsl(Package, CudaPackage): diff --git a/var/spack/repos/builtin/packages/fujitsu-fftw/package.py b/var/spack/repos/builtin/packages/fujitsu-fftw/package.py index 0f7214eed68774..2d270039b7db54 100644 --- a/var/spack/repos/builtin/packages/fujitsu-fftw/package.py +++ b/var/spack/repos/builtin/packages/fujitsu-fftw/package.py @@ -1,18 +1,10 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.error import SpackError from spack.package import * from spack.pkg.builtin.fftw import FftwBase -def target_check(spec): - if spec.target != "a64fx": - error_msg = "It can only be built on an A64FX machine.\n" - raise SpackError(error_msg) - - class FujitsuFftw(FftwBase): """FFTW (Fujitsu Optimized version) is a comprehensive collection of fast C routines for computing the Discrete Fourier Transform (DFT) @@ -53,11 +45,9 @@ class FujitsuFftw(FftwBase): msg="ARM-SVE vector instructions only works in single or double precision", ) requires("%fj") + requires("target=a64fx") def autoreconf(self, spec, prefix): - if spec.target != "a64fx": - target_check(spec) - touch = which("touch") touch("ChangeLog") autoreconf = which("autoreconf") diff --git a/var/spack/repos/builtin/packages/func/package.py b/var/spack/repos/builtin/packages/func/package.py new file mode 100644 index 00000000000000..bcad12bab4c707 --- /dev/null +++ b/var/spack/repos/builtin/packages/func/package.py @@ -0,0 +1,45 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Func(CMakePackage): + """(Function Comparator) is a C++ tool for quickly profiling the performance + of various different abstracted implementations of mathematical function evaluations""" + + homepage = "https://github.com/uofs-simlab/func" + url = "https://github.com/uofs-simlab/func/archive/refs/tags/v2.0.tar.gz" + git = "https://github.com/uofs-simlab/func" + + license("GPL/LGPL") + maintainers("Chrismarsh") + + version("master", branch="master") + version("2.2.0", sha256="bd4ecbc27096fa0b913fb46059e02298a96afd4912d549eb68b5c4c090999976") + version("2.1.0", sha256="150cc53fe90df16a1b06f34c3293f4aef4557ce42b30e1095e7570b1c367b9f7") + version("2.0", sha256="ca25b960c72bebc5b0be0fedc189ef24e669d21a7571fd59f751a187fb6c1cea") + version("1.0", sha256="60dbc353f82208efde08eeaea1fabd15e805b6c517a8e033d168027c89884fbf") + + variant( + "armadillo", + default=True, + description="Use Armadillo to enable ChebyInterpTables or PadeTable tables.", + ) + variant("openmp", default=True, description="Enable OpenMP") + variant("examples", default=False, description="Build examples") + + depends_on("cxx", type="build") + + depends_on("boost") + depends_on("armadillo", when="+armadillo") + depends_on("llvm-openmp", when="%apple-clang +openmp") + + def cmake_args(self): + args = [ + self.define_from_variant("FUNC_USE_OPENMP", "openmp"), + self.define_from_variant("FUNC_USE_ARMADILLO", "armadillo"), + self.define_from_variant("BUILD_EXAMPLES", "examples"), + ] + return args diff --git a/var/spack/repos/builtin/packages/fusion-io/package.py b/var/spack/repos/builtin/packages/fusion-io/package.py new file mode 100644 index 00000000000000..260e81ded4479c --- /dev/null +++ b/var/spack/repos/builtin/packages/fusion-io/package.py @@ -0,0 +1,47 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class FusionIo(CMakePackage): + """Fusion-IO is a library providing common interface (C++, C, Fortran, Python) + to data from various fusion simulation codes. It supported reading data from + M3D-C1, GPEC, MARS, GATO outputs and GEQDSK files.""" + + git = "https://github.com/nferraro/fusion-io" + + maintainers("changliu777") + + license("MIT") + + version("master", submodules=True, branch="master") + + variant("python", default=True, description="Enable Python support") + variant("trace", default=True, description="Build trace program") + + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + depends_on("mpi") + depends_on("hdf5") + depends_on("cmake@3:", type="build") + + extends("python", when="+python") + + def cmake_args(self): + spec = self.spec + + args = [ + self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc), + self.define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx), + self.define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc), + self.define_from_variant("FUSIONIO_ENABLE_TRACE", "trace"), + self.define_from_variant("FUSIONIO_ENABLE_PYTHON", "python"), + ] + + if self.spec.satisfies("+python"): + args.append(self.define("PYTHON_MODULE_INSTALL_PATH", python_platlib)) + + return args diff --git a/var/spack/repos/builtin/packages/fzf/package.py b/var/spack/repos/builtin/packages/fzf/package.py index b47da5f98d05ea..85d15f50621ad3 100644 --- a/var/spack/repos/builtin/packages/fzf/package.py +++ b/var/spack/repos/builtin/packages/fzf/package.py @@ -1,23 +1,30 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) + import re from spack.package import * -class Fzf(MakefilePackage): - """fzf is a general-purpose command-line fuzzy finder.""" +class Fzf(GoPackage): + """A general-purpose command-line fuzzy finder that provides fast, interactive + filtering for files, processes, git commits, and more. It supports fuzzy + search with real-time preview and various input sources.""" homepage = "https://github.com/junegunn/fzf" url = "https://github.com/junegunn/fzf/archive/v0.54.0.tar.gz" + git = "https://github.com/junegunn/fzf.git" maintainers("alecbcs") - executables = ["^fzf$"] - license("MIT") + sanity_check_is_file = ["bin/fzf"] + + # Versions from newest to oldest + version("master", branch="master") + version("0.60.0", sha256="69255fd9301e491b6ac6788bf1caf5d4f70d9209b4b8ab70ceb1caf6a69b5c16") version("0.57.0", sha256="d4e8e25fad2d3f75943b403c40b61326db74b705bf629c279978fdd0ceb1f97c") version("0.56.2", sha256="1d67edb3e3ffbb14fcbf786bfcc0b5b8d87db6a0685135677b8ef4c114d2b864") version("0.55.0", sha256="805383f71bca7f8fb271ecd716852aea88fd898d5027d58add9e43df6ea766da") @@ -33,39 +40,45 @@ class Fzf(MakefilePackage): version("0.41.1", sha256="982682eaac377c8a55ae8d7491fcd0e888d6c13915d01da9ebb6b7c434d7f4b5") version("0.40.0", sha256="9597f297a6811d300f619fff5aadab8003adbcc1566199a43886d2ea09109a65") - depends_on("go@1.17:", type="build") + # Variants + variant("vim", default=False, description="Install vim plugins for fzf") + + # Build dependencies depends_on("go@1.20:", type="build", when="@0.49.0:") + depends_on("go@1.17:", type="build") - variant("vim", default=False, description="Install vim plugins for fzf") + executables = ["^fzf$"] @classmethod def determine_version(cls, exe): + """Determine version of installed fzf executable.""" output = Executable(exe)("--version", output=str, error=str) match = re.match(r"(^[\d.]+)", output) return match.group(1) if match else None def url_for_version(self, version): + """Generate download URL for a specific version.""" base = "refs/tags/v" if self.spec.satisfies("@:0.53.0") else "" return f"https://github.com/junegunn/fzf/archive/{base}{version}.tar.gz" def setup_build_environment(self, env): - # Point GOPATH at the top of the staging dir for the build step. - env.prepend_path("GOPATH", self.stage.path) + """Set up the build environment for fzf.""" + # Setup build env from GoPackage builder + super().setup_build_environment(env) - # Set required environment variables since we - # are not using git to pull down the repository. + # Set required environment variables for non-git builds env.set("FZF_VERSION", self.spec.version) env.set("FZF_REVISION", "tarball") - def install(self, spec, prefix): - make("install") - - mkdir(prefix.bin) - install("bin/fzf", prefix.bin) + @run_after("install") + def install_completions(self): + mkdirp(bash_completion_path(self.prefix)) + mkdirp(zsh_completion_path(self.prefix)) - mkdirp(prefix.share.fzf.shell) - install_tree("shell", prefix.share.fzf.shell) + install("shell/completion.bash", bash_completion_path(self.prefix) / "fzf.bash") + install("shell/completion.zsh", zsh_completion_path(self.prefix) / "_fzf") - if spec.satisfies("+vim"): - mkdirp(prefix.share.fzf.plugins) - install("plugin/fzf.vim", prefix.share.fzf.plugins) + @run_after("install", when="+vim") + def install_vim_plugin(self): + mkdirp(self.prefix.share.fzf.plugins) + install("plugin/fzf.vim", self.prefix.share.fzf.plugins) diff --git a/var/spack/repos/builtin/packages/g4vg/package.py b/var/spack/repos/builtin/packages/g4vg/package.py new file mode 100644 index 00000000000000..170200b538de80 --- /dev/null +++ b/var/spack/repos/builtin/packages/g4vg/package.py @@ -0,0 +1,40 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class G4vg(CMakePackage): + """Generate VecGeom geometry representations from in-memory Geant4 geometry.""" + + homepage = "https://github.com/celeritas-project/g4vg" + git = "https://github.com/celeritas-project/g4vg.git" + url = "https://github.com/celeritas-project/g4vg/releases/download/v1.0.1/g4vg-1.0.1.tar.gz" + + maintainers("sethrj", "drbenmorgan") + + license("Apache-2.0", checked_by="sethrj") + + version("develop", branch="main", get_full_repo=True) + + version("1.0.2", sha256="daeb9263f2741c4a1073eb26f2e9fc10e89207c1ed3425da70db934069ff4160") + version("1.0.1", sha256="add7ce4bc37889cac2101323a997cea8574b18da6cbeffdab44a2b714d134e99") + + variant("debug", default=False, description="Enable runtime debug assertions") + variant("shared", default=True, description="Build shared libraries") + + depends_on("cxx", type="build") + depends_on("vecgeom@1.2.8:") + depends_on("geant4") + + def cmake_args(self): + define = self.define + from_variant = self.define_from_variant + args = [ + from_variant("BUILD_SHARED_LIBS", "shared"), + from_variant("G4VG_DEBUG", "debug"), + define("G4VG_BUILD_TESTS", False), + ] + + return args diff --git a/var/spack/repos/builtin/packages/gasnet/package.py b/var/spack/repos/builtin/packages/gasnet/package.py index 6f938f5f66dbad..4b169407883a9b 100644 --- a/var/spack/repos/builtin/packages/gasnet/package.py +++ b/var/spack/repos/builtin/packages/gasnet/package.py @@ -3,8 +3,8 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os +import warnings -import spack.main from spack.package import * @@ -147,7 +147,7 @@ def install(self, spec, prefix): git = which("git") git("describe", "--long", "--always", output="version.git") except ProcessError: - spack.main.send_warning_to_tty("Omitting version stamp due to git error") + warnings.warn("Omitting version stamp due to git error") # The GASNet-EX library has a highly multi-dimensional configure space, # to accomodate the varying behavioral requirements of each client runtime. diff --git a/var/spack/repos/builtin/packages/gatk/package.py b/var/spack/repos/builtin/packages/gatk/package.py index ba16eb335fe71b..fb2c1b0a59b144 100644 --- a/var/spack/repos/builtin/packages/gatk/package.py +++ b/var/spack/repos/builtin/packages/gatk/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/gaudi/package.py b/var/spack/repos/builtin/packages/gaudi/package.py index d94496ae9e3c56..13366ed570d373 100644 --- a/var/spack/repos/builtin/packages/gaudi/package.py +++ b/var/spack/repos/builtin/packages/gaudi/package.py @@ -7,7 +7,7 @@ from spack.package import * -class Gaudi(CMakePackage): +class Gaudi(CMakePackage, CudaPackage): """An experiment-independent HEP event data processing framework""" homepage = "https://gaudi.web.cern.ch/gaudi/" @@ -17,6 +17,7 @@ class Gaudi(CMakePackage): tags = ["hep"] version("master", branch="master") + version("39.2", sha256="9697f5092df49187e3d30256c821a4400534e77ddaa2d976ba4bb22745c904d6") version("39.1", sha256="acdeddcc2383a127b1ad4b0bdaf9f1c6699b64105e0c1d8095c560c96c157885") version("39.0", sha256="faa3653e2e6c769292c0592e3fc35cd98a2820bd6fc0c967cac565808b927262") version("38.3", sha256="47e8c65ea446656d2dae54a32205525e08257778cf80f9f029cd244d6650486e") @@ -46,6 +47,11 @@ class Gaudi(CMakePackage): depends_on("cxx", type="build") conflicts("%gcc@:10", when="@39:", msg="Gaudi needs a c++20 capable compiler for this version") + conflicts("+cuda", when="@:39.1", msg="Gaudi CUDA is only available in version 39.2 and later") + + # Require %gcc@13 for header + conflicts("%gcc@:12", when="+cuda @39.2:", msg="GaudiCUDA requires gcc-13.1 or later") + conflicts("%gcc@:12", when="+unwind @39.2:", msg="GaudiProfiling requires gcc-13.1 or later") maintainers("drbenmorgan", "vvolkl", "jmcarcell") @@ -143,6 +149,10 @@ def patch(self): # accidentally in a higher directory than the stage directory touch("pytest.ini") + # ensure is included instead of for 39.2 + if self.spec.satisfies("@39.2"): + filter_file("", "", "GaudiSvc/src/THistSvc/THistSvc.cpp") + def cmake_args(self): args = [ # Note: gaudi only builds examples when testing enabled @@ -150,6 +160,7 @@ def cmake_args(self): self.define_from_variant("GAUDI_BUILD_EXAMPLES", "examples"), self.define_from_variant("GAUDI_USE_AIDA", "aida"), self.define_from_variant("GAUDI_USE_CPPUNIT", "cppunit"), + self.define_from_variant("GAUDI_USE_CUDA", "cuda"), self.define_from_variant("GAUDI_ENABLE_GAUDIALG", "gaudialg"), self.define_from_variant("GAUDI_USE_GPERFTOOLS", "gperftools"), self.define_from_variant("GAUDI_USE_HEPPDT", "heppdt"), @@ -179,6 +190,9 @@ def setup_run_environment(self, env): # ...but Gaudi additionally requires a path variable about itself for lib_path in [self.prefix.lib, self.prefix.lib64]: env.prepend_path("LD_LIBRARY_PATH", lib_path) + # GAUDI_PLUGIN_PATH currently only used on macos + # but may replace LD_LIBRARY_PATH in the future + env.prepend_path("GAUDI_PLUGIN_PATH", lib_path) def url_for_version(self, version): major = str(version[0]) diff --git a/var/spack/repos/builtin/packages/gaussian-view/package.py b/var/spack/repos/builtin/packages/gaussian-view/package.py index cddbf44988cca8..dc66ef0779948b 100644 --- a/var/spack/repos/builtin/packages/gaussian-view/package.py +++ b/var/spack/repos/builtin/packages/gaussian-view/package.py @@ -5,8 +5,6 @@ import os -import llnl.util.tty as tty - import spack.tengine from spack.package import * diff --git a/var/spack/repos/builtin/packages/gcc-runtime/package.py b/var/spack/repos/builtin/packages/gcc-runtime/package.py index eb4b1520e2042b..95680003b7a728 100644 --- a/var/spack/repos/builtin/packages/gcc-runtime/package.py +++ b/var/spack/repos/builtin/packages/gcc-runtime/package.py @@ -8,8 +8,6 @@ from macholib import MachO, mach_o -from llnl.util import tty - from spack.package import * from spack.util.elf import delete_needed_from_elf, parse_elf diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 5d43c49f0ed9de..f220d8f5f3db70 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -7,11 +7,11 @@ import archspec.cpu -import llnl.util.tty as tty from llnl.util.symlink import readlink import spack.compiler import spack.platforms +import spack.repo import spack.util.libc from spack.operating_systems.mac_os import macos_sdk_path, macos_version from spack.package import * @@ -38,70 +38,103 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage, CompilerPackage): version("master", branch="master") + # Latest stable version("14.2.0", sha256="a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9") + + # Previous stable series releases version("14.1.0", sha256="e283c654987afe3de9d8080bc0bd79534b5ca0d681a73a11ff2b5d3767426840") + # Final releases of previous versions version("13.3.0", sha256="0845e9621c9543a13f484e94584a49ffc0129970e9914624235fc1d061a0c083") - version("13.2.0", sha256="e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da") - version("13.1.0", sha256="61d684f0aa5e76ac6585ad8898a2427aade8979ed5e7f85492286c4dfc13ee86") - version("12.4.0", sha256="704f652604ccbccb14bdabf3478c9511c89788b12cb3bbffded37341916a9175") - version("12.3.0", sha256="949a5d4f99e786421a93b532b22ffab5578de7321369975b91aec97adfda8c3b") - version("12.2.0", sha256="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff") - version("12.1.0", sha256="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b") - version("11.5.0", sha256="a6e21868ead545cf87f0c01f84276e4b5281d672098591c1c896241f09363478") - version("11.4.0", sha256="3f2db222b007e8a4a23cd5ba56726ef08e8b1f1eb2055ee72c1402cea73a8dd9") - version("11.3.0", sha256="b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39") - version("11.2.0", sha256="d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b") - version("11.1.0", sha256="4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf") - version("10.5.0", sha256="25109543fdf46f397c347b5d8b7a2c7e5694a5a51cce4b9c6e1ea8a71ca307c1") - version("10.4.0", sha256="c9297d5bcd7cb43f3dfc2fed5389e948c9312fd962ef6a4ce455cff963ebe4f1") - version("10.3.0", sha256="64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344") - version("10.2.0", sha256="b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c") - version("10.1.0", sha256="b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2") - version("9.5.0", sha256="27769f64ef1d4cd5e2be8682c0c93f9887983e6cfd1a927ce5a0a2915a95cf8f") - version("9.4.0", sha256="c95da32f440378d7751dd95533186f7fc05ceb4fb65eb5b85234e6299eb9838e") - version("9.3.0", sha256="71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1") - version("9.2.0", sha256="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206") - version("9.1.0", sha256="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0") - version("8.5.0", sha256="d308841a511bb830a6100397b0042db24ce11f642dab6ea6ee44842e5325ed50") - version("8.4.0", sha256="e30a6e52d10e1f27ed55104ad233c30bd1e99cfb5ff98ab022dc941edd1b2dd4") - version("8.3.0", sha256="64baadfe6cc0f4947a84cb12d7f0dfaf45bb58b7e92461639596c21e02d97d2c") - version("8.2.0", sha256="196c3c04ba2613f893283977e6011b2345d1cd1af9abeac58e916b1aab3e0080") - version("8.1.0", sha256="1d1866f992626e61349a1ccd0b8d5253816222cdc13390dcfaa74b093aa2b153") - version("7.5.0", sha256="b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661") - version("7.4.0", sha256="eddde28d04f334aec1604456e536416549e9b1aa137fc69204e65eb0c009fe51") - version("7.3.0", sha256="832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c") - version("7.2.0", sha256="1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a") - version("7.1.0", sha256="8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17") - version("6.5.0", sha256="7ef1796ce497e89479183702635b14bb7a46b53249209a5e0f999bebf4740945") - version("6.4.0", sha256="850bf21eafdfe5cd5f6827148184c08c4a0852a37ccf36ce69855334d2c914d4") - version("6.3.0", sha256="f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f") - version("6.2.0", sha256="9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5") - version("6.1.0", sha256="09c4c85cabebb971b1de732a0219609f93fc0af5f86f6e437fd8d7f832f1a351") - version("5.5.0", sha256="530cea139d82fe542b358961130c69cfde8b3d14556370b65823d2f91f0ced87") - version("5.4.0", sha256="608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a") - version("5.3.0", sha256="b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db") - version("5.2.0", sha256="5f835b04b5f7dd4f4d2dc96190ec1621b8d89f2dc6f638f9f8bc1b1014ba8cad") - version("5.1.0", sha256="b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad") - version("4.9.4", sha256="6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092") - version("4.9.3", sha256="2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e") - version("4.9.2", sha256="2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd") - version("4.9.1", sha256="d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e") version("4.8.5", sha256="22fb1e7e0f68a63cee631d85b20461d1ea6bda162f03096350e38c8d427ecf23") - version("4.8.4", sha256="4a80aa23798b8e9b5793494b8c976b39b8d9aa2e53cd5ed5534aff662a7f8695") version("4.7.4", sha256="92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282") version("4.6.4", sha256="35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8") version("4.5.4", sha256="eef3f0456db8c3d992cbb51d5d32558190bc14f3bc19383dd93acc27acc6befc") + # Deprecated older non-final releases + with default_args(deprecated=True): + version( + "13.2.0", sha256="e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da" + ) + version( + "13.1.0", sha256="61d684f0aa5e76ac6585ad8898a2427aade8979ed5e7f85492286c4dfc13ee86" + ) + + version( + "12.3.0", sha256="949a5d4f99e786421a93b532b22ffab5578de7321369975b91aec97adfda8c3b" + ) + version( + "12.2.0", sha256="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff" + ) + version( + "12.1.0", sha256="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b" + ) + + version( + "11.4.0", sha256="3f2db222b007e8a4a23cd5ba56726ef08e8b1f1eb2055ee72c1402cea73a8dd9" + ) + version( + "11.3.0", sha256="b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39" + ) + version( + "11.2.0", sha256="d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b" + ) + version( + "11.1.0", sha256="4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf" + ) + + version( + "10.4.0", sha256="c9297d5bcd7cb43f3dfc2fed5389e948c9312fd962ef6a4ce455cff963ebe4f1" + ) + version( + "10.3.0", sha256="64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344" + ) + version( + "10.2.0", sha256="b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c" + ) + version( + "10.1.0", sha256="b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2" + ) + + version("9.4.0", sha256="c95da32f440378d7751dd95533186f7fc05ceb4fb65eb5b85234e6299eb9838e") + version("9.3.0", sha256="71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1") + version("9.2.0", sha256="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206") + version("9.1.0", sha256="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0") + + version("8.4.0", sha256="e30a6e52d10e1f27ed55104ad233c30bd1e99cfb5ff98ab022dc941edd1b2dd4") + version("8.3.0", sha256="64baadfe6cc0f4947a84cb12d7f0dfaf45bb58b7e92461639596c21e02d97d2c") + version("8.2.0", sha256="196c3c04ba2613f893283977e6011b2345d1cd1af9abeac58e916b1aab3e0080") + version("8.1.0", sha256="1d1866f992626e61349a1ccd0b8d5253816222cdc13390dcfaa74b093aa2b153") + + version("7.4.0", sha256="eddde28d04f334aec1604456e536416549e9b1aa137fc69204e65eb0c009fe51") + version("7.3.0", sha256="832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c") + version("7.2.0", sha256="1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a") + version("7.1.0", sha256="8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17") + + version("6.4.0", sha256="850bf21eafdfe5cd5f6827148184c08c4a0852a37ccf36ce69855334d2c914d4") + version("6.3.0", sha256="f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f") + version("6.2.0", sha256="9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5") + version("6.1.0", sha256="09c4c85cabebb971b1de732a0219609f93fc0af5f86f6e437fd8d7f832f1a351") + + version("5.4.0", sha256="608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a") + version("5.3.0", sha256="b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db") + version("5.2.0", sha256="5f835b04b5f7dd4f4d2dc96190ec1621b8d89f2dc6f638f9f8bc1b1014ba8cad") + version("5.1.0", sha256="b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad") + + version("4.9.3", sha256="2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e") + version("4.9.2", sha256="2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd") + version("4.9.1", sha256="d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e") + version("4.8.4", sha256="4a80aa23798b8e9b5793494b8c976b39b8d9aa2e53cd5ed5534aff662a7f8695") + depends_on("c", type="build") depends_on("cxx", type="build") @@ -549,6 +582,9 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage, CompilerPackage): when="@13.2.0 target=aarch64:", ) + # see https://gcc.gnu.org/gcc-11/changes.html 11.5 Caveats + patch("patch-5522dec054cb940fe83661b96249aa12c54c1d77.patch", when="@11.5.0 target=aarch64:") + build_directory = "spack-build" compiler_languages = ["c", "cxx", "fortran", "d", "go"] @@ -782,7 +818,7 @@ def configure_args(self): if self.version >= Version("6"): options.append("--with-system-zlib") - if spec.satisfies("^zstd"): + if self.version >= Version("10"): options.append("--with-zstd-include={0}".format(spec["zstd"].headers.directories[0])) options.append("--with-zstd-lib={0}".format(spec["zstd"].libs.directories[0])) @@ -801,11 +837,6 @@ def configure_args(self): "--with-as=" + binutils.join("as"), ] ) - elif spec.satisfies("%apple-clang@15:"): - # https://github.com/iains/gcc-darwin-arm64/issues/117 - # https://github.com/iains/gcc-12-branch/issues/22 - # https://github.com/iains/gcc-13-branch/issues/8 - options.append("--with-ld=/Library/Developer/CommandLineTools/usr/bin/ld-classic") # enable_bootstrap if spec.satisfies("+bootstrap"): @@ -1190,7 +1221,7 @@ def _post_buildcache_install_hook(self): ) if header_dir and all( os.path.exists(os.path.join(header_dir, h)) - for h in libc.package_class.representative_headers + for h in spack.repo.PATH.get_pkg_class(libc.fullname).representative_headers ): relocation_args.append(f"-idirafter {header_dir}") else: diff --git a/var/spack/repos/builtin/packages/gcc/patch-5522dec054cb940fe83661b96249aa12c54c1d77.patch b/var/spack/repos/builtin/packages/gcc/patch-5522dec054cb940fe83661b96249aa12c54c1d77.patch new file mode 100644 index 00000000000000..0ffb81d717f221 --- /dev/null +++ b/var/spack/repos/builtin/packages/gcc/patch-5522dec054cb940fe83661b96249aa12c54c1d77.patch @@ -0,0 +1,111 @@ +From 5522dec054cb940fe83661b96249aa12c54c1d77 Mon Sep 17 00:00:00 2001 +From: Andre Vieira +Date: Fri, 8 Apr 2022 15:12:23 +0100 +Subject: [PATCH] aarch64: PR target/105157 Increase number of cores + TARGET_CPU_DEFAULT can encode + +This addresses the compile-time increase seen in the PR target/105157. This was +being caused by selecting the wrong core tuning, as when we added the latest +AArch64 the TARGET_CPU_generic tuning was pushed beyond the 0x3f mask we used +to encode both target cpu and attributes into TARGET_CPU_DEFAULT. + +gcc/ChangeLog: + + PR target/105157 + * config.gcc: Shift ext_mask by TARGET_CPU_NBITS. + * config/aarch64/aarch64.h (TARGET_CPU_NBITS): New macro. + (TARGET_CPU_MASK): Likewise. + (TARGET_CPU_DEFAULT): Use TARGET_CPU_NBITS. + * config/aarch64/aarch64.cc (aarch64_get_tune_cpu): Use TARGET_CPU_MASK. + (aarch64_get_arch): Likewise. + (aarch64_override_options): Use TARGET_CPU_NBITS. +--- + gcc/config.gcc | 2 +- + gcc/config/aarch64/aarch64.cc | 14 +++++++++----- + gcc/config/aarch64/aarch64.h | 8 +++++++- + 3 files changed, 17 insertions(+), 7 deletions(-) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index 7b58e1314ff0dc57701a77a7433de1a6e263c259..5382788e267214ccc1015d0bed85b718ebf00011 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -4261,7 +4261,7 @@ case "${target}" in + ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'` + done + +- ext_mask="(("$ext_mask") << 6)" ++ ext_mask="(("$ext_mask") << TARGET_CPU_NBITS)" + if [ x"$base_id" != x ]; then + target_cpu_cname="TARGET_CPU_$base_id | $ext_mask" + fi +diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c +index 3e2a6fb64725d4e37ddd89f6987795733cfff35c..cf62bdd023b5799284fdcc337a50c01ccd21493f 100644 +--- a/gcc/config/aarch64/aarch64.c ++++ b/gcc/config/aarch64/aarch64.c +@@ -18053,6 +18053,9 @@ aarch64_validate_mtune (const char *str, const struct processor **res) + return false; + } + ++static_assert (TARGET_CPU_generic < TARGET_CPU_MASK, ++ "TARGET_CPU_NBITS is big enough"); ++ + /* Return the CPU corresponding to the enum CPU. + If it doesn't specify a cpu, return the default. */ + +@@ -18062,12 +18065,12 @@ aarch64_get_tune_cpu (enum aarch64_processor cpu) + if (cpu != aarch64_none) + return &all_cores[cpu]; + +- /* The & 0x3f is to extract the bottom 6 bits that encode the +- default cpu as selected by the --with-cpu GCC configure option ++ /* The & TARGET_CPU_MASK is to extract the bottom TARGET_CPU_NBITS bits that ++ encode the default cpu as selected by the --with-cpu GCC configure option + in config.gcc. + ???: The whole TARGET_CPU_DEFAULT and AARCH64_CPU_DEFAULT_FLAGS + flags mechanism should be reworked to make it more sane. */ +- return &all_cores[TARGET_CPU_DEFAULT & 0x3f]; ++ return &all_cores[TARGET_CPU_DEFAULT & TARGET_CPU_MASK]; + } + + /* Return the architecture corresponding to the enum ARCH. +@@ -18079,7 +18082,8 @@ aarch64_get_arch (enum aarch64_arch arch) + if (arch != aarch64_no_arch) + return &all_architectures[arch]; + +- const struct processor *cpu = &all_cores[TARGET_CPU_DEFAULT & 0x3f]; ++ const struct processor *cpu ++ = &all_cores[TARGET_CPU_DEFAULT & TARGET_CPU_MASK]; + + return &all_architectures[cpu->arch]; + } +@@ -18166,7 +18170,7 @@ aarch64_override_options (void) + { + /* Get default configure-time CPU. */ + selected_cpu = aarch64_get_tune_cpu (aarch64_none); +- aarch64_isa_flags = TARGET_CPU_DEFAULT >> 6; ++ aarch64_isa_flags = TARGET_CPU_DEFAULT >> TARGET_CPU_NBITS; + } + + if (selected_tune) +diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h +index efa46ac0b8799b5849b609d591186e26e5cb37ff..359b6e8561faa38f53a806b8c114c83ae37e7e17 100644 +--- a/gcc/config/aarch64/aarch64.h ++++ b/gcc/config/aarch64/aarch64.h +@@ -813,10 +813,16 @@ enum target_cpus + TARGET_CPU_generic + }; + ++/* Define how many bits are used to represent the CPU in TARGET_CPU_DEFAULT. ++ This needs to be big enough to fit the value of TARGET_CPU_generic. ++ All bits after this are used to represent the AARCH64_CPU_DEFAULT_FLAGS. */ ++#define TARGET_CPU_NBITS 8 ++#define TARGET_CPU_MASK ((1 << TARGET_CPU_NBITS) - 1) ++ + /* If there is no CPU defined at configure, use generic as default. */ + #ifndef TARGET_CPU_DEFAULT + #define TARGET_CPU_DEFAULT \ +- (TARGET_CPU_generic | (AARCH64_CPU_DEFAULT_FLAGS << 6)) ++ (TARGET_CPU_generic | (AARCH64_CPU_DEFAULT_FLAGS << TARGET_CPU_NBITS)) + #endif + + /* If inserting NOP before a mult-accumulate insn remember to adjust the diff --git a/var/spack/repos/builtin/packages/gdal/package.py b/var/spack/repos/builtin/packages/gdal/package.py index 19f2ce85106292..830be49170a484 100644 --- a/var/spack/repos/builtin/packages/gdal/package.py +++ b/var/spack/repos/builtin/packages/gdal/package.py @@ -30,6 +30,7 @@ class Gdal(CMakePackage, AutotoolsPackage, PythonExtension): license("MIT") maintainers("adamjstewart") + version("3.10.2", sha256="67b4e08acd1cc4b6bd67b97d580be5a8118b586ad6a426b09d5853898deeada5") version("3.10.1", sha256="9211eac72b53f5f85d23cf6d83ee20245c6d818733405024e71f2af41e5c5f91") version("3.10.0", sha256="af821a3bcf68cf085724c21c9b53605fd451d83af3c8854d8bf194638eb734a8") version("3.9.3", sha256="34a037852ffe6d2163f1b8948a1aa7019ff767148aea55876c1339b22ad751f1") @@ -376,6 +377,7 @@ class Gdal(CMakePackage, AutotoolsPackage, PythonExtension): depends_on("poppler@:0.63", when="@:2.3+poppler") depends_on("poppler@:0.71", when="@:2.4+poppler") depends_on("poppler@:21", when="@:3.4.1+poppler") + depends_on("poppler@:25.01", when="@:3.10.1+poppler") depends_on("poppler", when="+poppler") depends_on("postgresql", when="+postgresql") depends_on("qhull", when="+qhull") diff --git a/var/spack/repos/builtin/packages/geant4/package.py b/var/spack/repos/builtin/packages/geant4/package.py index cd4a71bd5795c5..cb20e5065cad1b 100644 --- a/var/spack/repos/builtin/packages/geant4/package.py +++ b/var/spack/repos/builtin/packages/geant4/package.py @@ -49,6 +49,7 @@ class Geant4(CMakePackage): version("10.3.3", sha256="bcd36a453da44de9368d1d61b0144031a58e4b43a6d2d875e19085f2700a89d8") version("10.0.4", sha256="97f3744366b00143d1eed52f8786823034bbe523f45998106f798af61d83f863") + depends_on("c", type="build") depends_on("cxx", type="build") _cxxstd_values = ( diff --git a/var/spack/repos/builtin/packages/gem5/package.py b/var/spack/repos/builtin/packages/gem5/package.py index adb258815e6fd7..b39b78f2fe234c 100644 --- a/var/spack/repos/builtin/packages/gem5/package.py +++ b/var/spack/repos/builtin/packages/gem5/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import spack.config from spack.package import * @@ -64,7 +63,7 @@ def install(self, spec, prefix): def build_args(self, spec, prefix): args = [] args.append("build/ALL/gem5.opt") - args.append(f"-j{spack.config.determine_number_of_jobs(parallel=True)}") + args.append(f"-j{determine_number_of_jobs(parallel=True)}") args.append("--ignore-style") return args diff --git a/var/spack/repos/builtin/packages/genie/package.py b/var/spack/repos/builtin/packages/genie/package.py index 3eaa317d7d1c62..ed1d81dd9e0c96 100644 --- a/var/spack/repos/builtin/packages/genie/package.py +++ b/var/spack/repos/builtin/packages/genie/package.py @@ -6,7 +6,6 @@ import os from spack.package import * -from spack.version import Version class Genie(Package): diff --git a/var/spack/repos/builtin/packages/geomodel/package.py b/var/spack/repos/builtin/packages/geomodel/package.py index e3edaad352bd03..c79827a6e4e9d3 100644 --- a/var/spack/repos/builtin/packages/geomodel/package.py +++ b/var/spack/repos/builtin/packages/geomodel/package.py @@ -17,6 +17,8 @@ class Geomodel(CMakePackage): license("Apache-2.0", checked_by="wdconinc") + version("6.9.0", sha256="ea34dad8a0cd392e06794b8a1b7407dd6ad617fefd19fb4cccdf36b154749793") + version("6.8.0", sha256="4dfd5a932955ee2618a880bb210aed9ce7087cfadd31f23f92e5ff009c8384eb") version("6.7.0", sha256="bfa69062ba191d0844d7099b28c0d6c3c0f87e726dacfaa21dba7a6f593d34bf") version("6.6.0", sha256="3cefeaa409177d45d3fa63e069b6496ca062991b0d7d71275b1748487659e91b") version("6.5.0", sha256="8a2f71493e54ea4d393f4c0075f3ca13df132f172c891825f3ab949cda052c5f") diff --git a/var/spack/repos/builtin/packages/gftl-shared/package.py b/var/spack/repos/builtin/packages/gftl-shared/package.py index 42a4f8733c0b94..f3b73a978bb955 100644 --- a/var/spack/repos/builtin/packages/gftl-shared/package.py +++ b/var/spack/repos/builtin/packages/gftl-shared/package.py @@ -24,6 +24,7 @@ class GftlShared(CMakePackage): version("main", branch="main") + version("1.10.0", sha256="42158fe75fa6bee336516c7531b4c6c4e7252dee2fed541eec740209a07ceafe") version("1.9.0", sha256="a3291ce61b512fe88628cc074b02363c2ba3081e7b453371089121988482dd6f") version("1.8.0", sha256="3450161508c573ea053b2a23cdbf2a1d6fd6fdb78c162d31fc0019da0f8dd03c") version("1.7.0", sha256="8ba567133fcee6b93bc71f61b3bb2053b4b07c6d78f6ad98a04dfc40aa478de7") diff --git a/var/spack/repos/builtin/packages/gftl/package.py b/var/spack/repos/builtin/packages/gftl/package.py index 3581e7911b2f10..bcd0ed7e6af2e3 100644 --- a/var/spack/repos/builtin/packages/gftl/package.py +++ b/var/spack/repos/builtin/packages/gftl/package.py @@ -38,6 +38,8 @@ class Gftl(CMakePackage): version("develop", branch="develop") version("main", branch="main") + version("1.15.2", sha256="1d3b7057da7057995c13055ba1149ed53e80937423b74d0ab5f40e6b85b7e6aa") + version("1.15.1", sha256="13b9e17b7ec5e9ba19d0ee3ad1957bfa2015055b654891c6bb0bbe68b7a040d7") version("1.14.0", sha256="bf8e3ba3f708ea327c7eb1a5bd1afdce41358c6df1a323aba0f73575c25d5fc8") version("1.13.0", sha256="d8ef4bca5fb67e63dcd69e5377a0cef8336b00178a97450e79010552000d0a52") version("1.12.0", sha256="b50e17cb2109372819b3ee676e6e61fd3a517dc4c1ea293937c8a83f03b0cbd6") diff --git a/var/spack/repos/builtin/packages/ginkgo/package.py b/var/spack/repos/builtin/packages/ginkgo/package.py index 7e5f2881e153f1..50d8d4dff9f916 100644 --- a/var/spack/repos/builtin/packages/ginkgo/package.py +++ b/var/spack/repos/builtin/packages/ginkgo/package.py @@ -226,7 +226,7 @@ def cmake_args(self): if self.spec.satisfies("+sycl"): sycl_compatible_compilers = ["icpx"] - if not (os.path.basename(self.compiler.cxx) in sycl_compatible_compilers): + if os.path.basename(self.compiler.cxx) not in sycl_compatible_compilers: raise InstallError("ginkgo +sycl requires icpx compiler.") return args diff --git a/var/spack/repos/builtin/packages/glab/package.py b/var/spack/repos/builtin/packages/glab/package.py index 780177cf35be5c..e5c09a829b580c 100644 --- a/var/spack/repos/builtin/packages/glab/package.py +++ b/var/spack/repos/builtin/packages/glab/package.py @@ -15,6 +15,8 @@ class Glab(GoPackage): license("MIT") + version("1.53.0", sha256="2930aa5dd76030cc6edcc33483bb49dd6a328eb531d0685733ca7be7b906e915") + version("1.52.0", sha256="585495e53d3994172fb927218627b7470678bc766320cb52f4b4204238677dde") version("1.51.0", sha256="6a95d827004fee258aacb49a427875e3b505b063cc578933d965cd56481f5a19") version("1.48.0", sha256="45410de23a7bad37feeae18f47f3c0113d81133ad9bb97c8f0b8afc5409272c7") version("1.46.1", sha256="935f732ddacc6e54fc83d06351fc25454ac8a58c465c3efa43e066ea226257c2") @@ -42,6 +44,7 @@ class Glab(GoPackage): depends_on("go@1.22.5:", type="build", when="@1.44:") depends_on("go@1.23:", type="build", when="@1.46:") depends_on("go@1.23.2:", type="build", when="@1.48:") + depends_on("go@1.23.4:", type="build", when="@1.52:") build_directory = "cmd/glab" diff --git a/var/spack/repos/builtin/packages/glib/g_date_strftime.patch b/var/spack/repos/builtin/packages/glib/g_date_strftime.patch deleted file mode 100644 index 532c7432774a7c..00000000000000 --- a/var/spack/repos/builtin/packages/glib/g_date_strftime.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 00148329967adb196138372771052a3f606a6ea3 Mon Sep 17 00:00:00 2001 -From: coypu -Date: Wed, 2 Mar 2016 19:43:10 +0200 -Subject: [PATCH 2/2] gdate: Suppress string format literal warning - -Newer versions of GCC emit an error here, but we know it's safe. -https://bugzilla.gnome.org/761550 ---- - glib/gdate.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/glib/gdate.c b/glib/gdate.c -index 4aece02..92c34d2 100644 ---- a/glib/gdate.c -+++ b/glib/gdate.c -@@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate *d, - * - * Returns: number of characters written to the buffer, or 0 the buffer was too small - */ -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wformat-nonliteral" -+ - gsize - g_date_strftime (gchar *s, - gsize slen, -@@ -2549,3 +2552,5 @@ g_date_strftime (gchar *s, - return retval; - #endif - } -+ -+#pragma GCC diagnostic pop --- -2.7.1 - diff --git a/var/spack/repos/builtin/packages/glib/no-Werror=format-security.patch b/var/spack/repos/builtin/packages/glib/no-Werror=format-security.patch deleted file mode 100644 index 3e70212b9734f4..00000000000000 --- a/var/spack/repos/builtin/packages/glib/no-Werror=format-security.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/configure 2017-05-12 16:03:01.000000000 -0500 -+++ b/configure 2017-05-12 16:01:58.000000000 -0500 -@@ -29273,8 +29273,8 @@ - for flag in \ - -Wall -Wstrict-prototypes -Werror=declaration-after-statement \ - -Werror=missing-prototypes -Werror=implicit-function-declaration \ -- -Werror=pointer-arith -Werror=init-self -Werror=format-security \ -- -Werror=format=2 -Werror=missing-include-dirs; do -+ -Werror=pointer-arith -Werror=init-self \ -+ -Werror=missing-include-dirs; do - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports flag $flag in envvar CFLAGS" >&5 - $as_echo_n "checking if $CC supports flag $flag in envvar CFLAGS... " >&6; } diff --git a/var/spack/repos/builtin/packages/glib/old-kernels.patch b/var/spack/repos/builtin/packages/glib/old-kernels.patch deleted file mode 100644 index 406141032020e6..00000000000000 --- a/var/spack/repos/builtin/packages/glib/old-kernels.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/gio/gfile.c 2018-06-11 15:28:30.527667202 -0500 -+++ b/gio/gfile.c 2018-03-12 11:23:37.000000000 -0500 -@@ -3014,11 +3014,11 @@ - - /* Try a 1MiB buffer for improved throughput. If that fails, use the default - * pipe size. See: https://bugzilla.gnome.org/791457 */ -- buffer_size = fcntl (buffer[1], F_SETPIPE_SZ, 1024 * 1024); -+ buffer_size = -1; - if (buffer_size <= 0) - { - int errsv; -- buffer_size = fcntl (buffer[1], F_GETPIPE_SZ); -+ buffer_size = 65536; - errsv = errno; - - if (buffer_size <= 0) diff --git a/var/spack/repos/builtin/packages/glib/package.py b/var/spack/repos/builtin/packages/glib/package.py index e65473308c9dc8..6c79a24479870e 100644 --- a/var/spack/repos/builtin/packages/glib/package.py +++ b/var/spack/repos/builtin/packages/glib/package.py @@ -2,26 +2,24 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os -import spack.build_systems.autotools import spack.build_systems.meson from spack.package import * from spack.util.environment import is_system_path -class Glib(MesonPackage, AutotoolsPackage): - """GLib provides the core application building blocks for - libraries and applications written in C. +class Glib(MesonPackage): + """GLib provides the core application building blocks for libraries and applications written + in C. - The GLib package contains a low-level libraries useful for - providing data structure handling for C, portability wrappers - and interfaces for such runtime functionality as an event loop, + The GLib package contains a low-level libraries useful for providing data structure handling + for C, portability wrappers and interfaces for such runtime functionality as an event loop, threads, dynamic loading and an object system. """ homepage = "https://developer.gnome.org/glib/" - url = "https://download.gnome.org/sources/glib/2.53/glib-2.53.1.tar.xz" + url = "https://download.gnome.org/sources/glib/2.82/glib-2.82.2.tar.xz" list_url = "https://download.gnome.org/sources/glib" list_depth = 1 @@ -31,12 +29,7 @@ class Glib(MesonPackage, AutotoolsPackage): # Even minor versions are stable, odd minor versions are development, only add even numbers version("2.82.2", sha256="ab45f5a323048b1659ee0fbda5cecd94b099ab3e4b9abf26ae06aeb3e781fd63") - # No real reason to prefer older versions, `preferred` should be removed after testing - version( - "2.78.3", - sha256="609801dd373796e515972bf95fc0b2daa44545481ee2f465c4f204d224b2bc21", - preferred=True, - ) + version("2.78.3", sha256="609801dd373796e515972bf95fc0b2daa44545481ee2f465c4f204d224b2bc21") version("2.78.0", sha256="44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30") version("2.76.6", sha256="1136ae6987dcbb64e0be3197a80190520f7acab81e2bfb937dc85c11c8aa9f04") version("2.76.4", sha256="5a5a191c96836e166a7771f7ea6ca2b0069c603c7da3cba1cd38d1694a395dda") @@ -72,60 +65,9 @@ class Glib(MesonPackage, AutotoolsPackage): version("2.62.6", sha256="104fa26fbefae8024ff898330c671ec23ad075c1c0bce45c325c6d5657d58b9c") version("2.60.7", sha256="8b12c0af569afd3b71200556ad751bad4cf4bf7bc4b5f880638459a42ca86310") version("2.58.3", sha256="8f43c31767e88a25da72b52a40f3301fefc49a665b56dc10ee7cc9565cbe7481") - version("2.56.4", sha256="27f703d125efb07f8a743666b580df0b4095c59fc8750e8890132c91d437504c") - version( - "2.56.3", - sha256="a9a4c5b4c81b6c75bc140bdf5e32120ef3ce841b7413214ecf5f987acec74cb2", - deprecated=True, - ) - version( - "2.56.2", - sha256="d64abd16813501c956c4e123ae79f47f1b58de573df9fdd3b0795f1e2c1aa789", - deprecated=True, - ) - version( - "2.56.1", - sha256="40ef3f44f2c651c7a31aedee44259809b6f03d3d20be44545cd7d177221c0b8d", - deprecated=True, - ) - version( - "2.56.0", - sha256="ecef6e17e97b8d9150d0e8a4b3edee1ac37331213b8a2a87a083deea408a0fc7", - deprecated=True, - ) - version( - "2.55.1", - sha256="0cbb3d31c9d181bbcc97cba3d9dbe3250f75e2da25e5f7c8bf5a993fe54baf6a", - deprecated=True, - ) - version( - "2.53.1", - sha256="c8740f1d1a138086eede889b596a511fddda180646ab2f1d98aed4fdb6be7f72", - deprecated=True, - ) - version( - "2.49.7", - sha256="0fd13406ca31d6f654c3be620e0adaaa4f9fb788e164e265e33edf4b21e64ef6", - deprecated=True, - ) - version( - "2.49.4", - sha256="9e914f9d7ebb88f99f234a7633368a7c1133ea21b5cac9db2a33bc25f7a0e0d1", - deprecated=True, - ) - version( - "2.48.1", - sha256="74411bff489cb2a3527bac743a51018841a56a4d896cc1e0d0d54f8166a14612", - deprecated=True, - ) - version( - "2.42.1", - sha256="8f3f0865280e45b8ce840e176ef83bcfd511148918cc8d39df2ee89b67dcf89a", - deprecated=True, - ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("libmount", default=False, description="Build with libmount support") variant( @@ -134,74 +76,38 @@ class Glib(MesonPackage, AutotoolsPackage): description="Enable tracing support", ) - build_system( - conditional("meson", when="@2.58:"), - conditional("autotools", when="@:2.57"), - default="meson", - ) - - with when("build_system=meson"): - depends_on("meson@1.4:", when="@2.83:", type="build") - depends_on("meson@1.2:", when="@2.79:", type="build") - depends_on("meson@0.60.0:", when="@2.73:", type="build") - depends_on("meson@0.52.0:", when="@2.71:2.72", type="build") - depends_on("meson@0.49.2:", when="@2.61.2:2.70", type="build") - depends_on("meson@0.48.0:", when="@:2.61.1", type="build") + with default_args(type="build"): + depends_on("meson@1.4:", when="@2.83:") + depends_on("meson@1.2:", when="@2.79:") + depends_on("meson@0.60.0:", when="@2.73:") + depends_on("meson@0.52.0:", when="@2.71:") + depends_on("meson@0.49.2:", when="@2.61.2:") + depends_on("meson@0.48.0:") + depends_on("pkgconfig", type="build") - depends_on("pkgconfig", type="build") depends_on("libffi") depends_on("zlib-api") depends_on("gettext") depends_on("perl", type=("build", "run")) - depends_on("python", type=("build", "run"), when="@2.53.4:") + extends("python", type=("build", "run")) # Uses distutils in gio/gdbus-2.0/codegen/utils.py - depends_on("python@:3.11", type=("build", "run"), when="@2.53.4:2.78") + depends_on("python@:3.11", type=("build", "run"), when="@:2.78") depends_on("pcre2", when="@2.73.2:") depends_on("pcre2@10.34:", when="@2.74:") - depends_on("pcre+utf", when="@2.48:2.73.1") + depends_on("pcre+utf", when="@:2.73.1") depends_on("uuid", when="+libmount") depends_on("util-linux", when="+libmount") depends_on("iconv") depends_on("elf") # bin/gresource - # The following patch is needed for gcc-6.1 - patch("g_date_strftime.patch", when="@2.42.1") - # Clang doesn't seem to acknowledge the pragma lines to disable the -Werror - # around a legitimate usage. - patch("no-Werror=format-security.patch", when="@:2.57") - # Patch to prevent compiler errors in kernels older than 2.6.35 - patch("old-kernels.patch", when="@2.56.0:2.56.1 os=rhel6") - patch("old-kernels.patch", when="@2.56.0:2.56.1 os=centos6") - patch("old-kernels.patch", when="@2.56.0:2.56.1 os=scientific6") - # fix multiple definition error in gio tests for 2.76.1 - patch( - "https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3368.diff", - sha256="fa31180b55a832cbb75cc640bb115b7b092a26d7bcf0f48768de55576f0a38d3", - when="@2.76.1", - ) - # fix for older glibc - patch( - "https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3588.diff", - sha256="2c25d7b3bf581b3ec992d7af997fa6c769174d49b9350e0320c33f5e048cba99", - when="@2.78.0", - ) # glib prefers the libc version of gettext, which breaks the build if the # external version is also found. - patch("meson-gettext.patch", when="@2.58:2.64") + patch("meson-gettext.patch", when="@:2.64") patch("meson-gettext-2.66.patch", when="@2.66:2.68,2.72") patch("meson-gettext-2.70.patch", when="@2.70") - # Don't use PTRACE_O_EXITKILL if it's not defined - patch( - "https://gitlab.gnome.org/GNOME/glib/-/commit/bda87264372c006c94e21ffb8ff9c50ecb3e14bd.diff", - sha256="2c25d7b3bf581b3ec992d7af997fa6c769174d49b9350e0320c33f5e048cba99", - when="@2.78.0", - ) - def url_for_version(self, version): - """Handle glib's version-based custom URLs.""" - url = "https://download.gnome.org/sources/glib" - return url + "/%s/glib-%s.tar.xz" % (version.up_to(2), version) + return f"https://download.gnome.org/sources/glib/{version.up_to(2)}/glib-{version}.tar.xz" def patch(self): """A few glib tests have external dependencies / try to access the X server""" @@ -220,26 +126,37 @@ def libs(self): return find_libraries(["libglib*"], root=self.prefix, recursive=True) -class AnyBuilder(BaseBuilder): +class MesonBuilder(spack.build_systems.meson.MesonBuilder): + @property def dtrace_copy_path(self): return join_path(self.stage.source_path, "dtrace-copy") - def fix_python_path(self): - if not self.spec.satisfies("@2.53.4:"): - return - - files = ["gobject/glib-genmarshal.in", "gobject/glib-mkenums.in"] - + @run_before("install", when="@:2.80") # @2.81: uses meson found python abs path. + def fix_python_path_before_install(self): filter_file( "^#!/usr/bin/env @PYTHON@", - "#!/usr/bin/env {0}".format(os.path.basename(self.spec["python"].command.path)), - *files, + f"#!/usr/bin/env {os.path.basename(self.spec['python'].command.path)}", + "gobject/glib-genmarshal.in", + "gobject/glib-mkenums.in", + ) + + @run_after("install", when="@:2.80") + def fix_python_path_after_install(self): + # Revert shebang, so Spack's sbang hook can fix it up (we have to do + # this after install because otherwise the install target will try + # to rebuild files as filter_file updates the timestamps) + python_path = os.path.basename(self.spec["python"].command.path) + filter_file( + f"^#!/usr/bin/env {os.path.basename(python_path)}", + f"#!{self.spec['python'].command.path}", + join_path(self.prefix.bin, "glib-genmarshal"), + join_path(self.prefix.bin, "glib-mkenums"), ) @run_before("install") def fix_dtrace_usr_bin_path(self): - if "tracing=dtrace" not in self.spec: + if not self.spec.satisfies("tracing=dtrace"): return # dtrace may cause glib build to fail because it uses @@ -253,7 +170,7 @@ def fix_dtrace_usr_bin_path(self): copy(dtrace, dtrace_copy) filter_file( "^#!/usr/bin/python", - "#!/usr/bin/env {0}".format(os.path.basename(self.spec["python"].command.path)), + f"#!/usr/bin/env {os.path.basename(self.spec['python'].command.path)}", dtrace_copy, ) @@ -261,25 +178,6 @@ def fix_dtrace_usr_bin_path(self): # prepend to PATH the temporary folder where it resides env["PATH"] = ":".join([self.dtrace_copy_path] + env["PATH"].split(":")) - @run_after("install") - def filter_sbang(self): - # Revert sbang, so Spack's sbang hook can fix it up (we have to do - # this after install because otherwise the install target will try - # to rebuild files as filter_file updates the timestamps) - if self.spec.satisfies("@2.53.4:"): - pattern = "^#!/usr/bin/env {0}".format( - os.path.basename(self.spec["python"].command.path) - ) - repl = "#!{0}".format(self.spec["python"].command.path) - files = ["glib-genmarshal", "glib-mkenums"] - else: - pattern = "^#! /usr/bin/perl" - repl = "#!{0}".format(self.spec["perl"].command.path) - files = ["glib-mkenums"] - - files = [join_path(self.prefix.bin, file) for file in files] - filter_file(pattern, repl, *files, backup=False) - @run_after("install") def gettext_libdir(self): # Packages that link to glib were also picking up -lintl from glib's @@ -289,17 +187,16 @@ def gettext_libdir(self): # appropriate -L path. spec = self.spec if ( - spec.satisfies("@2.0:2") - and "intl" in self.spec["gettext"].libs.names + spec.satisfies("@2") + and "intl" in spec["gettext"].libs.names and not is_system_path(spec["gettext"].prefix) ): - pattern = "Libs:" - repl = "Libs: -L{0} -Wl,-rpath={0} ".format(spec["gettext"].libs.directories[0]) - myfile = join_path(self.spec["glib"].libs.directories[0], "pkgconfig", "glib-2.0.pc") - filter_file(pattern, repl, myfile, backup=False) - + filter_file( + "Libs:", + "Libs: -L{0} -Wl,-rpath={0} ".format(spec["gettext"].libs.directories[0]), + join_path(self.spec["glib"].libs.directories[0], "pkgconfig", "glib-2.0.pc"), + ) -class MesonBuilder(AnyBuilder, spack.build_systems.meson.MesonBuilder): def meson_args(self): args = [] if self.spec.satisfies("@2.63.5:"): @@ -339,54 +236,3 @@ def meson_args(self): else: args.append("-Diconv=libc") return args - - @run_before("meson") - def fix_python_path(self): - super().fix_python_path() - - -class AutotoolsBuilder(AnyBuilder, spack.build_systems.autotools.AutotoolsBuilder): - def configure_args(self): - args = [] - if self.spec.satisfies("+libmount"): - args.append("--enable-libmount") - else: - args.append("--disable-libmount") - if self.spec.satisfies("@2.53.4:"): - args.append( - "--with-python={0}".format(os.path.basename(self.spec["python"].command.path)) - ) - if self.spec["iconv"].name == "libiconv": - args.append("--with-libiconv=gnu") - else: - args.append("--with-libiconv=maybe") - if self.spec.satisfies("@2.56:"): - for value in ("dtrace", "systemtap"): - if ("tracing=" + value) in self.spec: - args.append("--enable-" + value) - else: - args.append("--disable-" + value) - else: - if self.spec.satisfies("tracing=dtrace") or self.spec.satisfies("tracing=systemtap"): - args.append("--enable-tracing") - else: - args.append("--disable-tracing") - # SELinux is not available in Spack, so glib should not use it. - args.append("--disable-selinux") - # glib should not use the globally installed gtk-doc. Otherwise, - # gtk-doc can fail with Python errors such as "ImportError: No module - # named site". This is due to the fact that Spack sets PYTHONHOME, - # which can confuse the global Python installation used by gtk-doc. - args.append("--disable-gtk-doc-html") - # glib uses gtk-doc even though it should be disabled if it can find - # its binaries. Override the checks to use the true binary. - true = which("true") - args.append("GTKDOC_CHECK={0}".format(true)) - args.append("GTKDOC_CHECK_PATH={0}".format(true)) - args.append("GTKDOC_MKPDF={0}".format(true)) - args.append("GTKDOC_REBASE={0}".format(true)) - return args - - @run_before("configure") - def fix_python_path(self): - super().fix_python_path() diff --git a/var/spack/repos/builtin/packages/globalarrays/package.py b/var/spack/repos/builtin/packages/globalarrays/package.py index 6e6c64d234bb1d..89b42c48fe3ebd 100644 --- a/var/spack/repos/builtin/packages/globalarrays/package.py +++ b/var/spack/repos/builtin/packages/globalarrays/package.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/gmake/package.py b/var/spack/repos/builtin/packages/gmake/package.py index ecc9b9ee7bcc1b..c94d37973adc6d 100644 --- a/var/spack/repos/builtin/packages/gmake/package.py +++ b/var/spack/repos/builtin/packages/gmake/package.py @@ -99,3 +99,11 @@ def setup_dependent_package(self, module, dspec): self.spec.prefix.bin.make, jobs=determine_number_of_jobs(parallel=dspec.package.parallel), ) + + @property + def libs(self): + return LibraryList([]) + + @property + def headers(self): + return HeaderList([]) diff --git a/var/spack/repos/builtin/packages/gnina/package.py b/var/spack/repos/builtin/packages/gnina/package.py index 32c2e8efff9daa..a38cd663d7a175 100644 --- a/var/spack/repos/builtin/packages/gnina/package.py +++ b/var/spack/repos/builtin/packages/gnina/package.py @@ -17,15 +17,18 @@ class Gnina(CMakePackage, CudaPackage): license("Apache-2.0") + version("master", branch="master") + version("1.3", sha256="79630705190576669c9613cc3e1e63f1122cba4e363e73c3a0bd7e21f76f443f") version("1.1", sha256="114570b0f84a545ce0fea5b2da87bc116c134cef64bf90e6e58e8f84e175a0fa") version("1.0.3", sha256="4274429f38293d79c7d22ab08aca91109e327e9ce3f682cd329a8f9c6ef429da") - depends_on("cxx", type="build") # generated - variant("cudnn", default=True, description="Build with cuDNN") variant("gninavis", default=False, description="Build gninavis") - _boost = "boost" + "".join( + depends_on("c", type="build") + depends_on("cxx", type="build") + + _boost_extensions = " " + "".join( [ "+atomic", "+chrono", @@ -52,11 +55,8 @@ class Gnina(CMakePackage, CudaPackage): ) depends_on("zlib-api") - depends_on(_boost) - depends_on("glog") + depends_on("boost@:1.79" + _boost_extensions) depends_on("protobuf@:3.21.12") - depends_on("hdf5+cxx+hl~mpi") - depends_on("openblas~fortran") depends_on("libmolgrid") @@ -67,13 +67,39 @@ class Gnina(CMakePackage, CudaPackage): depends_on("py-numpy", type="build") depends_on("py-pytest", type="build") - depends_on("cuda@11") + depends_on("cuda@11", when="@:1.1") + depends_on("cuda@12", when="@1.3:") depends_on("cudnn", when="+cudnn") + depends_on("cmake@3.27:", when="@1.3:") # CMake policy CMP0146 introduced in 3.27 + depends_on("jsoncpp", when="@1.3:") + depends_on("py-torch", when="@1.3:") + + depends_on("glog@:0.6", when="@:1.1") + depends_on("hdf5+cxx+hl~mpi", when="@:1.1") + depends_on("openblas~fortran", when="@:1.1") + + patch( + "https://patch-diff.githubusercontent.com/raw/gnina/gnina/pull/280.patch?full_index=1", + when="@1.3", + sha256="88d1760423cedfdb992409b0bfe3f9939ab5900f52074364db9ad8b87f4845d4", + ) + patch( + "https://patch-diff.githubusercontent.com/raw/gnina/gnina/pull/282.patch?full_index=1", + when="@1.3", + sha256="6a1db3d63039a11ecc6e753b325962773e0084673d54a0d93a503bca8b08fb9e", + ) + def cmake_args(self): - args = ["-DBLAS=Open"] # Use OpenBLAS instead of Atlas' BLAS + args = [] + + if self.spec.satisfies("@:1.1"): + args.append("-DBLAS=Open") # Use OpenBLAS instead of Atlas' BLAS if self.spec.satisfies("+gninavis"): args.append(f"-DRDKIT_INCLUDE_DIR={self.spec['rdkit'].prefix.include.rdkit}") + if self.spec.satisfies("@1.3:"): + args.append(self.define("GNINA_FORCE_EXTERNAL_LIBS", True)) + return args diff --git a/var/spack/repos/builtin/packages/gnutls/package.py b/var/spack/repos/builtin/packages/gnutls/package.py index 030c0ce1316b33..f6b2b8bcbb1d20 100644 --- a/var/spack/repos/builtin/packages/gnutls/package.py +++ b/var/spack/repos/builtin/packages/gnutls/package.py @@ -17,12 +17,14 @@ class Gnutls(AutotoolsPackage): homepage = "https://www.gnutls.org" url = "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.19.tar.xz" + git = "https://gitlab.com/gnutls/gnutls.git" list_depth = 2 maintainers("alecbcs") license("LGPL-2.1-or-later") + version("3.8.9", sha256="69e113d802d1670c4d5ac1b99040b1f2d5c7c05daec5003813c049b5184820ed") version("3.8.8", sha256="ac4f020e583880b51380ed226e59033244bc536cad2623f2e26f5afa2939d8fb") version("3.8.4", sha256="2bea4e154794f3f00180fa2a5c51fe8b005ac7a31cd58bd44cdfa7f36ebc3a9b") version("3.8.3", sha256="f74fc5954b27d4ec6dfbb11dea987888b5b124289a3703afcada0ee520f4173e") diff --git a/var/spack/repos/builtin/packages/go-bootstrap/package.py b/var/spack/repos/builtin/packages/go-bootstrap/package.py index 962c713ed152dc..a59ff36ecf7981 100644 --- a/var/spack/repos/builtin/packages/go-bootstrap/package.py +++ b/var/spack/repos/builtin/packages/go-bootstrap/package.py @@ -31,6 +31,17 @@ class GoBootstrap(Package): # should update these binary releases on a yearly schedule as # bootstrapping requirements are modified by new releases of go. go_releases = { + "1.22.12": { + "darwin": { + "amd64": "e7bbe07e96f0bd3df04225090fe1e7852ed33af37c43a23e16edbbb3b90a5b7c", + "arm64": "416c35218edb9d20990b5d8fc87be655d8b39926f15524ea35c66ee70273050d", + }, + "linux": { + "amd64": "4fa4f869b0f7fc6bb1eb2660e74657fbf04cdd290b5aef905585c86051b34d43", + "arm64": "fd017e647ec28525e86ae8203236e0653242722a7436929b1f775744e26278e7", + "ppc64le": "9573d30003b0796717a99d9e2e96c48fddd4fc0f29d840f212c503b03d7de112", + }, + }, "1.20.6": { "darwin": { "amd64": "98a09c085b4c385abae7d35b9155195d5e584d14988347ac7f18e4cbe3b5ef3d", diff --git a/var/spack/repos/builtin/packages/go/package.py b/var/spack/repos/builtin/packages/go/package.py index 7bb9e09ce6b8d1..db4f7ca24829f6 100644 --- a/var/spack/repos/builtin/packages/go/package.py +++ b/var/spack/repos/builtin/packages/go/package.py @@ -5,8 +5,6 @@ import os import re -from llnl.util import tty - from spack.package import * # - vanilla CentOS 7, and possibly other systems, fail a test: @@ -40,6 +38,9 @@ class Go(Package): license("BSD-3-Clause") + version("1.24.0", sha256="d14120614acb29d12bcab72bd689f257eb4be9e0b6f88a8fb7e41ac65f8556e5") + version("1.23.6", sha256="039c5b04e65279daceee8a6f71e70bd05cf5b801782b6f77c6e19e2ed0511222") + version("1.23.5", sha256="a6f3f4bbd3e6bdd626f79b668f212fbb5649daf75084fb79b678a0ae4d97423b") version("1.23.4", sha256="ad345ac421e90814293a9699cca19dd5238251c3f687980bbcae28495b263531") version("1.23.3", sha256="8d6a77332487557c6afa2421131b50f83db4ae3c579c3bc72e670ee1f6968599") version("1.23.2", sha256="36930162a93df417d90bd22c6e14daff4705baac2b02418edda671cdfa9cd07f") @@ -49,42 +50,36 @@ class Go(Package): version("1.22.6", sha256="9e48d99d519882579917d8189c17e98c373ce25abaebb98772e2927088992a51") version("1.22.4", sha256="fed720678e728a7ca30ba8d1ded1caafe27d16028fab0232b8ba8e22008fb784") - # https://nvd.nist.gov/vuln/detail/CVE-2024-24790 - # https://nvd.nist.gov/vuln/detail/CVE-2024-24789 - version( - "1.22.2", - sha256="374ea82b289ec738e968267cac59c7d5ff180f9492250254784b2044e90df5a9", - deprecated=True, - ) - version( - "1.22.1", - sha256="79c9b91d7f109515a25fc3ecdaad125d67e6bdb54f6d4d98580f46799caea321", - deprecated=True, - ) - version( - "1.22.0", - sha256="4d196c3d41a0d6c1dfc64d04e3cc1f608b0c436bd87b7060ce3e23234e1f4d5c", - deprecated=True, - ) - version( - "1.21.6", - sha256="124926a62e45f78daabbaedb9c011d97633186a33c238ffc1e25320c02046248", - deprecated=True, - ) - version( - "1.21.5", - sha256="285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19", - deprecated=True, - ) + # Deprecated versions due to CVEs + with default_args(deprecated=True): + # https://nvd.nist.gov/vuln/detail/CVE-2024-24790 + # https://nvd.nist.gov/vuln/detail/CVE-2024-24789 + version( + "1.22.2", sha256="374ea82b289ec738e968267cac59c7d5ff180f9492250254784b2044e90df5a9" + ) + version( + "1.22.1", sha256="79c9b91d7f109515a25fc3ecdaad125d67e6bdb54f6d4d98580f46799caea321" + ) + version( + "1.22.0", sha256="4d196c3d41a0d6c1dfc64d04e3cc1f608b0c436bd87b7060ce3e23234e1f4d5c" + ) + version( + "1.21.6", sha256="124926a62e45f78daabbaedb9c011d97633186a33c238ffc1e25320c02046248" + ) + version( + "1.21.5", sha256="285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19" + ) provides("golang") depends_on("bash", type="build") - depends_on("sed", type="build") depends_on("grep", type="build") - depends_on("go-or-gccgo-bootstrap", type="build") - depends_on("go-or-gccgo-bootstrap@1.17.13:", type="build", when="@1.20:") + depends_on("sed", type="build") + + depends_on("go-or-gccgo-bootstrap@1.22.6:", type="build", when="@1.24:") depends_on("go-or-gccgo-bootstrap@1.20.6:", type="build", when="@1.22:") + depends_on("go-or-gccgo-bootstrap@1.17.13:", type="build", when="@1.20:") + depends_on("go-or-gccgo-bootstrap", type="build") phases = ["build", "install"] @@ -98,7 +93,6 @@ def determine_version(cls, exe): return match.group(1) if match else None def setup_build_environment(self, env): - env.set("GOROOT_FINAL", self.spec.prefix.go) # We need to set CC/CXX_FOR_TARGET, otherwise cgo will use the # internal Spack wrappers and fail. env.set("CC_FOR_TARGET", self.compiler.cc) @@ -119,30 +113,8 @@ def install(self, spec, prefix): def setup_dependent_package(self, module, dependent_spec): """Called before go modules' build(), install() methods. - In most cases, extensions will only need to set GOPATH and use go:: - - env['GOPATH'] = self.source_path + ':' + env['GOPATH'] go('get', '', env=env) install_tree('bin', prefix.bin) """ # Add a go command/compiler for extensions module.go = self.spec["go"].command - - def generate_path_components(self, dependent_spec): - if os.environ.get("GOROOT", False): - tty.warn("GOROOT is set, this is not recommended") - - # Set to include paths of dependencies - path_components = [dependent_spec.prefix] - for d in dependent_spec.traverse(): - if d.package.extends(self.spec): - path_components.append(d.prefix) - return ":".join(path_components) - - def setup_dependent_build_environment(self, env, dependent_spec): - # This *MUST* be first, this is where new code is installed - env.prepend_path("GOPATH", self.generate_path_components(dependent_spec)) - - def setup_dependent_run_environment(self, env, dependent_spec): - # Allow packages to find this when using module files - env.prepend_path("GOPATH", self.generate_path_components(dependent_spec)) diff --git a/var/spack/repos/builtin/packages/gobject-introspection/package.py b/var/spack/repos/builtin/packages/gobject-introspection/package.py index 5371677ce8fab4..a8ed96afa9fbf1 100644 --- a/var/spack/repos/builtin/packages/gobject-introspection/package.py +++ b/var/spack/repos/builtin/packages/gobject-introspection/package.py @@ -49,7 +49,7 @@ class GobjectIntrospection(MesonPackage, AutotoolsPackage): depends_on("glib@2.58:", when="@1.60:1.72") depends_on("glib@2.56:", when="@1.56") depends_on("glib@2.49.2:", when="@1.49.2") - depends_on("glib@2.48.1", when="@1.48.0") + depends_on("glib@2.48.1:", when="@1.48.0") depends_on("libffi") # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/283 diff --git a/var/spack/repos/builtin/packages/gocryptfs/package.py b/var/spack/repos/builtin/packages/gocryptfs/package.py index e43ec3173205da..825226622d0958 100644 --- a/var/spack/repos/builtin/packages/gocryptfs/package.py +++ b/var/spack/repos/builtin/packages/gocryptfs/package.py @@ -17,9 +17,13 @@ class Gocryptfs(GoPackage): license("MIT", checked_by="snehring") + version("2.5.1", sha256="b2e69d382caef598ffa1071b8d5f6e9df30d38fe2f9e9b0bee0d2e7436654f6d") version("2.4.0", sha256="26a93456588506f4078f192b70e7816b6a4042a14b748b28a50d2b6c9b10e2ec") depends_on("c", type="build") # generated + depends_on("go@1.16:", type="build") + depends_on("go@1.19:", type="build", when="@2.5:") + depends_on("openssl") depends_on("pkgconfig", type="build") diff --git a/var/spack/repos/builtin/packages/gosam-contrib/package.py b/var/spack/repos/builtin/packages/gosam-contrib/package.py index f7768c04f5d4f7..87059d7ce12af8 100644 --- a/var/spack/repos/builtin/packages/gosam-contrib/package.py +++ b/var/spack/repos/builtin/packages/gosam-contrib/package.py @@ -16,8 +16,9 @@ class GosamContrib(AutotoolsPackage): version("2.0", sha256="c05beceea74324eb51c1049773095e2cb0c09c8c909093ee913d8b0da659048d") version("1.0", sha256="a29d4232d9190710246abc2ed97fdcd8790ce83580f56a360f3456b0377c40ec") - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") # whizard checks for .la files ( but does not use them ) install_libtool_archives = True diff --git a/var/spack/repos/builtin/packages/gpi-space/package.py b/var/spack/repos/builtin/packages/gpi-space/package.py index c6b1033ae1cea2..a67d67f39daea4 100644 --- a/var/spack/repos/builtin/packages/gpi-space/package.py +++ b/var/spack/repos/builtin/packages/gpi-space/package.py @@ -25,6 +25,7 @@ class GpiSpace(CMakePackage): license("GPL-3.0-or-later") version("latest", branch="main") + version("24.12", sha256="9cd97b8e41b4494c14a90afff6b801f9cf3b5811205e39c33a481ab09db59920") version("23.06", sha256="b4ee51f309c80c12a7842c0909041903608c6144535bc6faac3bbb8ff40e9213") version("22.12", sha256="1c0ab9a1ada9dbbc0f80fb04ddbbb24ff900231f709cb99aa63f0d135a3ad398") version("22.09", sha256="f938847205181081ed24896bba16302ac35bbf478b4ceecae5bb21d5a38c8556") @@ -66,10 +67,17 @@ class GpiSpace(CMakePackage): depends_on( "boost@1.62.0:1.63.0" "+atomic +chrono +coroutine +context +date_time +filesystem +iostreams" - " +program_options +random +regex +serialization +test +timer cxxstd=14" + " +program_options +random +regex +serialization +test +timer cxxstd=14", + when="@:23.06", + ) + depends_on( + "boost@1.62.0:1.63.0" + "+atomic +chrono +coroutine +context +date_time +filesystem +iostreams" + " +program_options +random +regex +serialization +test +timer cxxstd=17", + when="@24.12:", ) depends_on("hwloc@1.10: +libudev ~libxml2 libs=static") - depends_on("libssh2@1.7:") + depends_on("libssh2") depends_on("openssl@0.9:") with when("+iml"): depends_on("gpi-2@1.3.2:1.3.3 fabrics=infiniband", when="@:22.09 network=infiniband") diff --git a/var/spack/repos/builtin/packages/grackle/package.py b/var/spack/repos/builtin/packages/grackle/package.py index 2acc1b1c10ac4d..6dd2c67040246c 100644 --- a/var/spack/repos/builtin/packages/grackle/package.py +++ b/var/spack/repos/builtin/packages/grackle/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.hooks.sbang import filter_shebang from spack.package import * diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index ea9af54c6cb141..af5f6730672a13 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -4,8 +4,6 @@ import os -import llnl.util.filesystem as fs - import spack.build_systems.cmake from spack.package import * @@ -264,6 +262,7 @@ class Gromacs(CMakePackage, CudaPackage): depends_on("c", type="build") depends_on("cxx", type="build") depends_on("fortran", type="build", when="@:4.5.5") # No core Fortran code since 4.6 + depends_on("fortran", type="build", when="+cp2k") # Need Fortan compiler for CP2K variant( "mpi", default=True, description="Activate MPI support (disable for Thread-MPI support)" @@ -660,7 +659,7 @@ def build_test_binaries(self): not be intended with ``--test``. """ if self.pkg.run_tests: - with fs.working_dir(self.build_directory): + with working_dir(self.build_directory): make("tests") def check(self): @@ -669,7 +668,7 @@ def check(self): Override the standard CMakeBuilder behavior. GROMACS has both `test` and `check` targets, but we are only interested in the latter. """ - with fs.working_dir(self.build_directory): + with working_dir(self.build_directory): if self.generator == "Unix Makefiles": make("check") elif self.generator == "Ninja": diff --git a/var/spack/repos/builtin/packages/gtk-doc/package.py b/var/spack/repos/builtin/packages/gtk-doc/package.py index dcc170e79f4017..9730bd2e387a78 100644 --- a/var/spack/repos/builtin/packages/gtk-doc/package.py +++ b/var/spack/repos/builtin/packages/gtk-doc/package.py @@ -70,5 +70,5 @@ def url_for_version(self, version): return url.format(version) def configure_args(self): - args = ["--with-xml-catalog={0}".format(self.spec["docbook-xml"].package.catalog)] + args = ["--with-xml-catalog={0}".format(self["docbook-xml"].catalog)] return args diff --git a/var/spack/repos/builtin/packages/gtkplus/package.py b/var/spack/repos/builtin/packages/gtkplus/package.py index 10437d209f1e19..3a32d25ae43791 100644 --- a/var/spack/repos/builtin/packages/gtkplus/package.py +++ b/var/spack/repos/builtin/packages/gtkplus/package.py @@ -88,6 +88,8 @@ class Gtkplus(AutotoolsPackage, MesonPackage): depends_on("cups", when="+cups") depends_on("libxfixes", when="@:2") + conflicts("%gcc@14:", when="@:3.24.35") + patch("no-demos.patch", when="@2.0:2") def url_for_version(self, version): diff --git a/var/spack/repos/builtin/packages/gurobi/package.py b/var/spack/repos/builtin/packages/gurobi/package.py index 565a87a4160732..aa6c46e936cd75 100644 --- a/var/spack/repos/builtin/packages/gurobi/package.py +++ b/var/spack/repos/builtin/packages/gurobi/package.py @@ -53,7 +53,7 @@ def patch(self): def setup_run_environment(self, env): env.set("GUROBI_HOME", self.prefix) env.set("GRB_LICENSE_FILE", join_path(self.prefix, "gurobi.lic")) - env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib), + env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib) def install(self, spec, prefix): install_tree("linux64", prefix) diff --git a/var/spack/repos/builtin/packages/h5bench/package.py b/var/spack/repos/builtin/packages/h5bench/package.py index 4f5598f5130d6e..3c89cdf177ee69 100644 --- a/var/spack/repos/builtin/packages/h5bench/package.py +++ b/var/spack/repos/builtin/packages/h5bench/package.py @@ -74,8 +74,8 @@ def setup_build_tests(self): filter_file("mpirun", f"{launcher}", filename) filter_file(r"-n 2", "-n 1 --timeout 240", filename) - """Copy the example source files after the package is installed to an - install test subdirectory for use during `spack test run`.""" + # Copy the example source files after the package is installed to an + # install test subdirectory for use during `spack test run`. cache_extra_test_sources(self, ["tests", "samples"]) def mpi_launcher(self): diff --git a/var/spack/repos/builtin/packages/h5hut/package.py b/var/spack/repos/builtin/packages/h5hut/package.py index 25f6896e570cf1..9d35ff6a4679b4 100644 --- a/var/spack/repos/builtin/packages/h5hut/package.py +++ b/var/spack/repos/builtin/packages/h5hut/package.py @@ -11,11 +11,11 @@ class H5hut(AutotoolsPackage): High-Performance I/O Library for Particle-based Simulations.""" homepage = "https://amas.psi.ch/H5hut/" - url = "https://amas.web.psi.ch/Downloads/H5hut/H5hut-2.0.0rc3.tar.gz" + url = "https://amas.web.psi.ch/Downloads/H5hut/H5hut-0.0.0.tar.gz" git = "https://gitlab.psi.ch/H5hut/src.git" + maintainers("biddisco") - version("2.0.0rc3", sha256="1ca9a9478a99e1811ecbca3c02cc49258050d339ffb1a170006eab4ab2a01790") - + version("2.0.0rc7", sha256="bc058c4817c356b7b7acfe386c586923103b90bdfa83575db3a91754767e6fab") version("master", branch="master") depends_on("c", type="build") # generated @@ -47,7 +47,11 @@ def validate(self): def flag_handler(self, name, flags): build_system_flags = [] - if name == "cflags" and self.spec["hdf5"].satisfies("@1.12:"): + if ( + name == "cflags" + and self.spec.satisfies("@:1") + and self.spec["hdf5"].satisfies("@1.12:") + ): build_system_flags = ["-DH5_USE_110_API"] return flags, None, build_system_flags diff --git a/var/spack/repos/builtin/packages/haploview/package.py b/var/spack/repos/builtin/packages/haploview/package.py index d811b449bb2dd4..3843ae683082d1 100644 --- a/var/spack/repos/builtin/packages/haploview/package.py +++ b/var/spack/repos/builtin/packages/haploview/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/hard/package.py b/var/spack/repos/builtin/packages/hard/package.py new file mode 100644 index 00000000000000..58dc04597c4458 --- /dev/null +++ b/var/spack/repos/builtin/packages/hard/package.py @@ -0,0 +1,32 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Hard(CMakePackage): + """A FleCSI-based radiation-hydrodynamics solver suite + for the study of astrophysical phenomena""" + + git = "https://github.com/lanl/hard" + maintainers("JulienLoiseau") + + version("main", branch="main") + + variant("catalyst", default=False, description="Enable catalyst for paraview interface") + variant("radiation", default=True, description="Enable support for radiation physics") + variant("tests", default=False, description="Enable unit tests") + + depends_on("flecsi@2.3.0") + depends_on("libcatalyst", when="+catalyst") + depends_on("yaml-cpp@0.8:") + + def cmake_args(self): + options = [ + self.define_from_variant("ENABLE_UNIT_TESTS", "tests"), + self.define_from_variant("ENABLE_CATALYST", "catalyst"), + self.define("DISABLE_RADIATION", self.spec.satisfies("~radiation")), + ] + + return options diff --git a/var/spack/repos/builtin/packages/harfbuzz/package.py b/var/spack/repos/builtin/packages/harfbuzz/package.py index 137b8cd187b8ed..a519f88fd4d1a8 100644 --- a/var/spack/repos/builtin/packages/harfbuzz/package.py +++ b/var/spack/repos/builtin/packages/harfbuzz/package.py @@ -23,6 +23,7 @@ class Harfbuzz(MesonPackage, AutotoolsPackage): license("MIT") + version("10.2.0", sha256="620e3468faec2ea8685d32c46a58469b850ef63040b3565cde05959825b48227") version("10.1.0", sha256="6ce3520f2d089a33cef0fc48321334b8e0b72141f6a763719aaaecd2779ecb82") version("10.0.1", sha256="b2cb13bd351904cb9038f907dc0dee0ae07127061242fe3556b2795c4e9748fc") version("10.0.0", sha256="c2dfe016ad833a5043ecc6579043f04e8e6d50064e02ad449bb466e6431e3e04") diff --git a/var/spack/repos/builtin/packages/hdf/package.py b/var/spack/repos/builtin/packages/hdf/package.py index f217a8de0c188b..1092a4b1acd350 100644 --- a/var/spack/repos/builtin/packages/hdf/package.py +++ b/var/spack/repos/builtin/packages/hdf/package.py @@ -153,10 +153,15 @@ def flag_handler(self, name, flags): self.spec.satisfies("@:4.2.15 %apple-clang") or self.spec.satisfies("%clang@16:") or self.spec.satisfies("%oneapi") + or self.spec.satisfies("%gcc@14:") ): flags.append("-Wno-error=implicit-function-declaration") - if self.spec.satisfies("%clang@16:") or self.spec.satisfies("%apple-clang@15:"): + if ( + self.spec.satisfies("%clang@16:") + or self.spec.satisfies("%apple-clang@15:") + or self.spec.satisfies("%gcc@14:") + ): flags.append("-Wno-error=implicit-int") return flags, None, None diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 1735001674ac4a..624196b48bd29b 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -8,7 +8,6 @@ import sys import llnl.util.lang -import llnl.util.tty as tty from spack.package import * diff --git a/var/spack/repos/builtin/packages/heasoft/package.py b/var/spack/repos/builtin/packages/heasoft/package.py index 20d8fc637e1e34..f87cc8bd205b3b 100644 --- a/var/spack/repos/builtin/packages/heasoft/package.py +++ b/var/spack/repos/builtin/packages/heasoft/package.py @@ -4,10 +4,7 @@ import os -import llnl.util.tty as tty - from spack.package import * -from spack.util.environment import EnvironmentModifications class Heasoft(AutotoolsPackage): diff --git a/var/spack/repos/builtin/packages/helics/package.py b/var/spack/repos/builtin/packages/helics/package.py index b82c743558e0db..93d37e48f3ef62 100644 --- a/var/spack/repos/builtin/packages/helics/package.py +++ b/var/spack/repos/builtin/packages/helics/package.py @@ -22,6 +22,7 @@ class Helics(CMakePackage): version("develop", branch="develop", submodules=True) version("main", branch="main", submodules=True) version("master", branch="main", submodules=True) + version("3.6.0", sha256="e111ac5d92e808f27e330afd1f8b8ca4d86adf6ccd74e3280f2d40fb3e0e2ce9") version("3.5.3", sha256="f9ace240510b18caf642f55d08f9009a9babb203fbc032ec7d7d8aa6fd5e1553") version("3.5.2", sha256="c2604694698a1e33c4a68f3d1c5ab0a228ef2bfca1b0d3bae94801dbd3b11048") version("3.5.1", sha256="546fc6e6a85de6ba841e4bd547b811cc81a67a22be5e212ccb54be139d740555") @@ -88,8 +89,10 @@ class Helics(CMakePackage): depends_on("git", type="build", when="@master:") depends_on("cmake@3.4:", type="build", when="@:2") depends_on("cmake@3.10:", type="build", when="@3.0.0:3.2.1") - depends_on("cmake@3.11:", type="build", when="@3.3.0:") - depends_on("boost@1.70:", type="build", when="+boost") + depends_on("cmake@3.11:", type="build", when="@3.3.0:3.5.3") + depends_on("cmake@3.22:", type="build", when="@3.6.0:") + depends_on("boost@1.70:", type="build", when="@:3.5.3 +boost") + depends_on("boost@1.75:", type="build", when="@3.6.0: +boost") # TODO: replace this with an explicit list of components of Boost, # for instance depends_on('boost +filesystem') @@ -105,11 +108,24 @@ class Helics(CMakePackage): depends_on("python@3:", when="@:2 +python") # Compiler restrictions based on C++ standard supported - conflicts("%gcc@:6", when="@3.0.0:", msg="HELICS 3+ cannot be built with GCC older than 7.0") conflicts( - "%clang@:4", when="@3.0.0:", msg="HELICS 3+ cannot be built with Clang older than 5.0" + "%gcc@:6", when="@3.0.0:3.5.3", msg="HELICS 3+ cannot be built with GCC older than 7.0" + ) + conflicts( + "%gcc@:11", when="@3.6.0:", msg="HELICS 3.6+ cannot be built with GCC older than 11.0" + ) + conflicts( + "%clang@:4", when="@3.0.0:3.5.3", msg="HELICS 3+ cannot be built with Clang older than 5.0" + ) + conflicts( + "%clang@:15", when="@3.6.0:", msg="HELICS 3.6+ cannot be built with Clang older than 15.0" + ) + conflicts( + "%intel@:18", when="@3.0.0:3.5.3", msg="HELICS 3+ cannot be built with ICC older than 19" + ) + conflicts( + "%intel@:21", when="@3.6.0:", msg="HELICS 3.6+ cannot be built with ICC older than 21" ) - conflicts("%intel@:18", when="@3.0.0:", msg="HELICS 3+ cannot be built with ICC older than 19") # OpenMPI doesn't work with HELICS <=2.4.1 conflicts("^openmpi", when="@:2.4.1 +mpi") @@ -174,9 +190,9 @@ def cmake_args(self): # Python interface was removed from the main HELICS build in v3 args.append(from_variant("BUILD_PYTHON_INTERFACE", "python")) - # GCC >=13 - if spec.satisfies("%gcc@13:"): - # C++20 required when building with GCC>=13 + # GCC >=13 or HELICS 3.6+ + if spec.satisfies("%gcc@13:") or spec.satisfies("@3.6.0:"): + # C++20 required when building with GCC>=13 or HELICS 3.6+ args.append("-DCMAKE_CXX_STANDARD=20") return args diff --git a/var/spack/repos/builtin/packages/hepmc/package.py b/var/spack/repos/builtin/packages/hepmc/package.py index 9e5167e3364cb7..e0871e2a139370 100644 --- a/var/spack/repos/builtin/packages/hepmc/package.py +++ b/var/spack/repos/builtin/packages/hepmc/package.py @@ -25,8 +25,8 @@ class Hepmc(CMakePackage): version("2.06.06", sha256="8cdff26c10783ed4248220a84a43b7e1f9b59cc2c9a29bd634d024ca469db125") version("2.06.05", sha256="4c411077cc97522c03b74f973264b8d9fd2b6ccec0efc7ceced2645371c73618") - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("length", default="MM", values=("CM", "MM"), multi=False, description="Unit of length") variant( diff --git a/var/spack/repos/builtin/packages/hepmc3/package.py b/var/spack/repos/builtin/packages/hepmc3/package.py index d27acf5804d67d..a47484b461b15f 100644 --- a/var/spack/repos/builtin/packages/hepmc3/package.py +++ b/var/spack/repos/builtin/packages/hepmc3/package.py @@ -65,6 +65,8 @@ class Hepmc3(CMakePackage): conflicts("%gcc@9.3.0", when="@:3.1.1") patch("ba38f14d8f56c16cc4105d98f6d4540c928c6150.patch", when="@3.1.2:3.2.1 %gcc@9.3.0") + extends("python", when="+python") + @property def libs(self): return find_libraries(["libHepMC3", "libHepMC3Search"], root=self.prefix, recursive=True) diff --git a/var/spack/repos/builtin/packages/highfive/package.py b/var/spack/repos/builtin/packages/highfive/package.py index e195f18e47d334..3041df95a09845 100644 --- a/var/spack/repos/builtin/packages/highfive/package.py +++ b/var/spack/repos/builtin/packages/highfive/package.py @@ -42,7 +42,8 @@ class Highfive(CMakePackage): version("1.1", sha256="430fc312fc1961605ffadbfad82b9753a5e59482e9fbc64425fb2c184123d395") version("1.0", sha256="d867fe73d00817f686d286f3c69a23731c962c3e2496ca1657ea7302cd0bb944") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("boost", default=False, description="Support Boost") variant("mpi", default=True, description="Support MPI") @@ -57,11 +58,9 @@ class Highfive(CMakePackage): depends_on("hdf5 +mpi", when="+mpi") def cmake_args(self): - args = [ - "-DUSE_BOOST:Bool={0}".format(self.spec.satisfies("+boost")), - "-DHIGHFIVE_PARALLEL_HDF5:Bool={0}".format(self.spec.satisfies("+mpi")), - "-DHIGHFIVE_UNIT_TESTS:Bool=false", - "-DHIGHFIVE_EXAMPLES:Bool=false", - "-DHDF5_ROOT:String={0}".format(self.spec["hdf5"].prefix), + return [ + self.define_from_variant("USE_BOOST", "boost"), + self.define_from_variant("HIGHFIVE_PARALLEL_HDF5", "mpi"), + self.define("HIGHFIVE_UNIT_TESTS", False), + self.define("HIGHFIVE_EXAMPLES", False), ] - return args diff --git a/var/spack/repos/builtin/packages/hiop/package.py b/var/spack/repos/builtin/packages/hiop/package.py index 9f180a0f78cb70..762ce097fbc3f9 100644 --- a/var/spack/repos/builtin/packages/hiop/package.py +++ b/var/spack/repos/builtin/packages/hiop/package.py @@ -16,7 +16,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): homepage = "https://github.com/LLNL/hiop" git = "https://github.com/LLNL/hiop.git" - maintainers("ryandanehy", "cameronrutherford", "pelesh") + maintainers("nychiang", "cnpetra", "pelesh") license("BSD-3-Clause") diff --git a/var/spack/repos/builtin/packages/hip-tensor/package.py b/var/spack/repos/builtin/packages/hip-tensor/package.py index e41fbd900fda39..18508419bd4eef 100644 --- a/var/spack/repos/builtin/packages/hip-tensor/package.py +++ b/var/spack/repos/builtin/packages/hip-tensor/package.py @@ -16,6 +16,8 @@ class HipTensor(CMakePackage, ROCmPackage): maintainers("srekolam", "afzpatel") version("master", branch="master") + version("6.3.2", sha256="094db6d759eb32e9d15c36fce7f5b5d46ba81416953a8d9435b2fb9c161d8c83") + version("6.3.1", sha256="142401331526e6da3fa172cce283f1c053056cb59cf431264443da76cee2f168") version("6.3.0", sha256="9a4acef722e838ec702c6b111ebc1fff9d5686ae5c79a9f5a82e5fac2a5e406a") version("6.2.4", sha256="54c378b440ede7a07c93b5ed8d16989cc56283a56ea35e41f3666bb05b6bc984") version("6.2.1", sha256="592dbe73f5f95ba512f7fbe9975a68dbea85846be74da15344d74952b286f243") @@ -43,12 +45,14 @@ class HipTensor(CMakePackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"composable-kernel@{ver}", when=f"@{ver}") depends_on(f"rocm-cmake@{ver}", when=f"@{ver}") - for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"hipcc@{ver}", when=f"@{ver}") def setup_build_environment(self, env): diff --git a/var/spack/repos/builtin/packages/hip-tests/package.py b/var/spack/repos/builtin/packages/hip-tests/package.py new file mode 100644 index 00000000000000..93c9300817a752 --- /dev/null +++ b/var/spack/repos/builtin/packages/hip-tests/package.py @@ -0,0 +1,177 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +import os + +import spack.build_systems.cmake +from spack.package import * + + +class HipTests(CMakePackage): + """This repository provides unit tests for HIP implementation.""" + + homepage = "https://github.com/ROCm/hip-tests" + url = "https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-6.1.2.tar.gz" + git = "https://github.com/ROCm/hip-tests.git" + tags = ["rocm"] + + maintainers("srekolam", "renjithravindrankannath", "afzpatel") + + version("6.3.1", sha256="0fc1cf4f46f2bbef377d65803d86c2489b01b598c468070c79c5114a661f07c6") + version("6.3.0", sha256="8081d4ab1a43ffa1cebd646668d83008b799ab98c14daf7b455922355a439c8a") + version("6.2.4", sha256="1478b49583d09cb3a96e26ec3bf8dc5ff3e3ec72fa133bb6d7768595d825051e") + version("6.2.1", sha256="90fcf0169889533b882d289f9cb8a7baf9bd46a3ce36752b915083931dc839f1") + version("6.2.0", sha256="314837dbac78be71844ceb959476470c484fdcd4fb622ff8de9277783e0fcf1c") + version("6.1.2", sha256="5b14e4a30d8d8fb56c43e262009646ba9188eac1c8ff882d9a606a4bec69b56b") + version("6.1.1", sha256="10c96ee72adf4580056292ab17cfd858a2fd7bc07abeb41c6780bd147b47f7af") + version("6.1.0", sha256="cf3a6a7c43116032d933cc3bc88bfc4b17a4ee1513c978e751755ca11a5ed381") + + depends_on("c", type="build") # generated + depends_on("cxx", type="build") # generated + depends_on("cmake", type="run") + + for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1"]: + depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}") + depends_on(f"hip@{ver}", when=f"@{ver}") + depends_on(f"rocm-core@{ver}", when=f"@{ver}") + depends_on(f"rocminfo@{ver}", when=f"@{ver}") + depends_on(f"hipify-clang@{ver}", when=f"@{ver}") + depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") + + root_cmakelists_dir = "catch" + + def patch(self): + filter_file( + "${ROCM_PATH}/bin/rocm_agent_enumerator", + f"{self.spec['rocminfo'].prefix}/bin/rocm_agent_enumerator", + "catch/CMakeLists.txt", + string=True, + ) + filter_file( + "/opt/rocm/bin/rocm_agent_enumerator", + f"{self.spec['rocminfo'].prefix}/bin/rocm_agent_enumerator", + "catch/hipTestMain/hip_test_context.cc", + string=True, + ) + filter_file( + "${HIP_PATH}/llvm", + self.spec["llvm-amdgpu"].prefix, + "samples/2_Cookbook/17_llvm_ir_to_executable/CMakeLists.txt", + "samples/2_Cookbook/16_assembly_to_executable/CMakeLists.txt", + string=True, + ) + filter_file( + "${ROCM_PATH}/llvm", + self.spec["llvm-amdgpu"].prefix, + "catch/CMakeLists.txt", + "samples/2_Cookbook/16_assembly_to_executable/CMakeLists.txt", + "samples/2_Cookbook/21_cmake_hip_cxx_clang/CMakeLists.txt", + "samples/2_Cookbook/18_cmake_hip_device/CMakeLists.txt", + "samples/2_Cookbook/17_llvm_ir_to_executable/CMakeLists.txt", + "samples/2_Cookbook/23_cmake_hiprtc/CMakeLists.txt", + "samples/2_Cookbook/22_cmake_hip_lang/CMakeLists.txt", + "samples/2_Cookbook/19_cmake_lang/CMakeLists.txt", + string=True, + ) + filter_file( + "${CMAKE_PREFIX_PATH}/bin/hipify-perl", + f"{self.spec['hipify-clang'].prefix.bin}/hipify-perl", + "samples/0_Intro/square/CMakeLists.txt", + string=True, + ) + + def setup_build_environment(self, env): + env.set("CXX", self.spec["hip"].hipcc) + + def cmake_args(self): + args = [ + self.define("HIP_PLATFORM", "amd"), + self.define("HIP_PATH", self.spec["hip"].prefix), + self.define("ROCM_PATH", self.spec["hip"].prefix), + ] + if self.spec.satisfies("^cmake@3.21.0:3.21.2"): + args.append(self.define("__skip_rocmclang", "ON")) + return args + + def build(self, spec, prefix): + with working_dir(self.build_directory): + make("build_tests") + + @run_after("install") + def cache_test_sources(self): + """Copy the tests source files after the package is installed to an + install test subdirectory for use during `spack test run`.""" + cache_extra_test_sources(self, "samples") + + def test_samples(self): + """build and run all hip samples""" + sample_test_binaries = [ + "0_Intro/bit_extract/bit_extract", + "0_Intro/module_api/launchKernelHcc.hip.out", + "0_Intro/module_api/runKernel.hip.out", + "0_Intro/module_api/defaultDriver.hip.out", + "0_Intro/module_api_global/runKernel1.hip.out", + "0_Intro/square/square", + "1_Utils/hipDispatchLatency/hipDispatchEnqueueRateMT", + "1_Utils/hipDispatchLatency/hipDispatchLatency", + "1_Utils/hipInfo/hipInfo", + "2_Cookbook/0_MatrixTranspose/MatrixTranspose", + "2_Cookbook/1_hipEvent/hipEvent", + "2_Cookbook/3_shared_memory/sharedMemory", + "2_Cookbook/4_shfl/shfl", + "2_Cookbook/5_2dshfl/2dshfl", + "2_Cookbook/6_dynamic_shared/dynamic_shared", + "2_Cookbook/8_peer2peer/peer2peer", + "2_Cookbook/9_unroll/unroll", + "2_Cookbook/10_inline_asm/inline_asm", + "2_Cookbook/11_texture_driver/texture2dDrv", + "2_Cookbook/12_cmake_hip_add_executable/MatrixTranspose1", + "2_Cookbook/13_occupancy/occupancy", + "2_Cookbook/14_gpu_arch/gpuarch", + "2_Cookbook/15_static_library/device_functions/test_device_static", + "2_Cookbook/15_static_library/host_functions/test_opt_static", + "2_Cookbook/16_assembly_to_executable/square_asm.out", + "2_Cookbook/17_llvm_ir_to_executable/square_ir.out", + "2_Cookbook/18_cmake_hip_device/test_cpp", + "2_Cookbook/19_cmake_lang/test_cpp1", + "2_Cookbook/19_cmake_lang/test_fortran", + "2_Cookbook/21_cmake_hip_cxx_clang/square1", + "2_Cookbook/22_cmake_hip_lang/square2", + "2_Cookbook/23_cmake_hiprtc/test", + ] + + test_dir = join_path(self.test_suite.current_test_cache_dir, "samples") + prefix_paths = ";".join(spack.build_systems.cmake.get_cmake_prefix_path(self)) + clang_cpp_path = join_path(self.spec["llvm-amdgpu"].prefix, "bin", "clang++") + clang_path = join_path(self.spec["llvm-amdgpu"].prefix, "bin", "clang") + cc_options = [ + f"-DCMAKE_MODULE_PATH={self.spec['hip'].prefix.lib.cmake.hip}", + f"-DCMAKE_PREFIX_PATH={prefix_paths}", + f"-DCMAKE_CXX_COMPILER={clang_cpp_path}", + f"-DCMAKE_C_COMPILER={clang_path}", + f"-DHIP_HIPCC_EXECUTABLE={self.spec['hip'].prefix.bin}/hipcc", + f"-DCMAKE_HIP_COMPILER_ROCM={clang_cpp_path}", + ".", + ] + + cmake = which(self.spec["cmake"].prefix.bin.cmake) + with working_dir(test_dir, create=True): + cmake(*cc_options) + make("build_samples") + for binary_path in sample_test_binaries: + # binaries need to run in their directories + bin_dir, binary = os.path.split(binary_path) + with working_dir(bin_dir, create=True): + with test_part( + self, + "test_sample_{0}".format(binary), + purpose="configure, build and run test: {0}".format(binary), + ): + exe = Executable(binary) + if binary == "hipDispatchEnqueueRateMT": + options = ["16", "0"] + else: + options = [] + exe(*options) diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py index 8cbd01ff1f5126..44c79b53f27b8e 100644 --- a/var/spack/repos/builtin/packages/hip/package.py +++ b/var/spack/repos/builtin/packages/hip/package.py @@ -5,10 +5,8 @@ import os import re -import spack.build_environment from spack.hooks.sbang import filter_shebang from spack.package import * -from spack.util.prefix import Prefix class Hip(CMakePackage): @@ -27,6 +25,8 @@ class Hip(CMakePackage): license("MIT") version("master", branch="master") + version("6.3.2", sha256="2832e21d75369f87beee767949177a93ac113710afae6b73da5548c0047962ec") + version("6.3.1", sha256="ebde9fa80ad1f4ba3fbe04fd36d90548492ebe5828ac459995b5f9d384a29783") version("6.3.0", sha256="d8dba8cdf05463afb7879de2833983cafa6a006ba719815a35b96d9b92fc7fc4") version("6.2.4", sha256="76e4583ae3d31786270fd92abbb2e3dc5e665b22fdedb5ceff0093131d4dc0ca") version("6.2.1", sha256="a8b86666a59867cae67409c4a45e0b8f29a6328c9739e6512c2b5612376f30cf") @@ -117,6 +117,8 @@ class Hip(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") depends_on(f"comgr@{ver}", when=f"@{ver}") @@ -142,6 +144,8 @@ class Hip(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hipify-clang@{ver}", when=f"@{ver}") @@ -161,17 +165,30 @@ class Hip(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") # hipcc likes to add `-lnuma` by default :( # ref https://github.com/ROCm/HIP/pull/2202 depends_on("numactl", when="@3.7.0:") - - for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in [ + "6.0.0", + "6.0.2", + "6.1.0", + "6.1.1", + "6.1.2", + "6.2.0", + "6.2.1", + "6.2.4", + "6.3.0", + "6.3.1", + "6.3.2", + ]: depends_on(f"hipcc@{ver}", when=f"@{ver}") - for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"rocprofiler-register@{ver}", when=f"@{ver}") # roc-obj-ls requirements @@ -233,6 +250,8 @@ class Hip(CMakePackage): ) # Add hip-clr sources thru the below for d_version, d_shasum in [ + ("6.3.2", "ec13dc4ffe212beee22171cb2825d2b16cdce103c835adddb482b9238cf4f050"), + ("6.3.1", "bfb8a4a59e7bd958e2cd4bf6f14c6cdea601d9827ebf6dc7af053a90e963770f"), ("6.3.0", "829e61a5c54d0c8325d02b0191c0c8254b5740e63b8bfdb05eec9e03d48f7d2c"), ("6.2.4", "0a3164af7f997a4111ade634152957378861b95ee72d7060eb01c86c87208c54"), ("6.2.1", "e9cff3a8663defdbda833d49c9e7160171eca14dc285ffe4061378607d6c890d"), @@ -290,6 +309,8 @@ class Hip(CMakePackage): ) # Add hipother sources thru the below for d_version, d_shasum in [ + ("6.3.2", "1623d823de49471aae3ecb1fad0e9cdddf9301a4089f1fd44f78ac2ff0c20fb2"), + ("6.3.1", "caa69147227bf72fa7b076867f84579456ef55af63efec29914265a80602df42"), ("6.3.0", "a28eb1e8fe239b41e744584d45d676925ca210968ecb21bfa60678cf8e86eeb7"), ("6.2.4", "b7ebcf8a2679e50d27c49ebec0dbea5a67573f8b8c3f4a29108c84b28b5bedee"), ("6.2.1", "5d99e498c1fece44a421574282fc89c6a2499979eaa9f850e5caa7fa3a8938b8"), @@ -310,32 +331,6 @@ class Hip(CMakePackage): when=f"@{d_version} +cuda", ) - # Add hiptests sources thru the below - for d_version, d_shasum in [ - ("6.3.0", "8081d4ab1a43ffa1cebd646668d83008b799ab98c14daf7b455922355a439c8a"), - ("6.2.4", "1478b49583d09cb3a96e26ec3bf8dc5ff3e3ec72fa133bb6d7768595d825051e"), - ("6.2.1", "90fcf0169889533b882d289f9cb8a7baf9bd46a3ce36752b915083931dc839f1"), - ("6.2.0", "314837dbac78be71844ceb959476470c484fdcd4fb622ff8de9277783e0fcf1c"), - ("6.1.2", "5b14e4a30d8d8fb56c43e262009646ba9188eac1c8ff882d9a606a4bec69b56b"), - ("6.1.1", "10c96ee72adf4580056292ab17cfd858a2fd7bc07abeb41c6780bd147b47f7af"), - ("6.1.0", "cf3a6a7c43116032d933cc3bc88bfc4b17a4ee1513c978e751755ca11a5ed381"), - ("6.0.2", "740ca064f4909c20d83226a63c2f164f7555783ec5f5f70be5bc23d3587ad829"), - ("6.0.0", "e8f92a0f5d1f6093ca1fb24ff1b7140128900fcdc6e9f01f153d6907e5c2d807"), - ("5.7.1", "28fbdf49f405adfee903bc0f05a43ac392c55b34c514c3582dfb7d6d67e79985"), - ("5.7.0", "b1dae3cfc715e71dce92ac1da94265a9398944c76cee85ffab8f0c93665a48d6"), - ("5.6.1", "5b3002ddfafda162329e4d9e6ac1200eeb48ff08e666b342aa8aeca30750f48b"), - ("5.6.0", "8cf4509bf9c0747dab8ed8fec1365a9156792034b517207a0b2d63270429fd2e"), - ]: - resource( - name="hip-tests", - url=f"https://github.com/ROCm/hip-tests/archive/refs/tags/rocm-{d_version}.tar.gz", - sha256=d_shasum, - expand=True, - destination="", - placement="hip-tests", - when=f"@{d_version}", - ) - # Improve compilation without git repo and remove compiler rt linkage # for host and correction in CMake target path variable and # correcting the CMake path variable. @@ -650,76 +645,10 @@ def cmake_args(self): if self.spec.satisfies("@5.6.0:"): args.append(self.define("ROCCLR_PATH", self.stage.source_path + "/clr/rocclr")) args.append(self.define("AMD_OPENCL_PATH", self.stage.source_path + "/clr/opencl")) - args.append(self.define("CLR_BUILD_HIP", True)), - args.append(self.define("CLR_BUILD_OCL", False)), + args.append(self.define("CLR_BUILD_HIP", True)) + args.append(self.define("CLR_BUILD_OCL", False)) if self.spec.satisfies("@5.6:5.7"): - args.append(self.define("HIPCC_BIN_DIR", self.stage.source_path + "/hipcc/bin")), + args.append(self.define("HIPCC_BIN_DIR", self.stage.source_path + "/hipcc/bin")) if self.spec.satisfies("@6.0:"): - args.append(self.define("HIPCC_BIN_DIR", self.spec["hipcc"].prefix.bin)), + args.append(self.define("HIPCC_BIN_DIR", self.spec["hipcc"].prefix.bin)) return args - - test_src_dir_old = "samples" - test_src_dir = "hip-tests/samples" - - @run_after("install") - def install_samples(self): - if self.spec.satisfies("@5.6.0:"): - install_tree(self.test_src_dir, self.spec.prefix.share.samples) - - @run_after("install") - def cache_test_sources(self): - """Copy the tests source files after the package is installed to an - install test subdirectory for use during `spack test run`.""" - if self.spec.satisfies("@5.1:5.5"): - cache_extra_test_sources(self, [self.test_src_dir_old]) - elif self.spec.satisfies("@5.6:"): - cache_extra_test_sources(self, [self.test_src_dir]) - - def test_samples(self): - """build and run all hip samples""" - if self.spec.satisfies("@5.1:5.5"): - test_dir = join_path(self.test_suite.current_test_cache_dir, self.test_src_dir_old) - elif self.spec.satisfies("@5.6:"): - test_dir = join_path(self.test_suite.current_test_cache_dir, self.test_src_dir) - prefixes = ";".join(spack.build_environment.get_cmake_prefix_path(self)) - cc_options = ["-DCMAKE_PREFIX_PATH=" + prefixes, ".."] - - amdclang_path = join_path(self.spec["llvm-amdgpu"].prefix, "bin", "amdclang++") - os.environ["CXX"] = amdclang_path - os.environ["FC"] = "/usr/bin/gfortran" - - cmake = which(self.spec["cmake"].prefix.bin.cmake) - - for root, dirs, files in os.walk(test_dir): - dirs.sort() - if "CMakeLists.txt" in files or "Makefile" in files: - with working_dir(root, create=True): - head, test_name = os.path.split(root) - with test_part( - self, - "test_sample_{0}".format(test_name), - purpose="configure, build and run test: {0}".format(test_name), - ): - if "CMakeLists.txt" in files: - print("Configuring test " + test_name) - os.mkdir("build") - os.chdir("build") - cmake(*cc_options) - - print("Building test " + test_name) - make(parallel=False) - # iterate through the files in dir to find the newly built binary - for file in os.listdir("."): - if ( - file not in files - and os.path.isfile(file) - and os.access(file, os.X_OK) - and not file.endswith(".o") - ): - print("Executing test binary: " + file) - exe = which(file) - if file == "hipDispatchEnqueueRateMT": - options = ["16", "0"] - else: - options = [] - exe(*options) diff --git a/var/spack/repos/builtin/packages/hipblas-common/package.py b/var/spack/repos/builtin/packages/hipblas-common/package.py index 79c9f4ff4ac7e1..483b692215f864 100644 --- a/var/spack/repos/builtin/packages/hipblas-common/package.py +++ b/var/spack/repos/builtin/packages/hipblas-common/package.py @@ -15,4 +15,6 @@ class HipblasCommon(CMakePackage): license("MIT") + version("6.3.2", sha256="29aa1ac1a0f684a09fe2ea8a34ae8af3622c27708c7df403a7481e75174e1984") + version("6.3.1", sha256="512e652483b5580713eca14db3fa633d0441cd7c02cdb0d26e631ea605b9231b") version("6.3.0", sha256="240bb1b0f2e6632447e34deae967df259af1eec085470e58a6d0aa040c8530b0") diff --git a/var/spack/repos/builtin/packages/hipblas/package.py b/var/spack/repos/builtin/packages/hipblas/package.py index 1b6d78c8792de6..e53927e971229b 100644 --- a/var/spack/repos/builtin/packages/hipblas/package.py +++ b/var/spack/repos/builtin/packages/hipblas/package.py @@ -24,6 +24,8 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage): version("develop", branch="develop") version("master", branch="master") + version("6.3.2", sha256="6e86d4f8657e13665e37fdf3174c3a30f4c7dff2c4e2431d1be110cd7d463971") + version("6.3.1", sha256="77a1845254d738c43a48bc52fa3e94499ed83535b5771408ff476122bc4b7b7c") version("6.3.0", sha256="72604c1896e42e65ea2b3e905159af6ec5eede6a353678009c47d0a24f462c92") version("6.2.4", sha256="3137ba35e0663d6cceed70086fc6397d9e74803e1711382be62809b91beb2f32") version("6.2.1", sha256="b770b6ebd27d5c12ad01827195e996469bfc826e8a2531831df475fc8d7f6b2e") @@ -80,7 +82,19 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage): depends_on("rocm-cmake@5.2.0:", type="build", when="@5.2.0:5.7") depends_on("rocm-cmake@4.5.0:", type="build") - for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in [ + "6.0.0", + "6.0.2", + "6.1.0", + "6.1.1", + "6.1.2", + "6.2.0", + "6.2.1", + "6.2.4", + "6.3.0", + "6.3.1", + "6.3.2", + ]: depends_on(f"rocm-cmake@{ver}", when=f"+rocm @{ver}") depends_on(f"rocm-openmp-extras@{ver}", type="test", when=f"+rocm @{ver}") @@ -106,6 +120,8 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", "develop", ]: @@ -114,8 +130,8 @@ class Hipblas(CMakePackage, CudaPackage, ROCmPackage): for tgt in ROCmPackage.amdgpu_targets: depends_on(f"rocblas amdgpu_target={tgt}", when=f"+rocm amdgpu_target={tgt}") depends_on(f"rocsolver amdgpu_target={tgt}", when=f"+rocm amdgpu_target={tgt}") - - depends_on("hipblas-common@6.3.0", when="@6.3.0") + for ver in ["6.3.0", "6.3.1", "6.3.2"]: + depends_on(f"hipblas-common@{ver}", when=f"@{ver}") @classmethod def determine_version(cls, lib): @@ -142,7 +158,7 @@ def cmake_args(self): # FindHIP.cmake is still used for +cuda if self.spec.satisfies("+cuda"): args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip)) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): args.append("-DCMAKE_INSTALL_LIBDIR=lib") diff --git a/var/spack/repos/builtin/packages/hipblaslt/package.py b/var/spack/repos/builtin/packages/hipblaslt/package.py index 9ea8444e5fdcd6..7ecae4e1e712f8 100644 --- a/var/spack/repos/builtin/packages/hipblaslt/package.py +++ b/var/spack/repos/builtin/packages/hipblaslt/package.py @@ -16,6 +16,8 @@ class Hipblaslt(CMakePackage): maintainers("srekolam", "afzpatel", "renjithravindrankannath") license("MIT") + version("6.3.2", sha256="cc4875b1a5cf1708a7576c42aff6b4cb790cb7337f5dc2df33119a4aadcef027") + version("6.3.1", sha256="9a18a2e44264a21cfe58ed102fd3e34b336f23d6c191ca2da726e8e0883ed663") version("6.3.0", sha256="e570996037ea42eeca4c9b8b0b77a202d40be1a16068a6245595c551d80bdcad") version("6.2.4", sha256="b8a72cb1ed4988b0569817c6387fb2faee4782795a0d8f49b827b32b52572cfd") version("6.2.1", sha256="9b062b1d6d945349c31828030c8c1d99fe57d14a1837196ff9aa67bf10ef43f1") @@ -28,6 +30,7 @@ class Hipblaslt(CMakePackage): depends_on("c", type="build") depends_on("cxx", type="build") + depends_on("cmake@3.25.2:", type="build", when="@6.2.0:") amdgpu_targets = ROCmPackage.amdgpu_targets @@ -38,8 +41,19 @@ class Hipblaslt(CMakePackage): sticky=True, ) variant("asan", default=False, description="Build with address-sanitizer enabled or disabled") - - for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in [ + "6.0.0", + "6.0.2", + "6.1.0", + "6.1.1", + "6.1.2", + "6.2.0", + "6.2.1", + "6.2.4", + "6.3.0", + "6.3.1", + "6.3.2", + ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") depends_on(f"rocm-openmp-extras@{ver}", type="test", when=f"@{ver}") @@ -47,8 +61,9 @@ class Hipblaslt(CMakePackage): for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4"]: depends_on(f"hipblas@{ver}", when=f"@{ver}") - depends_on("hipblas-common@6.3.0", when="@6.3.0") - depends_on("rocm-smi-lib@6.3.0", when="@6.3.0") + for ver in ["6.3.0", "6.3.1", "6.3.2"]: + depends_on(f"hipblas-common@{ver}", when=f"@{ver}") + depends_on(f"rocm-smi-lib@{ver}", when=f"@{ver}") depends_on("msgpack-c") depends_on("py-joblib", type=("build", "link")) diff --git a/var/spack/repos/builtin/packages/hipcc/package.py b/var/spack/repos/builtin/packages/hipcc/package.py index c2f0c18c0b8b12..0d5a8dd985d16f 100644 --- a/var/spack/repos/builtin/packages/hipcc/package.py +++ b/var/spack/repos/builtin/packages/hipcc/package.py @@ -23,6 +23,8 @@ def url_for_version(self, version): maintainers("srekolam", "renjithravindrankannath", "afzpatel") license("MIT") + version("6.3.2", sha256="1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827") + version("6.3.1", sha256="e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c") version("6.3.0", sha256="79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c") version("6.2.4", sha256="7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528") version("6.2.1", sha256="4840f109d8f267c28597e936c869c358de56b8ad6c3ed4881387cf531846e5a7") diff --git a/var/spack/repos/builtin/packages/hipcub/package.py b/var/spack/repos/builtin/packages/hipcub/package.py index 92c31d22869cfa..61e9489fc71d42 100644 --- a/var/spack/repos/builtin/packages/hipcub/package.py +++ b/var/spack/repos/builtin/packages/hipcub/package.py @@ -17,6 +17,8 @@ class Hipcub(CMakePackage, CudaPackage, ROCmPackage): license("BSD-3-Clause") maintainers("srekolam", "renjithravindrankannath", "afzpatel") + version("6.3.2", sha256="4a1443c2ea12c3aa05fb65703eb309ccf8b893f9e6cbebec4ccf5502ba54b940") + version("6.3.1", sha256="e5d100c7b8f95fe6243ad9f22170c136aa34db4e588136bec54ede7cb2e7f12f") version("6.3.0", sha256="a609cde18cefa90a1970049cc5630f2ec263f12961aa85993897580da2ca0456") version("6.2.4", sha256="06f3655b110d3d2e2ecf0aca052d3ba3f2ef012c069e5d2d82f2b75d50555f46") version("6.2.1", sha256="e0203e72afac4da19cb1d62896fff404ec44517141b420bd38f6e962e52ef6fd") @@ -82,6 +84,8 @@ class Hipcub(CMakePackage, CudaPackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocprim@{ver}", when=f"+rocm @{ver}") depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}") @@ -105,7 +109,7 @@ def cmake_args(self): # FindHIP.cmake is still used for +cuda if self.spec.satisfies("+cuda"): args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip)) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) return args diff --git a/var/spack/repos/builtin/packages/hipfft/package.py b/var/spack/repos/builtin/packages/hipfft/package.py index 02234bb5b3e5fe..d2997ad7ed0cd6 100644 --- a/var/spack/repos/builtin/packages/hipfft/package.py +++ b/var/spack/repos/builtin/packages/hipfft/package.py @@ -24,6 +24,8 @@ class Hipfft(CMakePackage, CudaPackage, ROCmPackage): license("MIT") version("master", branch="master") + version("6.3.2", sha256="5d9e662c7d67f4c814cad70476b57651df5ae6b65f371ca6dbb5aa51d9eeb6f5") + version("6.3.1", sha256="b709df2d0115748ed004d0cddce829cb0f9ec3761eb855e61f0097cab04e4806") version("6.3.0", sha256="08a0c800f531247281b4dbe8de9567a6fde4f432829a451a720d0b0a3c711059") version("6.2.4", sha256="308b81230498b01046f7fc3299a9e9c2c5456d80fd71a94f490ad97f51ed9de8") version("6.2.1", sha256="5f668fa8b5ed10d47d164d887699d3c14d900d78f6a31bf953f8fbbc08bc5fd1") @@ -89,6 +91,8 @@ class Hipfft(CMakePackage, CudaPackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}") @@ -115,7 +119,7 @@ def cmake_args(self): if self.spec["hip"].satisfies("@5.2:"): args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip)) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): diff --git a/var/spack/repos/builtin/packages/hipfort/package.py b/var/spack/repos/builtin/packages/hipfort/package.py index 32bea267b0caef..035308e1e919b4 100644 --- a/var/spack/repos/builtin/packages/hipfort/package.py +++ b/var/spack/repos/builtin/packages/hipfort/package.py @@ -16,6 +16,8 @@ class Hipfort(CMakePackage): license("MIT") maintainers("cgmb", "srekolam", "renjithravindrankannath", "afzpatel") + version("6.3.2", sha256="d2438971199637eb2e09519c1f2300cdd7a84b4d948034a7cd1ce3e441faf5de") + version("6.3.1", sha256="8141bf3d05ab4f91c561815134707123e3d06486bf775224b9a3a4cc8ee8f56f") version("6.3.0", sha256="9e7f4420c75430cdb9046c0c4dbe656f22128b0672b2e261d50a6e92e47cc6d3") version("6.2.4", sha256="32daa4ee52c2d44790bff7a7ddde9d572e4785b2f54766a5e45d10228da0534b") version("6.2.1", sha256="5258f2dd63aeebe29ce566e654c47b8e2e1f5eb8ca3da92af09c54517b259f32") @@ -66,6 +68,8 @@ class Hipfort(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", type="build", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/hipify-clang/package.py b/var/spack/repos/builtin/packages/hipify-clang/package.py index e49f66a6388089..27948c4e6a1e21 100644 --- a/var/spack/repos/builtin/packages/hipify-clang/package.py +++ b/var/spack/repos/builtin/packages/hipify-clang/package.py @@ -19,6 +19,8 @@ class HipifyClang(CMakePackage): license("MIT") version("master", branch="master") + version("6.3.2", sha256="c0da5118be8207fab6d19803417c0b8d2db5bc766279038527cbd6fa92b25c67") + version("6.3.1", sha256="5f9d9a65545f97b18c6a0d4394dca1bcdee10737a5635b79378ea505081f9315") version("6.3.0", sha256="9fced04f9e36350bdbabd730c446b55a898e2f4ba82078855bcf5dea3b5e8dc8") version("6.2.4", sha256="981af55ab4243f084b3e75007e827f7c94ac317fa84fe08d59c5872124a7d3c7") version("6.2.1", sha256="db5680d677222596cf9edfb84ae96b37db829a40a2e0243d26ff24a16e03ff74") @@ -74,6 +76,8 @@ class HipifyClang(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") @@ -94,6 +98,8 @@ class HipifyClang(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/hiprand/package.py b/var/spack/repos/builtin/packages/hiprand/package.py index fab92e92948672..40380c181178cd 100644 --- a/var/spack/repos/builtin/packages/hiprand/package.py +++ b/var/spack/repos/builtin/packages/hiprand/package.py @@ -24,6 +24,8 @@ class Hiprand(CMakePackage, CudaPackage, ROCmPackage): version("develop", branch="develop") version("master", branch="master") + version("6.3.2", sha256="0a08ed7554c161b095c866cd5e6f0d63cdf063e5b3c1183afa6ac18bad94a575") + version("6.3.1", sha256="ec43bf64eda348cf53c2767e553fd9561540dc50ae3ce95ca916404aa9a3eafb") version("6.3.0", sha256="7464c1e48f4e1a97a5e5978146641971d068886038810876b60acb5dfb6c4d39") version("6.2.4", sha256="b6010f5e0c63a139acd92197cc1c0d64a428f7a0ad661bce0cd1e553ad6fd6eb") version("6.2.1", sha256="0d4585b8adbc299f3fdc2c74bb20ffd4285027b861a759c3e62ce564589465da") @@ -101,6 +103,8 @@ class Hiprand(CMakePackage, CudaPackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", "develop", ]: @@ -138,7 +142,7 @@ def cmake_args(self): else: args.append(self.define("BUILD_WITH_LIB", "ROCM")) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): diff --git a/var/spack/repos/builtin/packages/hipsolver/package.py b/var/spack/repos/builtin/packages/hipsolver/package.py index 3604209d6dcc3a..0b9d6c75340a89 100644 --- a/var/spack/repos/builtin/packages/hipsolver/package.py +++ b/var/spack/repos/builtin/packages/hipsolver/package.py @@ -29,6 +29,8 @@ class Hipsolver(CMakePackage, CudaPackage, ROCmPackage): version("develop", branch="develop") version("master", branch="master") + version("6.3.2", sha256="885c999da8e4aa0b4cb9584bc0fc0d6a8c8d56f5e7ee6d211c608003eff22aa7") + version("6.3.1", sha256="793074ebaa4a3b16dc6e4d2a54ecbb259f1e0ec7fdcd7f885da622a1d1478b76") version("6.3.0", sha256="a0443f0b894cedd5af59af4fadcb3c38daa728ca32c13b9741fb19e2d828a089") version("6.2.4", sha256="4dc564498361cb1bac17dcfeaf0f2b9c85320797c75b05ee33160a133f5f4a15") version("6.2.1", sha256="614e3c0bc11bfa84acd81d46db63f3852a750adaaec094b7701ab7b996cc8e93") @@ -107,6 +109,8 @@ class Hipsolver(CMakePackage, CudaPackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", "develop", ]: @@ -160,7 +164,7 @@ def cmake_args(self): self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip) ) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): args.append(self.define("CMAKE_INSTALL_LIBDIR", "lib")) diff --git a/var/spack/repos/builtin/packages/hipsparse/package.py b/var/spack/repos/builtin/packages/hipsparse/package.py index d13f9017dd4cb5..bd93050d96e0e9 100644 --- a/var/spack/repos/builtin/packages/hipsparse/package.py +++ b/var/spack/repos/builtin/packages/hipsparse/package.py @@ -21,6 +21,8 @@ class Hipsparse(CMakePackage, CudaPackage, ROCmPackage): libraries = ["libhipsparse"] license("MIT") + version("6.3.2", sha256="9fbc3468632fdc828d7bae386c2737eb371d78811f53da7348b417fb00d62808") + version("6.3.1", sha256="d64bc48e0aa5ec2f48853272a9c554b37ec98cb0724135e45f21b1340df7bccb") version("6.3.0", sha256="550fd5a480490e631507e8c34b2b0cf9cbc2ad2a5bf84e8ea0a8fad96eecb25a") version("6.2.4", sha256="0ecc0ff1eeb99e9a9ac419e49e9be9ec4cd23a117d819710114ee2f35aefe88b") version("6.2.1", sha256="5a3241c857f705b1e5c64b3f5163575726e64a8d19f3957f7326622fda277710") @@ -89,6 +91,8 @@ class Hipsparse(CMakePackage, CudaPackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}") depends_on(f"rocsparse@{ver}", when=f"+rocm @{ver}") @@ -125,7 +129,7 @@ def cmake_args(self): # FindHIP.cmake is still used for +cuda if self.spec.satisfies("+cuda"): args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip)) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): diff --git a/var/spack/repos/builtin/packages/hipsparselt/package.py b/var/spack/repos/builtin/packages/hipsparselt/package.py index 6b150dfd898582..1bc6cf5a3bbe62 100644 --- a/var/spack/repos/builtin/packages/hipsparselt/package.py +++ b/var/spack/repos/builtin/packages/hipsparselt/package.py @@ -21,6 +21,8 @@ class Hipsparselt(CMakePackage, ROCmPackage): maintainers("srekolam", "afzpatel", "renjithravindrankannath") license("MIT") + version("6.3.2", sha256="a0b30b478eff822dd7fa1c116ad99dcdf14ece1c33aae04ac71b594efd4d9866") + version("6.3.1", sha256="403d4c0ef47f89510452a20be6cce72962f21761081fc19a7e0e27e7f0c4ccfd") version("6.3.0", sha256="f67ed4900101686596add37824d0628f1e71cf6a30d827a0519b3c3657f63ac3") version("6.2.4", sha256="7b007b346f89fac9214ad8541b3276105ce1cac14d6f95a8a504b5a5381c8184") version("6.2.1", sha256="a23287bc759442aebaccce0306f5e3938865240e13553847356c25c54214a0d4") @@ -46,12 +48,26 @@ class Hipsparselt(CMakePackage, ROCmPackage): sticky=True, ) variant("asan", default=False, description="Build with address-sanitizer enabled or disabled") - - for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in [ + "6.0.0", + "6.0.2", + "6.1.0", + "6.1.1", + "6.1.2", + "6.2.0", + "6.2.1", + "6.2.4", + "6.3.0", + "6.3.1", + "6.3.2", + ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"hipsparse@{ver}", when=f"@{ver}") - depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") depends_on(f"rocm-openmp-extras@{ver}", when=f"@{ver}", type="test") + depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") + + for ver in ["6.3.0", "6.3.1", "6.3.2"]: + depends_on(f"rocm-smi-lib@{ver}", when=f"@{ver}") depends_on("cmake@3.5:", type="build") depends_on("msgpack-c@3:") @@ -63,7 +79,6 @@ class Hipsparselt(CMakePackage, ROCmPackage): depends_on("py-joblib") depends_on("googletest@1.10.0:", type="test") depends_on("netlib-lapack@3.7.1:", type="test") - depends_on("rocm-smi-lib@6.3.0", when="@6.3.0") patch("0001-update-llvm-path-add-hipsparse-include-dir-for-spack.patch", when="@6.0") # Below patch sets the proper path for clang++,lld and clang-offload-blunder inside the diff --git a/var/spack/repos/builtin/packages/hpc-beeflow/package.py b/var/spack/repos/builtin/packages/hpc-beeflow/package.py new file mode 100644 index 00000000000000..ca5de3e5a7faa5 --- /dev/null +++ b/var/spack/repos/builtin/packages/hpc-beeflow/package.py @@ -0,0 +1,48 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class HpcBeeflow(PythonPackage): + """BEE is a workflow orchestration system designed to build containerized + HPC applications and orchestrate workflows across HPC and cloud systems. + BEE has adopted the Common Workflow Language (CWL) for specifying workflows. + Complex scientific workflows specified by CWL are managed and visualized + through a graph database, giving the user the ability to monitor the state + of each task in the workflow. BEE runs jobs using the workload scheduler + (i.e. Slurm or Flux) on the HPC system that tasks are + specified to run on.""" + + homepage = "https://github.com/lanl/bee" + pypi = "hpc_beeflow/hpc_beeflow-0.1.9.tar.gz" + + # maintainers("pagrubel") + + license("MIT") + + version("0.1.9", sha256="196eb9155a5ca6e35d0cc514e0609cf352fc757088707306653496b83a311ac1") + + depends_on("python@3.8.3:3.12.2", type=("build", "run")) + depends_on("py-poetry@0.12:", type="build") + + depends_on("py-flask@2.0:", type=("build", "run")) + depends_on("py-fastapi@0.109.2", type=("build", "run")) + depends_on("py-uvicorn@0.27.1", type=("build", "run")) + depends_on("py-neo4j@5:", type=("build", "run")) + depends_on("py-pyyaml@6.0.1:", type=("build", "run")) + depends_on("py-flask-restful@0.3.9", type=("build", "run")) + depends_on("py-cwl-utils@0.16:", type=("build", "run")) + depends_on("py-apscheduler@3.6.3:", type=("build", "run")) + depends_on("py-jsonpickle@2.2.0:", type=("build", "run")) + depends_on("py-requests@:2.28", type=("build", "run")) + depends_on("py-requests-unixsocket@0.3.0:", type=("build", "run")) + depends_on("py-python-daemon@2.3.1:", type=("build", "run")) + depends_on("py-gunicorn@20.1.0:22", type=("build", "run")) + depends_on("py-typer@0.5.0:", type=("build", "run")) + depends_on("py-cffi@1.15.1:", type=("build", "run")) + depends_on("py-celery+redis+sqlalchemy@5.3.4:", type=("build", "run")) + depends_on("py-docutils@0.18.1", type=("build", "run")) + depends_on("py-graphviz@0.20.3:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/hpctoolkit/package.py b/var/spack/repos/builtin/packages/hpctoolkit/package.py index 7116df64109ba1..a39c1c20b69373 100644 --- a/var/spack/repos/builtin/packages/hpctoolkit/package.py +++ b/var/spack/repos/builtin/packages/hpctoolkit/package.py @@ -6,8 +6,6 @@ import os import tempfile -import llnl.util.tty as tty - import spack.build_systems.autotools import spack.build_systems.meson from spack.package import * @@ -118,6 +116,12 @@ class Hpctoolkit(AutotoolsPackage, MesonPackage): when="build_system=autotools", ) variant("viewer", default=True, description="Include hpcviewer.") + variant( + "docs", + default=False, + description="Include extra documentation (user's manual)", + when="@develop", + ) variant( "python", default=False, description="Support unwinding Python source.", when="@2023.03:" @@ -185,6 +189,10 @@ class Hpctoolkit(AutotoolsPackage, MesonPackage): depends_on("zlib-api") depends_on("zlib+shared", when="^[virtuals=zlib-api] zlib") + depends_on("py-docutils", type="build", when="@develop") + depends_on("py-sphinx", type="build", when="+docs") + depends_on("py-myst-parser@0.19:", type="build", when="+docs") + depends_on("cuda", when="+cuda") depends_on("oneapi-level-zero", when="+level_zero") depends_on("oneapi-igc", when="+gtpin") @@ -402,6 +410,8 @@ def meson_args(self): spec = self.spec args = [ + "-Dmanpages=enabled", + "-Dmanual=" + ("enabled" if spec.satisfies("+docs") else "disabled"), "-Dhpcprof_mpi=" + ("enabled" if spec.satisfies("+mpi") else "disabled"), "-Dpython=" + ("enabled" if spec.satisfies("+python") else "disabled"), "-Dpapi=" + ("enabled" if spec.satisfies("+papi") else "disabled"), diff --git a/var/spack/repos/builtin/packages/hpcviewer/package.py b/var/spack/repos/builtin/packages/hpcviewer/package.py index f4f0963d4c66da..3b336fb754e386 100644 --- a/var/spack/repos/builtin/packages/hpcviewer/package.py +++ b/var/spack/repos/builtin/packages/hpcviewer/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import platform from spack.package import * @@ -25,6 +24,8 @@ class Hpcviewer(Package): skip_version_audit = ["platform=windows"] darwin_sha = { + ("2025.01", "aarch64"): "8884c60a972f864bd43fcf1933be5ec2095427de12394c96b943d2064dab044d", + ("2025.01", "x86_64"): "2959313d5603ca9b14da04f3e5d51b19fc21c374eb3d5cc687d3f77f67bbf8b9", ("2024.09", "aarch64"): "f2e5b516105fe99315950ac4cc3bce120afadeca57cfaa16d58684756950d373", ("2024.09", "x86_64"): "dd7a807a70c384e73d9abfe67b9e41de5dedcec2da4a36cc487bb9cd1ed6b366", ("2024.02", "aarch64"): "0f2bf2f89b7b9656b1b249efc8b24763f7865e8ddae5b22a3c21cc79fda49ce9", @@ -51,6 +52,9 @@ class Hpcviewer(Package): } viewer_sha = { + ("2025.01", "aarch64"): "5cb9c0a9fb15fa9128da0d609554a76541d726737f4bc6b42bee87a2b9fe7e3d", + ("2025.01", "ppc64le"): "d487d9a3752527a2ab3e754b34182c6c5878b62e9b97131237cce990f08d7dfb", + ("2025.01", "x86_64"): "95af82b5e3b7a20f31a0b86f3ef5980f3caab7661eedba1810ebf2cf1340bd5b", ("2024.09", "aarch64"): "22f2fd477652a252375554270f82068691462e93d1fea4b7c1620e26ca0c9148", ("2024.09", "ppc64le"): "eabfa180fc023b9d0d3db06763ec5bb9abc278d65a9763cd26d214605d1b8dd4", ("2024.09", "x86_64"): "4b3acd19f96ffd387e5aca7a51fcaad4919449223ce77332c91d616660c2850a", diff --git a/var/spack/repos/builtin/packages/hpx-kokkos/package.py b/var/spack/repos/builtin/packages/hpx-kokkos/package.py index b23e9891ac25a4..d634d26abf3fea 100644 --- a/var/spack/repos/builtin/packages/hpx-kokkos/package.py +++ b/var/spack/repos/builtin/packages/hpx-kokkos/package.py @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.filesystem as fs - from spack.package import * @@ -95,7 +93,7 @@ def cmake_args(self): def check(self): if self.run_tests: - with fs.working_dir(self.build_directory): + with working_dir(self.build_directory): cmake("--build", ".", "--target", "tests") cmake("--build", ".", "--target", "benchmarks") ctest("--output-on-failure") diff --git a/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py b/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py index 204d181e7c2b96..8c08496b5fa4f1 100644 --- a/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py +++ b/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py @@ -23,6 +23,8 @@ class HsaRocrDev(CMakePackage): libraries = ["libhsa-runtime64"] version("master", branch="master") + version("6.3.2", sha256="aaecaa7206b6fa1d5d7b8f7c1f7c5057a944327ba4779448980d7e7c7122b074") + version("6.3.1", sha256="547ceeeda9a41cdffa21e57809dc5834f94938a0a2809c283aebcbcf01901df0") version("6.3.0", sha256="8fd6bcd6a5afd0ae5a59e33b786a525f575183d38c34049c2dab6b9270a1ca3b") version("6.2.4", sha256="b7aa0055855398d1228c39a6f4feb7d7be921af4f43d82855faf0b531394bb9b") version("6.2.1", sha256="dbe477b323df636f5e3221471780da156c938ec00dda4b50639aa8d7fb9248f4") @@ -104,6 +106,8 @@ class HsaRocrDev(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") @@ -126,6 +130,8 @@ class HsaRocrDev(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") @@ -180,6 +186,8 @@ def cmake_args(self): args.append(self.define("ROCM_PATCH_VERSION", "60100")) if self.spec.satisfies("@6.2"): args.append(self.define("ROCM_PATCH_VERSION", "60200")) + if self.spec.satisfies("@6.3"): + args.append(self.define("ROCM_PATCH_VERSION", "60300")) if self.spec.satisfies("@5.7.0:"): args.append(self.define_from_variant("ADDRESS_SANITIZER", "asan")) diff --git a/var/spack/repos/builtin/packages/htslib/package.py b/var/spack/repos/builtin/packages/htslib/package.py index 15faeec4e489d9..e4efec212a92ee 100644 --- a/var/spack/repos/builtin/packages/htslib/package.py +++ b/var/spack/repos/builtin/packages/htslib/package.py @@ -15,6 +15,7 @@ class Htslib(AutotoolsPackage): license("MIT AND BSD-3-Clause-Modification") + version("1.21", sha256="84b510e735f4963641f26fd88c8abdee81ff4cb62168310ae716636aac0f1823") version("1.20", sha256="e52d95b14da68e0cfd7d27faf56fef2f88c2eaf32a2be51c72e146e3aa928544") version("1.19.1", sha256="222d74d3574fb67b158c6988c980eeaaba8a0656f5e4ffb76b5fa57f035933ec") version("1.19", sha256="8751c40c4fa7d1f23a6864c5b20a73744f8be68239535ae7729c5f7d394d0736") diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index c98252450d5bf7..a7d8a8d35c69fb 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -322,7 +322,7 @@ def configure_args(self): if spec.satisfies("+sycl"): configure_args.append("--with-sycl") sycl_compatible_compilers = ["icpx"] - if not (os.path.basename(self.compiler.cxx) in sycl_compatible_compilers): + if os.path.basename(self.compiler.cxx) not in sycl_compatible_compilers: raise InstallError( "Hypre's SYCL GPU Backend requires the oneAPI CXX (icpx) compiler." ) diff --git a/var/spack/repos/builtin/packages/hztool/package.py b/var/spack/repos/builtin/packages/hztool/package.py index 33397b887dd6ab..767e2d5c770903 100644 --- a/var/spack/repos/builtin/packages/hztool/package.py +++ b/var/spack/repos/builtin/packages/hztool/package.py @@ -26,7 +26,8 @@ class Hztool(AutotoolsPackage): version("4.1", sha256="a24b5d483d1dacaa991958956e838601a426133c74885b3aa2fc27c98b42d22a") version("4.0", sha256="e6f6955159da46156bf9182f61754a59dd14e407d40c2448e3f821d55bf963a0") - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("fortran", type="build") def patch(self): filter_file("-fno-automatic", "-fno-automatic -fallow-argument-mismatch", "configure.ac") diff --git a/var/spack/repos/builtin/packages/ibm-java/package.py b/var/spack/repos/builtin/packages/ibm-java/package.py deleted file mode 100644 index 3ede20e8d10005..00000000000000 --- a/var/spack/repos/builtin/packages/ibm-java/package.py +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import os -import platform - -from llnl.util.symlink import readlink - -from spack.package import * - - -class IbmJava(Package): - """Binary distribution of the IBM Java Software Development Kit - for big and little-endian powerpc (power7, 8 and 9). Note: IBM - is fairly aggressive about taking down old versions, so old - (and even current) versions may not be available.""" - - homepage = "https://developer.ibm.com/javasdk/" - maintainers("mwkrentel") - - # Note: IBM is fairly aggressive about taking down old versions, - # so we may need to update this frequently. Also, old revs may - # not be available for download. - - version_list = [ - ("8.0.6.20", "ppc64", "88748d1502a35845b18d514dd76835f0f47270c6ffbd81f67f611e32d042b288"), - ( - "8.0.6.20", - "ppc64le", - "4a7ac4712548d7630f2471a067406c94c3846fff75a0afc660682129dcf80e5b", - ), - ("8.0.6.11", "ppc64", "6fd17a6b9a34bb66e0db37f6402dc1b7612d54084c94b859f4a42f445fd174d4"), - ( - "8.0.6.11", - "ppc64le", - "d69ff7519e32e89db88a9a4d4d88d1881524073ac940f35d3860db2c6647be2e", - ), - ("8.0.6.10", "ppc64", "ff5151ead88f891624eefe33d80d56c325ca0aa4b93bd96c135cad326993eda2"), - ( - "8.0.6.10", - "ppc64le", - "ea99ab28dd300b08940882d178247e99aafe5a998b1621cf288dfb247394e067", - ), - ("8.0.6.7", "ppc64", "a1accb461a039af4587ea86511e317fea1d423e7f781459a17ed3947afed2982"), - ("8.0.6.7", "ppc64le", "9ede76a597af28c7f10c6f8a68788cc2dcd39fdab178c9bac56df8b3766ac717"), - ("8.0.6.0", "ppc64", "e142746a83e47ab91d71839d5776f112ed154ae180d0628e3f10886151dad710"), - ("8.0.6.0", "ppc64le", "18c2eccf99225e6e7643141d8da4110cacc39f2fa00149fc26341d2272cc0102"), - ("8.0.5.30", "ppc64", "d39ce321bdadd2b2b829637cacf9c1c0d90235a83ff6e7dcfa7078faca2f212f"), - ( - "8.0.5.30", - "ppc64le", - "dec6434d926861366c135aac6234fc28b3e7685917015aa3a3089c06c3b3d8f0", - ), - ] - - # There are separate tar files for big and little-endian machine - # types. And no, this won't work cross platform. - - for ver, mach, sha in version_list: - if mach == platform.machine(): - version(ver, sha256=sha, expand=False) - - provides("java@8") - - conflicts("target=x86_64:", msg="ibm-java is only available for ppc64 and ppc64le") - conflicts("target=aarch64", msg="ibm-java is only available for ppc64 and ppc64le") - - # This assumes version numbers are 4-tuples: 8.0.5.30 - def url_for_version(self, version): - # Convert 8.0.5.30 to 8.0-5.30 for the file name. - dash = "{0}.{1}-{2}.{3}".format(*(str(version).split("."))) - - url = ( - "http://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud" - "/runtimes/java/{0}/linux/{1}/ibm-java-sdk-{2}-{1}" - "-archive.bin" - ).format(version, platform.machine(), dash) - - return url - - @property - def libs(self): - return find_libraries(["libjvm"], root=self.home, recursive=True) - - def setup_run_environment(self, env): - env.set("JAVA_HOME", self.home) - - def setup_dependent_build_environment(self, env, dependent_spec): - env.set("JAVA_HOME", self.home) - - def install(self, spec, prefix): - archive = os.path.basename(self.stage.archive_file) - - # The archive.bin file is quite fussy and doesn't work as a - # symlink. - if os.path.islink(archive): - targ = readlink(archive) - os.unlink(archive) - copy(targ, archive) - - # The properties file is how we avoid an interactive install. - prop = "properties" - with open(prop, "w") as file: - file.write("INSTALLER_UI=silent\n") - file.write("USER_INSTALL_DIR=%s\n" % prefix) - file.write("LICENSE_ACCEPTED=TRUE\n") - - # Running the archive file installs everything. - set_executable(archive) - inst = Executable(join_path(".", archive)) - inst("-f", prop) - - return diff --git a/var/spack/repos/builtin/packages/icu4c/package.py b/var/spack/repos/builtin/packages/icu4c/package.py index f94fd66ebed3af..3766bca23fde55 100644 --- a/var/spack/repos/builtin/packages/icu4c/package.py +++ b/var/spack/repos/builtin/packages/icu4c/package.py @@ -19,6 +19,8 @@ class Icu4c(AutotoolsPackage, MSBuildPackage): license("Unicode-TOU") + version("76.1", sha256="dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e") + version("75.1", sha256="cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef") version("74.2", sha256="68db082212a96d6f53e35d60f47d38b962e9f9d207a74cfac78029ae8ff5e08c") version("67.1", sha256="94a80cd6f251a53bd2a997f6f1b5ac6653fe791dfab66e1eb0227740fb86d5dc") version("66.1", sha256="52a3f2209ab95559c1cf0a14f24338001f389615bf00e2585ef3dbc43ecf0a2e") @@ -40,7 +42,7 @@ class Icu4c(AutotoolsPackage, MSBuildPackage): variant( "cxxstd", default="11", - values=("11", "14", "17"), + values=(conditional("11", "14", when="@:74"), "17"), multi=False, description="Use the specified C++ standard when building", ) @@ -70,7 +72,7 @@ def url_for_version(self, version): return url.format(version.dashed, version.underscored) def flag_handler(self, name, flags): - if name == "cxxflags": + if name == "cxxflags" and not self.spec.platform == "windows": # Control of the C++ Standard is via adding the required "-std" # flag to CXXFLAGS in env flags.append(getattr(self.compiler, f"cxx{self.spec.variants['cxxstd'].value}_flag")) @@ -123,7 +125,7 @@ def msbuild_args(self): @property def build_directory(self): solution_path = pathlib.Path(self.pkg.stage.source_path) - if self.spec.satsifies("@:67"): + if self.spec.satisfies("@:67"): solution_path = solution_path / "icu" solution_path = solution_path / "source" / "allinone" return str(solution_path) diff --git a/var/spack/repos/builtin/packages/indicators/package.py b/var/spack/repos/builtin/packages/indicators/package.py new file mode 100644 index 00000000000000..ba72421c83d5d3 --- /dev/null +++ b/var/spack/repos/builtin/packages/indicators/package.py @@ -0,0 +1,32 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class Indicators(CMakePackage): + """Activity indicators for modern C++.""" + + homepage = "https://github.com/p-ranav/indicators" + url = "https://github.com/p-ranav/indicators/archive/refs/tags/v2.3.tar.gz" + list_url = "https://github.com/p-ranav/indicators/tags" + git = "https://github.com/p-ranav/indicators.git" + + maintainers("stephenswat") + + license("MIT", checked_by="stephenswat") + + version("2.3", sha256="70da7a693ff7a6a283850ab6d62acf628eea17d386488af8918576d0760aef7b") + + depends_on("cxx", type="build") + depends_on("cmake@3.8:", type="build") + + def cmake_args(self): + args = [ + self.define("INDICATORS_BUILD_TESTS", self.run_tests), + self.define("INDICATORS_SAMPLES", False), + self.define("INDICATORS_DEMO", False), + ] + return args diff --git a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py index 7cef56e7ccb036..4e7dfdf634e6a7 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py @@ -7,7 +7,6 @@ from spack.build_environment import dso_suffix from spack.package import * -from spack.util.environment import EnvironmentModifications versions = [ { diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py index 3dd2aee4f61f6e..609ba05c16782b 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py @@ -20,6 +20,12 @@ class IntelOneapiMpi(IntelOneApiLibraryPackage): homepage = "https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/mpi-library.html" + version( + "2021.14.2", + url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/201b2570-bc4f-41ee-a6c8-6f7a71a4b840/intel-mpi-2021.14.2.9_offline.sh", + sha256="b1cdaa6237f9976dd67b3590c34b66c57b1f8fc2f470b7f18b34575d7f9fae04", + expand=False, + ) version( "2021.14.1", url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1acd5e79-796c-401a-ab31-a3dc7b20c6a2/intel-mpi-2021.14.1.7_offline.sh", diff --git a/var/spack/repos/builtin/packages/intel-oneapi-runtime/package.py b/var/spack/repos/builtin/packages/intel-oneapi-runtime/package.py index 32a263125f2291..2ff2e5b18891ba 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-runtime/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-runtime/package.py @@ -3,8 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -from llnl.util import tty - from spack.package import * from spack.pkg.builtin.gcc_runtime import get_elf_libraries diff --git a/var/spack/repos/builtin/packages/intel/package.py b/var/spack/repos/builtin/packages/intel/package.py index 34adfd182e6f90..5e4159d8f9953f 100644 --- a/var/spack/repos/builtin/packages/intel/package.py +++ b/var/spack/repos/builtin/packages/intel/package.py @@ -3,8 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import re -import llnl.util.tty as tty - import spack.compiler from spack.package import * diff --git a/var/spack/repos/builtin/packages/isa-l/package.py b/var/spack/repos/builtin/packages/isa-l/package.py index cbab37b1c2d470..005bb3614d972b 100644 --- a/var/spack/repos/builtin/packages/isa-l/package.py +++ b/var/spack/repos/builtin/packages/isa-l/package.py @@ -30,6 +30,7 @@ class IsaL(AutotoolsPackage): version("master", branch="master") # Current + version("2.31.1", sha256="e1d5573a4019738243b568ab1e1422e6ab7557c5cae33cc8686944d327ad6bb4") version("2.30.0", sha256="bcf592c04fdfa19e723d2adf53d3e0f4efd5b956bb618fed54a1108d76a6eb56") version("2.29.0", sha256="832d9747ef3f0c8c05d39e3d7fd6ee5299a844e1ee7382fc8c8b52a268f36eda") version("2.28.0", sha256="589202efdcfe437b1786750ec81bf93055e3b88a4bdf909d3b519f2a7134034b") diff --git a/var/spack/repos/builtin/packages/jacamar-ci/package.py b/var/spack/repos/builtin/packages/jacamar-ci/package.py new file mode 100644 index 00000000000000..f434b951bee38f --- /dev/null +++ b/var/spack/repos/builtin/packages/jacamar-ci/package.py @@ -0,0 +1,49 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import re + +from spack.package import * + + +class JacamarCi(GoPackage): + """Jacamar CI is a HPC focused CI/CD driver for the GitLab custom executor.""" + + homepage = "https://gitlab.com/ecp-ci/jacamar-ci" + url = "https://gitlab.com/ecp-ci/jacamar-ci/-/archive/v0.24.0/jacamar-ci-v0.24.0.tar.gz" + git = "https://gitlab.com/ecp-ci/jacamar-ci.git" + + maintainers("paulbry") + + license("Apache-2.0 OR MIT") + + version("develop", branch="develop") + version("0.24.2", sha256="d2b8be464b88a92df0ad2ba1e846226b993c4162779432cb8366fb9bca5c40db") + version("0.24.1", sha256="fe1036fee2e97e38457212bf1246895803eeb6e1a6aa1ecd24eba1d3ea994029") + version("0.23.0", sha256="796679e13ece5f88dd7d4a4f40a27a87a6f3273085bb07043b258a612a4b43d3") + + conflicts("platform=darwin", msg="Jacamar CI does not support MacOS") + + depends_on("go@1.22.7:", type="build", when="@0.23.0:") + depends_on("gmake", type="build") + depends_on("libc", type="link") + depends_on("libseccomp", type="link") + + executables = ["^jacamar$", "^jacamar-auth$"] + phases = ["build", "install"] + + def url_for_version(self, version): + return f"https://gitlab.com/ecp-ci/jacamar-ci/-/archive/v{version}/jacamar-ci-v{version}.tar.gz" + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str) + match = re.search(r"Version:\s*(\S+)", output) + return match.group(1) if match else None + + def build(self, spec, prefix): + make("VERSION={0}".format(spec.version), "build") + + def install(self, spec, prefix): + make("PREFIX={0}".format(prefix), "install") diff --git a/var/spack/repos/builtin/packages/jdk/package.py b/var/spack/repos/builtin/packages/jdk/package.py index a30717532c6174..be4d8ccbc696c0 100644 --- a/var/spack/repos/builtin/packages/jdk/package.py +++ b/var/spack/repos/builtin/packages/jdk/package.py @@ -6,7 +6,6 @@ import re from spack.package import * -from spack.util.prefix import Prefix class Jdk(Package): diff --git a/var/spack/repos/builtin/packages/jmol/package.py b/var/spack/repos/builtin/packages/jmol/package.py index bc212924af2fd3..e0c87d5a8fcd0d 100644 --- a/var/spack/repos/builtin/packages/jmol/package.py +++ b/var/spack/repos/builtin/packages/jmol/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/jq/package.py b/var/spack/repos/builtin/packages/jq/package.py index 641403846e1ca6..098963a74fc5cd 100644 --- a/var/spack/repos/builtin/packages/jq/package.py +++ b/var/spack/repos/builtin/packages/jq/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import sys from spack.package import * diff --git a/var/spack/repos/builtin/packages/json-c/package.py b/var/spack/repos/builtin/packages/json-c/package.py index c145195b470bd8..8f75891e6b0710 100644 --- a/var/spack/repos/builtin/packages/json-c/package.py +++ b/var/spack/repos/builtin/packages/json-c/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.build_systems import cmake from spack.package import * @@ -13,47 +14,38 @@ class JsonC(CMakePackage, AutotoolsPackage): license("MIT") + version("0.18", sha256="876ab046479166b869afc6896d288183bbc0e5843f141200c677b3e8dfb11724") version("0.16", sha256="8e45ac8f96ec7791eaf3bb7ee50e9c2100bbbc87b8d0f1d030c5ba8a0288d96b") version("0.15", sha256="b8d80a1ddb718b3ba7492916237bbf86609e9709fb007e7f7d4322f02341a4c6") version("0.14", sha256="b377de08c9b23ca3b37d9a9828107dff1de5ce208ff4ebb35005a794f30c6870") - version("0.13.1", sha256="b87e608d4d3f7bfdd36ef78d56d53c74e66ab278d318b71e6002a369d36f4873") - version("0.12.1", sha256="2a136451a7932d80b7d197b10441e26e39428d67b1443ec43bbba824705e1123") - version("0.12", sha256="000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f") - version("0.11", sha256="28dfc65145dc0d4df1dfe7701ac173c4e5f9347176c8983edbfac9149494448c") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + with default_args(deprecated=True): + version( + "0.13.1", sha256="b87e608d4d3f7bfdd36ef78d56d53c74e66ab278d318b71e6002a369d36f4873" + ) + version( + "0.12.1", sha256="2a136451a7932d80b7d197b10441e26e39428d67b1443ec43bbba824705e1123" + ) + version("0.12", sha256="000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f") + version("0.11", sha256="28dfc65145dc0d4df1dfe7701ac173c4e5f9347176c8983edbfac9149494448c") + + depends_on("c", type="build") build_system( conditional("cmake", when="@0.14:"), - conditional("autotools", when="@:0.13.1"), + conditional("autotools", when="@:0.13"), default="cmake", ) depends_on("autoconf", when="build_system=autotools", type="build") + depends_on("cmake@3.9:", when="@0.17: build_system=cmake", type="build") - parallel = False + @property + def parallel(self): + # autotools issue with make -j: https://github.com/json-c/json-c/issues/75 + return not self.spec.satisfies("build_system=autotools") - @when("@0.12:0.12.1 %gcc@7:") - def patch(self): - filter_file( - "-Wextra", - "-Wextra -Wno-error=implicit-fallthrough " "-Wno-error=unused-but-set-variable", - "Makefile.in", - ) - @when("%cce@11.0.3:") - def patch(self): - filter_file("-Werror", "", "CMakeLists.txt") - - def flag_handler(self, name, flags): - if name == "cflags": - if self.spec.satisfies("%oneapi"): - flags.append("-Wno-error=implicit-function-declaration") - return (flags, None, None) - - @run_after("install") - def darwin_fix(self): - # The shared library is not installed correctly on Darwin; fix this - if "platform=darwin" in self.spec: - fix_darwin_install_name(self.prefix.lib) +class CMakeBuilder(cmake.CMakeBuilder): + def cmake_args(self): + return [self.define("DISABLE_WERROR", True)] diff --git a/var/spack/repos/builtin/packages/jsoncons/package.py b/var/spack/repos/builtin/packages/jsoncons/package.py new file mode 100644 index 00000000000000..420b38beaafe16 --- /dev/null +++ b/var/spack/repos/builtin/packages/jsoncons/package.py @@ -0,0 +1,25 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class Jsoncons(CMakePackage): + """A C++, header-only library for constructing JSON and JSON-like + data formats, with JSON Pointer, JSON Patch, JSON Schema, + JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON + """ + + homepage = "https://danielaparker.github.io/jsoncons/" + url = "https://github.com/danielaparker/jsoncons/archive/refs/tags/v1.2.0.tar.gz" + + license("BSL-1.0", checked_by="pranav-sivaraman") + + version("1.2.0", sha256="3bdc0c8ceba1943b5deb889559911ebe97377971453a11227ed0a51a05e5d5d8") + + depends_on("cxx", type="build") + + def cmake_args(self): + return [self.define("JSONCONS_BUILD_TESTS", self.run_tests)] diff --git a/var/spack/repos/builtin/packages/jujutsu/package.py b/var/spack/repos/builtin/packages/jujutsu/package.py new file mode 100644 index 00000000000000..9fc6206adc2ee6 --- /dev/null +++ b/var/spack/repos/builtin/packages/jujutsu/package.py @@ -0,0 +1,35 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +import spack.build_systems.cargo +from spack.package import * + + +class Jujutsu(CargoPackage): + """A Git-compatible VCS that is both simple and powerful""" + + homepage = "https://jj-vcs.github.io/jj/latest/" + url = "https://github.com/jj-vcs/jj/archive/refs/tags/v0.25.0.tar.gz" + + maintainers("pranav-sivaraman") + + license("Apache-2.0", checked_by="pranav-sivaraman") + + version("0.25.0", sha256="3a99528539e414a3373f24eb46a0f153d4e52f7035bb06df47bd317a19912ea3") + + depends_on("rust@1.76:", type="build") + depends_on("pkgconfig", type="build") + depends_on("openssl") + + +class CargoBuilder(spack.build_systems.cargo.CargoBuilder): + @property + def build_directory(self): + """Return the directory containing the main Cargo.toml.""" + return f"{self.pkg.stage.source_path}/cli" + + @property + def build_args(self): + return ["--bin", "jj", "jj-cli"] diff --git a/var/spack/repos/builtin/packages/julia/package.py b/var/spack/repos/builtin/packages/julia/package.py index 7961198f60f540..7a628496575a41 100644 --- a/var/spack/repos/builtin/packages/julia/package.py +++ b/var/spack/repos/builtin/packages/julia/package.py @@ -2,10 +2,10 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import glob import os from spack.package import * -from spack.version import ver def get_best_target(microarch, compiler_name, compiler_version): @@ -25,8 +25,13 @@ class Julia(MakefilePackage): maintainers("vchuravy", "haampie", "giordano") version("master", branch="master") + version("1.11.2", sha256="5d56c7163aefbf4dfb97d97388f93175826bcc3f4b0e885fa351694f84dc70c4") + version("1.11.1", sha256="895549f40b21dee66b6380e30811f40d2d938c2baba0750de69c9a183cccd756") version("1.11.0", sha256="a938c6b7758a83e817b56db3e542bd85e6d74db75e1381b1ba24cd6e3dc8c566") + version("1.10.7", sha256="9ff0fec7ff92e27c5909982047d1bd2dc80a32173e21a2e2e029eca2ccc1c0e1") + version("1.10.6", sha256="16a2227840a2acda80f375fc21fbd42a3da3be24bd375bc9a40ca8321e3172fe") + version("1.10.5", sha256="12b1bf720b76e51a116127b30f7a824d601347bc0999cf36a0c90f1f53d00833") version("1.10.4", sha256="c46ed8166fe860a7258d088a0add68dfdf11ad64cc4c0b1f113570862d3ef777") version("1.10.3", sha256="b3cd34c839d25b98a162070b4e3abd5f34564ffdad13e07073be7885e5678a18") version("1.10.2", sha256="e3d20c02975da054aeb18d32ed84c5d760d54d2563e45e25017684a5a105d185") @@ -149,7 +154,7 @@ class Julia(MakefilePackage): depends_on("llvm@11.0.1") depends_on("mbedtls@2.24.0:2.24") depends_on("openlibm@0.7.0:0.7", when="+openlibm") - depends_on("curl@7.73.0:") + depends_on("curl@7.73.0:8.9") # patch for forward compat with curl@8.10 does not apply # Patches for llvm depends_on("llvm", patches="llvm7-symver-jlprefix.patch", when="@:1.7") @@ -298,6 +303,26 @@ class Julia(MakefilePackage): # which is creating symlinks to those libraries. patch("julia-1.10-rm-suite-sparse-cuda-stubs.patch", when="@1.10.0:1.10") + # Patches needed for curl 8.10 forward compatibility. They cannot be ordinary patches because + # they apply to files in embedded tarballs. + resource( + url="https://github.com/JuliaLang/Downloads.jl/commit/e692e77fb5427bf3c6e81514b323c39a88217eec.patch?full_index=1", + sha256="405044654ac2c5ee491c09496901f0538197201f06006c61779a4319045596eb", + name="downloads-patch-1", + placement="downloads-patch-1", + expand=False, + when="@1.7:1.11 ^curl@8.10:", + ) + + resource( + url="https://github.com/JuliaLang/Downloads.jl/commit/91a71b9597a5379735404af215035b5f5aa6b4d5.patch?full_index=1", + sha256="98e5ba550e957568c31fb2351b1623277a4514a830f2988bf37ebc3fd753d951", + name="downloads-jl-patch-2", + placement="downloads-patch-2", + expand=False, + when="@1.7:1.11 ^curl@8.10:", + ) + def patch(self): # The system-libwhich-libblastrampoline.patch causes a rebuild of docs as it # touches the main Makefile, so we reset the a/m-time to doc/_build's. @@ -420,6 +445,19 @@ def edit(self, spec, prefix): with open("Make.user", "w") as f: f.write("\n".join(options) + "\n") + @run_before("build", when="@1.7:1.11 ^curl@8.10:") + def patch_downloads_stdlib(self): + # stdlibs are distributed as tarballs, which we need to unpack so we can patch Downloads.jl + # making it forward compatible with curl. + make("-C", "stdlib") + + downloads_glob = glob.glob("stdlib/Downloads-*") + assert len(downloads_glob) == 1, "Expected exactly one stdlib/Downloads-* directory" + downloads_dir = downloads_glob[0] + + for patch in sorted(glob.glob("downloads-patch-*/*")): + Executable("patch")("-s", "-p1", "-i", os.path.abspath(patch), "-d", downloads_dir) + # julia's sys/package images are lacking rpaths, but this is fine because julia dlopen's them # at which point their dependencies are already loaded. ccalllazyfoo.so is from tests. unresolved_libraries = ["libjulia.so.*", "libjulia-internal.so.*", "ccalllazyfoo.so"] diff --git a/var/spack/repos/builtin/packages/justbuild/package.py b/var/spack/repos/builtin/packages/justbuild/package.py index c93c896ec58e87..1431d9746a3258 100644 --- a/var/spack/repos/builtin/packages/justbuild/package.py +++ b/var/spack/repos/builtin/packages/justbuild/package.py @@ -23,6 +23,8 @@ class Justbuild(Package): license("Apache-2.0") version("master", branch="master") + version("1.4.3", tag="v1.4.3", commit="dfbfdc230805a7c92baa7e49d82edc2816e00511") + version("1.4.2", tag="v1.4.2", commit="7fd5d41bc219acf0d15da5dfc75d8dd4a6c53ba3") version("1.4.1", tag="v1.4.1", commit="2dc306f510c7ba0661d95bd75305f7deb5eb54b2") version("1.4.0", tag="v1.4.0", commit="562bddf70175a602f896397f41ee5f5e07e834eb") version("1.3.2", tag="v1.3.2", commit="27a56845398b07471f8185648a79a63f97851659") diff --git a/var/spack/repos/builtin/packages/jwt-cpp/package.py b/var/spack/repos/builtin/packages/jwt-cpp/package.py index a25514eabd5685..a082566a260e60 100644 --- a/var/spack/repos/builtin/packages/jwt-cpp/package.py +++ b/var/spack/repos/builtin/packages/jwt-cpp/package.py @@ -22,7 +22,8 @@ class JwtCpp(CMakePackage): version("0.5.0", sha256="079a273f070dd11213e301712319a65881e51ab81535cc436d5313191df852a2") version("0.4.0", sha256="f0dcc7b0e8bef8f9c3f434e7121f9941145042c9fe3055a5bdd709085a4f2be4") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") # TODO: jwt-cpp>=0.5.0 has an embedded copy of picojson which can be packaged seperately diff --git a/var/spack/repos/builtin/packages/kokkos-kernels/package.py b/var/spack/repos/builtin/packages/kokkos-kernels/package.py index 98848493ef7082..1200d29dcd92bc 100644 --- a/var/spack/repos/builtin/packages/kokkos-kernels/package.py +++ b/var/spack/repos/builtin/packages/kokkos-kernels/package.py @@ -267,7 +267,7 @@ def cmake_args(self): options.append("-DCMAKE_CXX_COMPILER=%s" % spec["hip"].hipcc) else: # Compiler weirdness due to nvcc_wrapper - options.append("-DCMAKE_CXX_COMPILER=%s" % spec["kokkos"].kokkos_cxx) + options.append("-DCMAKE_CXX_COMPILER=%s" % self["kokkos"].kokkos_cxx) if self.run_tests: options.append("-DKokkosKernels_ENABLE_TESTS=ON") diff --git a/var/spack/repos/builtin/packages/kokkos-nvcc-wrapper/package.py b/var/spack/repos/builtin/packages/kokkos-nvcc-wrapper/package.py index 8b06a4163596ad..75a1adbb79210a 100644 --- a/var/spack/repos/builtin/packages/kokkos-nvcc-wrapper/package.py +++ b/var/spack/repos/builtin/packages/kokkos-nvcc-wrapper/package.py @@ -20,6 +20,8 @@ class KokkosNvccWrapper(Package): license("BSD-3-Clause") + version("4.5.01", sha256="e0008c89d7f03ebbe31eb3c89d40fe529b4e4072b40331ae6b9d6599f02dff44") + version("4.5.00", sha256="7f7d8db54e5d2b0d4109ac6aa05732abd25b17d004cce5e21f56005952954e68") version("4.4.01", sha256="3f7096d17eaaa4004c7497ac082bf1ae3ff47b5104149e54af021a89414c3682") version("4.4.00", sha256="c638980cb62c34969b8c85b73e68327a2cb64f763dd33e5241f5fd437170205a") version("4.3.01", sha256="5998b7c732664d6b5e219ccc445cd3077f0e3968b4be480c29cd194b4f45ec70") @@ -67,6 +69,6 @@ def setup_dependent_build_environment(self, env, dependent_spec): env.set("OMPI_CXX", wrapper) env.set("MPICXX_CXX", wrapper) # HPE MPT - def setup_dependent_package(self, module, dependent_spec): - wrapper = join_path(self.prefix.bin, "nvcc_wrapper") - self.spec.kokkos_cxx = wrapper + @property + def kokkos_cxx(self) -> str: + return join_path(self.prefix.bin, "nvcc_wrapper") diff --git a/var/spack/repos/builtin/packages/kokkos-tools/package.py b/var/spack/repos/builtin/packages/kokkos-tools/package.py index a8603e9f0fd1f3..f190954bbe7c42 100644 --- a/var/spack/repos/builtin/packages/kokkos-tools/package.py +++ b/var/spack/repos/builtin/packages/kokkos-tools/package.py @@ -10,7 +10,7 @@ class KokkosTools(CMakePackage): homepage = "https://github.com/kokkos/kokkos-tools/" git = "https://github.com/kokkos/kokkos-tools.git" - + maintainers("jennfshr", "vlkale", "rbberger") license("Apache-2.0 WITH LLVM-exception") version("develop", branch="develop") diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py index e884362c7e09b2..ece0d78667f0c7 100644 --- a/var/spack/repos/builtin/packages/kokkos/package.py +++ b/var/spack/repos/builtin/packages/kokkos/package.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import llnl.util.lang as lang @@ -408,11 +408,12 @@ def append_args(self, cmake_prefix, cmake_options, spack_options): if option: spack_options.append(option) - def setup_dependent_package(self, module, dependent_spec): - try: - self.spec.kokkos_cxx = self.spec["kokkos-nvcc-wrapper"].kokkos_cxx - except Exception: - self.spec.kokkos_cxx = spack_cxx + @property + def kokkos_cxx(self) -> str: + if self.spec.satisfies("+wrapper"): + return self["kokkos-nvcc-wrapper"].kokkos_cxx + # Assumes build-time globals have been set already + return spack_cxx def cmake_args(self): spec = self.spec @@ -474,9 +475,7 @@ def cmake_args(self): options.append(self.define(tpl + "_DIR", spec[tpl].prefix)) if self.spec.satisfies("+wrapper"): - options.append( - self.define("CMAKE_CXX_COMPILER", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx) - ) + options.append(self.define("CMAKE_CXX_COMPILER", self.kokkos_cxx)) elif "+rocm" in self.spec: if "+cmake_lang" in self.spec: options.append( @@ -513,7 +512,7 @@ def setup_build_tests(self): cmake_source_path = join_path(self.stage.source_path, self.test_script_relative_path) if not os.path.exists(cmake_source_path): return - """Copy test.""" + # Copy test cmake_out_path = join_path(self.test_script_relative_path, "out") cmake_args = [ cmake_source_path, diff --git a/var/spack/repos/builtin/packages/lammps/package.py b/var/spack/repos/builtin/packages/lammps/package.py index 5648ea4f5f43a2..c3033e58b826da 100644 --- a/var/spack/repos/builtin/packages/lammps/package.py +++ b/var/spack/repos/builtin/packages/lammps/package.py @@ -30,6 +30,8 @@ class Lammps(CMakePackage, CudaPackage, ROCmPackage, PythonExtension): # marked deprecated=True # * patch releases older than a stable release should be marked deprecated=True version("develop", branch="develop") + version("20250204", sha256="a4cb0a58451d47ac31ee3e1f148d92f445298d6e27f2d06f161b9b4168d79eb1") + version("20241119", sha256="7d1a825f13eef06d82ed8ae950f4a5ca6da9f6a5979745a85a7a58781e4c6ffa") version( "20240829.1", sha256="3aea41869aa2fb8120fc4814cab645686f969e2eb7c66aa5587e500597d482dc", @@ -399,7 +401,7 @@ class Lammps(CMakePackage, CudaPackage, ROCmPackage, PythonExtension): depends_on("cxx", type="build") - # scafacos, ml-quip, qmmm require C, but not available in Spack + # ml-quip, qmmm require C, but not available in Spack for c_pkg in ( "adios", "atc", @@ -407,15 +409,15 @@ class Lammps(CMakePackage, CudaPackage, ROCmPackage, PythonExtension): "electrode", "h5md", "kim", - "mdi", "ml-pod", "rheo", + "scafacos", "tools", ): depends_on("c", type="build", when=f"+{c_pkg}") - # scafacos, ml-quip require Fortran, but not available in Spack - for fc_pkg in ("kim",): + # ml-quip require Fortran, but not available in Spack + for fc_pkg in ("kim", "scafacos"): depends_on("fortran", type="build", when=f"+{fc_pkg}") stable_versions = { @@ -543,6 +545,7 @@ def url_for_version(self, version): "rheo": {"when": "@20240829:"}, "replica": {}, "rigid": {"default": True}, + "scafacos": {"when": "@20210702:"}, "shock": {}, "smtbq": {"when": "@20210702:"}, "snap": {"when": "@:20210527"}, @@ -596,9 +599,7 @@ def url_for_version(self, version): "vtk": {"when": "@20210702:"}, "yaff": {"when": "@20210702:"}, # "ml-quip": {"when": "@20210702:"}, no quip package - # "scafacos": {"when": "@20210702:"}, no scafacos package # "user-quip": {"when": "@20190201:20210527"}, no quip package - # "user-scafacos": {"when": "@20180905:20210527"}, no scafacos package } for pkg_name, pkg_options in supported_packages.items(): @@ -650,7 +651,7 @@ def url_for_version(self, version): default="fftw3", when="+kspace", description="FFT library for KSPACE package", - values=("kiss", "fftw3", "mkl"), + values=("kiss", "fftw3", "mkl", "nvpl"), multi=False, ) variant( @@ -665,7 +666,7 @@ def url_for_version(self, version): default="fftw3", when="@20240417: +kspace+kokkos", description="FFT library for Kokkos-enabled KSPACE package", - values=("kiss", "fftw3", "mkl", "hipfft", "cufft"), + values=("kiss", "fftw3", "mkl", "mkl_gpu", "nvpl", "hipfft", "cufft"), multi=False, ) variant( @@ -689,6 +690,8 @@ def url_for_version(self, version): depends_on("hipfft", when="+kokkos+kspace+rocm fft_kokkos=hipfft") depends_on("fftw-api@3", when="+kokkos+kspace fft_kokkos=fftw3") depends_on("mkl", when="+kokkos+kspace fft_kokkos=mkl") + depends_on("nvpl-fft", when="+kspace fft=nvpl") + depends_on("nvpl-fft", when="+kokkos+kspace fft_kokkos=nvpl") depends_on("voropp", when="+voronoi") depends_on("netcdf-c+mpi", when="+user-netcdf") depends_on("netcdf-c+mpi", when="+netcdf") @@ -721,13 +724,15 @@ def url_for_version(self, version): depends_on("kokkos@3.7.01:", when="@20230208: +kokkos") depends_on("kokkos@4.3.00:", when="@20240417: +kokkos") depends_on("kokkos@4.3.01:", when="@20240627: +kokkos") + depends_on("kokkos@4.4.01:", when="@20241119: +kokkos") + depends_on("kokkos@4.5.01:", when="@20250204: +kokkos") depends_on("adios2", when="+user-adios") depends_on("adios2", when="+adios") depends_on("plumed", when="+user-plumed") depends_on("plumed", when="+plumed") depends_on("eigen@3:", when="+user-smd") depends_on("eigen@3:", when="+machdyn") - depends_on("pace", when="+ml-pace", type="build") + depends_on("pace", when="+ml-pace") depends_on("py-cython", when="+mliap+python", type="build") depends_on("py-cython", when="+ml-iap+python", type="build") depends_on("py-mdi", when="+mdi", type=("build", "run")) @@ -741,6 +746,8 @@ def url_for_version(self, version): with when(_n2p2_cond): depends_on("n2p2@2.1.4:") depends_on("n2p2+shared", when="+lib") + depends_on("scafacos", when="+scafacos") + depends_on("scafacos cflags=-fPIC cxxflags=-fPIC fflags=-fPIC", when="+scafacos+lib") depends_on("vtk", when="+user-vtk") depends_on("vtk", when="+vtk") depends_on("hipcub", when="~kokkos +rocm") @@ -806,6 +813,15 @@ def url_for_version(self, version): msg="ROCm builds of the GPU package not maintained prior to version 20220623", ) conflicts("+intel", when="%aocc@:3.2.9999", msg="+intel with AOCC requires version 4 or newer") + conflicts("fft=nvpl", when="@:20240829", msg="fft=nvpl requires newer LAMMPS version") + conflicts( + "fft_kokkos=nvpl", when="@:20240829", msg="fft_kokkos=nvpl requires newer LAMMPS version" + ) + conflicts( + "fft_kokkos=mkl_gpu", + when="@:20240829", + msg="fft_kokkos=mkl_gpu requires newer LAMMPS version", + ) # Backport of https://github.com/lammps/lammps/pull/3726 conflicts("+kokkos+rocm+kspace", when="@:20210929.3") @@ -856,6 +872,22 @@ def url_for_version(self, version): root_cmakelists_dir = "cmake" + def flag_handler(self, name, flags): + wrapper_flags = [] + build_system_flags = [] + + if self.spec.satisfies("+mpi+cuda") or self.spec.satisfies("+mpi+rocm"): + if self.spec.satisfies("^[virtuals=mpi] cray-mpich"): + gtl_lib = self.spec["cray-mpich"].package.gtl_lib + build_system_flags.extend(gtl_lib.get(name) or []) + # hipcc is not wrapped, we need to pass the flags via the build + # system. + build_system_flags.extend(flags) + else: + wrapper_flags.extend(flags) + + return (wrapper_flags, [], build_system_flags) + def cmake_args(self): spec = self.spec diff --git a/var/spack/repos/builtin/packages/laszip/package.py b/var/spack/repos/builtin/packages/laszip/package.py index d58f7f164c4c7b..fb70d11bc56414 100644 --- a/var/spack/repos/builtin/packages/laszip/package.py +++ b/var/spack/repos/builtin/packages/laszip/package.py @@ -13,6 +13,7 @@ class Laszip(CMakePackage): license("LGPL-2.0-or-later") + version("3.4.4", sha256="41f826848ff106f471b134224f58075ac8e36a62b6ba0ad75be8a8c191bdba4b") version("3.4.3", sha256="53f546a7f06fc969b38d1d71cceb1862b4fc2c4a0965191a0eee81a57c7b373d") version("3.4.1", sha256="5d9b0ffaf8b7319c2fa216da3f3f878bb8f4e5b4b14d2c154d441a351da2be37") diff --git a/var/spack/repos/builtin/packages/lc-framework/package.py b/var/spack/repos/builtin/packages/lc-framework/package.py index 5da5a9fec7e91a..c2cbd96d916359 100644 --- a/var/spack/repos/builtin/packages/lc-framework/package.py +++ b/var/spack/repos/builtin/packages/lc-framework/package.py @@ -10,7 +10,7 @@ def try_le(x, y): try: return int(x) < y except ValueError: - False + return False class LcFramework(CMakePackage, CudaPackage): diff --git a/var/spack/repos/builtin/packages/lcals/package.py b/var/spack/repos/builtin/packages/lcals/package.py index 7dbcb05877b666..a9b4dd891d8115 100644 --- a/var/spack/repos/builtin/packages/lcals/package.py +++ b/var/spack/repos/builtin/packages/lcals/package.py @@ -53,30 +53,35 @@ def build_targets(self): if self.compiler.name == "intel": if arch == "MIC": cxxflags += "-DLCALS_PLATFORM_X86_SSE -DLCALS_COMPILER_ICC " - cxx_compile += "-g -O3 -mmic -vec-report3 " - " -inline-max-total-size=10000 -inline-forceinline -ansi-alias" + cxx_compile += ( + "-g -O3 -mmic -vec-report3 " + " -inline-max-total-size=10000 -inline-forceinline -ansi-alias" + ) elif microarch == "sse" and arch == "x86": cxxflags += "-DLCALS_PLATFORM_X86_SSE -DLCALS_COMPILER_ICC " - cxx_compile += "-O3 -msse4.1 -inline-max-total-size=10000" - " -inline-forceinline -ansi-alias -std=c++0x " + cxx_compile += ( + "-O3 -msse4.1 -inline-max-total-size=10000" + " -inline-forceinline -ansi-alias -std=c++0x " + ) elif microarch == "avx" and arch == "x86": cxxflags += "-DLCALS_PLATFORM_X86_AVX -DLCALS_COMPILER_ICC " - cxx_compile += "-O3 -mavx -inline-max-total-size=10000" - " -inline-forceinline -ansi-alias -std=c++0x" + cxx_compile += ( + "-O3 -mavx -inline-max-total-size=10000" + " -inline-forceinline -ansi-alias -std=c++0x" + ) cxxflags += self.compiler.openmp_flag elif self.compiler.name == "gcc": if arch == "MIC" or (microarch == "sse" and arch == "x86"): cxxflags += "-DLCALS_PLATFORM_X86_SSE -DLCALS_COMPILER_GNU " - cxx_compile += "-Ofast -msse4.1 -finline-functions" - " -finline-limit=10000 -std=c++11 " + cxx_compile += ( + "-Ofast -msse4.1 -finline-functions" " -finline-limit=10000 -std=c++11 " + ) elif microarch == "avx" and arch == "x86": cxxflags += "-DLCALS_PLATFORM_X86_AVX -DLCALS_COMPILER_GNU " - cxx_compile += "-Ofast -mavx -finline-functions" - " -finline-limit=10000 -std=c++11" + cxx_compile += "-Ofast -mavx -finline-functions" " -finline-limit=10000 -std=c++11" elif arch == "aarch64": cxxflags += "-DLCALS_COMPILER_GNU " - cxx_compile += "-Ofast -finline-functions" - " -finline-limit=10000 -std=c++11" + cxx_compile += "-Ofast -finline-functions" " -finline-limit=10000 -std=c++11" cxxflags += self.compiler.openmp_flag targets.append("LCALS_ARCH=") diff --git a/var/spack/repos/builtin/packages/lcio/package.py b/var/spack/repos/builtin/packages/lcio/package.py index 7d4f4b4fec805e..babd9ffef1909b 100644 --- a/var/spack/repos/builtin/packages/lcio/package.py +++ b/var/spack/repos/builtin/packages/lcio/package.py @@ -20,6 +20,8 @@ class Lcio(CMakePackage): license("BSD-3-Clause") version("master", branch="master") + version("2.22.5", sha256="a756521a2419f8d25d4a4f1bab0008e16c9947020d015f2f6ce457ab0a0429bf") + version("2.22.4", sha256="5d60eeb4df8611059f4bc839ac098f5d7e3608a662591e9cbae48aed07995514") version("2.22.3", sha256="5b9715786c5e953f8854881c5d0c4a48030a5491f1701232b82e960ac7980162") version("2.22.2", sha256="e5ad9690af85160ef52dd407fc0995451b4293f3aee415a8ea8a950de63d87a1") version("2.22.1", sha256="4bc3d2c83af7b1c65d6736dd14ee82f41af7ce9bfc7cfe779c5f47417e8dc326") @@ -46,7 +48,8 @@ class Lcio(CMakePackage): version("2.13.2", sha256="9f153ba13e56ee16795378f9192678d40df1faca51d00aaa8fb80547bfecb8d8") version("2.13.1", sha256="aa572e2ba38c0cadd6a92fa933c3ed97e21d016c7982578d3f293901169f4ec0") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant( "cxxstd", diff --git a/var/spack/repos/builtin/packages/legion/package.py b/var/spack/repos/builtin/packages/legion/package.py index dbd636ff76819b..ff3227918f979c 100644 --- a/var/spack/repos/builtin/packages/legion/package.py +++ b/var/spack/repos/builtin/packages/legion/package.py @@ -406,7 +406,7 @@ def cmake_args(self): if spec.satisfies("+kokkos"): # default is off. options.append("-DLegion_USE_Kokkos=ON") - os.environ["KOKKOS_CXX_COMPILER"] = spec["kokkos"].kokkos_cxx + os.environ["KOKKOS_CXX_COMPILER"] = self["kokkos"].kokkos_cxx if spec.satisfies("+cuda+cuda_unsupported_compiler ^kokkos%clang +cuda"): # Keep CMake CUDA compiler detection happy options.append( diff --git a/var/spack/repos/builtin/packages/leptonica/package.py b/var/spack/repos/builtin/packages/leptonica/package.py index 5de81895a4fea8..872ee6d00b9ca1 100644 --- a/var/spack/repos/builtin/packages/leptonica/package.py +++ b/var/spack/repos/builtin/packages/leptonica/package.py @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack.package import * @@ -14,6 +16,7 @@ class Leptonica(CMakePackage): license("custom") + version("1.85.0", sha256="c01376bce0379d4ea4bc2ec5d5cbddaa49e2f06f88242619ab8c059e21adf233") version("1.84.1", sha256="ecd7a868403b3963c4e33623595d77f2c87667e2cfdd9b370f87729192061bef") version("1.83.1", sha256="4289d0a4224b614010072253531c0455a33a4d7c7a0017fe7825ed382290c0da") version("1.81.0", sha256="70ebc04ff8b9684205bd1d01843c635a8521255b74813bf7cce9a33368f7952c") @@ -36,3 +39,9 @@ def cmake_args(self): args = [self.define("BUILD_SHARED_LIBS", "ON")] return args + + @run_after("install") + def pkgconfig_fixup(self): + with working_dir(self.prefix.lib.pkgconfig): + if not os.path.exists("lept.pc"): + symlink(f"lept_{self.spec.variants['build_type'].value}.pc", "lept.pc") diff --git a/var/spack/repos/builtin/packages/lhapdf/package.py b/var/spack/repos/builtin/packages/lhapdf/package.py index 52667f314e4e86..df696997bc73bc 100644 --- a/var/spack/repos/builtin/packages/lhapdf/package.py +++ b/var/spack/repos/builtin/packages/lhapdf/package.py @@ -22,6 +22,7 @@ class Lhapdf(AutotoolsPackage): license("GPL-3.0-or-later") + version("6.5.5", sha256="d20d8fb71936403274caec5bd584c891592b96c6319175df51d9bb69db869bd8") version("6.5.4", sha256="ace8913781044ad542e378697fcd95a8535d510818bb74a6665f9fd2b132ac0f") version("6.5.3", sha256="90fe7254d5a48a9b2d424fcbac1bf9708b0e54690efec4c78e9ad28b9203bfcd") version("6.5.2", sha256="23972ec46289c82a63df60b55b62f219418b4d80f94b8d570feb2b5e48014054") @@ -30,8 +31,9 @@ class Lhapdf(AutotoolsPackage): version("6.3.0", sha256="864468439c7662bbceed6c61c7132682ec83381a23c9c9920502fdd7329dd816") version("6.2.3", sha256="37200a1ab70247250a141dfed7419d178f9a83bd23a4f8a38e203d4e27b41308") - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") variant("python", default=True, description="Build python bindings") @@ -40,6 +42,8 @@ class Lhapdf(AutotoolsPackage): depends_on("libtool", type="build") depends_on("m4", type="build") + depends_on("yaml-cpp", when="@6.5.5:") + extends("python", when="+python") depends_on("py-cython", type="build", when="+python") depends_on("py-setuptools", type="build", when="+python") @@ -57,6 +61,9 @@ def setup_build_environment(self, env): def configure_args(self): args = ["FCFLAGS=-O3", "CFLAGS=-O3", "CXXFLAGS=-O3"] + if self.spec.satisfies("@6.5.5:"): + args.append(f"--with-yaml-cpp={self.spec['yaml-cpp'].prefix}") + if self.spec.satisfies("+python"): args.append( "LIBS=-L" diff --git a/var/spack/repos/builtin/packages/libcatalyst/package.py b/var/spack/repos/builtin/packages/libcatalyst/package.py index 2de2e6d2c82d58..2b32d8c9849cbe 100644 --- a/var/spack/repos/builtin/packages/libcatalyst/package.py +++ b/var/spack/repos/builtin/packages/libcatalyst/package.py @@ -4,8 +4,6 @@ import subprocess -import llnl.util.tty as tty - from spack.package import * diff --git a/var/spack/repos/builtin/packages/libdrm/package.py b/var/spack/repos/builtin/packages/libdrm/package.py index c7e1d59ac51e05..c0f61dd5b320fe 100644 --- a/var/spack/repos/builtin/packages/libdrm/package.py +++ b/var/spack/repos/builtin/packages/libdrm/package.py @@ -20,6 +20,7 @@ class Libdrm(AutotoolsPackage, MesonPackage): license("MIT") + version("2.4.124", sha256="ac36293f61ca4aafaf4b16a2a7afff312aa4f5c37c9fbd797de9e3c0863ca379") version("2.4.123", sha256="a2b98567a149a74b0f50e91e825f9c0315d86e7be9b74394dae8b298caadb79e") version("2.4.122", sha256="d9f5079b777dffca9300ccc56b10a93588cdfbc9dde2fae111940dfb6292f251") version("2.4.121", sha256="909084a505d7638887f590b70791b3bbd9069c710c948f5d1f1ce6d080cdfcab") diff --git a/var/spack/repos/builtin/packages/libfabric/package.py b/var/spack/repos/builtin/packages/libfabric/package.py index 75013eb08ff878..db26f29bced429 100644 --- a/var/spack/repos/builtin/packages/libfabric/package.py +++ b/var/spack/repos/builtin/packages/libfabric/package.py @@ -160,9 +160,8 @@ def determine_variants(cls, exes, version): variants = [] output = Executable(exe)("--list", output=str, error=os.devnull) # fabrics - fabrics = get_options_from_variant(cls, "fabrics") used_fabrics = [] - for fabric in fabrics: + for fabric in cls.fabrics: match = re.search(r"^%s:.*\n.*version: (\S+)" % fabric, output, re.MULTILINE) if match: used_fabrics.append(fabric) @@ -219,20 +218,3 @@ def configure_args(self): def installcheck(self): fi_info = Executable(self.prefix.bin.fi_info) fi_info() - - -# This code gets all the fabric names from the variants list -# Idea taken from the AutotoolsPackage source. -def get_options_from_variant(self, name): - values = self.variants[name][0].values - explicit_values = [] - if getattr(values, "feature_values", None): - values = values.feature_values - for value in sorted(values): - if hasattr(value, "when"): - if value.when is True: - # Explicitly extract the True value for downstream use - explicit_values.append("{0}".format(value)) - else: - explicit_values.append(value) - return explicit_values diff --git a/var/spack/repos/builtin/packages/libgcrypt/o_flag_munging-1.10.patch b/var/spack/repos/builtin/packages/libgcrypt/o_flag_munging-1.10.patch new file mode 100644 index 00000000000000..50cd9389bb86b4 --- /dev/null +++ b/var/spack/repos/builtin/packages/libgcrypt/o_flag_munging-1.10.patch @@ -0,0 +1,39 @@ +From 7cea256ef1a6017e722bdfd5b7381fa90580d55a Mon Sep 17 00:00:00 2001 +From: "simit.ghane" +Date: Tue, 7 May 2024 14:09:03 +0530 +Subject: [PATCH] fix o_flag_munging + +--- + cipher/Makefile.am | 2 +- + random/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cipher/Makefile.am b/cipher/Makefile.am +index c3d642b2..04bf25e9 100644 +--- a/cipher/Makefile.am ++++ b/cipher/Makefile.am +@@ -153,7 +153,7 @@ gost-s-box: gost-s-box.c + + + if ENABLE_O_FLAG_MUNGING +-o_flag_munging = sed -e 's/-O\([2-9sgz][2-9sgz]*\)/-O1/' -e 's/-Ofast/-O1/g' ++o_flag_munging = sed -e 's/[[:blank:]]-O\([2-9sgz][2-9sgz]*\)/ -O1 /g' -e 's/[[:blank:]]-Ofast/ -O1 /g' + else + o_flag_munging = cat + endif +diff --git a/random/Makefile.am b/random/Makefile.am +index 0c935a05..a42e4306 100644 +--- a/random/Makefile.am ++++ b/random/Makefile.am +@@ -56,7 +56,7 @@ jitterentropy-base.c jitterentropy.h jitterentropy-base-user.h + + # The rndjent module needs to be compiled without optimization. */ + if ENABLE_O_FLAG_MUNGING +-o_flag_munging = sed -e 's/-O\([1-9sgz][1-9sgz]*\)/-O0/g' -e 's/-Ofast/-O0/g' ++o_flag_munging = sed -e 's/[[:blank:]]-O\([1-9sgz][1-9sgz]*\)/ -O0 /g' -e 's/[[:blank:]]-Ofast/ -O0 /g' + else + o_flag_munging = cat + endif +-- +2.43.0 + diff --git a/var/spack/repos/builtin/packages/libgcrypt/o_flag_munging-1.11.patch b/var/spack/repos/builtin/packages/libgcrypt/o_flag_munging-1.11.patch new file mode 100644 index 00000000000000..ea5c1503b58127 --- /dev/null +++ b/var/spack/repos/builtin/packages/libgcrypt/o_flag_munging-1.11.patch @@ -0,0 +1,50 @@ +From 9c11f1e12a6ddbd49b5fd38c94e6a004f8da6e29 Mon Sep 17 00:00:00 2001 +From: "simit.ghane" +Date: Tue, 11 Jun 2024 07:22:28 +0530 +Subject: [PATCH] random:cipher: handle substitution in sed command + +* cipher/Makefile.am (o_flag_munging): Add 'g' flag for first sed +expression. +* random/Makefile.am (o_flag_munging): Likewise. +-- + +It was there earlier and accidentally removed from +Makefile.am of cipher and random + +Signed-off-by: simit.ghane +[jk: add changelog to commit message] +Signed-off-by: Jussi Kivilinna +--- + cipher/Makefile.am | 2 +- + random/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cipher/Makefile.am b/cipher/Makefile.am +index ea9014cc..149c9f21 100644 +--- a/cipher/Makefile.am ++++ b/cipher/Makefile.am +@@ -169,7 +169,7 @@ gost-s-box$(EXEEXT_FOR_BUILD): gost-s-box.c + + + if ENABLE_O_FLAG_MUNGING +-o_flag_munging = sed -e 's/[[:blank:]]-O\([2-9sgz][2-9sgz]*\)/ -O1 /' -e 's/[[:blank:]]-Ofast/ -O1 /g' ++o_flag_munging = sed -e 's/[[:blank:]]-O\([2-9sgz][2-9sgz]*\)/ -O1 /g' -e 's/[[:blank:]]-Ofast/ -O1 /g' + else + o_flag_munging = cat + endif +diff --git a/random/Makefile.am b/random/Makefile.am +index c7100ef8..a42e4306 100644 +--- a/random/Makefile.am ++++ b/random/Makefile.am +@@ -56,7 +56,7 @@ jitterentropy-base.c jitterentropy.h jitterentropy-base-user.h + + # The rndjent module needs to be compiled without optimization. */ + if ENABLE_O_FLAG_MUNGING +-o_flag_munging = sed -e 's/[[:blank:]]-O\([1-9sgz][1-9sgz]*\)/ -O0 /' -e 's/[[:blank:]]-Ofast/ -O0 /g' ++o_flag_munging = sed -e 's/[[:blank:]]-O\([1-9sgz][1-9sgz]*\)/ -O0 /g' -e 's/[[:blank:]]-Ofast/ -O0 /g' + else + o_flag_munging = cat + endif +-- +2.43.0 + diff --git a/var/spack/repos/builtin/packages/libgcrypt/package.py b/var/spack/repos/builtin/packages/libgcrypt/package.py index 17a7b03a7bc35b..980551562ddf55 100644 --- a/var/spack/repos/builtin/packages/libgcrypt/package.py +++ b/var/spack/repos/builtin/packages/libgcrypt/package.py @@ -17,26 +17,26 @@ class Libgcrypt(AutotoolsPackage): version("1.11.0", sha256="09120c9867ce7f2081d6aaa1775386b98c2f2f246135761aae47d81f58685b9c") version("1.10.3", sha256="8b0870897ac5ac67ded568dcfadf45969cfa8a6beb0fd60af2a9eadc2a3272aa") - version("1.10.2", sha256="3b9c02a004b68c256add99701de00b383accccf37177e0d6c58289664cce0c03") - version("1.10.1", sha256="ef14ae546b0084cd84259f61a55e07a38c3b53afc0f546bffcef2f01baffe9de") - version("1.10.0", sha256="6a00f5c05caa4c4acc120c46b63857da0d4ff61dc4b4b03933fa8d46013fae81") - # End of life: 2024-03-31 with default_args(deprecated=True): - version("1.9.4", sha256="ea849c83a72454e3ed4267697e8ca03390aee972ab421e7df69dfe42b65caaf7") - version("1.9.3", sha256="97ebe4f94e2f7e35b752194ce15a0f3c66324e0ff6af26659bbfb5ff2ec328fd") - version("1.9.2", sha256="b2c10d091513b271e47177274607b1ffba3d95b188bbfa8797f948aec9053c5a") - version("1.9.1", sha256="c5a67a8b9b2bd370fb415ed1ee31c7172e5683076493cf4a3678a0fbdf0265d9") - - # End of life: 2024-12-31 (LTS) - version("1.8.9", sha256="2bda4790aa5f0895d3407cf7bf6bd7727fd992f25a45a63d92fef10767fa3769") - version("1.8.7", sha256="03b70f028299561b7034b8966d7dd77ef16ed139c43440925fe8782561974748") - version("1.8.6", sha256="0cba2700617b99fc33864a0c16b1fa7fdf9781d9ed3509f5d767178e5fd7b975") - version("1.8.5", sha256="3b4a2a94cb637eff5bdebbcaf46f4d95c4f25206f459809339cdada0eb577ac3") - version("1.8.4", sha256="f638143a0672628fde0cad745e9b14deb85dffb175709cacc1f4fe24b93f2227") - version("1.8.1", sha256="7a2875f8b1ae0301732e878c0cca2c9664ff09ef71408f085c50e332656a78b3") - - depends_on("c", type="build") # generated + version( + "1.10.2", sha256="3b9c02a004b68c256add99701de00b383accccf37177e0d6c58289664cce0c03" + ) + version( + "1.10.1", sha256="ef14ae546b0084cd84259f61a55e07a38c3b53afc0f546bffcef2f01baffe9de" + ) + version( + "1.10.0", sha256="6a00f5c05caa4c4acc120c46b63857da0d4ff61dc4b4b03933fa8d46013fae81" + ) + # End of life: 2024-12-31 (LTS) + version("1.8.9", sha256="2bda4790aa5f0895d3407cf7bf6bd7727fd992f25a45a63d92fef10767fa3769") + version("1.8.7", sha256="03b70f028299561b7034b8966d7dd77ef16ed139c43440925fe8782561974748") + version("1.8.6", sha256="0cba2700617b99fc33864a0c16b1fa7fdf9781d9ed3509f5d767178e5fd7b975") + version("1.8.5", sha256="3b4a2a94cb637eff5bdebbcaf46f4d95c4f25206f459809339cdada0eb577ac3") + version("1.8.4", sha256="f638143a0672628fde0cad745e9b14deb85dffb175709cacc1f4fe24b93f2227") + version("1.8.1", sha256="7a2875f8b1ae0301732e878c0cca2c9664ff09ef71408f085c50e332656a78b3") + + depends_on("c", type="build") depends_on("libgpg-error@1.25:") depends_on("libgpg-error@1.27:", when="@1.9:") @@ -58,6 +58,9 @@ def flag_handler(self, name, flags): # https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=b42116d6067a5233f72e5598032d4b396bb8eaac patch("conditional_avx512.patch", when="@1.11.0") + patch("o_flag_munging-1.10.patch", when="@1.10") + patch("o_flag_munging-1.11.patch", when="@1.11") + def check(self): # Without this hack, `make check` fails on macOS when SIP is enabled # https://bugs.gnupg.org/gnupg/issue2056 diff --git a/var/spack/repos/builtin/packages/libgpiod/package.py b/var/spack/repos/builtin/packages/libgpiod/package.py new file mode 100644 index 00000000000000..7fa4eef8943892 --- /dev/null +++ b/var/spack/repos/builtin/packages/libgpiod/package.py @@ -0,0 +1,50 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class Libgpiod(AutotoolsPackage): + """C library and tools for interacting with the linux GPIO character device + (gpiod stands for GPIO device)""" + + homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/" + git = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod" + + maintainers("davekeeshan") + + license("LGPL-2.1-or-later") + + version("master", branch="master") + version("2.2.0", sha256="ae35329db7027c740e90c883baf27c26311f0614e6a7b115771b28188b992aec") + version("2.1.3", sha256="8d80ea022ae78122aa525308e7423b83064bff278fcd9cd045b94b4f81f8057d") + version("2.1.2", sha256="b1bdf1e3f75238695f93e442062bafc069170f2bf4f0cd4b8e049ca67131a1f0") + version("2.1.1", sha256="0af43a6089d69f9d075cf67ca2ae5972b9081e38e6b3d46cea37d67e2df6fb9b") + version("2.1.0", sha256="fd6ed4b2c674fe6cc3b481880f6cde1eea79e296e95a139b85401eaaea6de3fc") + version("2.0.2", sha256="3532e1dbaffdc2c5965a761a0750f2691ee49aad273ddbbd93acf6a727b1b65c") + version("2.0.1", sha256="b6eda55356160a8e73906e3d48e959ef81296787d764975b10f257e9660668e9") + version("2.0.0", sha256="62071ac22872d9b936408e4a067d15edcdd61dce864ace8725eacdaefe23b898") + version("1.6.5", sha256="1473d3035b506065393a4569763cf6b5c98e59c8f865326374ebadffa2578f3a") + version("1.6.4", sha256="829d4ac268df07853609d67cfc7f476e9aa736cb2a68a630be99e8fad197be0a") + version("1.6.3", sha256="eb446070be1444fd7d32d32bbca53c2f3bbb0a21193db86198cf6050b7a28441") + + depends_on("c", type="build") # generated + depends_on("cxx", type="build") # generated + + depends_on("autoconf", type="build") + depends_on("autoconf-archive", type="build") + depends_on("automake", type="build") + depends_on("pkgconfig", type="build") + depends_on("libtool", type="build") + + def autoreconf(self, spec, prefix): + Executable("./autogen.sh")() + + def url_for_version(self, version): + url = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-{0}.tar.gz" + if version[2] == 0: + return url.format(version.up_to(1)) + else: + return url.format(version) diff --git a/var/spack/repos/builtin/packages/libice/package.py b/var/spack/repos/builtin/packages/libice/package.py index 29a7c136585a34..47192c7a39ac22 100644 --- a/var/spack/repos/builtin/packages/libice/package.py +++ b/var/spack/repos/builtin/packages/libice/package.py @@ -15,6 +15,7 @@ class Libice(AutotoolsPackage, XorgPackage): maintainers("wdconinc") + version("1.1.2", sha256="1da62f732f8679c20045708a29372b82dff9e7eceee543ed488b845002b3b0ff") version("1.1.1", sha256="04fbd34a11ba08b9df2e3cdb2055c2e3c1c51b3257f683d7fcf42dabcf8e1210") version("1.1.0", sha256="7a735ec530d7a437955747eabac06bbc0b695da77fd1b4d1df3b0a483d823875") version("1.0.10", sha256="1116bc64c772fd127a0d0c0ffa2833479905e3d3d8197740b3abd5f292f22d2d") diff --git a/var/spack/repos/builtin/packages/libmicrohttpd/package.py b/var/spack/repos/builtin/packages/libmicrohttpd/package.py index 0457f9511029ac..3f88b69502943e 100644 --- a/var/spack/repos/builtin/packages/libmicrohttpd/package.py +++ b/var/spack/repos/builtin/packages/libmicrohttpd/package.py @@ -17,6 +17,8 @@ class Libmicrohttpd(AutotoolsPackage): license("LGPL-2.1-or-later") + version("1.0.1", sha256="a89e09fc9b4de34dde19f4fcb4faaa1ce10299b9908db1132bbfa1de47882b94") + version("0.9.77", sha256="9e7023a151120060d2806a6ea4c13ca9933ece4eacfc5c9464d20edddb76b0a0") version("0.9.76", sha256="f0b1547b5a42a6c0f724e8e1c1cb5ce9c4c35fb495e7d780b9930d35011ceb4c") version("0.9.75", sha256="9278907a6f571b391aab9644fd646a5108ed97311ec66f6359cebbedb0a4e3bb") version("0.9.74", sha256="42035d0261373324bfb434018f4ab892514b10253d1af232e41b4cc2c11e650b") @@ -26,7 +28,7 @@ class Libmicrohttpd(AutotoolsPackage): version("0.9.70", sha256="90d0a3d396f96f9bc41eb0f7e8187796049285fabef82604acd4879590977307") version("0.9.50", sha256="d1b6385068abded29b6470e383287aa7705de05ae3c08ad0bf5747ac4dc6ebd7") - depends_on("c", type="build") # generated + depends_on("c", type="build") variant("https", default=False, description="HTTPS support with GnuTLS") diff --git a/var/spack/repos/builtin/packages/libmolgrid/package.py b/var/spack/repos/builtin/packages/libmolgrid/package.py index ba9454b1f36d60..7afee3083a2779 100644 --- a/var/spack/repos/builtin/packages/libmolgrid/package.py +++ b/var/spack/repos/builtin/packages/libmolgrid/package.py @@ -18,6 +18,8 @@ class Libmolgrid(CMakePackage): license("Apache-2.0") + version("0.5.5", sha256="fe038d4c5fe96d73eadbe433cfd13c109446e8fd0af8d8739394966ea57afecd") + version("0.5.4", sha256="2eea846acd6c0d75cefaac3217fcafe56656fc38ba100f8b387e13078cea4ff2") version("0.5.3", sha256="a9f7a62cdeb516bc62a06b324cdd33b095a787df175c6166d74a8d30b6916abb") version("0.5.2", sha256="e732d13a96c2f374d57a73999119bef700172d392c195c751214aa6ac6680c3a") @@ -26,7 +28,8 @@ class Libmolgrid(CMakePackage): depends_on("zlib-api") depends_on("boost +regex +test +program_options +system +filesystem +iostreams +python") depends_on("openbabel@3:~gui~cairo") - depends_on("cuda@11") + depends_on("cuda@11:") + depends_on("cuda@12:", when="@0.5.5:") depends_on("python") depends_on("py-numpy") diff --git a/var/spack/repos/builtin/packages/libpressio-nvcomp/package.py b/var/spack/repos/builtin/packages/libpressio-nvcomp/package.py index 452105201befcb..4f458d9ae9792e 100644 --- a/var/spack/repos/builtin/packages/libpressio-nvcomp/package.py +++ b/var/spack/repos/builtin/packages/libpressio-nvcomp/package.py @@ -33,5 +33,5 @@ class LibpressioNvcomp(CMakePackage, CudaPackage): def cmake_args(self): cuda_arch = self.spec.variants["cuda_arch"].value - args = [("-DCMAKE_CUDA_ARCHITECTURES=%s" % cuda_arch)] + args = ["-DCMAKE_CUDA_ARCHITECTURES=%s" % cuda_arch] return args diff --git a/var/spack/repos/builtin/packages/libpressio/package.py b/var/spack/repos/builtin/packages/libpressio/package.py index c15311fb036c8c..d3337c80a1aa40 100644 --- a/var/spack/repos/builtin/packages/libpressio/package.py +++ b/var/spack/repos/builtin/packages/libpressio/package.py @@ -309,7 +309,7 @@ class Libpressio(CMakePackage, CudaPackage): depends_on("sz3@3.1.8:", when="@0.98.1: +sz3") depends_on("bzip2", when="+bzip2") depends_on("qoz", when="+qoz") - depends_on("cusz@0.6.0:", when="+cusz") + depends_on("cusz@0.9", when="+cusz") extends("python", when="+python") diff --git a/var/spack/repos/builtin/packages/librdkafka/package.py b/var/spack/repos/builtin/packages/librdkafka/package.py index 6bd606f2e60fb8..e53666c6bc15cf 100644 --- a/var/spack/repos/builtin/packages/librdkafka/package.py +++ b/var/spack/repos/builtin/packages/librdkafka/package.py @@ -14,6 +14,8 @@ class Librdkafka(AutotoolsPackage): license("BSD-2-Clause") + version("2.8.0", sha256="5bd1c46f63265f31c6bfcedcde78703f77d28238eadf23821c2b43fc30be3e25") + version("2.6.1", sha256="0ddf205ad8d36af0bc72a2fec20639ea02e1d583e353163bf7f4683d949e901b") version("2.6.0", sha256="abe0212ecd3e7ed3c4818a4f2baf7bf916e845e902bb15ae48834ca2d36ac745") version("2.5.3", sha256="eaa1213fdddf9c43e28834d9a832d9dd732377d35121e42f875966305f52b8ff") version("2.2.0", sha256="af9a820cbecbc64115629471df7c7cecd40403b6c34bfdbb9223152677a47226") diff --git a/var/spack/repos/builtin/packages/libslirp/package.py b/var/spack/repos/builtin/packages/libslirp/package.py index b94bd835729fb7..6881439c073417 100644 --- a/var/spack/repos/builtin/packages/libslirp/package.py +++ b/var/spack/repos/builtin/packages/libslirp/package.py @@ -14,6 +14,7 @@ class Libslirp(MesonPackage): license("BSD-3-Clause") + version("4.8.0", sha256="2a98852e65666db313481943e7a1997abff0183bd9bea80caec1b5da89fda28c") version("4.7.0", sha256="9398f0ec5a581d4e1cd6856b88ae83927e458d643788c3391a39e61b75db3d3b") version("4.6.1", sha256="69ad4df0123742a29cc783b35de34771ed74d085482470df6313b6abeb799b11") diff --git a/var/spack/repos/builtin/packages/libsm/package.py b/var/spack/repos/builtin/packages/libsm/package.py index bbbc425277cbf6..b61f952269e0bd 100644 --- a/var/spack/repos/builtin/packages/libsm/package.py +++ b/var/spack/repos/builtin/packages/libsm/package.py @@ -15,6 +15,7 @@ class Libsm(AutotoolsPackage, XorgPackage): maintainers("wdconinc") + version("1.2.5", sha256="a11c3d23b60dce0c13256a8ce9478c1ea330719c0747b5adfbce60571198fa57") version("1.2.4", sha256="51464ce1abce323d5b6707ceecf8468617106e1a8a98522f8342db06fd024c15") version("1.2.3", sha256="1e92408417cb6c6c477a8a6104291001a40b3bb56a4a60608fdd9cd2c5a0f320") version("1.2.2", sha256="14bb7c669ce2b8ff712fbdbf48120e3742a77edcd5e025d6b3325ed30cf120f4") diff --git a/var/spack/repos/builtin/packages/libsmeagol/package.py b/var/spack/repos/builtin/packages/libsmeagol/package.py new file mode 100644 index 00000000000000..09fc1ffc258c46 --- /dev/null +++ b/var/spack/repos/builtin/packages/libsmeagol/package.py @@ -0,0 +1,66 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Libsmeagol(MakefilePackage): + """Non-equilibrium Green's function (NEGS) code.""" + + homepage = "https://github.com/StefanoSanvitoGroup/libsmeagol" + git = "https://github.com/StefanoSanvitoGroup/libsmeagol.git" + + maintainers("RMeli") + + license("GPL-2.0-or-later", checked_by="RMeli") + + version("main", branch="main") + version("1.2", commit="fefed1bb4fceca584c3014debb169e8ed4ce1289") + + depends_on("mpi") + depends_on("blas") + + unsupported_compilers = ( + "aocc", + "apple_clang", + "cce", + "clang", + "fj", + "msvc", + "nag", + "nvhpc", + "oneapi", + ) + for uc in unsupported_compilers: + conflicts(f"%{uc}") + + @property + def build_targets(self): + spec = self.spec + + if spec.satisfies("%gcc"): + fcflags = ( + "-DMPI -fopenmp -march=native -O3 -g -std=gnu -fallow-argument-mismatch " + "-fexternal-blas -fblas-matmul-limit=0 -fno-omit-frame-pointer -funroll-loops" + ) + fixedform = "-ffixed-form" + freeform = "-ffree-form -ffree-line-length-none" + elif spec.satisfies("%intel"): + fcflags = "-DMPI -qopenmp -xHost -O2 -g -fno-moit-frame-pointer" + fixedform = "-fixed" + freeform = "-free" + else: + raise InstallError("Unsupported compiler.") + + return [ + f"FC={spec['mpi'].mpifc}", + f"FCFLAGS={fcflags} -fPIC", + f"FCFLAGS_FIXEDFORM={fixedform}", + f"FCFLAGS_FREEFORM={freeform}", + ] + + def install(self, spec, prefix): + mkdir(prefix.bin) + install_tree("lib", prefix.lib) + install_tree("obj", prefix.include) diff --git a/var/spack/repos/builtin/packages/libsodium/package.py b/var/spack/repos/builtin/packages/libsodium/package.py index 153577b944132e..42a41c89a04523 100644 --- a/var/spack/repos/builtin/packages/libsodium/package.py +++ b/var/spack/repos/builtin/packages/libsodium/package.py @@ -4,8 +4,6 @@ import os -import llnl.util.tty as tty - from spack.package import * diff --git a/var/spack/repos/builtin/packages/liburing/package.py b/var/spack/repos/builtin/packages/liburing/package.py index a37551cfc47d12..f096e9d8924624 100644 --- a/var/spack/repos/builtin/packages/liburing/package.py +++ b/var/spack/repos/builtin/packages/liburing/package.py @@ -2,27 +2,44 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - from spack.package import * class Liburing(AutotoolsPackage): - """This is the io_uring library, liburing. liburing provides helpers - to setup and teardown io_uring instances, and also a simplified interface - for applications that don't need (or want) to deal with the full kernel - side implementation.""" + """Linux-native io_uring I/O access library. + + liburing provides helpers to setup and teardown io_uring instances, + and a simplified interface for applications that don't need (or want) + to deal with the full kernel side implementation. It enables high-performance + asynchronous I/O operations on Linux systems supporting the io_uring + interface. + """ homepage = "https://github.com/axboe/liburing" url = "https://github.com/axboe/liburing/archive/refs/tags/liburing-2.3.tar.gz" git = "https://github.com/axboe/liburing.git" + maintainers("alecbcs") + license("LGPL-2.1-or-later OR MIT") + sanity_check_is_file = ["include/liburing.h", "lib/liburing.so"] + sanity_check_is_dir = ["include", "lib"] + version("master", branch="master") + version("2.9", sha256="897b1153b55543e8b92a5a3eb9b906537a5fedcf8afaf241f8b8787940c79f8d") + version("2.4", sha256="2398ec82d967a6f903f3ae1fd4541c754472d3a85a584dc78c5da2fabc90706b") version("2.3", sha256="60b367dbdc6f2b0418a6e0cd203ee0049d9d629a36706fcf91dfb9428bae23c8") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") # only for tests + + requires("platform=linux", msg="liburing is only supported on Linux.") - conflicts("platform=darwin", msg="Only supported on linux") - conflicts("platform=windows", msg="Only supported on linux") + @property + def build_targets(self): + if self.spec.satisfies("@2.7:"): + # avoid examples and test + return ["library"] + else: + return ["all"] diff --git a/var/spack/repos/builtin/packages/libxau/package.py b/var/spack/repos/builtin/packages/libxau/package.py index a5b0916c5ed70d..9145b01a8187c1 100644 --- a/var/spack/repos/builtin/packages/libxau/package.py +++ b/var/spack/repos/builtin/packages/libxau/package.py @@ -5,7 +5,7 @@ from spack.package import * -class Libxau(AutotoolsPackage, XorgPackage): +class Libxau(AutotoolsPackage, MesonPackage, XorgPackage): """The libXau package contains a library implementing the X11 Authorization Protocol. This is useful for restricting client access to the display.""" @@ -17,6 +17,9 @@ class Libxau(AutotoolsPackage, XorgPackage): maintainers("wdconinc") + build_system("autotools", conditional("meson", when="@1.0.12:"), default="autotools") + + version("1.0.12", sha256="2402dd938da4d0a332349ab3d3586606175e19cb32cb9fe013c19f1dc922dcee") version("1.0.11", sha256="3a321aaceb803577a4776a5efe78836eb095a9e44bbc7a465d29463e1a14f189") version("1.0.10", sha256="51a54da42475d4572a0b59979ec107c27dacf6c687c2b7b04e5cf989a7c7e60c") version("1.0.9", sha256="1f123d8304b082ad63a9e89376400a3b1d4c29e67e3ea07b3f659cccca690eea") diff --git a/var/spack/repos/builtin/packages/libxc/package.py b/var/spack/repos/builtin/packages/libxc/package.py index d9d63a07bb1d69..4c6e66b5dd74e7 100644 --- a/var/spack/repos/builtin/packages/libxc/package.py +++ b/var/spack/repos/builtin/packages/libxc/package.py @@ -2,10 +2,11 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.build_systems import autotools, cmake from spack.package import * -class Libxc(AutotoolsPackage, CudaPackage): +class Libxc(AutotoolsPackage, CudaPackage, CMakePackage): """Libxc is a library of exchange-correlation functionals for density-functional theory.""" @@ -14,6 +15,10 @@ class Libxc(AutotoolsPackage, CudaPackage): license("MPL-2.0-no-copyleft-exception") + maintainers("RMeli") + + build_system(conditional("cmake", when="@7.0.0:"), "autotools", default="cmake") + version("7.0.0", sha256="8d4e343041c9cd869833822f57744872076ae709a613c118d70605539fb13a77") version("6.2.2", sha256="d1b65ef74615a1e539d87a0e6662f04baf3a2316706b4e2e686da3193b26b20f") version("6.2.1", sha256="da96fc4f6e4221734986f49758b410ffe1d406efd3538761062a4af57a2bd272") @@ -34,12 +39,21 @@ class Libxc(AutotoolsPackage, CudaPackage): version("2.2.2", sha256="6ffaad40505dbe8f155049448554b54ea31d31babf74ccf6b7935bfe55eeafd8") version("2.2.1", sha256="c8577ba1ddd5c28fd0aa7c579ae65ab990eb7cb51ecf9f8175f9251f6deb9a06") - depends_on("c", type="build") # generated - depends_on("fortran", type="build") # generated - variant("shared", default=True, description="Build shared libraries") variant("kxc", default=False, when="@5:", description="Build with third derivatives") variant("lxc", default=False, when="@5:", description="Build with fourth derivatives") + variant( + "fortran", + default=True, + description="Build Fortran 2003 interface", + when="build_system=cmake", + ) + + generator("ninja") + + depends_on("c", type="build") + depends_on("fortran", type="build", when="build_system=autotools") + depends_on("fortran", type="build", when="build_system=cmake +fortran") conflicts("+shared +cuda", msg="Only ~shared supported with +cuda") conflicts("+cuda", when="@:4", msg="CUDA support only in libxc 5.0.0 and above") @@ -87,6 +101,9 @@ def libs(self): return find_libraries(libraries, root=self.prefix, shared=shared, recursive=True) + +class AutotoolsBuilder(autotools.AutotoolsBuilder): + def setup_build_environment(self, env): # microarchitecture-specific optimization flags should be controlled # by Spack, otherwise we may end up with contradictory or invalid flags @@ -94,7 +111,7 @@ def setup_build_environment(self, env): # https://gitlab.com/libxc/libxc/-/issues/430 (configure script does not ensure C99) # TODO: Switch to cmake since this is better supported - env.append_flags("CFLAGS", self.compiler.c99_flag) + env.append_flags("CFLAGS", self.pkg.compiler.c99_flag) if self.spec.satisfies("%intel"): if which("xiar"): env.set("AR", "xiar") @@ -137,3 +154,18 @@ def check(self): # libxc provides a testsuite, but many tests fail # http://www.tddft.org/pipermail/libxc/2013-February/000032.html pass + + +class CMakeBuilder(cmake.CMakeBuilder): + + def cmake_args(self): + spec = self.spec + args = [ + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("ENABLE_FORTRAN", "fortran"), + self.define_from_variant("ENABLE_CUDA", "cuda"), + self.define("DISABLE_KXC", spec.satisfies("~kxc")), + self.define("DISABLE_LXC", spec.satisfies("~lxc")), + self.define("BUILD_TESTING", self.pkg.run_tests), + ] + return args diff --git a/var/spack/repos/builtin/packages/libxcursor/package.py b/var/spack/repos/builtin/packages/libxcursor/package.py index 5756b41ac4ab1c..c1637948016c7d 100644 --- a/var/spack/repos/builtin/packages/libxcursor/package.py +++ b/var/spack/repos/builtin/packages/libxcursor/package.py @@ -15,6 +15,7 @@ class Libxcursor(AutotoolsPackage, XorgPackage): maintainers("wdconinc") + version("1.2.3", sha256="74e72da27e61cc2cfd2e267c14f500ea47775850048ee0b00362a55c9b60ee9b") version("1.2.2", sha256="98c3a30a3f85274c167d1ac5419d681ce41f14e27bfa5fe3003c8172cd8af104") version("1.2.1", sha256="77f96b9ad0a3c422cfa826afabaf1e02b9bfbfc8908c5fa1a45094faad074b98") version("1.1.14", sha256="be0954faf274969ffa6d95b9606b9c0cfee28c13b6fc014f15606a0c8b05c17b") diff --git a/var/spack/repos/builtin/packages/libxfont2/package.py b/var/spack/repos/builtin/packages/libxfont2/package.py index e8618c354ccc0f..75c5f70063bff2 100644 --- a/var/spack/repos/builtin/packages/libxfont2/package.py +++ b/var/spack/repos/builtin/packages/libxfont2/package.py @@ -18,6 +18,9 @@ class Libxfont2(AutotoolsPackage, XorgPackage): license("MIT") + maintainers("wdconinc") + + version("2.0.7", sha256="90b331c2fd2d0420767c4652e007d054c97a3f03a88c55e3b986bd3acfd7e338") version("2.0.6", sha256="a944df7b6837c8fa2067f6a5fc25d89b0acc4011cd0bc085106a03557fb502fc") version("2.0.1", sha256="381b6b385a69343df48a082523c856aed9042fbbc8ee0a6342fb502e4321230a") diff --git a/var/spack/repos/builtin/packages/libxshmfence/package.py b/var/spack/repos/builtin/packages/libxshmfence/package.py index 11f3f98fff0409..2e7e4f7cb8007f 100644 --- a/var/spack/repos/builtin/packages/libxshmfence/package.py +++ b/var/spack/repos/builtin/packages/libxshmfence/package.py @@ -17,6 +17,9 @@ class Libxshmfence(AutotoolsPackage, XorgPackage): license("MIT") + maintainers("wdconinc") + + version("1.3.3", sha256="d4a4df096aba96fea02c029ee3a44e11a47eb7f7213c1a729be83e85ec3fde10") version("1.3.2", sha256="870df257bc40b126d91b5a8f1da6ca8a524555268c50b59c0acd1a27f361606f") version("1.3.1", sha256="1129f95147f7bfe6052988a087f1b7cb7122283d2c47a7dbf7135ce0df69b4f8") version("1.3", sha256="b884300d26a14961a076fbebc762a39831cb75f92bed5ccf9836345b459220c7") diff --git a/var/spack/repos/builtin/packages/libxsmm/package.py b/var/spack/repos/builtin/packages/libxsmm/package.py index a2b5b672efea58..e7762ecd70853d 100644 --- a/var/spack/repos/builtin/packages/libxsmm/package.py +++ b/var/spack/repos/builtin/packages/libxsmm/package.py @@ -13,9 +13,9 @@ class Libxsmm(MakefilePackage): and sparse matrix operations, and deep learning primitives.""" - homepage = "https://github.com/hfp/libxsmm" - url = "https://github.com/hfp/libxsmm/archive/1.17.tar.gz" - git = "https://github.com/hfp/libxsmm.git" + homepage = "https://github.com/libxsmm/libxsmm" + url = "https://github.com/libxsmm/libxsmm/archive/1.17.tar.gz" + git = "https://github.com/libxsmm/libxsmm.git" maintainers("hfp") diff --git a/var/spack/repos/builtin/packages/libxt/package.py b/var/spack/repos/builtin/packages/libxt/package.py index 9b6f306374ce3b..3c7c4d06a036e7 100644 --- a/var/spack/repos/builtin/packages/libxt/package.py +++ b/var/spack/repos/builtin/packages/libxt/package.py @@ -15,6 +15,7 @@ class Libxt(AutotoolsPackage, XorgPackage): maintainers("wdconinc") + version("1.3.1", sha256="cf2212189869adb94ffd58c7d9a545a369b83d2274930bfbe148da354030b355") version("1.3.0", sha256="de4a80c4cc7785b9620e572de71026805f68e85a2bf16c386009ef0e50be3f77") version("1.2.1", sha256="6da1bfa9dd0ed87430a5ce95b129485086394df308998ebe34d98e378e3dfb33") version("1.2.0", sha256="d4bee88898fc5e1dc470e361430c72fbc529b9cdbbb6c0ed3affea3a39f97d8d") diff --git a/var/spack/repos/builtin/packages/libxtst/package.py b/var/spack/repos/builtin/packages/libxtst/package.py index 4d86026822be94..09343f20c2b51a 100644 --- a/var/spack/repos/builtin/packages/libxtst/package.py +++ b/var/spack/repos/builtin/packages/libxtst/package.py @@ -24,6 +24,7 @@ class Libxtst(AutotoolsPackage, XorgPackage): maintainers("wdconinc") + version("1.2.5", sha256="244ba6e1c5ffa44f1ba251affdfa984d55d99c94bb925a342657e5e7aaf6d39c") version("1.2.4", sha256="01366506aeb033f6dffca5326af85f670746b0cabbfd092aabefb046cf48c445") version("1.2.3", sha256="a0c83acce02d4923018c744662cb28eb0dbbc33b4adc027726879ccf68fbc2c2") version("1.2.2", sha256="221838960c7b9058cd6795c1c3ee8e25bae1c68106be314bc3036a4f26be0e6c") diff --git a/var/spack/repos/builtin/packages/libxv/package.py b/var/spack/repos/builtin/packages/libxv/package.py index 0e50609f112689..a19efc28b7ed80 100644 --- a/var/spack/repos/builtin/packages/libxv/package.py +++ b/var/spack/repos/builtin/packages/libxv/package.py @@ -16,6 +16,7 @@ class Libxv(AutotoolsPackage, XorgPackage): maintainers("wdconinc") + version("1.0.13", sha256="9a0c31392b8968a4f29a0ad9c51e7ce225bcec3c4cbab9f2a241f921776b2991") version("1.0.12", sha256="ce706619a970a580a0e35e9b5c98bdd2af243ac6494c65f44608a89a86100126") version("1.0.11", sha256="c4112532889b210e21cf05f46f0f2f8354ff7e1b58061e12d7a76c95c0d47bb1") version("1.0.10", sha256="89a664928b625558268de81c633e300948b3752b0593453d7815f8775bab5293") diff --git a/var/spack/repos/builtin/packages/libxxf86vm/package.py b/var/spack/repos/builtin/packages/libxxf86vm/package.py index aebb759212fdd0..8124ed3b513563 100644 --- a/var/spack/repos/builtin/packages/libxxf86vm/package.py +++ b/var/spack/repos/builtin/packages/libxxf86vm/package.py @@ -15,6 +15,7 @@ class Libxxf86vm(AutotoolsPackage, XorgPackage): maintainers("wdconinc") + version("1.1.6", sha256="d2b4b1ec4eb833efca9981f19ed1078a8a73eed0bb3ca5563b64527ae8021e52") version("1.1.5", sha256="f3f1c29fef8accb0adbd854900c03c6c42f1804f2bc1e4f3ad7b2e1f3b878128") version("1.1.4", sha256="5108553c378a25688dcb57dca383664c36e293d60b1505815f67980ba9318a99") diff --git a/var/spack/repos/builtin/packages/likwid/package.py b/var/spack/repos/builtin/packages/likwid/package.py index a673529786136c..b9b7b45a971c34 100644 --- a/var/spack/repos/builtin/packages/likwid/package.py +++ b/var/spack/repos/builtin/packages/likwid/package.py @@ -5,8 +5,6 @@ import glob import os -import llnl.util.tty as tty - import spack.tengine from spack.package import * @@ -262,8 +260,8 @@ def install(self, spec, prefix): @run_after("install") def caveats(self): if self.spec.satisfies("accessmode=accessdaemon"): - perm_script = "spack_perms_fix.sh" - perm_script_path = join_path(self.spec.prefix, perm_script) + perm_script = "spack_likwid_fix_perms.sh.j2" + perm_script_path = join_path(self.spec.prefix.bin, perm_script) daemons = glob.glob(join_path(self.spec.prefix, "sbin", "*")) with open(perm_script_path, "w") as f: env = spack.tengine.make_environment(dirs=self.package_dir) diff --git a/var/spack/repos/builtin/packages/likwid/spack_perms_fix.sh.j2 b/var/spack/repos/builtin/packages/likwid/spack_likwid_fix_perms.sh.j2 similarity index 53% rename from var/spack/repos/builtin/packages/likwid/spack_perms_fix.sh.j2 rename to var/spack/repos/builtin/packages/likwid/spack_likwid_fix_perms.sh.j2 index a3413d4d29274f..4db0f75d0aefdd 100755 --- a/var/spack/repos/builtin/packages/likwid/spack_perms_fix.sh.j2 +++ b/var/spack/repos/builtin/packages/likwid/spack_likwid_fix_perms.sh.j2 @@ -1,11 +1,9 @@ #!/bin/sh -eu {% for cf in chowns %} -chown root:root {{ prefix }}/{{ cf }} +chown root:root "{{ cf }}" {% endfor %} {% for sf in chmods %} -chmod 4755 {{ prefix }}/{{ sf }} +chmod 4755 "{{ sf }}" {% endfor %} - -# end diff --git a/var/spack/repos/builtin/packages/linux-perf/package.py b/var/spack/repos/builtin/packages/linux-perf/package.py index 8fceb6e11d34d7..71e5a08d7f8f8c 100644 --- a/var/spack/repos/builtin/packages/linux-perf/package.py +++ b/var/spack/repos/builtin/packages/linux-perf/package.py @@ -2,13 +2,11 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import re import shutil from textwrap import dedent -import llnl.util.tty as tty - from spack.package import * diff --git a/var/spack/repos/builtin/packages/lis/package.py b/var/spack/repos/builtin/packages/lis/package.py index af86407287af25..aa5e394aa9dd2e 100644 --- a/var/spack/repos/builtin/packages/lis/package.py +++ b/var/spack/repos/builtin/packages/lis/package.py @@ -15,12 +15,22 @@ class Lis(AutotoolsPackage): homepage = "https://www.ssisc.org/lis/index.en.html" url = "https://www.ssisc.org/lis/dl/lis-2.0.27.zip" + version("2.1.7", sha256="cbcfca1dcd514801ef530ea5d158311985108ab6a9f300d31dcbd01d2175b4b2") version("2.1.6", sha256="7e2c4c5a1b96d2aa21fe799c073d7ca3cd5be79f350593d83102e37ca9780821") version("2.1.5", sha256="4b78335cf85c327976536b8ac584f258dc9ae085e91b5d4a40879422b3e71543") version("2.1.4", sha256="d94d634db49fff2368bb615225ee4fdde919c63b7a9bc1f81f7d166a8c105f92") version("2.1.3", sha256="2ca0682198c2cdb6beb7866bd2b25071dc8964c6f76d8962477f848f39ff57ea") + version("2.1.2", sha256="673f01cb06446872f5a888e144b0d325d19444fea1e04c58e2ba8221ef645d46") version("2.1.1", sha256="e1b227fb9c88be4d897be4211198e1e9e8258eb75127848d35b67a0182bf4538") version("2.1.0", sha256="630a1341824fbeef7fdfb82413bfdeb7d3df14e77616ba88159fce1150cf006c") + version("2.0.35", sha256="3b2d583f482b874b04a03cbfd7b432f4e558ad56023ccffc68bb5acdcdcafda7") + version("2.0.34", sha256="f216593d92a93955d257857f863507333b48e24ad94fe614f0afb35c8edfda72") + version("2.0.33", sha256="9c3a9294d640652dbe278bbac673ff7855a3785253b81cc2724d06b58a0b2285") + version("2.0.32", sha256="93c515e1b38c9263d464f1c86773253a437fe973643618a6099fe0829e5c30d4") + version("2.0.31", sha256="f04950e761e3def7104d94172c5357bffd21918e8f381ad4e0dcb6d596334031") + version("2.0.30", sha256="fefe1ba48aa5867cde3c07ea4009fb333baa863b535a1f29bbdf99de42f49f67") + version("2.0.29", sha256="aecf08f79595b3f1a888f153615f099fc2fcf6b90955ffbaba9cd01892d9614d") + version("2.0.28", sha256="d2d8739ab11b605a62fca08fd56334c45ab10e7796a44f8243e1a1e3006fe36a") version("2.0.27", sha256="85f32f4abbc94d1b40b22c10b915170271b19822b6aa6939b1cb295f6e455237") variant("mpi", default=False, description="Build with MPI library") diff --git a/var/spack/repos/builtin/packages/llvm-amdgpu/package.py b/var/spack/repos/builtin/packages/llvm-amdgpu/package.py index e558b6f0bf8ef4..1b8877022958cc 100644 --- a/var/spack/repos/builtin/packages/llvm-amdgpu/package.py +++ b/var/spack/repos/builtin/packages/llvm-amdgpu/package.py @@ -24,6 +24,8 @@ class LlvmAmdgpu(CMakePackage, CompilerPackage): license("Apache-2.0") version("master", branch="amd-stg-open") + version("6.3.2", sha256="1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827") + version("6.3.1", sha256="e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c") version("6.3.0", sha256="79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c") version("6.2.4", sha256="7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528") version("6.2.1", sha256="4840f109d8f267c28597e936c869c358de56b8ad6c3ed4881387cf531846e5a7") @@ -159,6 +161,8 @@ class LlvmAmdgpu(CMakePackage, CompilerPackage): when="@master +rocm-device-libs", ) for d_version, d_shasum in [ + ("6.3.2", "aaecaa7206b6fa1d5d7b8f7c1f7c5057a944327ba4779448980d7e7c7122b074"), + ("6.3.1", "547ceeeda9a41cdffa21e57809dc5834f94938a0a2809c283aebcbcf01901df0"), ("6.3.0", "8fd6bcd6a5afd0ae5a59e33b786a525f575183d38c34049c2dab6b9270a1ca3b"), ("6.2.4", "b7aa0055855398d1228c39a6f4feb7d7be921af4f43d82855faf0b531394bb9b"), ("6.2.1", "dbe477b323df636f5e3221471780da156c938ec00dda4b50639aa8d7fb9248f4"), diff --git a/var/spack/repos/builtin/packages/llvm-doe/package.py b/var/spack/repos/builtin/packages/llvm-doe/package.py index 602f41d38b55cb..37d22acd239e79 100644 --- a/var/spack/repos/builtin/packages/llvm-doe/package.py +++ b/var/spack/repos/builtin/packages/llvm-doe/package.py @@ -2,12 +2,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import re import sys -import llnl.util.tty as tty - from spack.build_systems.cmake import get_cmake_prefix_path from spack.package import * diff --git a/var/spack/repos/builtin/packages/llvm/detection_test.yaml b/var/spack/repos/builtin/packages/llvm/detection_test.yaml index 860b3061d26d32..a189b5856802cc 100644 --- a/var/spack/repos/builtin/packages/llvm/detection_test.yaml +++ b/var/spack/repos/builtin/packages/llvm/detection_test.yaml @@ -16,6 +16,58 @@ paths: c: ".*/bin/clang-3.9$" cxx: ".*/bin/clang[+][+]-3.9$" +# flang-new detection: flang-new generates slightly-different output than clang +- layout: + - executables: + - "bin/clang" + - "bin/clang++" + script: | + echo "clang version 19.1.6 (https://github.com/spack/spack.git 8d3a733b7798b6e33c371518b6dec298c3ebd8b1)" + echo "Target: x86_64-unknown-linux-gnu" + echo "Thread model: posix" + echo "InstalledDir: /path/to/spack/install/llvm/bin" + - executables: + - "bin/flang-new" + script: | + echo "flang-new version 19.1.6 (https://github.com/spack/spack.git 8d3a733b7798b6e33c371518b6dec298c3ebd8b1)" + echo "Target: x86_64-unknown-linux-gnu" + echo "Thread model: posix" + echo "InstalledDir: /path/to/spack/install/llvm/bin" + platforms: ["darwin", "linux"] + results: + - spec: 'llvm@19.1.6 +flang+clang~lld~lldb' + extra_attributes: + compilers: + c: ".*/bin/clang" + cxx: ".*/bin/clang[+][+]" + fortran: ".*/bin/flang-new" + +# flang: like previous test, but the fortran compiler is called "flang" vs. "flang-new" +- layout: + - executables: + - "bin/clang" + - "bin/clang++" + script: | + echo "clang version 20.1.0-rc1 (https://github.com/llvm/llvm-project af7f483a9d801252247b6c72e3763c1f55c5a506)" + echo "Target: x86_64-unknown-linux-gnu" + echo "Thread model: posix" + echo "InstalledDir: /tmp/clang/LLVM-20.1.0-rc1-Linux-X64/bin" + - executables: + - "bin/flang" + script: | + echo "flang version 20.1.0-rc1 (https://github.com/llvm/llvm-project af7f483a9d801252247b6c72e3763c1f55c5a506)" + echo "Target: x86_64-unknown-linux-gnu" + echo "Thread model: posix" + echo "InstalledDir: /tmp/clang/LLVM-20.1.0-rc1-Linux-X64/bin" + platforms: ["darwin", "linux"] + results: + - spec: 'llvm@20.1.0 +flang+clang~lld~lldb' + extra_attributes: + compilers: + c: ".*/bin/clang" + cxx: ".*/bin/clang[+][+]" + fortran: ".*/bin/flang" + # `~` and other weird characters in the version string - layout: - executables: diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index e7854131a29086..b94d1b26091ff8 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -2,11 +2,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import os.path import re import sys -import llnl.util.tty as tty from llnl.util.lang import classproperty import spack.compilers @@ -30,7 +28,7 @@ def filter_detected_exes(cls, prefix, exes_in_prefix): reject = re.compile( r"-(vscode|cpp|cl|ocl|gpu|tidy|rename|scan-deps|format|refactor|offload|" r"check|query|doc|move|extdef|apply|reorder|change-namespace|" - r"include-fixer|import-test|dap|server)" + r"include-fixer|import-test|dap|server|PerfectShuffle)" ) return [x for x in exes_in_prefix if not reject.search(x)] @@ -56,6 +54,11 @@ class Llvm(CMakePackage, CudaPackage, LlvmDetection, CompilerPackage): license("Apache-2.0") version("main", branch="main") + + # Latest stable + version("19.1.7", sha256="59abea1c22e64933fad4de1671a61cdb934098793c7a31b333ff58dc41bff36c") + + # Previous stable series releases version("19.1.6", sha256="f07fdcbb27b2b67aa95e5ddadf45406b33228481c250e65175066d36536a1ee2") version("19.1.5", sha256="e2204b9903cd9d7ee833a2f56a18bef40a33df4793e31cc090906b32cbd8a1f5") version("19.1.4", sha256="010e1fd3cabee8799bd2f8a6fbc68f28207494f315cf9da7057a2820f79fd531") @@ -63,63 +66,142 @@ class Llvm(CMakePackage, CudaPackage, LlvmDetection, CompilerPackage): version("19.1.2", sha256="622cb6c5e95a3bb7e9876c4696a65671f235bd836cfd0c096b272f6c2ada41e7") version("19.1.1", sha256="115dfd98a353d05bffdab3f80db22f159da48aca0124e8c416f437adcd54b77f") version("19.1.0", sha256="0a08341036ca99a106786f50f9c5cb3fbe458b3b74cab6089fd368d0edb2edfe") + + # Final releases of previous versions version("18.1.8", sha256="09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856") - version("18.1.7", sha256="b60df7cbe02cef2523f7357120fb0d46cbb443791cde3a5fb36b82c335c0afc9") - version("18.1.6", sha256="01390edfae5b809e982b530ff9088e674c62b13aa92cb9dc1e067fa2cf501083") - version("18.1.5", sha256="d543309f55ae3f9b422108302b45c40f5696c96862f4bda8f5526955daa54284") - version("18.1.4", sha256="deca5a29e8b1d103ecc4badb3c304aca50d5cac6453364d88ee415dc55699dfb") - version("18.1.3", sha256="fc5a2fd176d73ceb17f4e522f8fe96d8dde23300b8c233476d3609f55d995a7a") - version("18.1.2", sha256="8d686d5ece6f12b09985cb382a3a530dc06bb6e7eb907f57c7f8bf2d868ebb0b") - version("18.1.1", sha256="62439f733311869dbbaf704ce2e02141d2a07092d952fc87ef52d1d636a9b1e4") - version("18.1.0", sha256="eb18f65a68981e94ea1a5aae4f02321b17da9e99f76bfdb983b953f4ba2d3550") version("17.0.6", sha256="81494d32e6f12ea6f73d6d25424dbd2364646011bb8f7e345ca870750aa27de1") - version("17.0.5", sha256="432c1eda3d1c9379cd52a9bee8e0ea6f7b204bff5075895f963fd8e575aa4fb8") - version("17.0.4", sha256="46200b79f52a02fe26d0a43fd856ab6ceff49ab2a0b7c240ac4b700a6ada700c") - version("17.0.3", sha256="1e3d9d04fb5fbd8d0080042ad72c7e2a5c68788b014b186647a604dbbdd625d2") - version("17.0.2", sha256="dcba3eb486973dce45b6edfe618f3f29b703ae7e6ef9df65182fb50fb6fe4235") - version("17.0.1", sha256="d51b10be66c10a6a81f4c594b554ffbf1063ffbadcb810af37d1f88d6e0b49dd") version("16.0.6", sha256="56b2f75fdaa95ad5e477a246d3f0d164964ab066b4619a01836ef08e475ec9d5") - version("16.0.5", sha256="e0fbca476693fcafa125bc71c8535587b6d9950293122b66b262bb4333a03942") - version("16.0.4", sha256="10c3fe1757d2e4f1cd7745dc548ecf687680a71824ec81701c38524c2a0753e2") - version("16.0.3", sha256="0bd71bc687a4e5a250c40afb0decefc50c85178fcce726137b682039de63919b") - version("16.0.2", sha256="97c3c6aafb53c4bb0ed2781a18d6f05e75445e24bb1dc57a32b74f8d710ac19f") - version("16.0.1", sha256="b5a9ff1793b1e2d388a3819bf35797002b1d2e40bb35a10c65605e0ea1435271") - version("16.0.0", sha256="cba969a0782a3a398658d439f047b5e548ea04724f4fbfdbe17cfc946f4cd3ed") version("15.0.7", sha256="42a0088f148edcf6c770dfc780a7273014a9a89b66f357c761b4ca7c8dfa10ba") - version("15.0.6", sha256="4d857d7a180918bdacd09a5910bf9743c9861a1e49cb065a85f7a990f812161d") - version("15.0.5", sha256="c47640269e0251e009ae18a25162df4e20e175885286e21d28c054b084b991a4") - version("15.0.4", sha256="e24b4d3bf7821dcb1c901d1e09096c1f88fb00095c5a6ef893baab4836975e52") - version("15.0.3", sha256="8ac8e4c0982bf236526d737d385db5e1e66543ab217a9355d54159659eae3774") - version("15.0.2", sha256="dc11d35e60ab61792baa607dff080c993b39de23fb93b3d3369ba15b0601c307") - version("15.0.1", sha256="20bccb964e39f604fdc16d1258f94d2053fbdcdab2b2f6d5e20e6095ec403c00") - version("15.0.0", sha256="36d83cd84e1caf2bcfda1669c029e2b949adb9860cff01e7d3246ac2348b11ae") version("14.0.6", sha256="98f15f842700bdb7220a166c8d2739a03a72e775b67031205078f39dd756a055") - version("14.0.5", sha256="a4a57f029cb81f04618e05853f05fc2d21b64353c760977d8e7799bf7218a23a") - version("14.0.4", sha256="1333236f9bee38658762076be4236cb5ebf15ae9b7f2bfce6946b96ae962dc73") - version("14.0.3", sha256="0e1d049b050127ecf6286107e9a4400b0550f841d5d2288b9d31fd32ed0683d5") - version("14.0.2", sha256="ca52232b3451c8e017f00eb882277707c13e30fac1271ec97015f6d0eeb383d1") - version("14.0.1", sha256="c8be00406e872c8a24f8571cf6f5517b73ae707104724b1fd1db2f0af9544019") - version("14.0.0", sha256="87b1a068b370df5b79a892fdb2935922a8efb1fddec4cc506e30fe57b6a1d9c4") version("13.0.1", sha256="09c50d558bd975c41157364421820228df66632802a4a6a7c9c17f86a7340802") - version("13.0.0", sha256="a1131358f1f9f819df73fa6bff505f2c49d176e9eef0a3aedd1fdbce3b4630e8") version("12.0.1", sha256="66b64aa301244975a4aea489f402f205cde2f53dd722dad9e7b77a0459b4c8df") - version("12.0.0", sha256="8e6c99e482bb16a450165176c2d881804976a2d770e0445af4375e78a1fbf19c") version("11.1.0", sha256="53a0719f3f4b0388013cfffd7b10c7d5682eece1929a9553c722348d1f866e79") - version("11.0.1", sha256="9c7ad8e8ec77c5bde8eb4afa105a318fd1ded7dff3747d14f012758719d7171b") - version("11.0.0", sha256="8ad4ddbafac4f2c8f2ea523c2c4196f940e8e16f9e635210537582a48622a5d5") version("10.0.1", sha256="c7ccb735c37b4ec470f66a6c35fbae4f029c0f88038f6977180b1a8ddc255637") - version("10.0.0", sha256="b81c96d2f8f40dc61b14a167513d87c0d813aae0251e06e11ae8a4384ca15451") version("9.0.1", sha256="be7b034641a5fda51ffca7f5d840b1a768737779f75f7c4fd18fe2d37820289a") - version("9.0.0", sha256="7807fac25330e24e9955ca46cd855dd34bbc9cc4fdba8322366206654d1036f2") version("8.0.1", sha256="5b18f6111c7aee7c0933c355877d4abcfe6cb40c1a64178f28821849c725c841") - version("8.0.0", sha256="d81238b4a69e93e29f74ce56f8107cbfcf0c7d7b40510b7879e98cc031e25167") version("7.1.0", sha256="71c93979f20e01f1a1cc839a247945f556fa5e63abf2084e8468b238080fd839") - version("7.0.1", sha256="f17a6cd401e8fd8f811fbfbb36dcb4f455f898c9d03af4044807ad005df9f3c0") version("6.0.1", sha256="aefadceb231f4c195fe6d6cd3b1a010b269c8a22410f339b5a089c2e902aa177") - version("6.0.0", sha256="1946ec629c88d30122afa072d3c6a89cc5d5e4e2bb28dc63b2f9ebcc7917ee64") version("5.0.2", sha256="fe87aa11558c08856739bfd9bd971263a28657663cb0c3a0af01b94f03b0b795") - version("5.0.1", sha256="84ca454abf262579814a2a2b846569f6e0cb3e16dc33ca3642b4f1dff6fbafd3") - version("5.0.0", sha256="1f1843315657a4371d8ca37f01265fa9aae17dbcf46d2d0a95c1fdb3c6a4bab6") + + # Deprecated older non-final releases + with default_args(deprecated=True): + version( + "18.1.7", sha256="b60df7cbe02cef2523f7357120fb0d46cbb443791cde3a5fb36b82c335c0afc9" + ) + version( + "18.1.6", sha256="01390edfae5b809e982b530ff9088e674c62b13aa92cb9dc1e067fa2cf501083" + ) + version( + "18.1.5", sha256="d543309f55ae3f9b422108302b45c40f5696c96862f4bda8f5526955daa54284" + ) + version( + "18.1.4", sha256="deca5a29e8b1d103ecc4badb3c304aca50d5cac6453364d88ee415dc55699dfb" + ) + version( + "18.1.3", sha256="fc5a2fd176d73ceb17f4e522f8fe96d8dde23300b8c233476d3609f55d995a7a" + ) + version( + "18.1.2", sha256="8d686d5ece6f12b09985cb382a3a530dc06bb6e7eb907f57c7f8bf2d868ebb0b" + ) + version( + "18.1.1", sha256="62439f733311869dbbaf704ce2e02141d2a07092d952fc87ef52d1d636a9b1e4" + ) + version( + "18.1.0", sha256="eb18f65a68981e94ea1a5aae4f02321b17da9e99f76bfdb983b953f4ba2d3550" + ) + version( + "17.0.5", sha256="432c1eda3d1c9379cd52a9bee8e0ea6f7b204bff5075895f963fd8e575aa4fb8" + ) + version( + "17.0.4", sha256="46200b79f52a02fe26d0a43fd856ab6ceff49ab2a0b7c240ac4b700a6ada700c" + ) + version( + "17.0.3", sha256="1e3d9d04fb5fbd8d0080042ad72c7e2a5c68788b014b186647a604dbbdd625d2" + ) + version( + "17.0.2", sha256="dcba3eb486973dce45b6edfe618f3f29b703ae7e6ef9df65182fb50fb6fe4235" + ) + version( + "17.0.1", sha256="d51b10be66c10a6a81f4c594b554ffbf1063ffbadcb810af37d1f88d6e0b49dd" + ) + version( + "16.0.5", sha256="e0fbca476693fcafa125bc71c8535587b6d9950293122b66b262bb4333a03942" + ) + version( + "16.0.4", sha256="10c3fe1757d2e4f1cd7745dc548ecf687680a71824ec81701c38524c2a0753e2" + ) + version( + "16.0.3", sha256="0bd71bc687a4e5a250c40afb0decefc50c85178fcce726137b682039de63919b" + ) + version( + "16.0.2", sha256="97c3c6aafb53c4bb0ed2781a18d6f05e75445e24bb1dc57a32b74f8d710ac19f" + ) + version( + "16.0.1", sha256="b5a9ff1793b1e2d388a3819bf35797002b1d2e40bb35a10c65605e0ea1435271" + ) + version( + "16.0.0", sha256="cba969a0782a3a398658d439f047b5e548ea04724f4fbfdbe17cfc946f4cd3ed" + ) + version( + "15.0.6", sha256="4d857d7a180918bdacd09a5910bf9743c9861a1e49cb065a85f7a990f812161d" + ) + version( + "15.0.5", sha256="c47640269e0251e009ae18a25162df4e20e175885286e21d28c054b084b991a4" + ) + version( + "15.0.4", sha256="e24b4d3bf7821dcb1c901d1e09096c1f88fb00095c5a6ef893baab4836975e52" + ) + version( + "15.0.3", sha256="8ac8e4c0982bf236526d737d385db5e1e66543ab217a9355d54159659eae3774" + ) + version( + "15.0.2", sha256="dc11d35e60ab61792baa607dff080c993b39de23fb93b3d3369ba15b0601c307" + ) + version( + "15.0.1", sha256="20bccb964e39f604fdc16d1258f94d2053fbdcdab2b2f6d5e20e6095ec403c00" + ) + version( + "15.0.0", sha256="36d83cd84e1caf2bcfda1669c029e2b949adb9860cff01e7d3246ac2348b11ae" + ) + version( + "14.0.5", sha256="a4a57f029cb81f04618e05853f05fc2d21b64353c760977d8e7799bf7218a23a" + ) + version( + "14.0.4", sha256="1333236f9bee38658762076be4236cb5ebf15ae9b7f2bfce6946b96ae962dc73" + ) + version( + "14.0.3", sha256="0e1d049b050127ecf6286107e9a4400b0550f841d5d2288b9d31fd32ed0683d5" + ) + version( + "14.0.2", sha256="ca52232b3451c8e017f00eb882277707c13e30fac1271ec97015f6d0eeb383d1" + ) + version( + "14.0.1", sha256="c8be00406e872c8a24f8571cf6f5517b73ae707104724b1fd1db2f0af9544019" + ) + version( + "14.0.0", sha256="87b1a068b370df5b79a892fdb2935922a8efb1fddec4cc506e30fe57b6a1d9c4" + ) + version( + "13.0.0", sha256="a1131358f1f9f819df73fa6bff505f2c49d176e9eef0a3aedd1fdbce3b4630e8" + ) + version( + "12.0.0", sha256="8e6c99e482bb16a450165176c2d881804976a2d770e0445af4375e78a1fbf19c" + ) + version( + "11.0.1", sha256="9c7ad8e8ec77c5bde8eb4afa105a318fd1ded7dff3747d14f012758719d7171b" + ) + version( + "11.0.0", sha256="8ad4ddbafac4f2c8f2ea523c2c4196f940e8e16f9e635210537582a48622a5d5" + ) + version( + "10.0.0", sha256="b81c96d2f8f40dc61b14a167513d87c0d813aae0251e06e11ae8a4384ca15451" + ) + version("9.0.0", sha256="7807fac25330e24e9955ca46cd855dd34bbc9cc4fdba8322366206654d1036f2") + version("8.0.0", sha256="d81238b4a69e93e29f74ce56f8107cbfcf0c7d7b40510b7879e98cc031e25167") + version("7.0.1", sha256="f17a6cd401e8fd8f811fbfbb36dcb4f455f898c9d03af4044807ad005df9f3c0") + version("6.0.0", sha256="1946ec629c88d30122afa072d3c6a89cc5d5e4e2bb28dc63b2f9ebcc7917ee64") + version("5.0.1", sha256="84ca454abf262579814a2a2b846569f6e0cb3e16dc33ca3642b4f1dff6fbafd3") + version("5.0.0", sha256="1f1843315657a4371d8ca37f01265fa9aae17dbcf46d2d0a95c1fdb3c6a4bab6") depends_on("c", type="build") depends_on("cxx", type="build") @@ -643,6 +725,19 @@ class Llvm(CMakePackage, CudaPackage, LlvmDetection, CompilerPackage): patch("llvm-cmake-modules-FindZ3.patch", level=0, when="@14.0.6") + # https://github.com/spack/spack/issues/48865 + patch( + "https://github.com/llvm/llvm-project/commit/f4be5ed6a3fef0b2b0c60b29e1c0638926638d28.patch?full_index=1", + sha256="51740996bbc01a5049fa859134ad44ffc9514da212cc7d9a445c8d16d6cc867e", + when="@15", + ) + # https://github.com/spack/spack/issues/48865 + patch( + "https://github.com/llvm/llvm-project/commit/73e15b5edb4fa4a77e68c299a6e3b21e610d351f.patch?full_index=1", + sha256="b540ef6e3728d7881d95775a163314fac6e2f9207f5d5e8b79c8c73c73ba4dc3", + when="@15:16", + ) + @when("@14:17") def patch(self): # https://github.com/llvm/llvm-project/pull/69458 @@ -653,19 +748,21 @@ def patch(self): string=True, ) + clang_and_friends = "(?:clang|flang|flang-new)" + compiler_version_regex = ( # Normal clang compiler versions are left as-is - r"clang version ([^ )\n]+)-svn[~.\w\d-]*|" + rf"{clang_and_friends} version ([^ )\n]+)-svn[~.\w\d-]*|" # Don't include hyphenated patch numbers in the version # (see https://github.com/spack/spack/pull/14365 for details) - r"clang version ([^ )\n]+?)-[~.\w\d-]*|" - r"clang version ([^ )\n]+)|" + rf"{clang_and_friends} version ([^ )\n]+?)-[~.\w\d-]*|" + rf"{clang_and_friends} version ([^ )\n]+)|" # LLDB r"lldb version ([^ )\n]+)|" # LLD r"LLD ([^ )\n]+) \(compatible with GNU linkers\)" ) - fortran_names = ["flang"] + fortran_names = ["flang", "flang-new"] @property def supported_languages(self): diff --git a/var/spack/repos/builtin/packages/lua-lpeg/package.py b/var/spack/repos/builtin/packages/lua-lpeg/package.py index 30c0735e4ce5ed..7cbbc97af240f9 100644 --- a/var/spack/repos/builtin/packages/lua-lpeg/package.py +++ b/var/spack/repos/builtin/packages/lua-lpeg/package.py @@ -35,6 +35,11 @@ class LuaLpeg(LuaPackage): depends_on("lua-lang@:5.1.9", when="@:0.12.1 ^[virtuals=lua-lang] lua") + @property + def libs(self): + libraries = [f"**/lua/{self.spec['lua-lang'].version.up_to(2)}/lpeg"] + return find_libraries(libraries, root=self.prefix) + class LuaBuilder(spack.build_systems.lua.LuaBuilder): # without this, the resulting library cannot be linked by a normal link phase, the diff --git a/var/spack/repos/builtin/packages/lua-luajit-openresty/package.py b/var/spack/repos/builtin/packages/lua-luajit-openresty/package.py index a7c117b48b2157..b1b9dc0ab5a263 100644 --- a/var/spack/repos/builtin/packages/lua-luajit-openresty/package.py +++ b/var/spack/repos/builtin/packages/lua-luajit-openresty/package.py @@ -35,7 +35,8 @@ class LuaLuajitOpenresty(LuaImplPackage): description="add symlinks to make lua-luajit a drop-in lua replacement", ) - provides("luajit", "lua-lang@5.1", when="+lualinks") + provides("luajit", "lua-lang", when="+lualinks") + provides("lua-lang@5.1", when="+lualinks") lua_version_override = "5.1" @run_after("install") diff --git a/var/spack/repos/builtin/packages/lua-sol2/package.py b/var/spack/repos/builtin/packages/lua-sol2/package.py index cf9c440313d606..1c52bd98e48039 100644 --- a/var/spack/repos/builtin/packages/lua-sol2/package.py +++ b/var/spack/repos/builtin/packages/lua-sol2/package.py @@ -31,6 +31,12 @@ class LuaSol2(CMakePackage): # Lua is not needed when building, since sol2 is headers-only depends_on("lua", type=("link", "run")) + patch( + "https://github.com/ThePhD/sol2/pull/1606.patch?full_index=1", + when="@3.3.0 %oneapi@2025:", + sha256="ed6c5924a0639fb1671e6d7dacbb88dce70aa006bcee2f380b6acd34da89664c", + ) + def cmake_args(self): args = [ self.define("SOL2_ENABLE_INSTALL", True), diff --git a/var/spack/repos/builtin/packages/magma/package.py b/var/spack/repos/builtin/packages/magma/package.py index a458c762f5a93b..0e102e4fa576f4 100644 --- a/var/spack/repos/builtin/packages/magma/package.py +++ b/var/spack/repos/builtin/packages/magma/package.py @@ -23,6 +23,7 @@ class Magma(CMakePackage, CudaPackage, ROCmPackage): test_requires_compiler = True version("master", branch="master") + version("2.9.0", sha256="ff77fd3726b3dfec3bfb55790b06480aa5cc384396c2db35c56fdae4a82c641c") version("2.8.0", sha256="f4e5e75350743fe57f49b615247da2cc875e5193cc90c11b43554a7c82cc4348") version("2.7.2", sha256="729bc1a70e518a7422fe7a3a54537a4741035a77be3349f66eac5c362576d560") version("2.7.1", sha256="d9c8711c047a38cae16efde74bee2eb3333217fd2711e1e9b8606cbbb4ae1a50") @@ -79,18 +80,22 @@ class Magma(CMakePackage, CudaPackage, ROCmPackage): "cuda_arch=none", when="+cuda", msg="magma: Please indicate a CUDA arch value or values" ) - # currently not compatible with CUDA-11 + # Versions before 2.5.3 were not compatible with CUDA-11 # https://bitbucket.org/icl/magma/issues/22/cuda-11-changes-issue # https://bitbucket.org/icl/magma/issues/25/error-cusparsesolveanalysisinfo_t-does-not conflicts("^cuda@11:", when="@:2.5.3") - # currently not compatible with CUDA-12.6 + # 2.8.0 release not compatible with CUDA-12.6 # https://github.com/icl-utk-edu/magma/issues/7 conflicts("^cuda@12.6:", when="@:2.8.0") - # Many cuda_arch values are not yet recognized by MAGMA's CMakeLists.txt - for target in [10, 11, 12, 13, 21, 32, 52, 53, 61, 62, 72, 86]: - conflicts(f"cuda_arch={target}") + # Many cuda_arch values were not recognized by MAGMA's CMakeLists.txt + with when("@:2.8"): + # All cuda_arch values are supported in 2.9.0 release + for target in [10, 11, 12, 13, 21, 32, 52, 53, 61, 62, 72, 86]: + conflicts( + f"cuda_arch={target}", msg=f"magma: cuda_arch={target} needs a version > 2.8.0" + ) # Some cuda_arch values had support added recently conflicts("cuda_arch=37", when="@:2.5", msg="magma: cuda_arch=37 needs a version > 2.5") @@ -205,7 +210,6 @@ def test_c(self): with working_dir(test_dir): pkg_config_path = self.prefix.lib.pkgconfig with spack.util.environment.set_env(PKG_CONFIG_PATH=pkg_config_path): - make("c") tests = [ ("example_sparse", "sparse solver"), diff --git a/var/spack/repos/builtin/packages/mapl/package.py b/var/spack/repos/builtin/packages/mapl/package.py index 9d1a0b72182ca8..bfe8e3f1eb63aa 100644 --- a/var/spack/repos/builtin/packages/mapl/package.py +++ b/var/spack/repos/builtin/packages/mapl/package.py @@ -38,6 +38,10 @@ class Mapl(CMakePackage): version("develop", branch="develop") version("main", branch="main") + version("2.54.1", sha256="2430ded45a98989e9100037f54cf22f5a5083e17196514b3667d3003413e49e1") + version("2.53.1", sha256="8371a75d4d81294eb9d99d66702f8cf62d4bd954cec3e247e1afae621b4e4726") + version("2.53.0", sha256="68c24e6c0e3340645b1fb685972c96ef80746d5a289572c9883e520680708ebe") + version("2.52.0", sha256="c30be3a6ed3fca40aea903e10ee51e2fb50b4ef2445fdc959d4871baf3c20585") version("2.51.2", sha256="f6df2be24d0c113af3d0424b674d970621660bf11e59a699373f014a14d0716e") version("2.51.1", sha256="337dba3980de1d5e603361ecf8f001c5bf99d0addecbeb5c207f3604183ca623") version("2.51.0", sha256="56213d845f5287e599213aab1dea60bf6b64c29cd8093313639304b270c45676") @@ -250,9 +254,11 @@ class Mapl(CMakePackage): conflicts("%gcc@13:", when="@:2.44") # MAPL can use ifx only from MAPL 2.51 onwards and only supports - # ifx 2025.0 and newer due to bugs in ifx - conflicts("%oneapi@:2024") - conflicts("%oneapi", when="@:2.50") + # ifx 2025.0 and newer due to bugs in ifx. + conflicts("%oneapi@2025:", when="@:2.50") + # NOTE there is a further check on oneapi in the cmake_args below + # that is hard to conflict since we don't know the fortran compiler + # at this point variant("flap", default=False, description="Build with FLAP support", when="@:2.39") variant("pflogger", default=True, description="Build with pFlogger support") @@ -386,6 +392,22 @@ def cmake_args(self): if fflags: args.append(self.define("CMAKE_Fortran_FLAGS", " ".join(fflags))) + # If oneapi@:2024 is used and it gets past the conflict above, we might be + # using ifx or ifort. If we are using ifx and the MAPL version is 2.50 or older + # we need to raise an error + + if self.spec.satisfies("@:2.50 %oneapi@:2024"): + # We now need to get which Fortran compiler is used here but there + # isn't an easy way like: + # if self.spec["fortran"].name == "ifx": + # yet (see https://github.com/spack/spack/pull/45189) + # So we need to parse the output of $FC --version + output = spack.compiler.get_compiler_version_output( + self.compiler.fc, "-diag-disable=10448 --version", ignore_errors=True + ) + if "ifx" in output: + raise InstallError("MAPL versions 2.50 and older do not support ifx") + # Scripts often need to know the MPI stack used to setup the environment. # Normally, we can autodetect this, but building with Spack does not # seem to work. We need to pass in the MPI stack used to CMake diff --git a/var/spack/repos/builtin/packages/mctc-lib/package.py b/var/spack/repos/builtin/packages/mctc-lib/package.py index a2e44ed023b9bb..9f65b63fad67c6 100644 --- a/var/spack/repos/builtin/packages/mctc-lib/package.py +++ b/var/spack/repos/builtin/packages/mctc-lib/package.py @@ -2,20 +2,23 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.build_systems import cmake, meson from spack.package import * -class MctcLib(MesonPackage): +class MctcLib(MesonPackage, CMakePackage): """Modular computation toolchain library for quantum chemistry file IO""" homepage = "https://github.com/grimme-lab/mctc-lib" - url = "https://github.com/grimme-lab/mctc-lib/releases/download/v0.3.0/mctc-lib-0.3.0.tar.xz" + url = "https://github.com/grimme-lab/mctc-lib/releases/download/v0.0.0/mctc-lib-0.0.0.tar.xz" git = "https://github.com/grimme-lab/mctc-lib" maintainers("awvwgk") license("Apache-2.0") + build_system("cmake", "meson", default="meson") + version("main", branch="main") version("0.3.1", sha256="a5032a0bbbbacc952037c5215b71aa6b438767a84bafb60fda25ba43c8835513") version("0.3.0", sha256="81f3edbf322e6e28e621730a796278498b84af0f221f785c537a315312059bf0") @@ -24,9 +27,17 @@ class MctcLib(MesonPackage): variant("json", default=False, description="Enable support for JSON") - depends_on("meson@0.57.2:", type="build") + depends_on("meson@0.57.2:", type="build", when="build_system=meson") + depends_on("json-fortran@8:", when="+json") depends_on("pkgconfig", type="build") + +class CMakeBuilder(cmake.CMakeBuilder): + def cmake_args(self): + return [self.define_from_variant("WITH_JSON", "json")] + + +class MesonBuilder(meson.MesonBuilder): def meson_args(self): return ["-Djson={0}".format("enabled" if "+json" in self.spec else "disabled")] diff --git a/var/spack/repos/builtin/packages/meme/package.py b/var/spack/repos/builtin/packages/meme/package.py index 7ecc81ffeec33b..e2bf79e2187c88 100644 --- a/var/spack/repos/builtin/packages/meme/package.py +++ b/var/spack/repos/builtin/packages/meme/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * -from spack.version import Version class Meme(AutotoolsPackage): diff --git a/var/spack/repos/builtin/packages/mercurial/package.py b/var/spack/repos/builtin/packages/mercurial/package.py index 8e1361d1f048cb..c548001b4a4377 100644 --- a/var/spack/repos/builtin/packages/mercurial/package.py +++ b/var/spack/repos/builtin/packages/mercurial/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from llnl.util import tty from spack.package import * diff --git a/var/spack/repos/builtin/packages/metall/package.py b/var/spack/repos/builtin/packages/metall/package.py index 5c9020d08a1cd0..e920e35f8eda37 100644 --- a/var/spack/repos/builtin/packages/metall/package.py +++ b/var/spack/repos/builtin/packages/metall/package.py @@ -22,6 +22,8 @@ class Metall(CMakePackage): version("master", branch="master") version("develop", branch="develop") + version("0.30", sha256="d241f45978fceeb83a4b2eda7513466341c45452fa26ec224c5235d00d279d37") + version("0.29", sha256="03281b603b46703c324971798819242529431cbbdaa80d5dbb5f0f8a24a74a58") version("0.28", sha256="770dedb7f8220c333688b232a22104ca9d8d5823e7a8a21152b58ef970eb85d0") version("0.27", sha256="6e6f17a760778f9162def939701f9381a75e5275fd1eb1b2af4b2e89e86e1c58") version("0.26", sha256="7453c87d99708be8542e354e582cbeefac1e5ba65e609cd85d7126c5b25a6d7b") diff --git a/var/spack/repos/builtin/packages/migraphx/package.py b/var/spack/repos/builtin/packages/migraphx/package.py index 87f5f3c7a695ad..b68b92b851ef74 100644 --- a/var/spack/repos/builtin/packages/migraphx/package.py +++ b/var/spack/repos/builtin/packages/migraphx/package.py @@ -19,6 +19,8 @@ class Migraphx(CMakePackage): libraries = ["libmigraphx"] license("MIT") + version("6.3.2", sha256="4e6b9800919e99070c0289616657592c23ff66a55230409f38e5c7e099c0d89b") + version("6.3.1", sha256="c60df20b3c890c469265ae6f273fb5d43cc13c8c514f76dd7b4d195d9e44ba85") version("6.3.0", sha256="21550e5cecf1b26c02e1c4633c7c4c6eb5e37be8758d7a2641f10cfdf4203636") version("6.2.4", sha256="849cca3c7c98dc437e42ac17013f86ef0a5fd202cb87b7822778bd9a8f93d293") version("6.2.1", sha256="a9479fd6846bae4a888f712c2fecee6a252951ae8979d9990b100450e4cd6c30") @@ -103,14 +105,27 @@ class Migraphx(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}") depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") depends_on(f"rocblas@{ver}", when=f"@{ver}") depends_on(f"miopen-hip@{ver}", when=f"@{ver}") - - for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in [ + "6.0.0", + "6.0.2", + "6.1.0", + "6.1.1", + "6.1.2", + "6.2.0", + "6.2.1", + "6.2.4", + "6.3.0", + "6.3.1", + "6.3.2", + ]: depends_on(f"rocmlir@{ver}", when=f"@{ver}") @property @@ -118,8 +133,7 @@ def cmake_python_hints(self): """Include the python include path to the CMake based on current spec """ - python = self.spec["python"] - return [self.define("Python_INCLUDE_DIR", python.package.config_vars["include"])] + return [self.define("Python_INCLUDE_DIR", self["python"].config_vars["include"])] @classmethod def determine_version(cls, lib): diff --git a/var/spack/repos/builtin/packages/mimalloc/package.py b/var/spack/repos/builtin/packages/mimalloc/package.py index 385fa1630c82ba..f91860404b4d70 100644 --- a/var/spack/repos/builtin/packages/mimalloc/package.py +++ b/var/spack/repos/builtin/packages/mimalloc/package.py @@ -18,6 +18,8 @@ class Mimalloc(CMakePackage): version("dev-slice", branch="dev-slice") version("dev", branch="dev") version("master", branch="master") + version("3.0.1", sha256="6a514ae31254b43e06e2a89fe1cbc9c447fdbf26edc6f794f3eb722f36e28261") + version("2.1.9", sha256="dd8ff701691f19bf4e225d42ef0d3d5e6ca0e03498ee4f044a0402e4697e4a20") version("2.1.7", sha256="0eed39319f139afde8515010ff59baf24de9e47ea316a315398e8027d198202d") version("2.1.2", sha256="2b1bff6f717f9725c70bf8d79e4786da13de8a270059e4ba0bdd262ae7be46eb") version("2.1.1", sha256="38b9660d0d1b8a732160191609b64057d8ccc3811ab18b7607bc93ca63a6010f") @@ -25,6 +27,7 @@ class Mimalloc(CMakePackage): version("2.0.9", sha256="4a29edae32a914a706715e2ac8e7e4109e25353212edeed0888f4e3e15db5850") version("2.0.7", sha256="f23aac6c73594e417af50cb38f1efed88ef1dc14a490f0eff07c7f7b079810a4") version("2.0.6", sha256="9f05c94cc2b017ed13698834ac2a3567b6339a8bde27640df5a1581d49d05ce5") + version("1.8.9", sha256="3aabe30485c4e908c1bf04136d5b95c08c6e73fa6fe6e1ec68b4851d3c60ee47") version("1.8.2", sha256="4058d53d6ceb75862f32c30a6ee686c3cbb5e965b2c324b828ca454f7fe064f9") version("1.8.1", sha256="7aaa54c3ed1feac90b6187eb93108e808660c6e103b0fa6a7e2fabb58c3147d5") version("1.8.0", sha256="4bb69b49821499256e7d9b2a47427c4661f5ad3f1547a21f7bdea7e3bcbc60f8") diff --git a/var/spack/repos/builtin/packages/miniconda2/package.py b/var/spack/repos/builtin/packages/miniconda2/package.py index 9ad5c1e5f60f83..e9d7c6329655bd 100644 --- a/var/spack/repos/builtin/packages/miniconda2/package.py +++ b/var/spack/repos/builtin/packages/miniconda2/package.py @@ -5,7 +5,6 @@ from os.path import split from spack.package import * -from spack.util.environment import EnvironmentModifications class Miniconda2(Package): diff --git a/var/spack/repos/builtin/packages/miniconda3/package.py b/var/spack/repos/builtin/packages/miniconda3/package.py index 79c85415ee50a9..0bf8099bc43f1b 100644 --- a/var/spack/repos/builtin/packages/miniconda3/package.py +++ b/var/spack/repos/builtin/packages/miniconda3/package.py @@ -6,7 +6,6 @@ from os.path import split from spack.package import * -from spack.util.environment import EnvironmentModifications _versions = { "24.7.1": { diff --git a/var/spack/repos/builtin/packages/miniforge3/package.py b/var/spack/repos/builtin/packages/miniforge3/package.py index a9865ddec7f68a..e4157bf13ae6cd 100644 --- a/var/spack/repos/builtin/packages/miniforge3/package.py +++ b/var/spack/repos/builtin/packages/miniforge3/package.py @@ -6,7 +6,6 @@ from os.path import split from spack.package import * -from spack.util.environment import EnvironmentModifications _versions = { "24.3.0-0": { diff --git a/var/spack/repos/builtin/packages/miopen-hip/package.py b/var/spack/repos/builtin/packages/miopen-hip/package.py index 1262c9606776a9..f09cd060a6a217 100644 --- a/var/spack/repos/builtin/packages/miopen-hip/package.py +++ b/var/spack/repos/builtin/packages/miopen-hip/package.py @@ -20,7 +20,8 @@ class MiopenHip(CMakePackage): libraries = ["libMIOpen"] license("MIT") - + version("6.3.2", sha256="7abda3b437e396a1611a6f63e73ab1656d45d5405194504136c0ccbb75b81fea") + version("6.3.1", sha256="edb82a74086fb96f8d7ee9e50a180302f716332cd0dff96bf7244bdc6fab5895") version("6.3.0", sha256="171834978d6316a5ec7607d4b10c7c69e5bfe9064edae8bdb9b207e578b41c1d") version("6.2.4", sha256="8e4836e007e5e66fa487288887a098aaeeb95f3c63a19c2b91f6e848c023a040") version("6.2.1", sha256="c7abe5ae7a332813a3c3da849e9a50b91221fe05c6bb622413e5b048b1f15982") @@ -42,6 +43,11 @@ class MiopenHip(CMakePackage): version("5.3.3", sha256="7efc98215d23a2caaf212378c37e9a6484f54a4ed3e9660719286e4f287d3715") version("5.3.0", sha256="c5819f593d71beeda2eb24b89182912240cc40f83b2b8f9de695a8e230aa4ea6") + variant( + "ck", + default=True, + description="Enable MIOpen to use composable kernels for various operation", + ) variant("asan", default=False, description="Build with address-sanitizer enabled or disabled") conflicts("+asan", when="os=rhel9") @@ -95,6 +101,8 @@ class MiopenHip(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}") depends_on(f"hip@{ver}", when=f"@{ver}") @@ -137,20 +145,34 @@ class MiopenHip(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: - depends_on("nlohmann-json", type="link") - depends_on(f"composable-kernel@{ver}", when=f"@{ver}") + depends_on(f"composable-kernel@{ver}", when=f"@{ver} +ck") for ver in ["5.4.0", "5.4.3", "5.5.0"]: - depends_on("nlohmann-json", type="link") depends_on(f"rocmlir@{ver}", when=f"@{ver}") - for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in [ + "6.0.0", + "6.0.2", + "6.1.0", + "6.1.1", + "6.1.2", + "6.2.0", + "6.2.1", + "6.2.4", + "6.3.0", + "6.3.1", + "6.3.2", + ]: depends_on(f"roctracer-dev@{ver}", when=f"@{ver}") - for ver in ["6.1.0", "6.1.1", "6.1.2"]: - depends_on("googletest") - for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"rocrand@{ver}", when=f"@{ver}") - depends_on("hipblas@6.3.0", when="@6.3.0") - depends_on("hipblaslt@6.3.0", when="@6.3.0") + for ver in ["6.3.0", "6.3.1", "6.3.2"]: + depends_on(f"hipblas@{ver}", when=f"@{ver}") + depends_on(f"hipblaslt@{ver}", when=f"@{ver}") + + depends_on("nlohmann-json", type="link") + depends_on("googletest", when="@6.1:") def setup_build_environment(self, env): lib_dir = self.spec["zlib-api"].libs.directories[0] @@ -206,7 +228,7 @@ def cmake_args(self): args.append(self.define("MIOPEN_USE_MLIR", "ON")) args.append(self.define("MIOPEN_ENABLE_AI_KERNEL_TUNING", "OFF")) if self.spec.satisfies("@5.5.1:"): - args.append(self.define("MIOPEN_USE_COMPOSABLEKERNEL", "ON")) + args.append(self.define_from_variant("MIOPEN_USE_COMPOSABLEKERNEL", "ck")) args.append(self.define("MIOPEN_ENABLE_AI_KERNEL_TUNING", "OFF")) args.append(self.define("MIOPEN_USE_MLIR", "OFF")) if self.spec.satisfies("@5.7.0:"): diff --git a/var/spack/repos/builtin/packages/mivisionx/package.py b/var/spack/repos/builtin/packages/mivisionx/package.py index ea773e395b0887..76227c764856b0 100644 --- a/var/spack/repos/builtin/packages/mivisionx/package.py +++ b/var/spack/repos/builtin/packages/mivisionx/package.py @@ -25,7 +25,8 @@ def url_for_version(self, version): return url.format(version) license("MIT") - + version("6.3.2", sha256="2e7984e4ef2e6195aa9afa11030b8418aee885bec9befa220b9b53b5229b7fae") + version("6.3.1", sha256="1f7bd1f6b61401bc642b50e96411344b092b09189534c5d6ba2f4c661d1af0ce") version("6.3.0", sha256="bc16881eae11140025b8fbd00bc741763548d41345dbe954c8d8659f4dccfe9e") version("6.2.4", sha256="7e65dc83f1b85e089c1218dff57211e64f3586bcb4415bda4798e4a434cba216") version("6.2.1", sha256="591fe23ee1e2ab49f29aeeb835b5045e4ba00165c604ddfaa26bd8eb56cb367d") @@ -172,6 +173,14 @@ def patch(self): "model_compiler/python/nnir_to_clib.py", string=True, ) + if self.spec.satisfies("@6.2:"): + filter_file( + r"crypto", + "{0}".format(self.spec["openssl"].libs), + "utilities/runvx/CMakeLists.txt", + "utilities/runcl/CMakeLists.txt", + string=True, + ) depends_on("cmake@3.5:", type="build") depends_on("ffmpeg@:4", type="build", when="@:5.3") @@ -229,6 +238,8 @@ def patch(self): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"miopen-hip@{ver}", when=f"@{ver}") for ver in [ @@ -250,6 +261,8 @@ def patch(self): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"migraphx@{ver}", when=f"@{ver}") depends_on(f"hip@{ver}", when=f"@{ver}") @@ -270,6 +283,8 @@ def patch(self): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") depends_on("python@3.5:", type="build") @@ -286,6 +301,8 @@ def patch(self): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rpp@{ver}", when=f"@{ver}") @@ -295,9 +312,10 @@ def setup_run_environment(self, env): env.prepend_path("LD_LIBRARY_PATH", self.spec["hsa-rocr-dev"].prefix.lib) def setup_build_environment(self, env): - if self.spec.satisfies("+asan"): + if self.spec.satisfies("@6.1:"): env.set("CC", f"{self.spec['llvm-amdgpu'].prefix}/bin/clang") env.set("CXX", f"{self.spec['llvm-amdgpu'].prefix}/bin/clang++") + if self.spec.satisfies("+asan"): env.set("ASAN_OPTIONS", "detect_leaks=0") env.set("CFLAGS", "-fsanitize=address -shared-libasan") env.set("CXXFLAGS", "-fsanitize=address -shared-libasan") diff --git a/var/spack/repos/builtin/packages/mmg/package.py b/var/spack/repos/builtin/packages/mmg/package.py index 50383d656413c3..2bb7df4b2af905 100644 --- a/var/spack/repos/builtin/packages/mmg/package.py +++ b/var/spack/repos/builtin/packages/mmg/package.py @@ -6,7 +6,6 @@ import spack.build_systems.cmake from spack.package import * -from spack.util.executable import which class Mmg(CMakePackage): diff --git a/var/spack/repos/builtin/packages/mochi-margo/package.py b/var/spack/repos/builtin/packages/mochi-margo/package.py index b081632fb788df..ac3f8a88776746 100644 --- a/var/spack/repos/builtin/packages/mochi-margo/package.py +++ b/var/spack/repos/builtin/packages/mochi-margo/package.py @@ -16,6 +16,14 @@ class MochiMargo(AutotoolsPackage): maintainers("carns", "mdorier", "fbudin69500") version("main", branch="main") + version("0.19.0", sha256="269e3b52228fb59a8ab502b8fac4761fc15440817455bb006f311093bd4c02f3") + version("0.18.3", sha256="4871af11d3cadc81e6f08a2112782c61324d9cdabc9e9b61c595c95da6d75127") + version("0.18.2", sha256="a3a9fde826954be06b9123887533f91e6725faf6f6c682c080b97c2172a22057") + version("0.18.1", sha256="06221986deaa5eb20001c49f29d580722a16b5bde66c1333b3b02f677ef973b5") + version("0.18.0", sha256="5b3e8b64217490bd8643506699cd06538abaf1bb19eb0429506de62bf0c8402e") + version("0.17.3", sha256="286ec8bab62e8f21b1d1acb0afa6699be247504de783897433b5d81ef3b5fe18") + version("0.17.2", sha256="2da1a3dbbe7d5eb6bb51cead00c0428f2d699da9fd4c3bae86088c9e36080089") + version("0.17.1", sha256="835d2a98ac6f6c647fa0e7e152a802c489d72170c82d3b7ba7af9a26fdd13367") version("0.17.0", sha256="5c456cdc2e3156f902e5068468ee6d061eb252dcfdfcb2b570726e9cf84fc2e8") version("0.16.0", sha256="5fb7ea3633b5bcc735e605dba27187ea893958bf86b8928184028735a338c61b") version("0.15.0", sha256="f962f02ddaae125eaf15bf89126ee47b4f852d366b14248d2d67a0be8f661224") diff --git a/var/spack/repos/builtin/packages/mochi-thallium/package.py b/var/spack/repos/builtin/packages/mochi-thallium/package.py index 2806e2d2e6b09a..326bdaad32d6ff 100644 --- a/var/spack/repos/builtin/packages/mochi-thallium/package.py +++ b/var/spack/repos/builtin/packages/mochi-thallium/package.py @@ -15,6 +15,17 @@ class MochiThallium(CMakePackage): maintainers("mdorier") version("main", branch="main") + version("0.15.0", sha256="a7872e926e97fdf80a67c8e44f1217a959c689763dbcf9712abd913d1ef23bdf") + version("0.14.6", sha256="dfdd39fc840a82a69c1698e764239e8aa0a5573f677a52fb2bdd6bffd529a232") + version("0.14.5", sha256="8a13f1adb6a549053f56b46235ea81ed9c047cd702b8980035fc81be3ea942e3") + version("0.14.4", sha256="bca33ef4af640581a1729606b708974a955a2a2a2f3817ee110c2c9da2da9a99") + version("0.14.3", sha256="b37b8fa9976471950e9d74e0269c2dc80ca5353e97c7ee4603460077fab28ca3") + version("0.14.2", sha256="7dc03a84845aa4b902c0b52d8384dd1b9bef02b53f880efb02ec58a12d8c6381") + version("0.14.1", sha256="0de7b7b5b517af552ababab7b5ef973207515398f7fd9685b3f6841432913c7b") + version("0.14.0", sha256="3af3c2e4cae15a256e76df89ed9ad46ced68ca9b045216a9510f563e96722104") + version("0.13.1", sha256="8166c412ebeb58898198069adbaf126362cffb2ba80ccf3c24b5cead0368acfa") + version("0.13.0", sha256="29f50b338c247ce5945ea90241ad938b951c4bac8af070cc3136f10f309ae542") + version("0.12.0", sha256="cbb6ea8f479d74a4310847ffd7eb4fb11107732540ebc13b5989b7c9809f6d06") version("0.11.3", sha256="d1ffd7ee1ccbcfb00f246cb29c5bc2560e59f8808609cbc19b7098aa8fc903c4") version("0.11.2", sha256="4f1e57ca843b7592525c179dec73bfb603a27fbda4feaf028d636e05c1b38e36") version("0.11.1", sha256="be99bec2309ce1945a777fba720175f409972cbf27b73388728a740d6406a040") @@ -54,8 +65,10 @@ class MochiThallium(CMakePackage): description="Use the cereal library for serialization", when="@0.4.1:", ) + conflicts("~cereal", when="@0.14.0:", msg="Thallium 0.14.0 and above requires Cereal") depends_on("pkgconfig", type=("build")) + depends_on("mochi-margo@0.18.0:", when="@0.14.0:") depends_on("mochi-margo@0.12.0:", when="@0.11.2:") depends_on("mochi-margo@0.9.8:", when="@0.10.0:") depends_on("mochi-margo@0.7:", when="@0.7:") diff --git a/var/spack/repos/builtin/packages/mpi-sync-clocks/package.py b/var/spack/repos/builtin/packages/mpi-sync-clocks/package.py new file mode 100644 index 00000000000000..9b67b130901def --- /dev/null +++ b/var/spack/repos/builtin/packages/mpi-sync-clocks/package.py @@ -0,0 +1,39 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class MpiSyncClocks(AutotoolsPackage): + """MPI Sync Clocks. + + MPI Sync Clocks is an implementation of synchronized clocks using MPI. + """ + + homepage = "https://pm2.gitlabpages.inria.fr/" + url = "https://pm2.gitlabpages.inria.fr/releases/mpi_sync_clocks-1.0.tar.gz" + git = "https://gitlab.inria.fr/pm2/pm2.git" + + build_directory = "build" + + maintainers("a-denis") + license("LGPL-2.1-or-later", checked_by="a-denis") + + version("master", branch="master") + version("1.0", sha256="06c63adc2f3ae7d00e3bdbbe62ee6800660fde320a3d36a232799e015165a1ff") + + depends_on("c", type="build") + depends_on("autoconf@2.69:", type="build") + depends_on("mpi", type=("build", "link", "run")) + + @property + def configure_directory(self) -> str: + if "@master" in self.spec: + return "mpi_sync_clocks" + else: + return super().configure_directory + + def autoreconf(self, spec, prefix): + with working_dir(self.configure_directory): + Executable("./autogen.sh")() diff --git a/var/spack/repos/builtin/packages/mpibenchmark/package.py b/var/spack/repos/builtin/packages/mpibenchmark/package.py new file mode 100644 index 00000000000000..7c6713f0eb47d8 --- /dev/null +++ b/var/spack/repos/builtin/packages/mpibenchmark/package.py @@ -0,0 +1,65 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Mpibenchmark(AutotoolsPackage): + """MadMPI benchmark. + + MadMPI benchmark is benchmark designed to assess the performance + of MPI libraries using various metrics. It may be used to + benchmark any MPI library. + """ + + homepage = "https://pm2.gitlabpages.inria.fr/mpibenchmark/" + url = "https://pm2.gitlabpages.inria.fr/releases/mpibenchmark-0.5.tar.gz" + list_url = "https://pm2.gitlabpages.inria.fr/releases/" + git = "https://gitlab.inria.fr/pm2/pm2.git" + + maintainers("a-denis") + license("GPL-2.0-or-later", checked_by="a-denis") + + version("master", branch="master") + version("0.5", sha256="bba9e5aa8b58c041f89e4518a0a7f80a63ebfaf0f90bb8bdd0976d1bf22bed83") + version("0.4", sha256="f3d562683bad29e00efae11a449596feacdef5f29cd4f1d60d01368adacece37") + version("0.3", sha256="af82d48a0a00971c9294725ea6944b8683c12ab3b8203357379fa0969e61325f") + version("0.2", sha256="b9b09f4cabd954e42adb3d7deb9af155eb8044f94206d59181e0173e3f3879d8") + version("0.1", sha256="c556d2339c00c4e4644de2dbf2e314ec117dbd3ea67c2ff7ebe5ddc0598a654e") + + variant("optimize", default=True, description="Build in optimized mode") + variant("debug", default=False, description="Build in debug mode") + variant("asan", default=False, description="Build with Address Sanitizer (ASAN)") + + depends_on("c", type="build") + depends_on("autoconf@2.69:", type="build") + depends_on("pkgconfig", type="build") + depends_on("gmake", type="build") + depends_on("hwloc") + depends_on("mpi", type=("build", "link", "run")) + depends_on("gnuplot+cairo", type=("build", "run")) + + build_directory = "build" + + @property + def configure_directory(self) -> str: + if "@master" in self.spec: + return "mpibenchmark" + else: + return super().configure_directory + + def configure_args(self): + config_args = [ + "--with-hwloc", # always use hwloc in spack + "--without-cuda", + "--without-hip", + self.enable_or_disable("optimize"), + self.enable_or_disable("debug"), + self.enable_or_disable("asan"), + ] + return config_args + + def autoreconf(self, spec, prefix): + with working_dir(self.configure_directory): + Executable("./autogen.sh")() diff --git a/var/spack/repos/builtin/packages/multicharge/package.py b/var/spack/repos/builtin/packages/multicharge/package.py new file mode 100644 index 00000000000000..0c16059434a426 --- /dev/null +++ b/var/spack/repos/builtin/packages/multicharge/package.py @@ -0,0 +1,50 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.build_systems import cmake, meson +from spack.package import * + + +class Multicharge(CMakePackage, MesonPackage): + """Electronegativity equilibration model for atomic partial charges""" + + homepage = "https://github.com/grimme-lab/multicharge" + url = "https://github.com/grimme-lab/multicharge/releases/download/v0.0.0/multicharge-0.0.0.tar.xz" + git = "https://github.com/grimme-lab/multicharge.git" + + maintainers("RMeli", "awvwgk") + + license("Apache-2.0", checked_by="RMeli") + + build_system("cmake", "meson", default="meson") + + version("0.3.0", sha256="e8f6615d445264798b12d2854e25c93938373dc149bb79e6eddd23fc4309749d") + + variant("openmp", default=True, description="Enable OpenMP support") + + depends_on("lapack") + depends_on("mctc-lib build_system=cmake", when="build_system=cmake") + depends_on("mctc-lib build_system=meson", when="build_system=meson") + + +class CMakeBuilder(cmake.CMakeBuilder): + def cmake_args(self): + args = [self.define_from_variant("WITH_OpenMP", "openmp")] + return args + + +class MesonBuilder(meson.MesonBuilder): + def meson_args(self): + lapack = self.spec["lapack"].libs.names[0] + if lapack == "lapack": + lapack = "netlib" + elif lapack.startswith("mkl"): + lapack = "mkl" + elif lapack != "openblas": + lapack = "auto" + + return [ + "-Dopenmp={0}".format(str("+openmp" in self.spec).lower()), + "-Dlapack={0}".format(lapack), + ] diff --git a/var/spack/repos/builtin/packages/mummer4/48bit_index.patch b/var/spack/repos/builtin/packages/mummer4/48bit_index.patch new file mode 100644 index 00000000000000..98ec46911a8f8a --- /dev/null +++ b/var/spack/repos/builtin/packages/mummer4/48bit_index.patch @@ -0,0 +1,10 @@ +--- include/mummer/48bit_index.hpp 2020-10-01 01:47:50.000000000 +0100 ++++ include/mummer/48bit_index.hpp.patched 2023-06-09 12:07:09.949856479 +0100 +@@ -6,6 +6,7 @@ + #endif + ++#include + #include "48bit_iterator.hpp" + + template + struct fortyeight_index { diff --git a/var/spack/repos/builtin/packages/mummer4/package.py b/var/spack/repos/builtin/packages/mummer4/package.py index a818047ffd40e9..8ff49847458d0f 100644 --- a/var/spack/repos/builtin/packages/mummer4/package.py +++ b/var/spack/repos/builtin/packages/mummer4/package.py @@ -25,3 +25,6 @@ class Mummer4(AutotoolsPackage): depends_on("perl@5.6.0:", type=("build", "run")) depends_on("awk", type="run") depends_on("sed", type="run") + + # Adds missing inclusion of + patch("48bit_index.patch", level=0, when="%gcc@13:") diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py index e509843534ca67..f4f242965b3f11 100644 --- a/var/spack/repos/builtin/packages/mvapich2/package.py +++ b/var/spack/repos/builtin/packages/mvapich2/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import re import sys diff --git a/var/spack/repos/builtin/packages/nalu-wind/package.py b/var/spack/repos/builtin/packages/nalu-wind/package.py index c80931591357e0..bc428851daeb3f 100644 --- a/var/spack/repos/builtin/packages/nalu-wind/package.py +++ b/var/spack/repos/builtin/packages/nalu-wind/package.py @@ -62,7 +62,8 @@ class NaluWind(CMakePackage, CudaPackage, ROCmPackage): depends_on("mpi") depends_on("yaml-cpp@0.6.0:0.7.0") - depends_on("openfast@4.0.0:+cxx+netcdf", when="+fsi") + depends_on("openfast@4.0.2:+cxx+netcdf", when="+fsi") + depends_on("openfast@4.0.2:+cxx+netcdf", when="+openfast") depends_on("trilinos@15.1.1", when="@=2.1.0") depends_on("trilinos@13.4.1", when="@=2.0.0") depends_on("hypre@2.29.0:", when="@2.0.0:+hypre") @@ -71,7 +72,6 @@ class NaluWind(CMakePackage, CudaPackage, ROCmPackage): "gotype=long cxxstd=17" ) depends_on("trilinos~cuda~wrapper", when="~cuda") - depends_on("openfast@2.6.0: +cxx", when="+openfast") depends_on("tioga@1.0.0:", when="+tioga") depends_on("hypre@2.18.2: ~int64+mpi~superlu-dist", when="+hypre") depends_on("trilinos+muelu+belos+amesos2+ifpack2", when="+trilinos-solvers") @@ -127,6 +127,9 @@ class NaluWind(CMakePackage, CudaPackage, ROCmPackage): conflicts("^trilinos+cuda", when="~cuda") conflicts("^trilinos+rocm", when="~rocm") conflicts("+shared", when="+trilinos-solvers") + conflicts( + "openfast@4.0.0:4.0.1", msg="OpenFAST 4.0.0:4.0.1 contains a bug. Use OpenFAST >= 4.0.2." + ) def setup_dependent_run_environment(self, env, dependent_spec): spec = self.spec @@ -140,9 +143,9 @@ def setup_build_environment(self, env): spec = self.spec env.append_flags("CXXFLAGS", "-DUSE_STK_SIMD_NONE") if spec.satisfies("+cuda"): - env.set("OMPI_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx) - env.set("MPICH_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx) - env.set("MPICXX_CXX", self.spec["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("OMPI_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("MPICH_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("MPICXX_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) if spec.satisfies("+rocm"): env.append_flags("CXXFLAGS", "-fgpu-rdc") diff --git a/var/spack/repos/builtin/packages/namd/package.py b/var/spack/repos/builtin/packages/namd/package.py index ab8433bc7f02c6..e2fb94c7186711 100644 --- a/var/spack/repos/builtin/packages/namd/package.py +++ b/var/spack/repos/builtin/packages/namd/package.py @@ -6,8 +6,6 @@ import platform import sys -import llnl.util.tty as tty - from spack.build_environment import optimization_flags from spack.package import * diff --git a/var/spack/repos/builtin/packages/nccmp/package.py b/var/spack/repos/builtin/packages/nccmp/package.py index 2159f0d9d2e870..d4a7a0ed837f7c 100644 --- a/var/spack/repos/builtin/packages/nccmp/package.py +++ b/var/spack/repos/builtin/packages/nccmp/package.py @@ -38,10 +38,11 @@ def cmake_args(self): args.append(self.define("CMAKE_C_FLAGS", " ".join(cflags))) nc = self.spec["netcdf-c"] - if "~shared" in nc: + if nc.satisfies("~shared"): nc_flags = Executable("nc-config")("--static", "--libs", output=str).strip() args.append(self.define("CMAKE_EXE_LINKER_FLAGS", nc_flags)) - if "+mpi" in nc: - args.append(self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc)) + + if nc.satisfies("+mpi"): + args.append(self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc)) return args diff --git a/var/spack/repos/builtin/packages/nektar/package.py b/var/spack/repos/builtin/packages/nektar/package.py index 50e1602a1c447e..a48d55b2b0c48e 100644 --- a/var/spack/repos/builtin/packages/nektar/package.py +++ b/var/spack/repos/builtin/packages/nektar/package.py @@ -4,8 +4,6 @@ import os -import llnl.util.filesystem as fs - from spack.package import * @@ -167,7 +165,7 @@ def install(self, spec, prefix): super(Nektar, self).install(spec, prefix) if "+python" in spec: python = which("python") - with fs.working_dir(self.build_directory): + with working_dir(self.build_directory): python("setup.py", "install", "--prefix", prefix) def setup_run_environment(self, env): diff --git a/var/spack/repos/builtin/packages/neofoam/package.py b/var/spack/repos/builtin/packages/neofoam/package.py new file mode 100644 index 00000000000000..7d6c3566bdfb7e --- /dev/null +++ b/var/spack/repos/builtin/packages/neofoam/package.py @@ -0,0 +1,23 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Neofoam(CMakePackage): + """NeoFOAM is a WIP prototype of a modern CFD core.""" + + homepage = "https://github.com/exasim-project/NeoFOAM" + git = "https://github.com/exasim-project/NeoFOAM.git" + + maintainers("greole", "HenningScheufler") + + license("MIT", checked_by="greole") + + version("main", branch="main") + + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("mpi") + depends_on("kokkos@4.3.0") diff --git a/var/spack/repos/builtin/packages/neovim/package.py b/var/spack/repos/builtin/packages/neovim/package.py index 43403b77ce9513..85ef5d8399f6e8 100644 --- a/var/spack/repos/builtin/packages/neovim/package.py +++ b/var/spack/repos/builtin/packages/neovim/package.py @@ -88,6 +88,7 @@ class Neovim(CMakePackage): ) # depend on virtual, lua-luajit-openresty preferred + depends_on("lua-lang") depends_on("luajit", when="~no_luajit") depends_on("lua-lang@5.1", when="+no_luajit") @@ -153,4 +154,7 @@ class Neovim(CMakePackage): @when("^lua") def cmake_args(self): - return [self.define("PREFER_LUA", True)] + return [ + self.define("PREFER_LUA", True), + self.define("LPEG_LIBRARY", self.spec["lua-lpeg"].libs), + ] diff --git a/var/spack/repos/builtin/packages/netlib-lapack/package.py b/var/spack/repos/builtin/packages/netlib-lapack/package.py index 69b9866c76c3a5..43eb8e9881dc75 100644 --- a/var/spack/repos/builtin/packages/netlib-lapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-lapack/package.py @@ -20,6 +20,11 @@ class NetlibLapack(CMakePackage): license("BSD-3-Clause-Open-MPI") + version( + "3.12.1", + sha256="2ca6407a001a474d4d4d35f3a61550156050c48016d949f0da0529c0aa052422", + url="https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.12.1.tar.gz", + ) version( "3.12.0", sha256="eac9570f8e0ad6f30ce4b963f4f033f0f643e7c3912fc9ee6cd99120675ad48b", @@ -67,6 +72,7 @@ class NetlibLapack(CMakePackage): # netlib-lapack is the reference implementation of LAPACK for ver in [ + "3.12.1", "3.12.0", "3.11.0", "3.10.1", @@ -114,12 +120,30 @@ class NetlibLapack(CMakePackage): # https://github.com/Reference-LAPACK/lapack/pull/268 patch("testing.patch", when="@3.7.0:3.8") + # renaming with _64 suffixes pushes code beyond fortran column 72 + patch( + "https://github.com/Reference-LAPACK/lapack/pull/1093.patch?full_index=1", + sha256="b1af8b6ef2113a59aba006319ded0c1a282533c3815289e1c9e91185f63ee9fe", + when="@3.6:3.12.1", + ) + patch( + "https://github.com/Reference-LAPACK/lapack/pull/1094.patch?full_index=1", + sha256="e318340ec2e10539b756f50a4816242519d9a14134d3966c669ec64d292758c8", + when="@3.12:3.12.1", + ) + patch( + "https://github.com/Reference-LAPACK/lapack/pull/1099.patch?full_index=1", + sha256="3059ebf898cbca5101db77b77c645ab144a3cecbe58dd2bb46d9b84e7debee92", + when="@3.12:3.12.1", + ) + # liblapack links to libblas, so if this package is used as a lapack # provider, it must also provide blas. provides("lapack", "blas", when="~external-blas") provides("lapack") depends_on("c", type="build") + depends_on("cxx", type="build", when="@:3.12.0") depends_on("fortran", type="build") depends_on("blas", when="+external-blas") depends_on("netlib-xblas+fortran+plain_blas", when="+xblas") diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 89ec06ec20cc8d..c1ac240f57c5c5 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -113,7 +113,7 @@ class NetlibScalapack(ScalapackBase): """ homepage = "https://www.netlib.org/scalapack/" - url = "https://www.netlib.org/scalapack/scalapack-2.0.2.tgz" + url = "https://github.com/Reference-ScaLAPACK/scalapack/archive/refs/tags/v2.2.2.tar.gz" git = "https://github.com/Reference-ScaLAPACK/scalapack" tags = ["e4s"] @@ -121,8 +121,9 @@ class NetlibScalapack(ScalapackBase): license("BSD-3-Clause-Open-MPI") - version("2.2.0", sha256="40b9406c20735a9a3009d863318cb8d3e496fb073d201c5463df810e01ab2a57") - version("2.1.0", sha256="61d9216cf81d246944720cfce96255878a3f85dec13b9351f1fa0fd6768220a6") + version("2.2.2", sha256="a2f0c9180a210bf7ffe126c9cb81099cf337da1a7120ddb4cbe4894eb7b7d022") + version("2.2.0", sha256="8862fc9673acf5f87a474aaa71cd74ae27e9bbeee475dbd7292cec5b8bcbdcf3") + version("2.1.0", sha256="f03fda720a152030b582a237f8387014da878b84cbd43c568390e9f05d24617f") version("2.0.2", sha256="0c74aeae690fe5ee4db7926f49c5d0bb69ce09eea75beb915e00bba07530395c") version("2.0.1", sha256="a9b34278d4e10b40cbe084c6d87d09af8845e874250719bfbbc497b2a88bfde1") version("2.0.0", sha256="e51fbd9c3ef3a0dbd81385b868e2355900148eea689bf915c5383d72daf73114") @@ -132,3 +133,9 @@ class NetlibScalapack(ScalapackBase): depends_on("fortran", type="build") # generated # versions before 2.0.0 are not using cmake and requires blacs as # a separated package + + def url_for_version(self, version): + if self.spec.satisfies("@2.2:"): + return super().url_for_version(version) + url_fmt = "https://www.netlib.org/scalapack/scalapack-{0}.tgz" + return url_fmt.format(version) diff --git a/var/spack/repos/builtin/packages/ngspice/package.py b/var/spack/repos/builtin/packages/ngspice/package.py index d64e5230cdabd2..ceef484b61eb56 100644 --- a/var/spack/repos/builtin/packages/ngspice/package.py +++ b/var/spack/repos/builtin/packages/ngspice/package.py @@ -21,6 +21,7 @@ class Ngspice(AutotoolsPackage): # Master version by default adds the experimental adms feature version("master", branch="master") + version("44", sha256="3865d13ab44f1f01f68c7ac0e0716984e45dce5a86d126603c26d8df30161e9b") version("43", sha256="14dd6a6f08531f2051c13ae63790a45708bd43f3e77886a6a84898c297b13699") version("42", sha256="737fe3846ab2333a250dfadf1ed6ebe1860af1d8a5ff5e7803c772cc4256e50a") version("41", sha256="1ce219395d2f50c33eb223a1403f8318b168f1e6d1015a7db9dbf439408de8c4") diff --git a/var/spack/repos/builtin/packages/nim/package.py b/var/spack/repos/builtin/packages/nim/package.py index e01bd79628d9d1..f5db59f3349667 100644 --- a/var/spack/repos/builtin/packages/nim/package.py +++ b/var/spack/repos/builtin/packages/nim/package.py @@ -15,7 +15,7 @@ class Nim(Package): """ homepage = "https://nim-lang.org/" - url = "https://nim-lang.org/download/nim-2.2.0.tar.xz" + url = "https://nim-lang.org/download/nim-2.2.2.tar.xz" git = "https://github.com/nim-lang/Nim.git" license("MIT", checked_by="Buldram") @@ -23,6 +23,7 @@ class Nim(Package): maintainers("Buldram") version("devel", branch="devel") + version("2.2.2", sha256="7fcc9b87ac9c0ba5a489fdc26e2d8480ce96a3ca622100d6267ef92135fd8a1f") version("2.2.0", sha256="ce9842849c9760e487ecdd1cdadf7c0f2844cafae605401c7c72ae257644893c") version("2.0.14", sha256="d420b955833294b7861e3fb65021dac26d1c19c528c4d6e139ccd379e2c15a43") version("2.0.12", sha256="c4887949c5eb8d7f9a9f56f0aeb2bf2140fabf0aee0f0580a319e2a09815733a") @@ -104,9 +105,7 @@ class Nim(Package): phases = ["build", "install"] def patch(self): - """Hardcode dependency dynamic library paths into - wrapper modules using rpath.""" - + # Hardcode dependency dynamic library paths into wrapper modules using rpath def append_rpath(path, libdirs): """Add a pragma at the end of the file which passes rpath with libdirs to the linker when the module is used.""" @@ -132,6 +131,22 @@ def append_rpath(path, libdirs): if spec.satisfies("+sqlite"): append_rpath("lib/wrappers/sqlite3.nim", spec["sqlite"].libs.directories) + # Musl defines SysThread as a struct *pthread_t rather than an unsigned long as glibc does. + if self.spec.satisfies("^[virtuals=libc] musl"): + if self.spec.satisfies("@devel,1.9.3:"): + pthreadModule = "lib/std/private/threadtypes.nim" + elif self.spec.satisfies("@:0.19.6"): + pthreadModule = "lib/system/threads.nim" + else: + pthreadModule = "lib/system/threadlocalstorage.nim" + + filter_file( + 'header: "" .} = distinct culong', + 'header: "" .} = pointer', + pthreadModule, + string=True, + ) + def build(self, spec, prefix): if spec.satisfies("@devel"): with working_dir("csources_v2"): diff --git a/var/spack/repos/builtin/packages/ninja-fortran/package.py b/var/spack/repos/builtin/packages/ninja-fortran/package.py index 5bb0bb2ea919c0..54f4dd93bb25d1 100644 --- a/var/spack/repos/builtin/packages/ninja-fortran/package.py +++ b/var/spack/repos/builtin/packages/ninja-fortran/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import spack.version from spack.package import * @@ -63,7 +62,7 @@ def url_for_version(self, version): split_ver = str(ver).split(".") url_version = ".".join(split_ver[:3]) + "." + split_ver[4] - if version < spack.version.Version("1.8.2.1"): + if version < Version("1.8.2.1"): url = "https://github.com/Kitware/ninja/archive/v{0}.kitware.dyndep-1.tar.gz" else: url = ( diff --git a/var/spack/repos/builtin/packages/nlcglib/package.py b/var/spack/repos/builtin/packages/nlcglib/package.py index d5c17f3ac59ae6..55ac169201a0f6 100644 --- a/var/spack/repos/builtin/packages/nlcglib/package.py +++ b/var/spack/repos/builtin/packages/nlcglib/package.py @@ -116,7 +116,7 @@ def cmake_args(self): if "+cuda%gcc" in self.spec: options += [ self.define( - "CMAKE_CXX_COMPILER", "{0}".format(self.spec["kokkos-nvcc-wrapper"].kokkos_cxx) + "CMAKE_CXX_COMPILER", "{0}".format(self["kokkos-nvcc-wrapper"].kokkos_cxx) ) ] diff --git a/var/spack/repos/builtin/packages/nnn/package.py b/var/spack/repos/builtin/packages/nnn/package.py new file mode 100644 index 00000000000000..5cc0561e289e52 --- /dev/null +++ b/var/spack/repos/builtin/packages/nnn/package.py @@ -0,0 +1,97 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Nnn(MakefilePackage): + """nnn (n³) is a full-featured terminal file manager. + It's tiny, nearly 0-config and incredibly fast.""" + + homepage = "https://github.com/jarun/nnn" + url = "https://github.com/jarun/nnn/archive/refs/tags/v5.0.tar.gz" + + maintainers("fthaler") + + license("BSD-2-Clause", checked_by="fthaler") + + version("5.0", sha256="31e8fd85f3dd7ab2bf0525c3c0926269a1e6d35a5343a6714315642370d8605a") + + depends_on("binutils", type="build") + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("pkgconfig", type="build") + + depends_on("coreutils") + depends_on("file") + depends_on("git", when="+gitstatus") + depends_on("ncurses") + depends_on("pcre", when="+pcre") + depends_on("readline", when="+readline") + depends_on("sed") + depends_on("tar") + depends_on("zip") + + variant("mouse", default=True, description="Enable mouse support") + variant( + "pcre", + default=False, + description="Use Perl Compatible Regular Expressions (default is POSIX)", + ) + variant("readline", default=True, description="Compile with readline") + variant( + "icons", + values=("none", "emoji", "nerd", "icons-in-terminal"), + default="emoji", + description="Choose the icons to use " + "(see https://github.com/jarun/nnn/wiki/Advanced-use-cases#file-icons)", + ) + + variant("colemak", default=False, description="Key bindings for Colemak keyboard layout") + variant("gitstatus", default=True, description="Add git status column to the detail view") + variant("namefirst", default=False, description="Print filenames first in the detail view") + variant( + "restorepreview", + default=False, + description="Add pipe to close and restore preview-tui for internal undetached edits", + ) + + def setup_build_environment(self, env): + spec = self.spec + env.set("PREFIX", self.prefix) + if "+pcre" in spec: + env.append_flags("CPPFLAGS", spec["pcre"].headers.include_flags) + env.append_flags("LDFLAGS", spec["pcre"].libs.ld_flags) + + @property + def build_targets(self): + spec = self.spec + targets = [] + if "~mouse" in spec: + targets.append("O_NOMOUSE=1") + if "+pcre" in spec: + targets.append("O_PCRE=1") + if "~readline" in spec: + targets.append("O_NORL=1") + + if "icons=emoji" in spec: + targets.append("O_EMOJI=1") + elif "icons=nerd" in spec: + targets.append("O_NERD=1") + elif "icons=icons-in-terminal" in spec: + targets.append("O_ICONS=1") + + if "+colemak" in spec: + targets.append("O_COLEMAK=1") + if "+gitstatus" in spec: + targets.append("O_GITSTATUS=1") + if "+namefirst" in spec: + targets.append("O_NAMEFIRST=1") + if "+restorepreview" in spec: + targets.append("O_RESTOREPREVIEW=1") + return targets + + @property + def install_targets(self): + return self.build_targets + ["strip", "install"] diff --git a/var/spack/repos/builtin/packages/node-js/package.py b/var/spack/repos/builtin/packages/node-js/package.py index b9d795c0fc38fb..a5ce2599d4dd75 100644 --- a/var/spack/repos/builtin/packages/node-js/package.py +++ b/var/spack/repos/builtin/packages/node-js/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re import subprocess import sys @@ -137,6 +138,21 @@ class NodeJs(Package): # and https://github.com/nodejs/node/issues/53633 patch("fix-broken-gcc12-pr53728.patch", when="@22.2:22.5") + # https://github.com/nodejs/node/issues/55596 + # This patch is not sufficient, however, therefore + # add a conflict with this particular version of gcc + # until https://github.com/spack/spack/issues/48492 is resolved + patch("wasm-compiler-gcc11p2.patch", when="@21:22 %gcc@11.2") + conflicts("%gcc@11.2", when="@21:") + + executables = ["^node$"] + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str) + match = re.match(r"v([\d.]+)\s*", output) + return match.group(1) if match else None + def setup_build_environment(self, env): # Force use of experimental Python 3 support env.set("PYTHON", self.spec["python"].command.path) diff --git a/var/spack/repos/builtin/packages/node-js/wasm-compiler-gcc11p2.patch b/var/spack/repos/builtin/packages/node-js/wasm-compiler-gcc11p2.patch new file mode 100644 index 00000000000000..7670c935132df8 --- /dev/null +++ b/var/spack/repos/builtin/packages/node-js/wasm-compiler-gcc11p2.patch @@ -0,0 +1,40 @@ +diff --git a/deps/v8/src/compiler/wasm-compiler.cc b/deps/v8/src/compiler/wasm-compiler.cc +--- a/deps/v8/src/compiler/wasm-compiler.cc 2024-10-28 21:25:11.000000000 -0400 ++++ b/deps/v8/src/compiler/wasm-compiler.cc 2024-11-01 02:02:22.554537121 -0400 +@@ -8613,11 +8613,13 @@ + '-'); + + auto compile_with_turboshaft = [&]() { ++ wasm::WrapperCompilationInfo ci; ++ ci.code_kind = CodeKind::WASM_TO_JS_FUNCTION; ++ ci.import_info.import_kind = kind; ++ ci.import_info.expected_arity = expected_arity; ++ ci.import_info.suspend = suspend; + return Pipeline::GenerateCodeForWasmNativeStubFromTurboshaft( +- env->module, sig, +- wasm::WrapperCompilationInfo{ +- .code_kind = CodeKind::WASM_TO_JS_FUNCTION, +- .import_info = {kind, expected_arity, suspend}}, ++ env->module, sig, ci, + func_name, WasmStubAssemblerOptions(), nullptr); + }; + auto compile_with_turbofan = [&]() { +@@ -8774,12 +8776,14 @@ + base::VectorOf(name_buffer.get(), kMaxNameLen) + kNamePrefixLen, sig); + + auto compile_with_turboshaft = [&]() { ++ wasm::WrapperCompilationInfo ci; ++ ci.code_kind = CodeKind::WASM_TO_JS_FUNCTION; ++ ci.import_info.import_kind = kind; ++ ci.import_info.expected_arity = expected_arity; ++ ci.import_info.suspend = suspend; + std::unique_ptr job = + Pipeline::NewWasmTurboshaftWrapperCompilationJob( +- isolate, sig, +- wasm::WrapperCompilationInfo{ +- .code_kind = CodeKind::WASM_TO_JS_FUNCTION, +- .import_info = {kind, expected_arity, suspend}}, ++ isolate, sig, ci, + nullptr, std::move(name_buffer), WasmAssemblerOptions()); + + // Compile the wrapper diff --git a/var/spack/repos/builtin/packages/npm/package.py b/var/spack/repos/builtin/packages/npm/package.py index aa187ed43c4363..7d24a00029fcb4 100644 --- a/var/spack/repos/builtin/packages/npm/package.py +++ b/var/spack/repos/builtin/packages/npm/package.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os +import re import shutil from spack.package import * @@ -15,6 +16,8 @@ class Npm(Package): url = "https://registry.npmjs.org/npm/-/npm-9.3.1.tgz" git = "https://github.com/npm/cli.git" + tags = ["build-tools"] + license("Artistic-2.0") version("9.3.1", sha256="41caa26a340b0562bc5429d28792049c980fe3e872b42b82cad94e8f70e37f40") @@ -45,6 +48,14 @@ class Npm(Package): when="@6", ) + executables = ["^npm$"] + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str).strip() + match = re.match(r"([\d.]+)\s*", output) + return match.group(1) if match else None + @when("@6") def patch(self): shutil.rmtree("node_modules/node-gyp") diff --git a/var/spack/repos/builtin/packages/nrm/package.py b/var/spack/repos/builtin/packages/nrm/package.py index 942a99b6a5202c..c993c5c4c25400 100644 --- a/var/spack/repos/builtin/packages/nrm/package.py +++ b/var/spack/repos/builtin/packages/nrm/package.py @@ -13,10 +13,6 @@ class Nrm(PythonPackage): version("0.1.0", sha256="911a848042fa50ed216c818e0667bcd3e4219687eb5a35476b7313abe12106dc") depends_on("py-setuptools", type=("build")) - # using py-pip@23.1 results in - # ValueError: ZIP does not support timestamps before 1980 - depends_on("py-pip@:23.0", type="build") - depends_on("py-six", type=("build", "run")) depends_on("py-pyzmq@17.1.2", type=("build", "run")) depends_on("py-pyyaml", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/nvhpc/package.py b/var/spack/repos/builtin/packages/nvhpc/package.py index 38319949b36af3..fe530a289ae345 100644 --- a/var/spack/repos/builtin/packages/nvhpc/package.py +++ b/var/spack/repos/builtin/packages/nvhpc/package.py @@ -7,7 +7,6 @@ import platform from spack.package import * -from spack.util.prefix import Prefix # FIXME Remove hack for polymorphic versions # This package uses a ugly hack to be able to dispatch, given the same @@ -20,6 +19,16 @@ # - package key must be in the form '{os}-{arch}' where 'os' is in the # format returned by platform.system() and 'arch' by platform.machine() _versions = { + "25.1": { + "Linux-aarch64": ( + "0e1d694d54d44559155024d5bab4ca6764eba52d3f27b89f5c252416976e0360", + "https://developer.download.nvidia.com/hpc-sdk/25.1/nvhpc_2025_251_Linux_aarch64_cuda_multi.tar.gz", + ), + "Linux-x86_64": ( + "0813791f8363f4c493db7891b00396ce522cb73910279b8f18a440aedda6727c", + "https://developer.download.nvidia.com/hpc-sdk/25.1/nvhpc_2025_251_Linux_x86_64_cuda_multi.tar.gz", + ), + }, "24.11": { "Linux-aarch64": ( "f2f64e5dec5e90dad5e12a31a992172b0aa19abf872ef1c54a1a437c7008eefb", diff --git a/var/spack/repos/builtin/packages/nvpl-blas/package.py b/var/spack/repos/builtin/packages/nvpl-blas/package.py index 560c9230af6603..9cbc2c167407e1 100644 --- a/var/spack/repos/builtin/packages/nvpl-blas/package.py +++ b/var/spack/repos/builtin/packages/nvpl-blas/package.py @@ -21,6 +21,7 @@ class NvplBlas(Package): license("UNKNOWN") + version("0.4.0.1", sha256="6655898327ed36afd0242719075447058c3c89640b5b9bbfeb5af4dd5c101174") version("0.3.0", sha256="b51cb199a440c1e8673d3d845d395950c9a9020d4e83af2655eb96c23c6ec90d") version("0.2.0.1", sha256="ba29f6a9d3831b6ae5c9265b4d124c13b9b9e0faea025359b02b41ad230975c2") version("0.1.0", sha256="4ccc894593cbcbfaa1a4f3c54505982691971667acf191c9ab0f4252a37c8063") diff --git a/var/spack/repos/builtin/packages/nvpl-lapack/package.py b/var/spack/repos/builtin/packages/nvpl-lapack/package.py index e42ba1e8ce4168..dfc82368275b66 100644 --- a/var/spack/repos/builtin/packages/nvpl-lapack/package.py +++ b/var/spack/repos/builtin/packages/nvpl-lapack/package.py @@ -21,6 +21,7 @@ class NvplLapack(Package): license("UNKNOWN") + version("0.3.0", sha256="41cc18fc52f6869747b4185a96e34de93a53eb9d6aa95aab07082958055161b0") version("0.2.3.1", sha256="25927df133c5486fd71d5976c93917c96e62275a78dffc354bcaf1b022f56f8e") version("0.2.2.1", sha256="cdfbf69517a044e99e3e6231c8b2f4e845fd0de57775ccad6b4b0b4fe7e91e84") version("0.2.0.1", sha256="7054f775b18916ee662c94ad7682ace53debbe8ee36fa926000fe412961edb0b") diff --git a/var/spack/repos/builtin/packages/nvtx/package.py b/var/spack/repos/builtin/packages/nvtx/package.py index 03ad25176469d7..d1a04d9c85c641 100644 --- a/var/spack/repos/builtin/packages/nvtx/package.py +++ b/var/spack/repos/builtin/packages/nvtx/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.build_systems.python import PythonPipBuilder from spack.package import * diff --git a/var/spack/repos/builtin/packages/nwchem/oneapi2025.patch b/var/spack/repos/builtin/packages/nwchem/oneapi2025.patch new file mode 100644 index 00000000000000..2b53652563000b --- /dev/null +++ b/var/spack/repos/builtin/packages/nwchem/oneapi2025.patch @@ -0,0 +1,36 @@ +diff -ruN spack-src/src/config/makefile.h spack-src-patched/src/config/makefile.h +--- spack-src/src/config/makefile.h 2024-08-28 02:30:22.000000000 +0000 ++++ spack-src-patched/src/config/makefile.h 2025-02-07 16:03:07.315882016 +0000 +@@ -2364,15 +2364,14 @@ + _GOTAVX2 := $(shell cat /proc/cpuinfo | grep fma | tail -n 1 | awk ' /fma/ {print "Y"}') + _GOTAVX512F := $(shell cat /proc/cpuinfo | grep avx512f | tail -n 1 | awk ' /avx512f/ {print "Y"}') + endif +- _IFCE := $(shell ifort -V 2>&1 |head -1 |awk ' /64/ {print "Y";exit};') +- _IFCV7 := $(shell ifort -v 2>&1|grep "Version "|head -n 1|awk ' /7./ {print "Y";exit}') +- _IFCV11 := $(shell ifort -logo 2>&1|grep "Version "|head -n 1|sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 11) {print "Y";exit}}') +- _IFCV12 := $(shell ifort -logo 2>&1|grep "Version "|head -n 1|sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 12) {print "Y";exit}}') +- _IFCV14 := $(shell ifort -logo 2>&1|grep "Version "|head -n 1|sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 14) {print "Y";exit}}') +- _IFCV15ORNEWER := $(shell ifort -logo 2>&1|grep "Version "|head -n 1 | sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 15) {print "Y";exit}}') +- _IFCV17 := $(shell ifort -logo 2>&1|grep "Version "|head -n 1 | sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 17) {print "Y";exit}}') +- _IFCV18 := $(shell ifort -logo 2>&1|grep "Version "|head -n 1 | sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 18) {print "Y";exit}}') +- ++ _IFCE := $(shell $(FC) -V 2>&1 |head -1 |awk ' /64/ {print "Y";exit};') ++ _IFCV7 := $(shell $(FC) -v 2>&1|grep "Version "|head -n 1|awk ' /7./ {print "Y";exit}') ++ _IFCV11 := $(shell $(FC) -logo 2>&1|grep "Version "|head -n 1|sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 11) {print "Y";exit}}') ++ _IFCV12 := $(shell $(FC) -logo 2>&1|grep "Version "|head -n 1|sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 12) {print "Y";exit}}') ++ _IFCV14 := $(shell $(FC) -logo 2>&1|grep "Version "|head -n 1|sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 14) {print "Y";exit}}') ++ _IFCV15ORNEWER := $(shell $(FC) -logo 2>&1|grep "Version "|head -n 1 | sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 15) {print "Y";exit}}') ++ _IFCV17 := $(shell $(FC) -logo 2>&1|grep "Version "|head -n 1 | sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 17) {print "Y";exit}}') ++ _IFCV18 := $(shell $(FC) -logo 2>&1|grep "Version "|head -n 1 | sed 's/.*Version \([0-9][0-9]\).*/\1/' | awk '{if ($$1 >= 18) {print "Y";exit}}') + # Intel EM64T is required + ifneq ($(_IFCE),Y) + defineFCE: +@@ -2406,7 +2405,7 @@ + # CPP=fpp -P + # + ifeq ($(_IFCV15ORNEWER), Y) +- IFORTVER := $(shell ifort -v 2>&1|cut -d " " -f 3) ++ IFORTVER := $(shell $(FC) -v 2>&1|cut -d " " -f 3) + # ifeq ($(IFORTVER),2021.7.0) + # $(info ) + # $(info ifort 2021.7.0 not validated) diff --git a/var/spack/repos/builtin/packages/nwchem/package.py b/var/spack/repos/builtin/packages/nwchem/package.py index 222d6e5a7407f3..de05736af604b0 100644 --- a/var/spack/repos/builtin/packages/nwchem/package.py +++ b/var/spack/repos/builtin/packages/nwchem/package.py @@ -13,11 +13,14 @@ class Nwchem(Package): homepage = "https://nwchemgit.github.io" url = "https://github.com/nwchemgit/nwchem/releases/download/v7.2.0-release/nwchem-7.2.0-release.revision-d0d141fd-srconly.2023-03-10.tar.bz2" + git = "https://github.com/nwchemgit/nwchem.git" tags = ["ecp", "ecp-apps"] maintainers("jeffhammond") + version("master", branch="master") + version( "7.2.3", sha256="8cb4ec065215bc0316d8e01f67f1674a572f7d0f565c52e4a327975c04ddb6eb", @@ -69,6 +72,9 @@ class Nwchem(Package): "elpa", default=False, description="Enable optimised diagonalisation routines from ELPA" ) + # https://github.com/nwchemgit/nwchem/pull/1034 + patch("oneapi2025.patch", when="@7.2.3 %oneapi@2025:") + # This patch is for the modification of the build system (e.g. compiler flags) and # Fortran syntax to enable the compilation with Fujitsu compilers. The modification # will be merged to the next release of NWChem (see https://github.com/nwchemgit/nwchem/issues/347 diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py index 48646f6f62be8a..494f025be2f612 100644 --- a/var/spack/repos/builtin/packages/octave/package.py +++ b/var/spack/repos/builtin/packages/octave/package.py @@ -1,7 +1,7 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os import re import shutil import sys @@ -29,6 +29,7 @@ class Octave(AutotoolsPackage, GNUMirrorPackage): license("GPL-3.0-or-later") + version("9.3.0", sha256="809fa39a7acc84815bf4dc4d2d7e6b228ce75a07f3b2413f3313aa8e0aaa3287") version("9.1.0", sha256="3f8c6c6ecfa249a47c97e18e651be4db8499be2f5de1a095a3eea53efc01d6a1") version("8.4.0", sha256="6b38dd9751678424aeb3a9d666432b1f378eb3971a21290a90cd3d35119d56ad") version("8.2.0", sha256="57d17f918a940d38ca3348211e110b34d735a322a87db71c177c4692a49a9c84") @@ -327,12 +328,12 @@ def configure_args(self): if "+qhull" in spec: config_args.extend( [ - "--with-qhull-includedir=%s" % spec["qhull"].prefix.include, - "--with-qhull-libdir=%s" % spec["qhull"].prefix.lib, + "--with-qhull_r-includedir=%s" % spec["qhull"].prefix.include, + "--with-qhull_r-libdir=%s" % spec["qhull"].prefix.lib, ] ) else: - config_args.append("--without-qhull") + config_args.append("--without-qhull_r") if "+qrupdate" in spec: config_args.extend( @@ -370,7 +371,9 @@ def configure_args(self): config_args.append("--enable-fortran-calling-convention=gfortran") # Make sure we do not use qtchooser - config_args.append("ac_cv_prog_ac_ct_QTCHOOSER=") + if spec.satisfies("+qt"): + config_args.append("ac_cv_prog_ac_ct_QTCHOOSER=") + config_args.append("--with-qt={0}".format(str(spec["qt"].version.up_to(1)))) return config_args diff --git a/var/spack/repos/builtin/packages/octopus/package.py b/var/spack/repos/builtin/packages/octopus/package.py index 6e03884c3fba6d..6a690b1057aab8 100644 --- a/var/spack/repos/builtin/packages/octopus/package.py +++ b/var/spack/repos/builtin/packages/octopus/package.py @@ -4,9 +4,6 @@ import os -import llnl.util.filesystem as fs -import llnl.util.tty as tty - from spack.package import * @@ -193,7 +190,7 @@ def configure_args(self): else: # To be foolproof, fail with a proper error message # if neither FFTW nor MKL are in the dependency tree. - tty.die( + raise InstallError( 'Unsupported "fftw-api" provider, ' "currently only FFTW and MKL are supported.\n" "Please report this issue on Spack's repository." @@ -370,7 +367,7 @@ def test_recipe(self): with working_dir("example-recipe", create=True): print("Current working directory (in example-recipe)") - fs.copy(join_path(os.path.dirname(__file__), "test", "recipe.inp"), "inp") + copy(join_path(os.path.dirname(__file__), "test", "recipe.inp"), "inp") exe = which(self.spec.prefix.bin.octopus) out = exe(output=str.split, error=str.split) check_outputs(expected, out) @@ -399,7 +396,7 @@ def test_he(self): with working_dir("example-he", create=True): print("Current working directory (in example-he)") - fs.copy(join_path(os.path.dirname(__file__), "test", "he.inp"), "inp") + copy(join_path(os.path.dirname(__file__), "test", "he.inp"), "inp") exe = which(self.spec.prefix.bin.octopus) out = exe(output=str.split, error=str.split) check_outputs(expected, out) diff --git a/var/spack/repos/builtin/packages/of-precice/package.py b/var/spack/repos/builtin/packages/of-precice/package.py index cb0adbdad6ddcc..5980ac846f4faa 100644 --- a/var/spack/repos/builtin/packages/of-precice/package.py +++ b/var/spack/repos/builtin/packages/of-precice/package.py @@ -4,8 +4,6 @@ import os -import llnl.util.tty as tty - from spack.package import * from spack.pkg.builtin.openfoam import add_extra_files diff --git a/var/spack/repos/builtin/packages/omniperf/package.py b/var/spack/repos/builtin/packages/omniperf/package.py index 4f1db8330c7c11..36847f5f7abb17 100644 --- a/var/spack/repos/builtin/packages/omniperf/package.py +++ b/var/spack/repos/builtin/packages/omniperf/package.py @@ -17,7 +17,7 @@ class Omniperf(CMakePackage): maintainers("afzpatel", "srekolam", "renjithravindrankannath") license("MIT") - + version("6.3.1", sha256="2b79cb3ecced9a40f6871286967d00b1ab87f9cdff8283819fd7ae44b230d4bf") version("6.3.0", sha256="f8e9703b5f78abba6f4a61f69ffc73225d1bb47b591cf33a26ed98060efd65d1") version("6.2.4", sha256="2230260fce0838583899f4969b936ca047b30985a0fffad276ea353232538770") version("6.2.1", sha256="56b795d471adad8ee9d7025544269e23929da31524d73db6f54396d3aca1445a") diff --git a/var/spack/repos/builtin/packages/oommf/package.py b/var/spack/repos/builtin/packages/oommf/package.py index b2a5bfae283e69..d8e6dec46b7df6 100644 --- a/var/spack/repos/builtin/packages/oommf/package.py +++ b/var/spack/repos/builtin/packages/oommf/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index bc9fa8b0c46ddc..bbd39d05d0850b 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -324,7 +324,7 @@ def libs(self): spec = self.spec # Look for openblas{symbol_suffix} - name = ["libopenblas", "openblas"] + name = self.libraries search_shared = bool(spec.variants["shared"].value) suffix = spec.variants["symbol_suffix"].value if suffix != "none": diff --git a/var/spack/repos/builtin/packages/opendatadetector/package.py b/var/spack/repos/builtin/packages/opendatadetector/package.py index 8ca314331b74d6..f2c03e60ecffbd 100644 --- a/var/spack/repos/builtin/packages/opendatadetector/package.py +++ b/var/spack/repos/builtin/packages/opendatadetector/package.py @@ -23,7 +23,8 @@ class Opendatadetector(CMakePackage): version("v2", tag="v2", commit="7041ae086dff4ee4a8d5b65f5d9559acc6dbec47") version("v1", tag="v1", commit="81c43c6511723c13c15327479082d3dcfa1947c7") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") # because of DD4hep + depends_on("cxx", type="build") depends_on("dd4hep") depends_on("root") diff --git a/var/spack/repos/builtin/packages/openfast/package.py b/var/spack/repos/builtin/packages/openfast/package.py index 5feb3ea11e3a1f..ab097acdd88484 100644 --- a/var/spack/repos/builtin/packages/openfast/package.py +++ b/var/spack/repos/builtin/packages/openfast/package.py @@ -17,7 +17,7 @@ class Openfast(CMakePackage): version("develop", branch="dev") version("master", branch="main") - version("4.0.0", tag="v4.0.0") + version("4.0.2", tag="v4.0.2") version("3.5.5", tag="v3.5.5") version("3.5.4", tag="v3.5.4") version("3.5.3", tag="v3.5.3") @@ -37,6 +37,10 @@ class Openfast(CMakePackage): version("2.0.0", tag="v2.0.0") version("1.0.0", tag="v1.0.0") + with default_args(deprecated=True): + version("4.0.1", tag="v4.0.1") + version("4.0.0", tag="v4.0.0") + depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated depends_on("fortran", type="build") # generated diff --git a/var/spack/repos/builtin/packages/openfoam-org/package.py b/var/spack/repos/builtin/packages/openfoam-org/package.py index 5ee5aea8a42a3a..ac3b21a0af7c3a 100644 --- a/var/spack/repos/builtin/packages/openfoam-org/package.py +++ b/var/spack/repos/builtin/packages/openfoam-org/package.py @@ -38,8 +38,6 @@ import os import re -import llnl.util.tty as tty - from spack.package import * from spack.pkg.builtin.openfoam import ( OpenfoamArch, @@ -48,7 +46,6 @@ rewrite_environ_files, write_environ, ) -from spack.util.environment import EnvironmentModifications class OpenfoamOrg(Package): diff --git a/var/spack/repos/builtin/packages/openfoam/package.py b/var/spack/repos/builtin/packages/openfoam/package.py index 81745c838019a3..90cb3c784ff8ce 100644 --- a/var/spack/repos/builtin/packages/openfoam/package.py +++ b/var/spack/repos/builtin/packages/openfoam/package.py @@ -43,11 +43,8 @@ import os import re -import llnl.util.tty as tty - from spack.package import * from spack.pkg.builtin.boost import Boost -from spack.util.environment import EnvironmentModifications # Not the nice way of doing things, but is a start for refactoring __all__ = [ diff --git a/var/spack/repos/builtin/packages/openjdk/package.py b/var/spack/repos/builtin/packages/openjdk/package.py index 932ba1080b5e81..bc07e1e2341f41 100644 --- a/var/spack/repos/builtin/packages/openjdk/package.py +++ b/var/spack/repos/builtin/packages/openjdk/package.py @@ -7,7 +7,6 @@ import re from spack.package import * -from spack.util.prefix import Prefix # If you need to add a new version, please be aware that: # - versions in the following dict are automatically added to the package diff --git a/var/spack/repos/builtin/packages/openldap/package.py b/var/spack/repos/builtin/packages/openldap/package.py index 6e4a643046f8d7..f3d0297b8baa4f 100644 --- a/var/spack/repos/builtin/packages/openldap/package.py +++ b/var/spack/repos/builtin/packages/openldap/package.py @@ -50,17 +50,22 @@ class Openldap(AutotoolsPackage): conflicts("~static", when="~shared") depends_on("icu4c", when="+icu") - depends_on("gnutls", when="~client_only tls=gnutls") - depends_on("openssl", when="~client_only tls=openssl") - depends_on("openssl@1.1.1:", when="~client_only tls=openssl @2.6.0:") - depends_on("unixodbc", when="~client_only") - depends_on("postgresql", when="~client_only") - depends_on("berkeley-db", when="~client_only") # for slapd + + with when("~client_only"): + depends_on("gnutls", when="tls=gnutls") + depends_on("openssl", when="tls=openssl") + depends_on("openssl@1.1.1:", when="tls=openssl @2.6.0:") + depends_on("unixodbc") + depends_on("postgresql") + depends_on("berkeley-db") # for slapd + depends_on("libtool", type="link") # links against libltdl + depends_on("libxcrypt", type="link") + depends_on("perl", when="~client_only+perl") # for slapd + # depends_on('openslp', when='~client_only') # not avail. in spack yet + # depends_on('Pth', when='~client_only') # not avail. in spack yet + # Recommended dependencies by Linux From Scratch depends_on("cyrus-sasl", when="+sasl") - # depends_on('openslp', when='~client_only') # not avail. in spack yet - # depends_on('Pth', when='~client_only') # not avail. in spack yet - depends_on("perl", when="~client_only+perl") # for slapd depends_on("groff", type="build") depends_on("pkgconfig", type="build") depends_on("wiredtiger", when="@2.6.0:") @@ -94,24 +99,21 @@ def configure_args(self): "--enable-backends=mod", "--disable-sql", "--enable-overlays=mod", + f"--with-tls={self.spec.variants['tls'].value}", + *self.enable_or_disable("static"), + *self.enable_or_disable("shared"), + *self.enable_or_disable("dynamic"), + *self.with_or_without("cyrus-sasl", variant="sasl"), + *self.enable_or_disable("perl"), + *self.enable_or_disable("wt"), ] if self.spec.satisfies("@:2.5"): - args.extend(("--disable-ndb", "--disable-shell", "--disable-bdb", "--disable-hdb")) + args += ["--disable-ndb", "--disable-shell", "--disable-bdb", "--disable-hdb"] - args += self.enable_or_disable("static") - args += self.enable_or_disable("shared") - args += self.enable_or_disable("dynamic") - args += self.with_or_without("cyrus-sasl", variant="sasl") - args.append("--with-tls=" + self.spec.variants["tls"].value) if self.spec.satisfies("@2.6.0: tls=gnutls"): args += ["--disable-autoca"] - if self.spec.satisfies("@2.5.0:"): - args += self.enable_or_disable("wt") - - args += self.enable_or_disable("perl") - return args def build(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/openloops/package.py b/var/spack/repos/builtin/packages/openloops/package.py index 1b9003edbac1c0..ce87fd30546d8e 100644 --- a/var/spack/repos/builtin/packages/openloops/package.py +++ b/var/spack/repos/builtin/packages/openloops/package.py @@ -15,18 +15,22 @@ class Openloops(Package): at NLO QCD and NLO EW.""" homepage = "https://openloops.hepforge.org/" - url = "https://openloops.hepforge.org/downloads?f=OpenLoops-2.1.1.tar.gz" + url = "https://gitlab.com/openloops/OpenLoops/-/archive/OpenLoops-2.1.3/OpenLoops-OpenLoops-2.1.3.tar.gz" tags = ["hep"] license("GPL-3.0-only") - + version("2.1.4", sha256="3423688d016ffcda3b738de89418338e95249276ac634e77f356a20deb57daaa") + version("2.1.3", sha256="b26ee805d63b781244a5bab4db09f4a7a5a5c9ed371ead0d5260f00a0a94b233") version("2.1.2", sha256="f52575cae3d70b6b51a5d423e9cd0e076ed5961afcc015eec00987e64529a6ae") version("2.1.1", sha256="f1c47ece812227eab584e2c695fef74423d2f212873f762b8658f728685bcb91") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + + # conflicts because there is a scons 3.0.5 in 2.1.2 + conflicts("^python@3.12:", when="@:2.1.2") all_processes = [ "tbln", @@ -249,6 +253,11 @@ class Openloops(Package): phases = ["configure", "build", "build_processes", "install"] + def url_for_version(self, v): + if self.spec.satisfies("@:2.1.2"): + return f"https://openloops.hepforge.org/downloads?f=OpenLoops-{v}.tar.gz" + return f"https://gitlab.com/openloops/OpenLoops/-/archive/OpenLoops-{v}/OpenLoops-OpenLoops-{v}.tar.gz" + def configure(self, spec, prefix): spack_env = ( "PATH LD_LIBRARY_PATH CPATH C_INCLUDE_PATH" + "CPLUS_INCLUDE_PATH INTEL_LICENSE_FILE" diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 9afb47effd49f4..6591f04bae588a 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -3,15 +3,11 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import itertools import os import re import sys -import llnl.util.tty as tty - import spack.compilers -import spack.version from spack.package import * @@ -68,6 +64,9 @@ class Openmpi(AutotoolsPackage, CudaPackage): version( "5.0.0", sha256="9d845ca94bc1aeb445f83d98d238cd08f6ec7ad0f73b0f79ec1668dbfdacd613" ) # libmpi.so.40.40.0 + version( + "4.1.8", sha256="466f68e3132a1dc02710cc2011fafced8336d98359fa2dae4dddcfd5719f12a9" + ) # libmpi.so.40.30.8 version( "4.1.7", sha256="54a33cb7ad81ff0976f15a6cc8003c3922f0f3d8ceed14e1813ef3603f22cd34" ) # libmpi.so.40.30.7 @@ -402,9 +401,9 @@ class Openmpi(AutotoolsPackage, CudaPackage): "1.0", sha256="cf75e56852caebe90231d295806ac3441f37dc6d9ad17b1381791ebb78e21564" ) # libmpi.so.0.0.0 - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") patch("ad_lustre_rwcontig_open_source.patch", when="@1.6.5") patch("llnl-platforms.patch", when="@1.6.5") @@ -737,7 +736,7 @@ def determine_variants(cls, exes, version): variants.append("+atomics") # java - if version in spack.version.ver("1.7.4:"): + if version in ver("1.7.4:"): match = re.search(r"\bJava bindings: (\S+)", output) if match and is_enabled(match.group(1)): variants.append("+java") @@ -755,7 +754,7 @@ def determine_variants(cls, exes, version): variants.append("~static") # sqlite - if version in spack.version.ver("1.7.3:1"): + if version in ver("1.7.3:1"): if re.search(r"\bMCA db: sqlite", output): variants.append("+sqlite3") else: @@ -766,7 +765,7 @@ def determine_variants(cls, exes, version): variants.append("+vt") # thread_multiple - if version in spack.version.ver("1.5.4:2"): + if version in ver("1.5.4:2"): match = re.search(r"MPI_THREAD_MULTIPLE: (\S+?),?", output) if match and is_enabled(match.group(1)): variants.append("+thread_multiple") @@ -783,7 +782,7 @@ def determine_variants(cls, exes, version): variants.append("~cuda") # wrapper-rpath - if version in spack.version.ver("1.7.4:"): + if version in ver("1.7.4:"): match = re.search(r"\bWrapper compiler rpath: (\S+)", output) if match and is_enabled(match.group(1)): variants.append("+wrapper-rpath") @@ -791,7 +790,7 @@ def determine_variants(cls, exes, version): variants.append("~wrapper-rpath") # cxx - if version in spack.version.ver(":4"): + if version in ver(":4"): match = re.search(r"\bC\+\+ bindings: (\S+)", output) if match and match.group(1) == "yes": variants.append("+cxx") @@ -799,7 +798,7 @@ def determine_variants(cls, exes, version): variants.append("~cxx") # cxx_exceptions - if version in spack.version.ver(":4"): + if version in ver(":4"): match = re.search(r"\bC\+\+ exceptions: (\S+)", output) if match and match.group(1) == "yes": variants.append("+cxx_exceptions") @@ -807,7 +806,7 @@ def determine_variants(cls, exes, version): variants.append("~cxx_exceptions") # singularity - if version in spack.version.ver(":4"): + if version in ver(":4"): if re.search(r"--with-singularity", output): variants.append("+singularity") @@ -823,7 +822,7 @@ def determine_variants(cls, exes, version): variants.append("~memchecker") # pmi - if version in spack.version.ver("1.5.5:4"): + if version in ver("1.5.5:4"): if re.search(r"\bMCA (?:ess|prrte): pmi", output): variants.append("+pmi") else: @@ -972,37 +971,37 @@ def with_or_without_ofi(self, activated): def with_or_without_fca(self, activated): if not activated: return "--without-fca" - return "--with-fca={0}".format(self.spec["fca"].prefix) + return f"--with-fca={self.spec['fca'].prefix}" def with_or_without_hcoll(self, activated): if not activated: return "--without-hcoll" - return "--with-hcoll={0}".format(self.spec["hcoll"].prefix) + return f"--with-hcoll={self.spec['hcoll'].prefix}" def with_or_without_ucc(self, activated): if not activated: return "--without-ucc" - return "--with-ucc={0}".format(self.spec["ucc"].prefix) + return f"--with-ucc={self.spec['ucc'].prefix}" def with_or_without_xpmem(self, activated): if not activated: return "--without-xpmem" - return "--with-xpmem={0}".format(self.spec["xpmem"].prefix) + return f"--with-xpmem={self.spec['xpmem'].prefix}" def with_or_without_knem(self, activated): if not activated: return "--without-knem" - return "--with-knem={0}".format(self.spec["knem"].prefix) + return f"--with-knem={self.spec['knem'].prefix}" def with_or_without_lsf(self, activated): if not activated: return "--without-lsf" - return "--with-lsf={0}".format(self.spec["lsf"].prefix) + return f"--with-lsf={self.spec['lsf'].prefix}" def with_or_without_tm(self, activated): if not activated: return "--without-tm" - return "--with-tm={0}".format(self.spec["pbs"].prefix) + return f"--with-tm={self.spec['pbs'].prefix}" @run_before("autoreconf") def die_without_fortran(self): @@ -1035,11 +1034,6 @@ def configure_args(self): if spec.satisfies("@:4.1.6,5.0.0:5.0.3 %apple-clang@15:"): config_args.append("--with-wrapper-fcflags=-Wl,-ld_classic") - # All rpath flags should be appended with self.compiler.cc_rpath_arg. - # Later, we might need to update share/openmpi/mpic++-wrapper-data.txt - # and mpifort-wrapper-data.txt (see filter_rpaths()). - wrapper_ldflags = [] - config_args.extend(self.enable_or_disable("builtin-atomics", variant="atomics")) if spec.satisfies("+pmi"): @@ -1182,16 +1176,6 @@ def configure_args(self): # filter_pc_files()): if spec.satisfies("@3.0.5:"): config_args.append("--disable-wrapper-runpath") - - # Add extra_rpaths and implicit_rpaths into the wrappers. - wrapper_ldflags.extend( - [ - self.compiler.cc_rpath_arg + path - for path in itertools.chain( - self.compiler.extra_rpaths, self.compiler.implicit_rpaths() - ) - ] - ) else: config_args.append("--disable-wrapper-rpath") config_args.append("--disable-wrapper-runpath") @@ -1199,9 +1183,6 @@ def configure_args(self): config_args.extend(self.enable_or_disable("mpi-cxx", variant="cxx")) config_args.extend(self.enable_or_disable("cxx-exceptions", variant="cxx_exceptions")) - if wrapper_ldflags: - config_args.append("--with-wrapper-ldflags={0}".format(" ".join(wrapper_ldflags))) - # # the Spack path padding feature causes issues with Open MPI's lex based parsing system # used by the compiler wrappers. Crank up lex buffer to 1MB to handle this. @@ -1240,53 +1221,6 @@ def configure_args(self): return config_args - @run_after("install", when="+wrapper-rpath") - def filter_rpaths(self): - def filter_lang_rpaths(lang_tokens, rpath_arg): - if self.compiler.cc_rpath_arg == rpath_arg: - return - - files = find( - self.spec.prefix.share.openmpi, - ["*{0}-wrapper-data*".format(t) for t in lang_tokens], - ) - files.extend( - find( - self.spec.prefix.lib.pkgconfig, ["ompi-{0}.pc".format(t) for t in lang_tokens] - ) - ) - - x = FileFilter(*[f for f in files if not os.path.islink(f)]) - - # Replace self.compiler.cc_rpath_arg, which have been added as - # '--with-wrapper-ldflags', with rpath_arg in the respective - # language-specific wrappers and pkg-config files. - x.filter(self.compiler.cc_rpath_arg, rpath_arg, string=True, backup=False) - - if self.spec.satisfies("@:1.10.3,2:2.1.1"): - # Replace Libtool-style RPATH prefixes '-Wl,-rpath -Wl,' with - # rpath_arg for old version of OpenMPI, which assumed that CXX - # and FC had the same prefixes as CC. - x.filter("-Wl,-rpath -Wl,", rpath_arg, string=True, backup=False) - - filter_lang_rpaths(["c++", "CC", "cxx"], self.compiler.cxx_rpath_arg) - filter_lang_rpaths(["fort", "f77", "f90"], self.compiler.fc_rpath_arg) - - @run_after("install", when="@:3.0.4+wrapper-rpath") - def filter_pc_files(self): - files = find(self.spec.prefix.lib.pkgconfig, "*.pc") - x = FileFilter(*[f for f in files if not os.path.islink(f)]) - - # Remove this linking flag if present (it turns RPATH into RUNPATH) - x.filter( - "{0}--enable-new-dtags".format(self.compiler.linker_arg), "", string=True, backup=False - ) - - # NAG compiler is usually mixed with GCC, which has a different - # prefix for linker arguments. - if self.compiler.name == "nag": - x.filter("-Wl,--enable-new-dtags", "", string=True, backup=False) - # For v4 and lower @run_after("install") def delete_mpirun_mpiexec(self): diff --git a/var/spack/repos/builtin/packages/openpbs/package.py b/var/spack/repos/builtin/packages/openpbs/package.py index a1c2015e41c271..b99f014d23cbb8 100644 --- a/var/spack/repos/builtin/packages/openpbs/package.py +++ b/var/spack/repos/builtin/packages/openpbs/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.tty as tty from spack.package import * diff --git a/var/spack/repos/builtin/packages/openpmd-api/package.py b/var/spack/repos/builtin/packages/openpmd-api/package.py index 1df664360dee83..1aec68118c31e0 100644 --- a/var/spack/repos/builtin/packages/openpmd-api/package.py +++ b/var/spack/repos/builtin/packages/openpmd-api/package.py @@ -9,7 +9,7 @@ class OpenpmdApi(CMakePackage): """C++ & Python API for Scientific I/O""" homepage = "https://www.openPMD.org" - url = "https://github.com/openPMD/openPMD-api/archive/0.16.0.tar.gz" + url = "https://github.com/openPMD/openPMD-api/archive/0.16.1.tar.gz" git = "https://github.com/openPMD/openPMD-api.git" maintainers("ax3l", "franzpoeschel") @@ -20,6 +20,7 @@ class OpenpmdApi(CMakePackage): # C++17 up until here version("develop", branch="dev") + version("0.16.1", sha256="a029a1779351949f41c1f36d0e75c698e59c5d284f080d5e4c2b8650779d2d58") version("0.16.0", sha256="b52222a4ab2511f9e3f6e21af222f57ab4fb6228623024fc5d982066333e104f") version("0.15.2", sha256="fbe3b356fe6f4589c659027c8056844692c62382e3ec53b953bed1c87e58ba13") version("0.15.1", sha256="0e81652152391ba4d2b62cfac95238b11233a4f89ff45e1fcffcc7bcd79dabe1") @@ -60,6 +61,7 @@ class OpenpmdApi(CMakePackage): depends_on("mpark-variant@1.4.0:", when="@:0.14") # pre C++17 releases depends_on("toml11@3.7.1:3", when="@0.15") depends_on("toml11@3.7.1:", when="@0.16:") + depends_on("toml11@4.2.0: cxx_std=17", when="@0.16.1:") with when("+hdf5"): depends_on("hdf5@1.8.13:") depends_on("hdf5@1.8.13: ~mpi", when="~mpi") diff --git a/var/spack/repos/builtin/packages/openradioss-engine/package.py b/var/spack/repos/builtin/packages/openradioss-engine/package.py index e7ab1f8b811bad..bdfd4e5b88c9ce 100644 --- a/var/spack/repos/builtin/packages/openradioss-engine/package.py +++ b/var/spack/repos/builtin/packages/openradioss-engine/package.py @@ -110,10 +110,10 @@ def install(self, spec, prefix): ) install_tree( join_path(self.stage.source_path, "hm_cfg_files"), join_path(prefix, "hm_cfg_files") - ), + ) install_tree( join_path(self.stage.source_path, "extlib", "h3d"), join_path(prefix, "extlib", "h3d") - ), + ) install_tree( join_path(self.stage.source_path, "extlib", "hm_reader"), join_path(prefix, "extlib", "hm_reader"), diff --git a/var/spack/repos/builtin/packages/openradioss-starter/package.py b/var/spack/repos/builtin/packages/openradioss-starter/package.py index 4af3dc15163a78..b528036a56be8b 100644 --- a/var/spack/repos/builtin/packages/openradioss-starter/package.py +++ b/var/spack/repos/builtin/packages/openradioss-starter/package.py @@ -96,10 +96,10 @@ def install(self, spec, prefix): ) install_tree( join_path(self.stage.source_path, "hm_cfg_files"), join_path(prefix, "hm_cfg_files") - ), + ) install_tree( join_path(self.stage.source_path, "extlib", "h3d"), join_path(prefix, "extlib", "h3d") - ), + ) install_tree( join_path(self.stage.source_path, "extlib", "hm_reader"), join_path(prefix, "extlib", "hm_reader"), diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 0f62e959a1ef49..27cddb8d36fc68 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -5,8 +5,6 @@ import os import re -import llnl.util.tty as tty - from spack.package import * diff --git a/var/spack/repos/builtin/packages/openturbine/package.py b/var/spack/repos/builtin/packages/openturbine/package.py new file mode 100644 index 00000000000000..0c2d33a67a93ff --- /dev/null +++ b/var/spack/repos/builtin/packages/openturbine/package.py @@ -0,0 +1,62 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Openturbine(CMakePackage, CudaPackage, ROCmPackage): + """An open-source wind turbine structural dynamics simulation code.""" + + license("MIT License", checked_by="ddement") + + homepage = "https://www.exascaleproject.org/research-project/exawind/" + url = "https://github.com/Exawind/openturbine.git" + git = "https://github.com/Exawind/openturbine.git" + + maintainers("faisal-bhuiyan", "ddement", "deslaughter") + + version("main", branch="main") + + variant("tests", default=False, description="Build OpenTurbine Test Suite") + variant("openmp", default=False, description="Build OpenTurbine with OpenMP support") + variant("vtk", default=False, description="Enable VTK") + variant("adi", default=False, description="Build the OpenFAST ADI external project") + variant("rosco", default=False, description="Build the ROSCO controller external project") + + depends_on("cxx", type="build") + depends_on("yaml-cpp") + depends_on("kokkos-kernels+blas+lapack") + depends_on("trilinos+amesos2") + + depends_on("kokkos-kernels@4.3:") + depends_on("trilinos@16:") + + depends_on("kokkos-kernels+cuda+cublas+cusparse+cusolver", when="+cuda") + depends_on("kokkos-kernels+rocblas+rocsparse+rocsolver", when="+rocm") + depends_on("kokkos-kernels+openmp", when="+openmp") + depends_on("trilinos+cuda+basker", when="+cuda") + depends_on("trilinos+rocm+basker", when="+rocm") + depends_on("trilinos+openmp+basker", when="+openmp") + depends_on("kokkos-kernels~cuda", when="~cuda") + depends_on("kokkos-kernels~openmp", when="~openmp") + depends_on("trilinos~cuda", when="~cuda") + depends_on("trilinos~rocm", when="~rocm") + depends_on("trilinos~openmp", when="~openmp") + + depends_on("googletest", when="+tests") + + depends_on("vtk", when="+vtk") + + depends_on("fortran", type="build", when="+adi") + + depends_on("fortran", type="build", when="+rosco") + + def cmake_args(self): + options = [ + self.define_from_variant("OpenTurbine_ENABLE_TESTS", "tests"), + self.define_from_variant("OpenTurbine_ENABLE_VTK", "vtk"), + self.define_from_variant("OpenTurbine_BUILD_OPENFAST_ADI", "adi"), + self.define_from_variant("OpenTurbine_BUILD_ROSCO_CONTROLLER", "rosco"), + ] + return options diff --git a/var/spack/repos/builtin/packages/openturns/package.py b/var/spack/repos/builtin/packages/openturns/package.py index d9c4e471165994..788089f0287cfa 100644 --- a/var/spack/repos/builtin/packages/openturns/package.py +++ b/var/spack/repos/builtin/packages/openturns/package.py @@ -22,6 +22,10 @@ class Openturns(CMakePackage): license("LGPL-3.0-or-later") version("master", branch="master") + version("1.24", sha256="6c5232b4daf0b93fbc49dee45299ade2c2c16d44476700e7689af6b50c999f57") + version("1.23", sha256="4c7cfe5d2310933e3a2e91f7db9531d80e32157143157df80f6e93267c29f414") + version("1.22", sha256="487f7fc00f02eb91d264c8c9d78c2abba505ac6aaa5bc0328c04dddbe6d58741") + version("1.21", sha256="f91f9b37c738c99761b3fd9eb2d50b2c1e3a8e4466f0f842fdc2445128cb5bda") version("1.20", sha256="2be5247f0266d153619b35dfb1eeeb46736c502dad993b40aff8857d6314f293") version("1.19", sha256="1d61cb6ce8ec1121db9f1e9fb490aaa056d2ff250db26df05d2e3e30ceb32344") version("1.18", sha256="1840d3fd8b38fd5967b1fa04e49d8f760c2c497400430e97623595ca48754ae0") diff --git a/var/spack/repos/builtin/packages/oras/package.py b/var/spack/repos/builtin/packages/oras/package.py index 20b11f49311c3d..f52f889b24b806 100644 --- a/var/spack/repos/builtin/packages/oras/package.py +++ b/var/spack/repos/builtin/packages/oras/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.tty as tty from spack.package import * @@ -43,6 +42,6 @@ def install(self, spec, prefix): oras = find("bin", "oras") if not oras: - tty.die("Oras executable missing in bin.") + raise InstallError("Oras executable missing in bin.") tty.debug("Found oras executable %s to move into install bin" % oras[0]) install(oras[0], prefix.bin) diff --git a/var/spack/repos/builtin/packages/pandoramonitoring/package.py b/var/spack/repos/builtin/packages/pandoramonitoring/package.py index 1c304b90cce4ac..28f504419617eb 100644 --- a/var/spack/repos/builtin/packages/pandoramonitoring/package.py +++ b/var/spack/repos/builtin/packages/pandoramonitoring/package.py @@ -19,17 +19,29 @@ class Pandoramonitoring(CMakePackage): maintainers("jmcarcell", "wdconinc") version("master", branch="master") + version("3.6.0", sha256="5fc9574faa3e90d96e5d2a27dea46b55f844499cf21e39060acb1e4c080dec77") version("3.5.0", sha256="274562abb7c797194634d5460a56227444a1de07a240c88ae35ca806abcbaf60") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") - depends_on("root@6.18.04: +x +opengl") + depends_on("root@6.18.04: +geom +opengl +x") depends_on("pandorasdk") + # https://github.com/PandoraPFA/PandoraMonitoring/pull/13 + @when("@:3.6.0") + def patch(self): + filter_file( + "TTreeWrapper::Branch::~Branch", + "TTreeWrapper::Branch::~Branch", + "src/TTreeWrapper.cc", + ) + def cmake_args(self): args = [ self.define("CMAKE_MODULE_PATH", self.spec["pandorapfa"].prefix.cmakemodules), - self.define("CMAKE_CXX_FLAGS", "-std=c++17"), + self.define("CMAKE_CXX_FLAGS", "-Wno-error"), + self.define("CMAKE_CXX_STANDARD", self.spec["root"].variants["cxxstd"].value), ] return args diff --git a/var/spack/repos/builtin/packages/pandorapfa/package.py b/var/spack/repos/builtin/packages/pandorapfa/package.py index 7f126af2b0b427..56001713d4f5ed 100644 --- a/var/spack/repos/builtin/packages/pandorapfa/package.py +++ b/var/spack/repos/builtin/packages/pandorapfa/package.py @@ -20,6 +20,7 @@ class Pandorapfa(Package): maintainers("jmcarcell", "wdconinc") version("master", branch="master") + version("4.11.2", sha256="02b0e8c1844ec515055cb85f9d14d9d13eda28607c634611a59d767eb08a8b34") version("4.3.1", sha256="2f4757a6ed2e10d3effc300b330f67ba13c499dbf21ba720b29b50527332fcdb") version("4.3.0", sha256="a794022c33b3a5afc1272740ac385e0c4ab96a112733012e7dfcbe80b5a3b445") version("4.2.1", sha256="1d262417748d18e00466ae3f1714ab0d7452e903bd1430773a72c652cf4666e4") diff --git a/var/spack/repos/builtin/packages/pandorasdk/package.py b/var/spack/repos/builtin/packages/pandorasdk/package.py index 2971edd0a65408..2e0ea3d651f10a 100644 --- a/var/spack/repos/builtin/packages/pandorasdk/package.py +++ b/var/spack/repos/builtin/packages/pandorasdk/package.py @@ -22,16 +22,24 @@ class Pandorasdk(CMakePackage): version("3.4.1", sha256="9607bf52a9d79d88d28c45d4f3336e066338b36ab81b4d2d125226f4ad3a7aaf") version("3.4.0", sha256="1e30db056d4a43f8659fccdda00270af14593425d933f91e91d5c97f1e124c6b") - depends_on("cxx", type="build") # generated + variant( + "cxxstd", + default="17", + values=("17", "20"), + multi=False, + description="Use the specified C++ standard when building.", + ) + + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("pandorapfa") def cmake_args(self): args = [ - self.define("LC_PANDORA_CONTENT", True), - self.define("LAR_PANDORA_CONTENT", True), self.define("CMAKE_MODULE_PATH", self.spec["pandorapfa"].prefix.cmakemodules), - self.define("CMAKE_CXX_FLAGS", "-std=c++17"), + self.define("CMAKE_CXX_FLAGS", "-Wno-error"), + self.define("CMAKE_CXX_STANDARD", self.spec.variants["cxxstd"].value), ] return args diff --git a/var/spack/repos/builtin/packages/pango/package.py b/var/spack/repos/builtin/packages/pango/package.py index c32702ca6c7571..a49ca4172b9a5d 100644 --- a/var/spack/repos/builtin/packages/pango/package.py +++ b/var/spack/repos/builtin/packages/pango/package.py @@ -54,6 +54,8 @@ class Pango(MesonPackage): depends_on("harfbuzz") depends_on("harfbuzz+coretext", when="platform=darwin") depends_on("cairo+ft+fc") + # quartz needed even when ~X on the new cairo versions + requires("^cairo+quartz", when="^cairo@1.17.8: platform=darwin") depends_on("cairo~X", when="~X") depends_on("cairo+X", when="+X") depends_on("libxft", when="+X") diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py index 3830c04dc7a7a0..74aa8627c853b3 100644 --- a/var/spack/repos/builtin/packages/papi/package.py +++ b/var/spack/repos/builtin/packages/papi/package.py @@ -6,8 +6,6 @@ import os import sys -import llnl.util.filesystem as fs - import spack.util.environment from spack.package import * @@ -76,6 +74,7 @@ class Papi(AutotoolsPackage, ROCmPackage): depends_on("lm-sensors", when="+lmsensors") depends_on("cuda", when="+cuda") depends_on("cuda", when="+nvml") + depends_on("bc", when="+cuda", type="build") depends_on("hsa-rocr-dev", when="+rocm") depends_on("rocprofiler-dev", when="+rocm") depends_on("llvm-amdgpu", when="+rocm") @@ -210,7 +209,7 @@ def fix_darwin_install(self): join_path(self.prefix.lib, "libpapi.so"), join_path(self.prefix.lib, "libpapi.dylib"), ) - fs.fix_darwin_install_name(self.prefix.lib) + fix_darwin_install_name(self.prefix.lib) test_src_dir = "src/smoke_tests" test_requires_compiler = True @@ -229,6 +228,7 @@ def test_smoke(self): raise SkipTest("Skipping smoke tests, directory doesn't exist") with working_dir(test_dir, create=False): with spack.util.environment.set_env(PAPIROOT=self.prefix): + make = self.spec["gmake"].command make() exe_simple = which("simple") exe_simple() diff --git a/var/spack/repos/builtin/packages/paraconf/package.py b/var/spack/repos/builtin/packages/paraconf/package.py new file mode 100644 index 00000000000000..5ba73e9a319c78 --- /dev/null +++ b/var/spack/repos/builtin/packages/paraconf/package.py @@ -0,0 +1,46 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class Paraconf(CMakePackage): + """Paraconf is a library that provides a simple query language to access a + Yaml tree on top of libyaml.""" + + homepage = "https://github.com/pdidev/paraconf" + url = "https://github.com/pdidev/paraconf/archive/1.0.0.tar.gz" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("1.0.0", sha256="9336492c292088a7d97192f2b1fa306e11f6f32373ac75f29b9af7eecd5c0c11") + version("0.4.16", sha256="d896cb5bbf1c6b311f6bed44263548c799265e1f22d50475aecbddc80b0db982") + version("0.4.15", sha256="914befa7a8d6fbf2de3466e434a9ea20363900af5519859663a24c7a51bd26a6") + version("0.4.14", sha256="8a07bdf972ce137932b0d5e08036cf90db23b69f7eaabf52eb7d495d1da01d99") + version("0.4.13", sha256="28da96ba45bcb826a387488f283baa0c88bc0b00fa74f4c110d444c0b9a8030c") + version("0.4.12", sha256="bbbaf462ed23e9a64a4d521ee469ab723fcd86a6dda9a9d9b4dddfd1a58eef93") + version("0.4.11", sha256="35f4ba41eaf675ff16ad4f0722a9e2050ee63b073c7e3e67eb74439978599499") + version("0.4.10", sha256="0a0028354b131436e70af06c9e029f738ed771088e53633b2b5d1c8ee1276e83") + version("0.4.9", sha256="e99a01584e07e4d09b026fcd9a39500fbdbc3074a2598a4bc89f400825094c5a") + + variant("shared", default=True, description="Build shared libraries rather than static ones") + variant("fortran", default=True, description="Enable Fortran support") + variant("tests", default=False, description="Build tests") + + depends_on("cmake@3.5:", type=("build")) + depends_on("pkgconfig", type=("build")) + depends_on("libyaml@0.1.7:", type=("link", "run")) + + root_cmakelists_dir = "paraconf" + + def cmake_args(self): + args = [ + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("BUILD_TESTING", "tests"), + self.define_from_variant("BUILD_FORTRAN", "fortran"), + ] + return args diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/package.py b/var/spack/repos/builtin/packages/parallel-netcdf/package.py index 6216d01df237d5..b8ea46ac23eca0 100644 --- a/var/spack/repos/builtin/packages/parallel-netcdf/package.py +++ b/var/spack/repos/builtin/packages/parallel-netcdf/package.py @@ -4,8 +4,6 @@ import os -import llnl.util.tty as tty - from spack.package import * diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index 6a480c2c00ab66..12b731409f9c7b 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -359,6 +359,11 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): # intel oneapi doesn't compile some code in catalyst patch("catalyst-etc_oneapi_fix.patch", when="@5.10.0:5.10.1%oneapi") + # Classic Intel compilers don't compile some code in vtkFFT.txx + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11928 + # Applying it for every compiler is fine. + patch("vtk-fft-icc.patch", when="@5.12.0:5.13.2") + # Patch for paraview 5.8: ^hdf5@1.13.2: # Even with ~hdf5, hdf5 is part of the dependency tree due to netcdf-c # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9690 @@ -386,7 +391,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): def url_for_version(self, version): _urlfmt = "http://www.paraview.org/files/v{0}/ParaView-v{1}{2}.tar.{3}" - """Handle ParaView version-based custom URLs.""" + # Handle ParaView version-based custom URLs if version < Version("5.1.0"): return _urlfmt.format(version.up_to(2), version, "-source", "gz") elif version < Version("5.6.1"): diff --git a/var/spack/repos/builtin/packages/paraview/vtk-fft-icc.patch b/var/spack/repos/builtin/packages/paraview/vtk-fft-icc.patch new file mode 100644 index 00000000000000..7d596d6c6b572a --- /dev/null +++ b/var/spack/repos/builtin/packages/paraview/vtk-fft-icc.patch @@ -0,0 +1,13 @@ +diff --git a/VTK/Common/Math/vtkFFT.txx b/VTK/Common/Math/vtkFFT.txx +index 043812a2f32..8c8410aeee9 100644 +--- a/VTK/Common/Math/vtkFFT.txx ++++ b/VTK/Common/Math/vtkFFT.txx +@@ -327,6 +327,6 @@ vtkSmartPointer vtkFFT::Csd(vtkScalarNumberArray* + vtkSMPTools::Fill(averageRange.begin(), averageRange.end(), 0.0); + + auto resRange = vtk::DataArrayTupleRange(result); +- using ConstTupleRef = decltype(resRange)::ConstTupleReferenceType; ++ using ConstTupleRef = typename decltype(resRange)::ConstTupleReferenceType; + for (unsigned int i = 0; i < shape[0]; ++i) + { + auto begin = resRange.cbegin() + i * shape[1]; \ No newline at end of file diff --git a/var/spack/repos/builtin/packages/parsec/package.py b/var/spack/repos/builtin/packages/parsec/package.py index 9917a4bc057cb9..522297a4ee39a2 100644 --- a/var/spack/repos/builtin/packages/parsec/package.py +++ b/var/spack/repos/builtin/packages/parsec/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # -import llnl.util.tty as tty + from spack.package import * diff --git a/var/spack/repos/builtin/packages/pass/package.py b/var/spack/repos/builtin/packages/pass/package.py index 5a9253ad1fd047..01957f08ccb9bc 100644 --- a/var/spack/repos/builtin/packages/pass/package.py +++ b/var/spack/repos/builtin/packages/pass/package.py @@ -6,7 +6,11 @@ class Pass(MakefilePackage): - """A minimal password manager following the UNIX philosphy.""" + """Pass is a simple password manager that follows the Unix philosophy. + + It stores passwords in gpg encrypted files organized in a directory hierarchy, + provides commands for adding, editing, generating, and retrieving passwords, + and features integration with git for versioning and synchronization.""" homepage = "https://www.passwordstore.org/" git = "https://git.zx2c4.com/password-store.git" @@ -15,26 +19,37 @@ class Pass(MakefilePackage): license("GPL-2.0", checked_by="taliaferro") + # Sanity checks + sanity_check_is_file = ["bin/pass"] + sanity_check_is_dir = ["share/bash-completion/completions"] + + # Versions - newest to oldest + version("master", branch="master") version("1.7.4", tag="1.7.4", commit="1078f2514d579178d5df7042c6a790e9c9b731ad") + # Variants variant("xclip", default=False, description="install the X11 clipboard provider") + # Required dependencies depends_on("bash") - depends_on("gnupg") depends_on("git") - depends_on("tree") - depends_on("util-linux") # for GNU getopt + depends_on("gnupg") depends_on("libqrencode") depends_on("openssl") # used for base64 only + depends_on("tree") + depends_on("util-linux") # for GNU getopt + # Optional dependencies depends_on("xclip", when="+xclip") def setup_build_environment(self, env): - env.set("PREFIX", prefix) + """Set required environment variables for build.""" + env.set("PREFIX", self.prefix) env.set("WITH_ALLCOMP", "yes") def edit(self, spec, prefix): - """ + """Patch platform-specific dependency paths in script files. + Pass's install process involves slotting in a small script snippet at the start of the file, defining certain platform-specific behaviors including the paths where some of its key dependencies are likely to @@ -42,7 +57,6 @@ def edit(self, spec, prefix): but the paths to the dependencies are wrong (for example, on MacOS it looks for getopt in /opt/homebrew.) We can hardcode those paths here. """ - bash_exec = self.spec["bash"].command gpg_exec = self.spec["gnupg"].prefix.bin.gpg getopt_exec = self.spec["util-linux"].prefix.bin.getopt diff --git a/var/spack/repos/builtin/packages/pbwt/package.py b/var/spack/repos/builtin/packages/pbwt/package.py new file mode 100644 index 00000000000000..cbbf88a1050231 --- /dev/null +++ b/var/spack/repos/builtin/packages/pbwt/package.py @@ -0,0 +1,41 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Pbwt(MakefilePackage): + """Implementation of Positional Burrows-Wheeler Transform for genetic data.""" + + homepage = "https://github.com/richarddurbin/pbwt" + url = "https://github.com/richarddurbin/pbwt/archive/refs/tags/v2.1.tar.gz" + + maintainers("teaguesterling") + + license("APACHE-2.0", checked_by="teaguesterling") # License in pbwtCore.c + + version("2.1", sha256="d48ff12a0a84b1eb8ba5081fd900b5d003cfacc44b5a3d35a1423c69cc3f3e90") + version("2.0", sha256="3750e355989fdc4e646d68dfe2dd7262ac3da46a2bff66c8563443fb44ecaf96") + + depends_on("c", type="build") + depends_on("htslib") + depends_on("zlib-api") + depends_on("bzip2") + depends_on("lzma") + depends_on("curl") + + def patch(self): + htslib = self.spec["htslib"] + filter_file("^HTSDIR=../htslib$", f"HTSDIR={htslib.prefix}", "Makefile") + filter_file(r"^CPPFLAGS=-I\$\(HTSDIR\)$", r"CPPFLAGS=-I$(HTSDIR)/include", "Makefile") + filter_file(r"^HTSLIB=\$\(HTSDIR\)/libhts.a$", "HTSLIB=$(HTSDIR)/lib/libhts.a", "Makefile") + filter_file( + r"^LDLIBS=-lpthread \$\(HTSLIB\) -lz -lm -lbz2 -llzma -lcurl$", + "LDLIBS=-lpthread $(HTSLIB) -lz -lm -lbz2 -llzma -lcurl -lcrypto -ldeflate", + "Makefile", + ) + + @property + def install_targets(self): + return ["install", f"PREFIX={self.prefix.bin}"] diff --git a/var/spack/repos/builtin/packages/pdftk/package.py b/var/spack/repos/builtin/packages/pdftk/package.py index 7d9435ddd05c59..c82fa33a33e717 100644 --- a/var/spack/repos/builtin/packages/pdftk/package.py +++ b/var/spack/repos/builtin/packages/pdftk/package.py @@ -49,7 +49,7 @@ def edit(self, spec, prefix): vars = [ ("VERSUFF", "-%s" % gcc_version), ("CXX", compiler.cxx), - ("GCJ", spec["eclipse-gcj-parser"].package.gcj), + ("GCJ", self["eclipse-gcj-parser"].gcj), ("GCJH", join_path(gcc_base, "bin", "gcjh")), ("GJAR", join_path(gcc_base, "bin", "gjar")), ("LIBGCJ", join_path(gcc_base, "share", "java", "libgcj-{0}.jar".format(gcc_version))), diff --git a/var/spack/repos/builtin/packages/pdi/package.py b/var/spack/repos/builtin/packages/pdi/package.py new file mode 100644 index 00000000000000..b699f3fcdd2258 --- /dev/null +++ b/var/spack/repos/builtin/packages/pdi/package.py @@ -0,0 +1,69 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.hooks.sbang import sbang_shebang_line +from spack.package import * + + +class Pdi(CMakePackage): + """PDI is a library that aims to decouple high-performance simulation codes + from Input/Output concerns. It offers a declarative application programming + interface that enables codes to expose the buffers in which they store data + and to notify PDI of significant steps of the simulation. It supports a + plugin system to make existing libraries such as HDF5, SIONlib or FTI + available to codes, potentially mixed in a single execution.""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("benchs", default=False, description="Build benchmarks") + variant("docs", default=False, description="Build documentation") + variant("tests", default=False, description="Build tests") + variant("fortran", default=True, description="Enable Fortran support") + variant("python", default=True, description="Enable Python support") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("doxygen@1.8.17:", type=("build"), when="@1.8: +docs") + depends_on("paraconf@1:", type=("link", "run"), when="@1.6:") + depends_on("paraconf +fortran", type=("link", "run"), when="+fortran") + depends_on("paraconf@0.4.14: +shared", type=("link", "run")) + depends_on("pkgconfig", type=("build")) + depends_on("python@3.8.2:3.11.9", type=("build", "link", "run"), when="@1.8: +python") + depends_on("py-pybind11@2.3:2", type=("link"), when="+python") + depends_on("py-pybind11@2.4.3:", type=("link"), when="@1.8: +python") + depends_on("spdlog@1.5:", type=("link"), when="@1.5:") + + root_cmakelists_dir = "pdi" + + def patch(self): + # Run before build so that the standard Spack sbang install hook can fix + # up the path to the python binary the zpp scripts requires. We dont use + # filter_shebang("vendor/zpp-1.0.16/bin/zpp.in") because the template is + # not yet instantiated and PYTHON_EXECUTABLE is not yet large enough to + # trigger the replacement via filter_shebang. + + filter_file( + r"#!@PYTHON_EXECUTABLE@ -B", + sbang_shebang_line() + "\n#!@PYTHON_EXECUTABLE@ -B", + "vendor/zpp-1.0.16/bin/zpp.in", + ) + + def cmake_args(self): + args = [ + self.define_from_variant("BUILD_BENCHMARKING", "benchs"), + self.define_from_variant("BUILD_DOCUMENTATION", "docs"), + self.define_from_variant("BUILD_FORTRAN", "fortran"), + self.define_from_variant("BUILD_PYTHON", "python"), + self.define_from_variant("BUILD_TESTING", "tests"), + ] + return args diff --git a/var/spack/repos/builtin/packages/pdiplugin-decl-hdf5/package.py b/var/spack/repos/builtin/packages/pdiplugin-decl-hdf5/package.py new file mode 100644 index 00000000000000..0229bd25912546 --- /dev/null +++ b/var/spack/repos/builtin/packages/pdiplugin-decl-hdf5/package.py @@ -0,0 +1,53 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class PdipluginDeclHdf5(CMakePackage): + """Decl'HDF5 plugin enables one to read and write data from HDF5 files in a + declarative way. Decl'HDF5 does not support the full HDF5 feature set but + offers a simple declarative interface to access a large subset of it for the + PDI library""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("benchs", default=False, description="Build benchmarks") + variant("fortran", default=True, description="Enable Fortran (for tests only)") + variant("tests", default=False, description="Build tests") + variant("mpi", default=True, description="Enable parallel HDF5") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("hdf5@1.10.4:1 +shared", type=("build", "link", "run"), when="@1.8:") + depends_on("hdf5 +mpi", type=("build", "link", "run"), when="+mpi") + depends_on("pdi@develop", type=("link", "run"), when="@develop") + depends_on("pdi@1.8.1", type=("link", "run"), when="@1.8.1") + depends_on("pdi@1.8.0", type=("link", "run"), when="@1.8.0") + depends_on("pkgconfig", type=("build")) + + root_cmakelists_dir = "plugins/decl_hdf5" + + def cmake_args(self): + args = [ + "-DBUILD_BENCHMARKING:BOOL={:s}".format("ON" if "+benchs" in self.spec else "OFF"), + "-DINSTALL_PDIPLUGINDIR:PATH={:s}".format(self.prefix.lib), + "-DBUILD_TESTING:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_FORTRAN:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_HDF5_PARALLEL:BOOL={:s}".format("ON" if "+mpi" in self.spec else "OFF"), + "-DBUILD_CFG_VALIDATOR:BOOL=OFF", + ] + return args + + def setup_run_environment(self, env): + env.prepend_path("PDI_PLUGIN_PATH", self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/pdiplugin-decl-netcdf/package.py b/var/spack/repos/builtin/packages/pdiplugin-decl-netcdf/package.py new file mode 100644 index 00000000000000..bc7b7435a04ef5 --- /dev/null +++ b/var/spack/repos/builtin/packages/pdiplugin-decl-netcdf/package.py @@ -0,0 +1,47 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class PdipluginDeclNetcdf(CMakePackage): + """The trace plugin is intended to generate a trace of what happens in PDI + "data store".""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("tests", default=False, description="Build tests") + variant("mpi", default=True, description="Enable parallel NetCDF") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("netcdf-c@4.7.3:4", type=("link"), when="@1.8:") + depends_on("netcdf-c@4.6.2:4+mpi", type=("link"), when="+mpi") + depends_on("pdi@develop", type=("link", "run"), when="@develop") + depends_on("pdi@1.8.1", type=("link", "run"), when="@1.8.1") + depends_on("pdi@1.8.0", type=("link", "run"), when="@1.8.0") + depends_on("pkgconfig", type=("build")) + + root_cmakelists_dir = "plugins/decl_netcdf" + + def cmake_args(self): + return [ + "-DINSTALL_PDIPLUGINDIR:PATH={:s}".format(self.prefix.lib), + "-DBUILD_TESTING:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_HDF5_PARALLEL:BOOL={:s}".format("ON" if "+mpi" in self.spec else "OFF"), + "-DBUILD_NETCDF_PARALLEL:BOOL={:s}".format("ON" if "+mpi" in self.spec else "OFF"), + "-DBUILD_CFG_VALIDATOR:BOOL=OFF", + ] + + def setup_run_environment(self, env): + env.prepend_path("PDI_PLUGIN_PATH", self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/pdiplugin-mpi/package.py b/var/spack/repos/builtin/packages/pdiplugin-mpi/package.py new file mode 100644 index 00000000000000..eb0956b380379b --- /dev/null +++ b/var/spack/repos/builtin/packages/pdiplugin-mpi/package.py @@ -0,0 +1,43 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class PdipluginMpi(CMakePackage): + """MPI plugin for the PDI library""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("tests", default=False, description="Build tests") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("mpi", type=("build", "link", "run")) + depends_on("pdi@develop", type=("link", "run"), when="@develop") + depends_on("pdi@1.8.1", type=("link", "run"), when="@1.8.1") + depends_on("pdi@1.8.0", type=("link", "run"), when="@1.8.0") + depends_on("pkgconfig", type=("build")) + + root_cmakelists_dir = "plugins/mpi" + + def cmake_args(self): + args = [ + "-DINSTALL_PDIPLUGINDIR:PATH={:s}".format(self.prefix.lib), + "-DBUILD_TESTING:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_CFG_VALIDATOR:BOOL=OFF", + ] + return args + + def setup_run_environment(self, env): + env.prepend_path("PDI_PLUGIN_PATH", self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/pdiplugin-pycall/package.py b/var/spack/repos/builtin/packages/pdiplugin-pycall/package.py new file mode 100644 index 00000000000000..3cd08606414766 --- /dev/null +++ b/var/spack/repos/builtin/packages/pdiplugin-pycall/package.py @@ -0,0 +1,41 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class PdipluginPycall(CMakePackage): + """pycall plugin for the PDI library""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("tests", default=False, description="Build tests") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("pdi+python@develop", type=("link", "run"), when="@develop") + depends_on("pdi+python@1.8.1", type=("link", "run"), when="@1.8.1") + depends_on("pdi+python@1.8.0", type=("link", "run"), when="@1.8.0") + depends_on("pkgconfig", type=("build")) + + root_cmakelists_dir = "plugins/pycall" + + def cmake_args(self): + args = [ + "-DINSTALL_PDIPLUGINDIR:PATH={:s}".format(self.prefix.lib), + "-DBUILD_TESTING:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + ] + return args + + def setup_run_environment(self, env): + env.prepend_path("PDI_PLUGIN_PATH", self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/pdiplugin-serialize/package.py b/var/spack/repos/builtin/packages/pdiplugin-serialize/package.py new file mode 100644 index 00000000000000..b6bd43dc5653b4 --- /dev/null +++ b/var/spack/repos/builtin/packages/pdiplugin-serialize/package.py @@ -0,0 +1,43 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class PdipluginSerialize(CMakePackage): + """The trace plugin is intended to generate a trace of what happens in PDI + "data store".""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("tests", default=False, description="Build tests") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("pdi@develop", type=("link", "run"), when="@develop") + depends_on("pdi@1.8.1", type=("link", "run"), when="@1.8.1") + depends_on("pdi@1.8.0", type=("link", "run"), when="@1.8.0") + depends_on("pkgconfig", type=("build")) + + root_cmakelists_dir = "plugins/serialize" + + def cmake_args(self): + return [ + "-DINSTALL_PDIPLUGINDIR:PATH={:s}".format(self.prefix.lib), + "-DBUILD_FORTRAN:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_TESTING:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_CFG_VALIDATOR:BOOL=OFF", + ] + + def setup_run_environment(self, env): + env.prepend_path("PDI_PLUGIN_PATH", self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/pdiplugin-set-value/package.py b/var/spack/repos/builtin/packages/pdiplugin-set-value/package.py new file mode 100644 index 00000000000000..21c192c6dec65a --- /dev/null +++ b/var/spack/repos/builtin/packages/pdiplugin-set-value/package.py @@ -0,0 +1,43 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class PdipluginSetValue(CMakePackage): + """The trace plugin is intended to generate a trace of what happens in PDI + "data store".""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("tests", default=False, description="Build tests") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("pdi@develop", type=("link", "run"), when="@develop") + depends_on("pdi@1.8.1", type=("link", "run"), when="@1.8.1") + depends_on("pdi@1.8.0", type=("link", "run"), when="@1.8.0") + depends_on("pkgconfig", type=("build")) + depends_on("spdlog@1.5:", type=("link"), when="@1.5:") + + root_cmakelists_dir = "plugins/set_value" + + def cmake_args(self): + return [ + "-DINSTALL_PDIPLUGINDIR:PATH={:s}".format(self.prefix.lib), + "-DBUILD_TESTING:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_CFG_VALIDATOR:BOOL=OFF", + ] + + def setup_run_environment(self, env): + env.prepend_path("PDI_PLUGIN_PATH", self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/pdiplugin-trace/package.py b/var/spack/repos/builtin/packages/pdiplugin-trace/package.py new file mode 100644 index 00000000000000..af620c39869385 --- /dev/null +++ b/var/spack/repos/builtin/packages/pdiplugin-trace/package.py @@ -0,0 +1,42 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class PdipluginTrace(CMakePackage): + """The trace plugin is intended to generate a trace of what happens in PDI + "data store".""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("tests", default=False, description="Build tests") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("pdi@develop", type=("link", "run"), when="@develop") + depends_on("pdi@1.8.1", type=("link", "run"), when="@1.8.1") + depends_on("pdi@1.8.0", type=("link", "run"), when="@1.8.0") + depends_on("pkgconfig", type=("build")) + + root_cmakelists_dir = "plugins/trace" + + def cmake_args(self): + return [ + "-DINSTALL_PDIPLUGINDIR:PATH={:s}".format(self.prefix.lib), + "-DBUILD_TESTING:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_CFG_VALIDATOR:BOOL=OFF", + ] + + def setup_run_environment(self, env): + env.prepend_path("PDI_PLUGIN_PATH", self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/pdiplugin-user-code/package.py b/var/spack/repos/builtin/packages/pdiplugin-user-code/package.py new file mode 100644 index 00000000000000..0a41eeb95cca05 --- /dev/null +++ b/var/spack/repos/builtin/packages/pdiplugin-user-code/package.py @@ -0,0 +1,44 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class PdipluginUserCode(CMakePackage): + """The user-code plugin for the PDI librarie enables one to call a + user-defined function when a specified event occur or certain data becomes + available""" + + homepage = "https://pdi.dev" + git = "https://github.com/pdidev/pdi.git" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("develop", branch="main", no_cache=True) + version("1.8.1", commit="105161d5c93431d674c73ef365dce3eb724b4fcb") + version("1.8.0", commit="edce72fc198475bab1541cc0b77a30ad02da91c5") + + variant("tests", default=False, description="Build tests") + + depends_on("cmake@3.16.3:", type=("build"), when="@1.8:") + depends_on("pdi@develop", type=("link", "run"), when="@develop") + depends_on("pdi@1.8.1", type=("link", "run"), when="@1.8.1") + depends_on("pdi@1.8.0", type=("link", "run"), when="@1.8.0") + depends_on("pkgconfig", type=("build")) + + root_cmakelists_dir = "plugins/user_code" + + def cmake_args(self): + args = [ + "-DINSTALL_PDIPLUGINDIR:PATH={:s}".format(self.prefix.lib), + "-DBUILD_TESTING:BOOL={:s}".format("ON" if "+tests" in self.spec else "OFF"), + "-DBUILD_CFG_VALIDATOR:BOOL=OFF", + ] + return args + + def setup_run_environment(self, env): + env.prepend_path("PDI_PLUGIN_PATH", self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/perl-bio-bigfile/package.py b/var/spack/repos/builtin/packages/perl-bio-bigfile/package.py index d8c3022af99c32..671841689bb494 100644 --- a/var/spack/repos/builtin/packages/perl-bio-bigfile/package.py +++ b/var/spack/repos/builtin/packages/perl-bio-bigfile/package.py @@ -67,9 +67,9 @@ def build_pl_args(self): def setup_build_environment(self, env): # These variables are exected by by the Build.PL file # even though we override the results via PERL_MB_OPT - kent = self.spec["kentutils"] - env.set("KENT_SRC", kent.prefix) - env.set("MACHTYPE", kent.package.machtype) + kent_pkg = self["kentutils"] + env.set("KENT_SRC", kent_pkg.prefix) + env.set("MACHTYPE", kent_pkg.machtype) # Overriding this explicitly as an environmental variable # as the Build.PL script doesn't honnor the command line diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index eff6a9ad9a4652..7a4a06c6d66d04 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -332,7 +332,7 @@ def do_stage(self, mirror_only=False): try: perm = os.stat(filename).st_mode os.chmod(filename, perm | 0o200) - except IOError: + except OSError: continue def nmake_arguments(self): diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 411012f1eae242..6ac1548cb8b525 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -3,8 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os -import llnl.util.tty as tty - from spack.package import * @@ -22,6 +20,7 @@ class Petsc(Package, CudaPackage, ROCmPackage): tags = ["e4s"] version("main", branch="main") + version("3.22.3", sha256="88c0d465a3bd688cb17ebf06a17c06d6e9cc457fa6b9643d217389424e6bd795") version("3.22.2", sha256="83624de0178b42d37ca1f7f905e1093556c6919fe5accd3e9f11d00a66e11256") version("3.22.1", sha256="7117d3ae6827f681ed9737939d4e86896b4751e27cca941bb07e5703f19a0a7b") version("3.22.0", sha256="2c03f7c0f7ad2649240d4989355cf7fb7f211b75156cd7d424e1d9dd7dfb290b") @@ -240,9 +239,24 @@ class Petsc(Package, CudaPackage, ROCmPackage): "memalign", default="none", description="Specify alignment of allocated arrays", - values=("4", "8", "16", "32", "64", "none"), + values=( + "4", + "8", + "16", + "32", + "64", + "128", + "256", + "512", + "1024", + "2048", + "4096", + "8192", + "none", + ), multi=False, ) + variant("p4est", default=False, description="Activates support for P4Est (only parallel)") variant("saws", default=False, description="Activates support for Saws") variant("libyaml", default=False, description="Activates support for YAML") @@ -321,8 +335,7 @@ def check_fortran_compiler(self): patch("revert-3.18.0-ver-format-for-dealii.patch", when="@3.18.0") depends_on("diffutils", type="build") - # not listed as a "build" dependency - so that slepc build gets the same dependency - depends_on("gmake") + depends_on("gmake", type="build") # Virtual dependencies # Git repository needs sowing to build Fortran interface @@ -399,6 +412,7 @@ def check_fortran_compiler(self): depends_on("hypre@2.14:2.22.0", when="@3.14:3.15+hypre") depends_on("hypre@2.14:2.28.0", when="@3.16:3.19+hypre") depends_on("hypre@2.14:", when="@3.20+hypre") + depends_on("hypre@2.32:", when="@3.22:+hypre") depends_on("hypre@develop", when="@main+hypre") depends_on("superlu-dist@:4.3~int64", when="@3.4.4:3.6.4+superlu-dist+mpi~int64") @@ -449,8 +463,8 @@ def check_fortran_compiler(self): depends_on("kokkos", when="+kokkos") depends_on("kokkos~complex_align", when="+kokkos+complex") depends_on("kokkos-kernels", when="+kokkos") - conflicts("kokkos@4.5:", when="@:3.22") - conflicts("kokkos-kernels@4.5:", when="@:3.22") + conflicts("kokkos@4.5:", when="@:3.22 +kokkos") + conflicts("kokkos-kernels@4.5:", when="@:3.22 +kokkos") for cuda_arch in CudaPackage.cuda_arch_values: depends_on( "kokkos+cuda+cuda_lambda cuda_arch=%s" % cuda_arch, @@ -567,7 +581,7 @@ def configure_options(self): if "+sycl" in spec: sycl_compatible_compilers = ["icpx"] - if not (os.path.basename(self.compiler.cxx) in sycl_compatible_compilers): + if os.path.basename(self.compiler.cxx) not in sycl_compatible_compilers: raise InstallError("PETSc's SYCL GPU Backend requires oneAPI CXX (icpx) compiler.") options.append("--with-sycl=1") options.append("--with-syclc=" + self.compiler.cxx) @@ -575,6 +589,9 @@ def configure_options(self): else: options.append("--with-sycl=0") + if spec.satisfies("^cuda@12.8.0"): + options.append("CUDAPPFLAGS=-Wno-deprecated-gpu-targets") + if "trilinos" in spec: if spec.satisfies("^trilinos+boost"): options.append("--with-boost=1") @@ -593,14 +610,14 @@ def configure_options(self): if "+exodusii+fortran" in spec and "+fortran" in spec: options.append("--with-exodusii-fortran-bindings") + direct_dependencies = { + *(spec.name for spec in spec.dependencies()), + *(virtual for edge in spec.edges_to_dependencies() for virtual in edge.virtuals), + } # tuple format (spacklibname, petsclibname, useinc, uselib) # default: 'gmp', => ('gmp', 'gmp', True, True) # any other combination needs a full tuple # if not (useinc || uselib): usedir - i.e (False, False) - direct_dependencies = [] - for dep in spec.dependencies(): - direct_dependencies.append(dep.name) - direct_dependencies.extend(set(vspec.name for vspec in dep.package.virtuals_provided)) for library in ( ("cuda", "cuda", False, False), ("hip", "hip", True, False), @@ -704,6 +721,8 @@ def configure_options(self): hip_ipkgs.extend(["rocrand"]) else: hip_lpkgs.extend(["rocrand"]) + if spec.satisfies("^hipblas@6.3.0:"): + hip_ipkgs.extend(["hipblas-common"]) hip_inc = "" hip_lib = "" for pkg in hip_ipkgs: diff --git a/var/spack/repos/builtin/packages/pfind/package.py b/var/spack/repos/builtin/packages/pfind/package.py new file mode 100644 index 00000000000000..370c83301656ce --- /dev/null +++ b/var/spack/repos/builtin/packages/pfind/package.py @@ -0,0 +1,34 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Pfind(Package): + """ + The tool provides parallel access to a single directory. However, this + feature depends on the distribution of the "cookie" returned by telldir(). + Depending on the system, it may work. + """ + + homepage = "https://github.com/VI4IO/pfind" + git = "https://github.com/VI4IO/pfind.git" + + version("main", branch="master") + + depends_on("mpi") + + def setup_build_environment(self, env): + env.set("CC", self.spec["mpi"].mpicc, force=True) + env.set("CXX", self.spec["mpi"].mpicxx, force=True) + + def install(self, spec, prefix): + + for installer_path in ["./prepare.sh", "./compile.sh"]: + set_executable(installer_path) + installer = Executable(installer_path) + installer() + + mkdirp(prefix.bin) + install("pfind", prefix.bin) diff --git a/var/spack/repos/builtin/packages/pflogger/package.py b/var/spack/repos/builtin/packages/pflogger/package.py index a968a01147b814..05f5f578c1bd6c 100644 --- a/var/spack/repos/builtin/packages/pflogger/package.py +++ b/var/spack/repos/builtin/packages/pflogger/package.py @@ -21,6 +21,7 @@ class Pflogger(CMakePackage): version("develop", branch="develop") version("main", branch="main") + version("1.16.1", sha256="82ae8d008dda3984e12df3e92a61486a8f5c0b87182d54087f1d004ecc141fff") version("1.15.0", sha256="454f05731a3ba50c7ae3ef9463b642c53248ae84ccb3b93455ef2ae2b6858235") version("1.14.0", sha256="63422493136f66f61d5148b7b1d278b1e5ca76bd37c578e45e4ae0e967351823") version("1.13.2", sha256="934e573134f7f1a22b14eb582ea38dd68eb9dccb10526bfabe51229efe106352") diff --git a/var/spack/repos/builtin/packages/pfunit/package.py b/var/spack/repos/builtin/packages/pfunit/package.py index 5457486d78da27..dc0d17c3498151 100644 --- a/var/spack/repos/builtin/packages/pfunit/package.py +++ b/var/spack/repos/builtin/packages/pfunit/package.py @@ -18,6 +18,7 @@ class Pfunit(CMakePackage): maintainers("mathomp4", "tclune") + version("4.11.1", sha256="db954ce44e857fe17cf4212f91223d2ab73248de0c3af405e2e1224f92ed8d42") version("4.10.0", sha256="ee5e899dfb786bac46e3629b272d120920bafdb7f6a677980fc345f6acda0f99") version("4.9.0", sha256="caea019f623d4e02dd3e8442cee88e6087b4c431a2628e9ec2de55b527b51ab6") version("4.8.0", sha256="b5c66ab949fd23bee5c3b4d93069254f7ea40decb8d21f622fd6aa45ee68ef10") diff --git a/var/spack/repos/builtin/packages/pgdspider/package.py b/var/spack/repos/builtin/packages/pgdspider/package.py index a891952117a417..1df00aef1bd1a1 100644 --- a/var/spack/repos/builtin/packages/pgdspider/package.py +++ b/var/spack/repos/builtin/packages/pgdspider/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/phist/package.py b/var/spack/repos/builtin/packages/phist/package.py index 8b5e957b3c8ebb..ec17bf0ec396be 100644 --- a/var/spack/repos/builtin/packages/phist/package.py +++ b/var/spack/repos/builtin/packages/phist/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.tty as tty import spack.hooks.sbang as sbang from spack.package import * diff --git a/var/spack/repos/builtin/packages/picard/package.py b/var/spack/repos/builtin/packages/picard/package.py index e9befc083253f1..f5da7fd82a33de 100644 --- a/var/spack/repos/builtin/packages/picard/package.py +++ b/var/spack/repos/builtin/packages/picard/package.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import glob -import os.path +import os import re from spack.package import * diff --git a/var/spack/repos/builtin/packages/pika/package.py b/var/spack/repos/builtin/packages/pika/package.py index b1f222e478a01a..7d26a15b7dd986 100644 --- a/var/spack/repos/builtin/packages/pika/package.py +++ b/var/spack/repos/builtin/packages/pika/package.py @@ -18,6 +18,7 @@ class Pika(CMakePackage, CudaPackage, ROCmPackage): license("BSL-1.0") + version("0.32.0", sha256="19217e3eecff30a7038f5712b6e161db09f12d7077550e8f66add74b3e524d29") version("0.31.0", sha256="bdbd8e36afb367cc2c7172e5a819c756e4ee20e74dfdec4905f2e84bf097eb7c") version("0.30.1", sha256="b0f3689a3edd30f8d674e19b5134fc5013813f843c45797c1015163e51989ac0") version("0.30.0", sha256="1798bf7de2505bc707bf95716fda8de5630b2e2ae54a6c4ef59f9931394d31cc") @@ -149,8 +150,6 @@ class Pika(CMakePackage, CudaPackage, ROCmPackage): depends_on("apex", when="+apex") depends_on("cuda@11:", when="+cuda") depends_on("hip@5.2:", when="@0.8: +rocm") - # https://github.com/pika-org/pika/issues/1238 - conflicts("%gcc@13:", when="+rocm") depends_on("hipblas", when="@:0.8 +rocm") depends_on("mpi", when="+mpi") with when("+stdexec"): diff --git a/var/spack/repos/builtin/packages/pilon/package.py b/var/spack/repos/builtin/packages/pilon/package.py index b2af507068e8d5..5e374f9ec9c993 100644 --- a/var/spack/repos/builtin/packages/pilon/package.py +++ b/var/spack/repos/builtin/packages/pilon/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/plasma/package.py b/var/spack/repos/builtin/packages/plasma/package.py index eec32b08cce8d6..ec9ec5a6e96384 100644 --- a/var/spack/repos/builtin/packages/plasma/package.py +++ b/var/spack/repos/builtin/packages/plasma/package.py @@ -120,7 +120,7 @@ def cmake_args(self): options.append(self.define("{}_PROVIDER".format(lib), provider)) if "cray-libsci" in self.spec: for lib in ("CBLAS", "LAPACKE"): - libsci_prefix = self.spec["cray-libsci"].package.external_prefix + libsci_prefix = self["cray-libsci"].external_prefix options.append(self.define("{}_PROVIDER".format(lib), "generic")) options.append( self.define("{}_INCLUDE_DIRS".format(lib), join_path(libsci_prefix, "include")) diff --git a/var/spack/repos/builtin/packages/plog/package.py b/var/spack/repos/builtin/packages/plog/package.py new file mode 100644 index 00000000000000..9a30c1ef136f14 --- /dev/null +++ b/var/spack/repos/builtin/packages/plog/package.py @@ -0,0 +1,21 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Plog(CMakePackage): + """Portable, simple and extensible C++ logging library.""" + + homepage = "https://github.com/SergiusTheBest/plog" + url = "https://github.com/SergiusTheBest/plog/archive/refs/tags/1.1.10.tar.gz" + + maintainers("plexoos") + + license("MIT", checked_by="plexoos") + + version("1.1.10", sha256="55a090fc2b46ab44d0dde562a91fe5fc15445a3caedfaedda89fe3925da4705a") + version("1.1.9", sha256="058315b9ec9611b659337d4333519ab4783fad3f2f23b1cc7bb84d977ea38055") + + depends_on("cxx", type="build") diff --git a/var/spack/repos/builtin/packages/plsm/package.py b/var/spack/repos/builtin/packages/plsm/package.py new file mode 100644 index 00000000000000..5e45fff3f08938 --- /dev/null +++ b/var/spack/repos/builtin/packages/plsm/package.py @@ -0,0 +1,46 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Plsm(CMakePackage, CudaPackage): + """plsm is a generic library for spatial subdivision within an N-dimensional lattice.""" + + homepage = "https://github.com/ORNL-Fusion/plsm" + url = "https://github.com/ORNL-Fusion/plsm/archive/refs/tags/v2.1.2.tar.gz" + git = "https://github.com/ORNL-Fusion/plsm.git" + + maintainers("PhilipFackler", "sblondel") + license("BSD-3-Clause", checked_by="PhilipFackler") + + version("2.1.2", sha256="0816fc604b35aac9d848063c2cb2e20abef5e39e146d745873a061a9445ec277") + version("2.0.4", sha256="a92080c7015d33a11ffd0d790a75341d1b1e3b7d19331fbd48c5e6a15a09693d") + version("2.0.3", sha256="d7ca114dd566ee8f1485bcb5e4d9307a43c33f107d295cec31a568b3ad7064bc") + version("2.0.1", sha256="b5b60172ee398a08df9d11b04719d85c7c99c6a5b10b3709f72fcd40a920c0c3") + version("2.0.0", sha256="833e63134101e1574de383e3d6d50fcee60ef7f9e69394d5b4c722e2a6317017") + version("1.1.1", sha256="e40e2d5d3339b303a0056bcec0882b3040e69b38ddef4c3154a6e8ce3d83ebb8") + + depends_on("cxx", type="build") + + variant("int64", default=True, description="Use 64-bit indices") + variant("openmp", default=False, description="Activates OpenMP backend") + + conflicts("+cuda", when="cuda_arch=none") + conflicts("+openmp", when="+cuda", msg="Can't use both OpenMP and CUDA") + + depends_on("kokkos") + depends_on("kokkos +openmp", when="+openmp") + for cuda_arch in CudaPackage.cuda_arch_values: + depends_on( + f"kokkos+cmake_lang+cuda+cuda_lambda cuda_arch={cuda_arch}", + when=f"+cuda cuda_arch={cuda_arch}", + ) + + def cmake_args(self): + args = [ + self.define("BUILD_TESTING", self.run_tests), + self.define_from_variant("PLSM_USE_64BIT_INDEX_TYPE", "int64"), + ] + return args diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py index b5d207559149cd..2c24d42c36c7cc 100644 --- a/var/spack/repos/builtin/packages/plumed/package.py +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import collections -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/pmdk/package.py b/var/spack/repos/builtin/packages/pmdk/package.py index 05faa1e9d6b6bb..7b75912b2a7735 100644 --- a/var/spack/repos/builtin/packages/pmdk/package.py +++ b/var/spack/repos/builtin/packages/pmdk/package.py @@ -39,6 +39,7 @@ class Pmdk(Package): variant("rpmem", default=False, description="Build remote persistent memory components") depends_on("gmake", type="build") + depends_on("cmake", type="build") depends_on("pkgconfig", when="@1.12.1:", type="build") depends_on("ncurses", when="@1.6:") depends_on("libfabric", when="+rpmem") diff --git a/var/spack/repos/builtin/packages/podio/package.py b/var/spack/repos/builtin/packages/podio/package.py index fc9d8a62dd22d8..2d530bbcba289f 100644 --- a/var/spack/repos/builtin/packages/podio/package.py +++ b/var/spack/repos/builtin/packages/podio/package.py @@ -70,7 +70,8 @@ class Podio(CMakePackage): deprecated=True, ) - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") _cxxstd_values = (conditional("17", when="@:1.2"), conditional("20", when="@0.14.1:")) variant( diff --git a/var/spack/repos/builtin/packages/poppler/package.py b/var/spack/repos/builtin/packages/poppler/package.py index a840317a502e4a..9257acd0c8ce15 100644 --- a/var/spack/repos/builtin/packages/poppler/package.py +++ b/var/spack/repos/builtin/packages/poppler/package.py @@ -13,6 +13,8 @@ class Poppler(CMakePackage): list_url = "https://poppler.freedesktop.org/releases.html" git = "https://gitlab.freedesktop.org/poppler/poppler.git" + maintainers("cessenat") + license("GPL-2.0-or-later") version("master", branch="master") @@ -40,10 +42,11 @@ class Poppler(CMakePackage): variant("openjpeg", default=False, description="Use libopenjpeg for JPX streams") variant("qt", default=False, description="Compile poppler qt wrapper") variant("zlib", default=False, description="Build with zlib") - variant("iconv", default=False, description="Search for Iconv package") variant("jpeg", default=False, description="Search for JPEG package") variant("png", default=False, description="Search for PNG package") variant("tiff", default=False, description="Search for TIFF package") + variant("nss", default=False, description="Search for NSS package") + variant("gpgme", default=False, description="Search for GPGME package") depends_on("cmake@3.1.0:", type="build") depends_on("pkgconfig", type="build") @@ -60,10 +63,12 @@ class Poppler(CMakePackage): depends_on("qt@4.0:", when="+qt") depends_on("zlib-api", when="+zlib") depends_on("cairo+ft@1.10.0:", when="+glib") - depends_on("iconv", when="+iconv") + depends_on("iconv", when="+cpp") depends_on("jpeg", when="+jpeg") depends_on("libpng", when="+png") depends_on("libtiff", when="+tiff") + depends_on("nss@3.73:", when="+nss") + depends_on("gpgme", when="+gpgme") depends_on("qt@5.0:", when="@0.62.0:+qt") depends_on("qt@4.0:4.8.6", when="@:0.61+qt") @@ -86,80 +91,63 @@ def cmake_args(self): "-DTESTDATADIR={0}".format(join_path(self.stage.source_path, "testdata")), # TODO: Add packages for these missing dependencies "-DENABLE_SPLASH=OFF", - "-DWITH_NSS3=OFF", ] # Install header files args.append("-DENABLE_UNSTABLE_API_ABI_HEADERS=ON") - if "+boost" in spec: - args.append("-DENABLE_BOOST=ON") - else: - args.append("-DENABLE_BOOST=OFF") - - if "+cms" in spec: + args.append(self.define_from_variant("ENABLE_BOOST", "boost")) + if spec.satisfies("+cms"): args.append("-DENABLE_CMS=lcms2") else: args.append("-DENABLE_CMS=none") - if "+cpp" in spec: - args.append("-DENABLE_CPP=ON") + args.append(self.define_from_variant("ENABLE_CPP", "cpp")) + if spec.satisfies("+cpp"): + args.append("-DWITH_Iconv=ON") else: - args.append("-DENABLE_CPP=OFF") + args.append("-DWITH_Iconv=OFF") - if "+glib" in spec: + if spec.satisfies("+glib"): args.extend(["-DENABLE_GLIB=ON", "-DWITH_GLIB=ON", "-DWITH_Cairo=ON"]) else: args.extend(["-DENABLE_GLIB=OFF", "-DWITH_GLIB=OFF", "-DWITH_Cairo=OFF"]) - if "+gobject" in spec: - args.append("-DENABLE_GOBJECT_INTROSPECTION=ON") - else: - args.append("-DENABLE_GOBJECT_INTROSPECTION=OFF") - - if "+libcurl" in spec: - args.append("-DENABLE_LIBCURL=ON") - else: - args.append("-DENABLE_LIBCURL=OFF") + args.append(self.define_from_variant("ENABLE_GOBJECT_INTROSPECTION", "gobject")) + args.append(self.define_from_variant("ENABLE_LIBCURL", "libcurl")) - if "+openjpeg" in spec: + if spec.satisfies("+openjpeg"): args.append("-DENABLE_LIBOPENJPEG=openjpeg2") else: args.append("-DENABLE_LIBOPENJPEG=none") - if "+qt" in spec and spec.satisfies("^qt@4.0:4.8.6"): + if spec.satisfies("+qt") and spec.satisfies("^qt@4.0:4.8.6"): args.append("-DENABLE_QT4=ON") args.append("-DENABLE_QT5=OFF") - elif "+qt" in spec and spec.satisfies("^qt@5.0:"): + args.append("-DENABLE_QT6=OFF") + elif spec.satisfies("+qt") and spec.satisfies("^qt@5.0:5.99"): args.append("-DENABLE_QT5=ON") args.append("-DENABLE_QT4=OFF") - else: + args.append("-DENABLE_QT6=OFF") + elif spec.satisfies("+qt") and spec.satisfies("^qt@6.0:"): args.append("-DENABLE_QT4=OFF") args.append("-DENABLE_QT5=OFF") - - if "+zlib" in spec: - args.append("-DENABLE_ZLIB=ON") + args.append("-DENABLE_QT6=ON") else: - args.append("-DENABLE_ZLIB=OFF") + args.append("-DENABLE_QT4=OFF") + args.append("-DENABLE_QT5=OFF") + args.append("-DENABLE_QT6=OFF") - if "+iconv" in spec: - args.append("-DWITH_Iconv=ON") - else: - args.append("-DWITH_Iconv=OFF") + args.append(self.define_from_variant("ENABLE_ZLIB", "zlib")) - if "+jpeg" in spec: + if spec.satisfies("+jpeg"): args.extend(["-DENABLE_DCTDECODER=libjpeg", "-DWITH_JPEG=ON"]) else: args.extend(["-DENABLE_DCTDECODER=none", "-DWITH_JPEG=OFF"]) - if "+png" in spec: - args.append("-DWITH_PNG=ON") - else: - args.append("-DWITH_PNG=OFF") - - if "+tiff" in spec: - args.append("-DWITH_TIFF=ON") - else: - args.append("-DWITH_TIFF=OFF") + args.append(self.define_from_variant("ENABLE_LIBPNG", "png")) + args.append(self.define_from_variant("ENABLE_LIBTIFF", "tiff")) + args.append(self.define_from_variant("ENABLE_NSS3", "nss")) + args.append(self.define_from_variant("ENABLE_GPGME", "gpgme")) return args diff --git a/var/spack/repos/builtin/packages/ports-of-call/package.py b/var/spack/repos/builtin/packages/ports-of-call/package.py index c481a5801b14f0..6ccfa894c33618 100644 --- a/var/spack/repos/builtin/packages/ports-of-call/package.py +++ b/var/spack/repos/builtin/packages/ports-of-call/package.py @@ -17,6 +17,9 @@ class PortsOfCall(CMakePackage): license("BSD-3-Clause") version("main", branch="main") + version("1.7.1", sha256="18b0b99370ef2adf3374248f653461606f826fe4076d0f19ac8c72d46035fdf5") + version("1.7.0", sha256="99045a7c4e3fbc73f01e930ce870cdc573a39910a28d85c54d65d2135f764bfc") + version("1.6.0", sha256="290da149d4ad79c15787956559aeeefa0a06403be2f08cd324562ef013306797") version("1.5.2", sha256="73d16fe9236a9475010dbb01bf751c15bef01eb2e15bf92c8d9be2c0a606329f") version("1.5.1", sha256="b1f0232cd6d2aac65385d77cc061ec5035283ea50d0f167e7003eae034effb78") version("1.4.1", sha256="82d2c75fcca8bd613273fd4126749df68ccc22fbe4134ba673b4275f9972b78d") @@ -44,11 +47,32 @@ class PortsOfCall(CMakePackage): default="None", when="@:1.2.0", ) + variant("test", default=False, description="Build tests") + variant( + "test_portability_strategy", + description="Portability strategy used by tests", + values=("Kokkos", "Cuda", "None"), + multi=False, + default="None", + when="@1.7.0: +test", + ) depends_on("cmake@3.12:", type="build") + depends_on("catch2@3.0.1:", when="+test", type=("build", "test")) + depends_on("kokkos", when="+test test_portability_strategy=Kokkos", type=("build", "test")) def cmake_args(self): - args = [] + args = [ + self.define_from_variant("PORTS_OF_CALL_BUILD_TESTING", "test"), + self.define_from_variant( + "PORTS_OF_CALL_TEST_PORTABILITY_STRATEGY", "test_portability_strategy" + ), + ] if self.spec.satisfies("@:1.2.0"): args.append(self.define_from_variant("PORTABILITY_STRATEGY", "portability_strategy")) + if self.spec.satisfies("test_portability_strategy=Kokkos ^kokkos+rocm"): + args.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)) + args.append(self.define("CMAKE_C_COMPILER", self.spec["hip"].hipcc)) + if self.spec.satisfies("test_portability_strategy=Kokkos ^kokkos+cuda"): + args.append(self.define("CMAKE_CXX_COMPILER", self.spec["kokkos"].kokkos_cxx)) return args diff --git a/var/spack/repos/builtin/packages/postgresql/package.py b/var/spack/repos/builtin/packages/postgresql/package.py index 6faaeeecd27733..f86021ac9353b7 100644 --- a/var/spack/repos/builtin/packages/postgresql/package.py +++ b/var/spack/repos/builtin/packages/postgresql/package.py @@ -20,6 +20,7 @@ class Postgresql(AutotoolsPackage): license("PostgreSQL") + version("17.2", sha256="82ef27c0af3751695d7f64e2d963583005fbb6a0c3df63d0e4b42211d7021164") version("16.4", sha256="971766d645aa73e93b9ef4e3be44201b4f45b5477095b049125403f9f3386d6f") version("16.3", sha256="331963d5d3dc4caf4216a049fa40b66d6bcb8c730615859411b9518764e60585") version("15.8", sha256="4403515f9a69eeb3efebc98f30b8c696122bfdf895e92b3b23f5b8e769edcb6a") @@ -76,6 +77,8 @@ class Postgresql(AutotoolsPackage): depends_on("perl+opcode", when="+perl") depends_on("python", when="+python") depends_on("libxml2", when="+xml") + depends_on("flex", when="@17:") + depends_on("bison", when="@17:") depends_on("pkgconfig", when="+xml", type="build") @property diff --git a/var/spack/repos/builtin/packages/precice/package.py b/var/spack/repos/builtin/packages/precice/package.py index 539fcfdd8a040d..ade39ddddfc5f3 100644 --- a/var/spack/repos/builtin/packages/precice/package.py +++ b/var/spack/repos/builtin/packages/precice/package.py @@ -195,7 +195,7 @@ def cmake_args(self): python_library = spec["python"].libs[0] python_include = spec["python"].headers.directories[0] numpy_include = join_path( - spec["py-numpy"].package.module.python_platlib, "numpy", "core", "include" + self["py-numpy"].module.python_platlib, "numpy", "core", "include" ) cmake_args.extend( [ diff --git a/var/spack/repos/builtin/packages/pumgen/package.py b/var/spack/repos/builtin/packages/pumgen/package.py new file mode 100644 index 00000000000000..e792d88e028846 --- /dev/null +++ b/var/spack/repos/builtin/packages/pumgen/package.py @@ -0,0 +1,58 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class Pumgen(CMakePackage): + """PUMGen - A mesh converter to the PUML format, as used in SeisSol.""" + + homepage = "https://github.com/SeisSol/PUMGen/wiki/How-to-compile-PUMGen" + git = "https://github.com/SeisSol/PUMGen.git" + version("master", branch="master", submodules=True) + + version( + "1.1.1", tag="v1.1.1", commit="ad3d0f22edfdb72713ef7bb42a41251fa7275bd8", submodules=True + ) + version( + "1.0.1", tag="v1.0.1", commit="13d1e1f41e3cdcb1d3c94f1870f003778e5f0ce0", submodules=True + ) + maintainers("Thomas-Ulrich", "davschneller", "vikaskurapati") + variant( + "with_simmetrix", + default=False, + description="Use Simmetrix libraries, embedding mesh generation with Simmetrix in PUMGen", + ) + + depends_on("mpi") + # simmetrix (e.g. @2024.0-240616) currently does not + # have a precompiled libSimPartitionWrapper-openmpi5.a + depends_on("openmpi@:4", when="+with_simmetrix ^[virtuals=mpi] openmpi") + + depends_on("hdf5@1.10: +shared +threadsafe +mpi") + depends_on("simmetrix-simmodsuite", when="+with_simmetrix") + + with when("@1.0.1"): + depends_on("pumi +int64 +zoltan ~fortran", when="~with_simmetrix") + depends_on( + "pumi +int64 simmodsuite=base +zoltan ~fortran ~simmodsuite_version_check", + when="+with_simmetrix", + ) + depends_on("zoltan@3.83 +parmetis+int64 ~fortran +shared") + + depends_on("easi@1.2: +asagi jit=impalajit,lua", when="+with_simmetrix") + + def cmake_args(self): + args = [self.define_from_variant("SIMMETRIX", "with_simmetrix")] + if "simmetrix-simmodsuite" in self.spec: + mpi_id = self.spec["mpi"].name + self.spec["mpi"].version.up_to(1).string + args.append("-DSIM_MPI=" + mpi_id) + args.append("-DSIMMETRIX_ROOT=" + self.spec["simmetrix-simmodsuite"].prefix) + return args + + def install(self, spec, prefix): + self.cmake(spec, prefix) + self.build(spec, prefix) + install_tree(self.build_directory, prefix.bin) diff --git a/var/spack/repos/builtin/packages/py-amrex/package.py b/var/spack/repos/builtin/packages/py-amrex/package.py index 7922cd7214c9d9..1eb8000fd2dbbb 100644 --- a/var/spack/repos/builtin/packages/py-amrex/package.py +++ b/var/spack/repos/builtin/packages/py-amrex/package.py @@ -18,7 +18,12 @@ class PyAmrex(CMakePackage, PythonExtension, CudaPackage, ROCmPackage): license("BSD-3-Clause-LBNL") version("develop", branch="development") - version("24.10", sha256="dc1752ed3fbd5113dcfdbddcfe6c3c458e572b288ac9d41ed3ed7db130591d74") + version("25.02", sha256="c743086b317f9fa90639d825db32a92376cde8dc5e1eab47a4c6a82af36d5b5c") + version( + "24.10", + sha256="dc1752ed3fbd5113dcfdbddcfe6c3c458e572b288ac9d41ed3ed7db130591d74", + deprecated=True, + ) version( "24.08", sha256="e7179d88261f64744f392a2194ff2744fe323fe0e21d0742ba60458709a1b47e", @@ -36,7 +41,7 @@ class PyAmrex(CMakePackage, PythonExtension, CudaPackage, ROCmPackage): deprecated=True, ) - for v in ["24.10", "24.08", "24.04", "24.03"]: + for v in ["25.02", "24.10", "24.08", "24.04", "24.03"]: depends_on("amrex@{0}".format(v), when="@{0}".format(v), type=("build", "link")) variant( @@ -67,6 +72,7 @@ class PyAmrex(CMakePackage, PythonExtension, CudaPackage, ROCmPackage): depends_on("cmake@3.20:3", type="build", when="@:24.08") depends_on("cmake@3.24:3", type="build", when="@24.09:") + depends_on("pkgconfig", type="build") # amrex +fft depends_on("python@3.8:", type=("build", "run")) depends_on("py-mpi4py@2.1.0:", type=("build", "run"), when="+mpi") depends_on("py-numpy@1.15:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-arch/package.py b/var/spack/repos/builtin/packages/py-arch/package.py index bd4e3708f39e95..6334110c26e7c8 100644 --- a/var/spack/repos/builtin/packages/py-arch/package.py +++ b/var/spack/repos/builtin/packages/py-arch/package.py @@ -31,7 +31,7 @@ class PyArch(PythonPackage): # "numpy>=2.0.0rc1,<3" ??? # https://github.com/bashtage/arch/blob/9ced09e2566c0ebcad962d2441b1e79e2aaa7c9f/requirements.txt#L1 # numpy>=1.22.3 ??? - depends_on("py-numpy@1.22.3", type=("build", "run")) + depends_on("py-numpy@1.22.3:", type=("build", "run")) depends_on("py-scipy@1.8:", type="run") depends_on("py-pandas@1.4:", type="run") diff --git a/var/spack/repos/builtin/packages/py-arkouda/package.py b/var/spack/repos/builtin/packages/py-arkouda/package.py new file mode 100644 index 00000000000000..f56cc74d75f8af --- /dev/null +++ b/var/spack/repos/builtin/packages/py-arkouda/package.py @@ -0,0 +1,55 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT)s + +from spack.package import * + + +class PyArkouda(PythonPackage): + """This is the python client for Arkouda.""" + + homepage = "https://github.com/Bears-R-Us/arkouda" + + # Updating the arkouda PyPI package is future work + url = "https://github.com/Bears-R-Us/arkouda/archive/refs/tags/v2024.10.02.tar.gz" + git = "https://github.com/Bears-R-Us/arkouda.git" + + # See https://spdx.org/licenses/ for a list. + license("MIT") + + test_requires_compiler = True + + # A list of GitHub accounts to notify when the package is updated. + # TODO: add arkouda devs github account + maintainers("arezaii") + + version("master", branch="master") + + version( + "2024.10.02", sha256="00671a89a08be57ff90a94052f69bfc6fe793f7b50cf9195dd7ee794d6d13f23" + ) + version( + "2024.06.21", sha256="ab7f753befb3a0b8e27a3d28f3c83332d2c6ae49678877a7456f0fcfe42df51c" + ) + + variant("dev", default=False, description="Include arkouda developer extras") + + depends_on("python@3.8:", type=("build", "run"), when="@:2024.06.21") + depends_on("python@3.9:3.12.3", type=("build", "run"), when="@2024.10.02:") + depends_on("py-setuptools", type="build") + depends_on("py-numpy@1.24.1:1.99", type=("build", "run")) + depends_on("py-pandas@1.4.0:", type=("build", "run")) + conflicts("^py-pandas@2.2.0", msg="arkouda client not compatible with pandas 2.2.0") + + depends_on("py-pyarrow", type=("build", "run")) + depends_on("py-pyzmq@20:", type=("build", "run")) + depends_on("py-scipy@:1.13.1", type=("build", "run"), when="@2024.06.21:") + depends_on("py-tables@3.7.0: +lzo +bzip2", type=("build", "run"), when="@:2024.06.21") + depends_on("py-tables@3.8.0: +lzo +bzip2", type=("build", "run"), when="@2024.10.02:") + depends_on("py-h5py@3.7.0:", type=("build", "run")) + depends_on("py-matplotlib@3.3.2:", type=("build", "run")) + depends_on("py-versioneer", type=("build")) + depends_on("py-pyfiglet", type=("build", "run")) + depends_on("py-typeguard@2.10:2.12", type=("build", "run")) + depends_on("py-tabulate", type=("build", "run")) + depends_on("py-pytest@6.0:", type=("build", "run"), when="@2024.10.02") diff --git a/var/spack/repos/builtin/packages/py-awkward-cpp/package.py b/var/spack/repos/builtin/packages/py-awkward-cpp/package.py index 31cca8a0c9afab..bccc6827a393a6 100644 --- a/var/spack/repos/builtin/packages/py-awkward-cpp/package.py +++ b/var/spack/repos/builtin/packages/py-awkward-cpp/package.py @@ -34,7 +34,7 @@ class PyAwkwardCpp(PythonPackage): depends_on("python@3.7:", type=("build", "run")) depends_on("python@3.8:", type=("build", "run"), when="@19:") - depends_on("py-scikit-build-core@0.2.0:+pyproject", when="@11:", type="build") + depends_on("py-scikit-build-core@0.2.0:+pyproject", when="@10:", type="build") depends_on("py-pybind11", type=("build", "link")) depends_on("py-numpy@1.17.0:", when="@12:", type=("build", "run")) depends_on("py-numpy@1.18.0:", when="@19:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-awkward/package.py b/var/spack/repos/builtin/packages/py-awkward/package.py index 2184f4f334436b..f5db8ec1cb87d9 100644 --- a/var/spack/repos/builtin/packages/py-awkward/package.py +++ b/var/spack/repos/builtin/packages/py-awkward/package.py @@ -81,13 +81,15 @@ class PyAwkward(PythonPackage): depends_on("py-numpy@1.17.0:", when="@2.1:", type=("build", "run")) depends_on("py-numpy@1.18.0:", when="@2.3:", type=("build", "run")) depends_on("py-pybind11", type=("build", "link")) - depends_on("py-importlib-resources", when="@2: ^python@:3.8", type=("build", "run")) + depends_on("py-importlib-resources", when="@2:2.3 ^python@:3.8", type=("build", "run")) depends_on("py-typing-extensions@4.1:", when="@2: ^python@:3.10", type=("build", "run")) depends_on("py-packaging", when="@2:", type=("build", "run")) depends_on("dlpack", when="@1.0.0:") depends_on("rapidjson") depends_on("cmake@3.13:", type="build") depends_on("py-wheel@0.36.0:", when="@:1.7.0", type="build") + depends_on("py-importlib-metadata@4.13.0:", when="@2.4.0:", type=("build", "run")) + depends_on("py-fsspec@2022.11.0:", when="@2.6.0:", type=("build", "run")) @when("@1.9.0:") def setup_build_environment(self, env): diff --git a/var/spack/repos/builtin/packages/py-basemap/package.py b/var/spack/repos/builtin/packages/py-basemap/package.py index f0784a025bbeaf..338f5161e4e6da 100644 --- a/var/spack/repos/builtin/packages/py-basemap/package.py +++ b/var/spack/repos/builtin/packages/py-basemap/package.py @@ -9,38 +9,42 @@ class PyBasemap(PythonPackage): """The matplotlib basemap toolkit is a library for plotting 2D data on maps in Python.""" - url = "https://github.com/matplotlib/basemap/archive/v1.2.0rel.tar.gz" homepage = "https://matplotlib.org/basemap/" + url = "https://github.com/matplotlib/basemap/archive/refs/tags/v1.4.1.tar.gz" license("MIT") - version("1.2.1", sha256="3fb30424f18cd4ffd505e30fd9c810ae81b999bb92f950c76553e1abc081faa7") + version("1.4.1", sha256="730b1e2ff5eb31c73680bd8ebabc6b11adfc587cfa6832c528a8a82822e5a490") + + variant("hires", default=False, description="Install hi-res data.") depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated + depends_on("py-cython@0.29:3.0", type="build") + + depends_on("python@3.10:3", type=("build", "run")) + depends_on("py-numpy@1.21:1.26", type=("build", "run")) + depends_on("py-matplotlib@1.5:3.8", type=("build", "run")) + depends_on("py-pyproj@1.9.3:3.6", type=("build", "run")) + depends_on("py-pyshp@1.2:2.3", type=("build", "run")) + depends_on("py-packaging@16.0:23", type=("build", "run")) + depends_on("geos", type=("build", "run")) # Per Github issue #3813, setuptools is required at runtime in order # to make mpl_toolkits a namespace package that can span multiple # directories (i.e., matplotlib and basemap) depends_on("py-setuptools", type=("build", "run")) - depends_on("py-numpy@1.2.1:", type=("build", "run")) - depends_on("py-matplotlib@1.0.0:3.0.0,3.0.2:", type=("build", "run")) - # 1.2.1 is PROJ6 compatible - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939022 - depends_on("py-pyproj@1.9.3:", type=("build", "run"), when="@1.2.1:") - - depends_on("py-pyshp@1.2.0:", type=("build", "run")) - depends_on("py-six", type=("build", "run")) - depends_on("pil", type=("build", "run")) - depends_on("geos") - - def url_for_version(self, version): - if version >= Version("1.2.0"): - return "https://github.com/matplotlib/basemap/archive/v{0}rel.tar.gz".format(version) - else: - return "https://downloads.sourceforge.net/project/matplotlib/matplotlib-toolkits/basemap-{0}/basemap-{0}.tar.gz".format( - version - ) def setup_build_environment(self, env): env.set("GEOS_DIR", self.spec["geos"].prefix) + + def install(self, spec, prefix): + with working_dir("packages/basemap"): + python("setup.py", "install", "--prefix={0}".format(prefix)) + + with working_dir("packages/basemap_data"): + python("setup.py", "install", "--prefix={0}".format(prefix)) + + if "+hires" in spec: + with working_dir("packages/basemap_data_hires"): + python("setup.py", "install", "--prefix={0}".format(prefix)) diff --git a/var/spack/repos/builtin/packages/py-bqplot/package.py b/var/spack/repos/builtin/packages/py-bqplot/package.py new file mode 100644 index 00000000000000..35b6c01f44097b --- /dev/null +++ b/var/spack/repos/builtin/packages/py-bqplot/package.py @@ -0,0 +1,24 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyBqplot(PythonPackage): + """Interactive plotting for the Jupyter notebook, using d3.js and ipywidgets.""" + + homepage = "https://github.com/bqplot/bqplot" + # Source code only available on GitHub, has build issues + url = "https://files.pythonhosted.org/packages/py2.py3/b/bqplot/bqplot-0.12.44-py2.py3-none-any.whl" + + license("Apache-2.0") + + version("0.12.44", sha256="cad65bf5c4ce7ea7b03e1c674340f9274c0975941e63057831b29f7c2c37f144") + + with default_args(type=("build", "run")): + depends_on("py-ipywidgets@7.5:8") + depends_on("py-traitlets@4.3:") + depends_on("py-traittypes@0.0.6:") + depends_on("py-numpy@1.10.4:") + depends_on("py-pandas@1:2") diff --git a/var/spack/repos/builtin/packages/py-cmake/package.py b/var/spack/repos/builtin/packages/py-cmake/package.py deleted file mode 100644 index 59dc41a1b7aad4..00000000000000 --- a/var/spack/repos/builtin/packages/py-cmake/package.py +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack.package import * - -pycmake_versions = { - "3.27.9": "d8a40eef1268c91e5b520b28fd5fe0591d750e48e44276dbfd493a14ee595c41", - "3.22.2": "b5bd5eeb488b13cf64ec963800f3d979eaeb90b4382861b86909df503379e219", - "3.21.4": "30fa5ed8a5ad66dcd263adb87f3ce3dc2d0ec0ac3958f5becff577e4b62cd065", - "3.18.0": "52b98c5ee70b5fa30a8623e96482227e065292f78794eb085fdf0fecb204b79b", -} - - -class PyCmake(PythonPackage): - """CMake is an open-source, cross-platform family of tools designed to - build, test and package software. - - Deprecated: use cmake instead. - """ - - homepage = "https://cmake.org" - git = "https://github.com/scikit-build/cmake-python-distributions.git" - pypi = "cmake/cmake-3.22.2.tar.gz" - - license("Apache-2.0") - - for v, sha in pycmake_versions.items(): - version(v, sha256=sha, deprecated=True) - - depends_on("ninja", type="build") - depends_on("py-scikit-build@0.12:", type="build") - depends_on("py-setuptools@42:", type="build") - depends_on("py-setuptools-scm+toml", when="@3.27.9:", type="build") - # in newer pip versions --install-option does not exist - depends_on("py-pip@:23.0", type="build") - depends_on("git", type="build") - - for v in pycmake_versions.keys(): - depends_on(f"cmake@{v}", type=("build", "link", "run"), when=f"@{v}") - - # see: - # https://github.com/scikit-build/cmake-python-distributions/issues/227 - # https://github.com/spack/spack/pull/28760#issuecomment-1029362288 - for v in pycmake_versions.keys(): - resource( - name="cmake-src", - git="https://gitlab.kitware.com/cmake/cmake.git", - commit="v{0}".format(v), - when="@{0}".format(v), - destination="cmake-src", - placement="cmake-src", - ) - - def install_options(self, spec, prefix): - return ["-DBUILD_CMAKE_FROM_SOURCE=ON", "-DCMakeProject_SOURCE_DIR=cmake-src"] - - def setup_build_environment(self, env): - if self.run_tests: - env.set( - "SKBUILD_CONFIGURE_OPTIONS", - # BootstrapTest is already exlcude upstream, - # The rest are (non-understood) known failures, disabled to get test suite working - # todo: investigate test failures / check if still needed in newer versions - "-DRUN_CMAKE_TEST=ON -DRUN_CMAKE_TEST_EXCLUDE=BootstrapTest|CompileWarningAsError" - "|GET_RUNTIME_DEPENDENCIES", - ) - else: - env.set("SKBUILD_CONFIGURE_OPTIONS", "-DRUN_CMAKE_TEST=OFF") diff --git a/var/spack/repos/builtin/packages/py-colour/package.py b/var/spack/repos/builtin/packages/py-colour/package.py new file mode 100644 index 00000000000000..2ae9b1c3119fc9 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-colour/package.py @@ -0,0 +1,20 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyColour(PythonPackage): + """converts and manipulates various color representation (HSL, RVB, web, X11, ...)""" + + homepage = "http://github.com/vaab/colour" + pypi = "colour/colour-0.1.5.tar.gz" + + license("BSD-2-Clause") + + version("0.1.5", sha256="af20120fefd2afede8b001fbef2ea9da70ad7d49fafdb6489025dae8745c3aee") + + with default_args(type="build"): + depends_on("py-setuptools") + depends_on("py-d2to1") diff --git a/var/spack/repos/builtin/packages/py-d2to1/package.py b/var/spack/repos/builtin/packages/py-d2to1/package.py index aa2b06793e2d6a..d55a90278d4a0d 100644 --- a/var/spack/repos/builtin/packages/py-d2to1/package.py +++ b/var/spack/repos/builtin/packages/py-d2to1/package.py @@ -18,6 +18,8 @@ class PyD2to1(PythonPackage): ) version("0.2.12", sha256="04ab9f3ac255d367ecda1eb59379e5031816740c3a3eda95d0dba9f6bb3b7ca4") - depends_on("c", type="build") # generated + depends_on("c", type="build") - depends_on("py-setuptools", type="build") + # d2to1/core.py + # from setuptools.dist import _get_unpatched + depends_on("py-setuptools@:67", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-dacite/package.py b/var/spack/repos/builtin/packages/py-dacite/package.py new file mode 100644 index 00000000000000..006b50d95ec542 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-dacite/package.py @@ -0,0 +1,20 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyDacite(PythonPackage): + """Simple creation of data classes from dictionaries.""" + + homepage = "https://github.com/konradhalas/dacite" + pypi = "dacite/dacite-1.8.0.tar.gz" + + license("MIT") + + version("1.8.0", sha256="6257a5e505b61a8cafee7ef3ad08cf32ee9b885718f42395d017e0a9b4c6af65") + + depends_on("python@3.6:") + + depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-datasets/package.py b/var/spack/repos/builtin/packages/py-datasets/package.py index e9104f77823047..3b9c6b80176223 100644 --- a/var/spack/repos/builtin/packages/py-datasets/package.py +++ b/var/spack/repos/builtin/packages/py-datasets/package.py @@ -17,6 +17,7 @@ class PyDatasets(PythonPackage): license("Apache-2.0") + version("3.2.0", sha256="9a6e1a356052866b5dbdd9c9eedb000bf3fc43d986e3584d9b028f4976937229") version("2.20.0", sha256="3c4dbcd27e0f642b9d41d20ff2efa721a5e04b32b2ca4009e0fc9139e324553f") version("2.8.0", sha256="a843b69593914071f921fc1086fde939f30a63415a34cdda5db3c0acdd58aff2") version("1.8.0", sha256="d57c32bb29e453ee7f3eb0bbca3660ab4dd2d0e4648efcfa987432624cab29d3") @@ -30,7 +31,7 @@ class PyDatasets(PythonPackage): depends_on("py-pandas") depends_on("py-requests@2.19:") depends_on("py-xxhash") - depends_on("py-multiprocess") + depends_on("py-multiprocess@:0.70.16") depends_on("py-packaging") with when("@:1.8.0"): depends_on("py-dill@:0.3.6") @@ -39,24 +40,28 @@ class PyDatasets(PythonPackage): depends_on("py-huggingface-hub@:0.0") depends_on("py-importlib-metadata", when="^python@:3.7") depends_on("py-pyarrow@1:3+parquet") - depends_on("py-tqdm@4.27:4.49", when="@:1.8.0") + depends_on("py-tqdm@4.27:4.49") + with when("@2.8.0"): + depends_on("py-responses@:0.18") with when("@2.8.0:"): depends_on("py-aiohttp") depends_on("py-pyyaml@5.1:") - depends_on("python@3.7:") - with when("@2.8.0"): depends_on("py-dill@:0.3.6") depends_on("py-fsspec@2021.11.1:+http") depends_on("py-huggingface-hub@0.2:0") depends_on("py-pyarrow@6:+parquet") - depends_on("py-responses@:0.18") depends_on("py-tqdm@4.62.1:") + depends_on("python@3.7:") with when("@2.20.0:"): depends_on("py-filelock") depends_on("py-dill@0.3.0:0.3.8") # temporary upper bound depends_on("py-fsspec@2023.1.0:2024.5.0+http") depends_on("py-huggingface-hub@0.21.2:") - depends_on("py-pyarrow@15:+parquet") + depends_on("py-pyarrow@15:+parquet+dataset") depends_on("py-requests@2.32.2:") depends_on("py-tqdm@4.66.3:") depends_on("python@3.8:") + with when("@3.2.0:"): + depends_on("py-huggingface-hub@0.23.0:") + depends_on("py-fsspec@2023.1.0:2024.9.0+http") + depends_on("python@3.9:") diff --git a/var/spack/repos/builtin/packages/py-donfig/package.py b/var/spack/repos/builtin/packages/py-donfig/package.py new file mode 100644 index 00000000000000..e34fd58855bec9 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-donfig/package.py @@ -0,0 +1,24 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyDonfig(PythonPackage): + """Donfig is a python library making package and script configuration easy""" + + homepage = "https://donfig.readthedocs.io/en/latest/" + pypi = "donfig/donfig-0.8.1.post1.tar.gz" + + maintainers("Chrismarsh") + + license("MIT", checked_by="Chrismarsh") + + version( + "0.8.1.post1", sha256="3bef3413a4c1c601b585e8d297256d0c1470ea012afa6e8461dc28bfb7c23f52" + ) + + depends_on("py-setuptools@62.6:", type="build") + depends_on("py-versioneer@0.28: +toml") + depends_on("py-pyyaml", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-eerepr/package.py b/var/spack/repos/builtin/packages/py-eerepr/package.py new file mode 100644 index 00000000000000..cb43034b79e597 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-eerepr/package.py @@ -0,0 +1,19 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyEerepr(PythonPackage): + """Code Editor-style reprs for Earth Engine data in a Jupyter notebook.""" + + homepage = "https://github.com/aazuspan/eerepr" + pypi = "eerepr/eerepr-0.1.0.tar.gz" + + license("MIT") + + version("0.1.0", sha256="a3c6f4d94ee19374aea2ff7ae9f2471f06649be5e18f9cb1cced8a00c2c20857") + + depends_on("py-hatchling", type="build") + depends_on("py-earthengine-api", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-einops/package.py b/var/spack/repos/builtin/packages/py-einops/package.py index 928282e9a76faf..8a84dff30fba74 100644 --- a/var/spack/repos/builtin/packages/py-einops/package.py +++ b/var/spack/repos/builtin/packages/py-einops/package.py @@ -16,6 +16,7 @@ class PyEinops(PythonPackage): license("MIT") maintainers("adamjstewart") + version("0.8.1", sha256="de5d960a7a761225532e0f1959e5315ebeafc0cd43394732f103ca44b9837e84") version("0.8.0", sha256="63486517fed345712a8385c100cb279108d9d47e6ae59099b07657e983deae85") version("0.7.0", sha256="b2b04ad6081a3b227080c9bf5e3ace7160357ff03043cd66cc5b2319eb7031d1") version("0.6.1", sha256="f95f8d00f4ded90dbc4b19b6f98b177332614b0357dde66997f3ae5d474dc8c8") diff --git a/var/spack/repos/builtin/packages/py-elevation/package.py b/var/spack/repos/builtin/packages/py-elevation/package.py new file mode 100644 index 00000000000000..d208a6d6310aee --- /dev/null +++ b/var/spack/repos/builtin/packages/py-elevation/package.py @@ -0,0 +1,37 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.package import * + + +class PyElevation(PythonPackage): + """ + Python script to download global terrain digital elevation models, + SRTM 30m DEM and SRTM 90m DEM. + """ + + homepage = "http://elevation.bopen.eu/" + pypi = "elevation/elevation-1.1.3.tar.gz" + + maintainers("Chrismarsh") + + license("Apache-2.0", checked_by="Chrismarsh") + + version("1.1.3", sha256="be27446562e7964f7d8fa78c4829dbbb8ac43df405ad09be8c49633adb8f4877") + + depends_on("py-setuptools@42:", type="build") + depends_on("py-setuptools-scm@3.4: +toml", type="build") + depends_on("py-setuptools-scm-git-archive", type="build") + depends_on("py-click", type="build") + + depends_on("py-fasteners") + depends_on("py-rasterio") + depends_on("py-fiona") + depends_on("py-appdirs") + + # listed in + # https://github.com/bopen/elevation/blob/1.1.3/README.rst + depends_on("curl") + depends_on("unzip") + depends_on("gzip") + depends_on("gdal+python") diff --git a/var/spack/repos/builtin/packages/py-ewah-bool-utils/package.py b/var/spack/repos/builtin/packages/py-ewah-bool-utils/package.py new file mode 100644 index 00000000000000..00280b53e0f10d --- /dev/null +++ b/var/spack/repos/builtin/packages/py-ewah-bool-utils/package.py @@ -0,0 +1,24 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyEwahBoolUtils(PythonPackage): + """EWAH Bool Array utils for yt""" + + homepage = "https://github.com/yt-project/ewah_bool_utils" + pypi = "ewah_bool_utils/ewah_bool_utils-1.2.2.tar.gz" + + license("BSD-3-Clause", checked_by="lgarrison") + + version("1.2.2", sha256="eb901f46caef189de3a0c1f5ca06287cfaba7976ddf76fa1c1f3bce1b60b7ac3") + + depends_on("python@3.9:", type=("build", "run")) + + depends_on("py-setuptools@61.2:", type="build") + depends_on("py-cython@3.0:", type="build") + depends_on("py-numpy@2.0.0:", type="build") + + depends_on("py-numpy@1.19.3:2", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-executing/package.py b/var/spack/repos/builtin/packages/py-executing/package.py index 635c94a999882a..aaf240afa1fd80 100644 --- a/var/spack/repos/builtin/packages/py-executing/package.py +++ b/var/spack/repos/builtin/packages/py-executing/package.py @@ -13,10 +13,12 @@ class PyExecuting(PythonPackage): license("MIT") + version("2.1.0", sha256="8ea27ddd260da8150fa5a708269c4a10e76161e2496ec3e587da9e3c0fe4b9ab") version("1.2.0", sha256="19da64c18d2d851112f09c287f8d3dbbdf725ab0e569077efb6cdcbd3497c107") version("1.1.0", sha256="2c2c07d1ec4b2d8f9676b25170f1d8445c0ee2eb78901afb075a4b8d83608c6a") version("1.0.0", sha256="98daefa9d1916a4f0d944880d5aeaf079e05585689bebd9ff9b32e31dd5e1017") version("0.8.2", sha256="c23bf42e9a7b9b212f185b1b2c3c91feb895963378887bb10e64a2e612ec0023") + depends_on("python@:3.12", type=("build", "run"), when="@:2.0") depends_on("py-setuptools", type="build") depends_on("py-setuptools-scm+toml", type="build") diff --git a/var/spack/repos/builtin/packages/py-extension-helpers/package.py b/var/spack/repos/builtin/packages/py-extension-helpers/package.py index 29825617f8201b..2fd9e40a8ffc3d 100644 --- a/var/spack/repos/builtin/packages/py-extension-helpers/package.py +++ b/var/spack/repos/builtin/packages/py-extension-helpers/package.py @@ -12,14 +12,27 @@ class PyExtensionHelpers(PythonPackage): extensions. It is developed by the Astropy project but is intended to be general and usable by any Python package.""" - homepage = "https://github.com/astropy/astropy-helpers" - pypi = "extension-helpers/extension-helpers-0.1.tar.gz" + homepage = "https://github.com/astropy/extension-helpers" + pypi = "extension-helpers/extension_helpers-1.2.0.tar.gz" license("BSD-3-Clause") - version("0.1", sha256="ac8a6fe91c6d98986a51a9f08ca0c7945f8fd70d95b662ced4040ae5eb973882") + version("1.2.0", sha256="e7d9c8f71804edd7ecd05b5d59a5b504f6e24867970abfc12771242eed76ebcc") + version( + "0.1", + sha256="ac8a6fe91c6d98986a51a9f08ca0c7945f8fd70d95b662ced4040ae5eb973882", + # 0.1 uses dash in the tarball name + url="https://files.pythonhosted.org/packages/81/78/056daee475dfc41cc0b62540388703cddcae4d4f6bef10c6ce1aea76ebaf/extension-helpers-0.1.tar.gz", + ) - depends_on("c", type="build") # generated + depends_on("c", type="build") depends_on("python@3.6:", type=("build", "run")) + depends_on("python@3.8:", type=("build", "run"), when="@1.2.0:") + depends_on("py-setuptools@30.3:", type="build") + depends_on("py-setuptools@43.0.0:", type="build", when="@1.2.0:") + depends_on("py-setuptools-scm@6.2:", type="build", when="@1.2.0:") + + depends_on("py-setuptools@40.2:", type=("build", "run"), when="@1.2.0:") + depends_on("py-tomli@1.0.0:", type=("build", "run"), when="@1.2.0: ^python@:3.10") diff --git a/var/spack/repos/builtin/packages/py-fastapi/package.py b/var/spack/repos/builtin/packages/py-fastapi/package.py index d30f40107312bd..a55cd1c79a0ce8 100644 --- a/var/spack/repos/builtin/packages/py-fastapi/package.py +++ b/var/spack/repos/builtin/packages/py-fastapi/package.py @@ -16,6 +16,7 @@ class PyFastapi(PythonPackage): version("0.115.4", sha256="db653475586b091cb8b2fec2ac54a680ac6a158e07406e1abae31679e8826349") version("0.110.2", sha256="b53d673652da3b65e8cd787ad214ec0fe303cad00d2b529b86ce7db13f17518d") + version("0.109.2", sha256="f3817eac96fe4f65a2ebb4baa000f394e55f5fccdaf7f75250804bc58f354f73") with default_args(deprecated=True): # https://nvd.nist.gov/vuln/detail/CVE-2024-24762 version( diff --git a/var/spack/repos/builtin/packages/py-fastjsonschema/package.py b/var/spack/repos/builtin/packages/py-fastjsonschema/package.py index 2225e18e71f57d..666cdd789168b7 100644 --- a/var/spack/repos/builtin/packages/py-fastjsonschema/package.py +++ b/var/spack/repos/builtin/packages/py-fastjsonschema/package.py @@ -14,8 +14,22 @@ class PyFastjsonschema(PythonPackage): license("BSD-3-Clause") + version("2.21.1", sha256="794d4f0a58f848961ba16af7b9c85a3e88cd360df008c59aac6fc5ae9323b5d4") + version("2.21.0", sha256="a02026bbbedc83729da3bfff215564b71902757f33f60089f1abae193daa4771") + version("2.20.0", sha256="3d48fc5300ee96f5d116f10fe6f28d938e6008f59a6a025c2649475b87f76a23") + version("2.19.1", sha256="e3126a94bdc4623d3de4485f8d468a12f02a67921315ddc87836d6e456dc789d") + version("2.19.0", sha256="e25df6647e1bc4a26070b700897b07b542ec898dd4f1f6ea013e7f6a88417225") + version("2.18.1", sha256="06dc8680d937628e993fa0cd278f196d20449a1adc087640710846b324d422ea") + version("2.18.0", sha256="e820349dd16f806e4bd1467a138dced9def4bc7d6213a34295272a6cac95b5bd") + version("2.17.1", sha256="f4eeb8a77cef54861dbf7424ac8ce71306f12cbb086c45131bcba2c6a4f726e3") + version("2.17.0", sha256="1a68234b7a20ab35ce6600a35ce76a18bac630fc0c6443b3ae22e89fa21d8987") version("2.16.3", sha256="4a30d6315a68c253cfa8f963b9697246315aa3db89f98b97235e345dedfb0b8e") version("2.16.2", sha256="01e366f25d9047816fe3d288cbfc3e10541daf0af2044763f3d0ade42476da18") version("2.15.1", sha256="671f36d225b3493629b5e789428660109528f373cf4b8a22bac6fa2f8191c2d2") + depends_on("python@3.3:3.13", when="@2.21:", type=("build", "run")) + depends_on("python@3.3:3.12", when="@2.20:", type=("build", "run")) + depends_on("python@3.3:3.11", when="@2.16.3:", type=("build", "run")) + depends_on("python@3.3:", when="@2.15:", type=("build", "run")) + depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-flash-attn/package.py b/var/spack/repos/builtin/packages/py-flash-attn/package.py index 298a49a7205c2b..61fe469b6296d9 100644 --- a/var/spack/repos/builtin/packages/py-flash-attn/package.py +++ b/var/spack/repos/builtin/packages/py-flash-attn/package.py @@ -14,7 +14,7 @@ class PyFlashAttn(PythonPackage): pypi = "flash-attn/flash_attn-0.0.0.tar.gz" git = "https://github.com/Dao-AILab/flash-attention.git" - maintainers("aurianer") + maintainers("aurianer", "thomas-bouvier") license("BSD") @@ -41,6 +41,7 @@ class PyFlashAttn(PythonPackage): with default_args(type=("build", "run")): depends_on("py-torch+cuda") depends_on("py-einops") + depends_on("py-triton") with default_args(type=("build", "link", "run")): depends_on("py-pybind11") diff --git a/var/spack/repos/builtin/packages/py-flit-core/package.py b/var/spack/repos/builtin/packages/py-flit-core/package.py index f7b4ed8c112fe9..f77761a91f2f66 100644 --- a/var/spack/repos/builtin/packages/py-flit-core/package.py +++ b/var/spack/repos/builtin/packages/py-flit-core/package.py @@ -19,6 +19,7 @@ class PyFlitCore(PythonPackage): license("BSD-3-Clause") + version("3.10.1", sha256="66e5b87874a0d6e39691f0e22f09306736b633548670ad3c09ec9db03c5662f7") version("3.9.0", sha256="72ad266176c4a3fcfab5f2930d76896059851240570ce9a98733b658cb786eba") version("3.8.0", sha256="b305b30c99526df5e63d6022dd2310a0a941a187bd3884f4c8ef0418df6c39f3") version("3.7.1", sha256="14955af340c43035dbfa96b5ee47407e377ee337f69e70f73064940d27d0a44f") @@ -32,11 +33,6 @@ class PyFlitCore(PythonPackage): version("3.0.0", sha256="a465052057e2d6d957e6850e9915245adedfc4fd0dd5737d0791bf3132417c2d") version("2.3.0", sha256="a50bcd8bf5785e3a7d95434244f30ba693e794c5204ac1ee908fc07c4acdbf80") - # pyproject.toml - depends_on("python@3.6:", when="@3.4:", type=("build", "run")) - depends_on("python@3.4:", when="@3:", type=("build", "run")) - depends_on("python@2.7,3.4:", type=("build", "run")) - # flit_core/build_thyself.py depends_on("py-tomli", when="@3.4:3.5", type="run") depends_on("py-toml", when="@3.1:3.3", type="run") diff --git a/var/spack/repos/builtin/packages/py-flox/package.py b/var/spack/repos/builtin/packages/py-flox/package.py new file mode 100644 index 00000000000000..7fe1afe9d09135 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-flox/package.py @@ -0,0 +1,30 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyFlox(PythonPackage): + """Fast & furious GroupBy operations for dask.array.""" + + homepage = "https://github.com/xarray-contrib/flox" + pypi = "flox/flox-0.10.0.tar.gz" + + maintainers("Chrismarsh") + + license("Apache-2.0", checked_by="Chrismarsh") + + version("0.10.0", sha256="4d326f13597c99ea0ce260b54f4c88d071445816efc83e42e3f8d4030e835654") + + depends_on("py-setuptools@61:", type="build") + depends_on("py-setuptools-scm@7.0: +toml", type="build") + + depends_on("python@3.10:", type=("build", "run")) + + depends_on("py-pandas@1.5:", type=("build", "run")) + depends_on("py-packaging@21.3:", type=("build", "run")) + depends_on("py-numpy@1.22:", type=("build", "run")) + depends_on("py-numpy-groupies@0.9.19:", type=("build", "run")) + depends_on("py-toolz", type=("build", "run")) + depends_on("py-scipy@1.9:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-folium/package.py b/var/spack/repos/builtin/packages/py-folium/package.py index 26aacce6f9d74b..d9f5b157599340 100644 --- a/var/spack/repos/builtin/packages/py-folium/package.py +++ b/var/spack/repos/builtin/packages/py-folium/package.py @@ -13,6 +13,7 @@ class PyFolium(PythonPackage): license("MIT") + version("0.19.4", sha256="431a655b52a9bf3efda336f2be022103f0106504a0599e7c349efbfd30bafda6") version("0.16.0", sha256="2585ee9253dc758d3a365534caa6fb5fa0c244646db4dc5819afc67bbd4daabb") depends_on("py-setuptools@41.2:", type="build") diff --git a/var/spack/repos/builtin/packages/py-geemap/package.py b/var/spack/repos/builtin/packages/py-geemap/package.py new file mode 100644 index 00000000000000..84497b0a4b5536 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-geemap/package.py @@ -0,0 +1,40 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyGeemap(PythonPackage): + """A Python package for interactive mapping using Google Earth Engine and ipyleaflet.""" + + homepage = "https://github.com/gee-community/geemap" + pypi = "geemap/geemap-0.35.1.tar.gz" + + license("MIT") + + version("0.35.1", sha256="98f3f17fb1d07a6fe43b06f03fb680e10517adfd96002184015a3d4fe92435d6") + + with default_args(type="build"): + depends_on("py-setuptools@64:") + depends_on("py-setuptools-scm@8:") + + with default_args(type=("build", "run")): + depends_on("py-bqplot") + depends_on("py-colour") + depends_on("py-earthengine-api@1:") + depends_on("py-eerepr@0.0.4:") + depends_on("py-folium@0.17:") + depends_on("py-geocoder") + depends_on("py-ipyevents") + depends_on("py-ipyfilechooser@0.6:") + depends_on("py-ipyleaflet@0.19.2:") + depends_on("py-ipytree") + depends_on("py-matplotlib") + depends_on("py-numpy") + depends_on("py-pandas") + depends_on("py-plotly") + depends_on("py-pyperclip") + depends_on("py-pyshp@2.3.1:") + depends_on("py-python-box") + depends_on("py-scooby") diff --git a/var/spack/repos/builtin/packages/py-geocoder/package.py b/var/spack/repos/builtin/packages/py-geocoder/package.py new file mode 100644 index 00000000000000..97b59d3ac465e3 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-geocoder/package.py @@ -0,0 +1,25 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyGeocoder(PythonPackage): + """Geocoder is a simple and consistent geocoding library.""" + + homepage = "https://github.com/DenisCarriere/geocoder" + pypi = "geocoder/geocoder-1.38.1.tar.gz" + + license("MIT") + + version("1.38.1", sha256="c9925374c961577d0aee403b09e6f8ea1971d913f011f00ca70c76beaf7a77e7") + + depends_on("py-setuptools", type="build") + + with default_args(type=("build", "run")): + depends_on("py-requests") + depends_on("py-ratelim") + depends_on("py-click") + depends_on("py-six") + depends_on("py-future") diff --git a/var/spack/repos/builtin/packages/py-geojson/package.py b/var/spack/repos/builtin/packages/py-geojson/package.py new file mode 100644 index 00000000000000..60226c93332356 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-geojson/package.py @@ -0,0 +1,23 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyGeojson(PythonPackage): + """Python bindings and utilities for GeoJSON.""" + + homepage = "https://github.com/jazzband/geojson" + pypi = "geojson/geojson-3.1.0.tar.gz" + + maintainers("Chrismarsh") + + license("BSD-3-Clause", checked_by="Chrismarsh") + + version("3.2.0", sha256="b860baba1e8c6f71f8f5f6e3949a694daccf40820fa8f138b3f712bd85804903") + version("3.1.0", sha256="58a7fa40727ea058efc28b0e9ff0099eadf6d0965e04690830208d3ef571adac") + + depends_on("python@3.7:3.12", when="@3.1.0") + depends_on("python@3.7:3.13", when="@3.2.0") + depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-gpaw/package.py b/var/spack/repos/builtin/packages/py-gpaw/package.py index c524457377994d..850337688e5856 100644 --- a/var/spack/repos/builtin/packages/py-gpaw/package.py +++ b/var/spack/repos/builtin/packages/py-gpaw/package.py @@ -60,7 +60,7 @@ def patch(self): python_include = spec["python"].headers.directories[0] numpy_include = join_path( - spec["py-numpy"].package.module.python_platlib, "numpy", "core", "include" + self["py-numpy"].module.python_platlib, "numpy", "core", "include" ) libs = blas.libs + lapack.libs + libxc.libs diff --git a/var/spack/repos/builtin/packages/py-ipyevents/package.py b/var/spack/repos/builtin/packages/py-ipyevents/package.py index 72c972db89f2ba..c174246a4afb2d 100644 --- a/var/spack/repos/builtin/packages/py-ipyevents/package.py +++ b/var/spack/repos/builtin/packages/py-ipyevents/package.py @@ -13,10 +13,20 @@ class PyIpyevents(PythonPackage): license("BSD-3-Clause") - version("2.0.1", sha256="23eb2afab13d9056397f120a88051dd3beb067b698d08b33adffc9e077f019cb") + version("2.0.2", sha256="26e878b0c5854bc8b6bd6a2bd2c89b314ebe86fda642f4d2434051545bab258f") + version( + "2.0.1", + sha256="23eb2afab13d9056397f120a88051dd3beb067b698d08b33adffc9e077f019cb", + deprecated=True, + ) + + with default_args(type="build"): + depends_on("py-hatchling", when="@2.0.2:") + depends_on("py-jupyterlab@3") + depends_on("py-hatch-jupyter-builder@0.8.3:", when="@2.0.2:") + + # Historical dependencies + depends_on("py-setuptools@40.8:", when="@:2.0.1") + depends_on("py-jupyter-packaging@0.7", when="@:2.0.1") - depends_on("python@3.6:", type=("build", "run")) - depends_on("py-setuptools@40.8:", type="build") - depends_on("py-jupyter-packaging@0.7", type="build") - depends_on("py-jupyterlab@3.0:3", type="build") depends_on("py-ipywidgets@7.6:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-ipyfilechooser/package.py b/var/spack/repos/builtin/packages/py-ipyfilechooser/package.py new file mode 100644 index 00000000000000..f554d1be02b95e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-ipyfilechooser/package.py @@ -0,0 +1,19 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyIpyfilechooser(PythonPackage): + """Python file chooser widget for use in Jupyter/IPython in conjunction with ipywidgets.""" + + homepage = "https://github.com/crahan/ipyfilechooser" + pypi = "ipyfilechooser/ipyfilechooser-0.6.0.tar.gz" + + license("MIT") + + version("0.6.0", sha256="41df9e4395a924f8e1b78e2804dbe5066dc3fdc233fb07fecfcdc2a0c9a7d8d3") + + depends_on("py-setuptools", type="build") + depends_on("py-ipywidgets", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-ipyleaflet/package.py b/var/spack/repos/builtin/packages/py-ipyleaflet/package.py new file mode 100644 index 00000000000000..7571980c176cca --- /dev/null +++ b/var/spack/repos/builtin/packages/py-ipyleaflet/package.py @@ -0,0 +1,25 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyIpyleaflet(PythonPackage): + """A Jupyter widget for dynamic Leaflet maps.""" + + homepage = "https://github.com/jupyter-widgets/ipyleaflet" + pypi = "ipyleaflet/ipyleaflet-0.19.2.tar.gz" + + license("MIT") + + version("0.19.2", sha256="b3b83fe3460e742964c2a5924ea7934365a3749bb75310ce388d45fd751372d2") + + depends_on("py-hatchling", type="build") + + with default_args(type=("build", "run")): + depends_on("py-ipywidgets@7.6:8") + depends_on("py-traittypes@0.2.1:2") + depends_on("py-xyzservices@2021.8.1:") + depends_on("py-branca@0.5:") + depends_on("py-jupyter-leaflet@0.19") diff --git a/var/spack/repos/builtin/packages/py-ipyrad/package.py b/var/spack/repos/builtin/packages/py-ipyrad/package.py index efda0f642e8e62..949c1f8c6ef8c9 100644 --- a/var/spack/repos/builtin/packages/py-ipyrad/package.py +++ b/var/spack/repos/builtin/packages/py-ipyrad/package.py @@ -16,6 +16,7 @@ class PyIpyrad(PythonPackage): license("GPL-3.0-only") + version("0.9.102", sha256="2a8dc210d69cdedd34ac92715f23a9c3b7b4593a97b0d16851a566eacf33ef42") version("0.9.93", sha256="7f42396c0baa284dde0e9896270006f3c7e2211fa93bb149decccd39b4ab557e") version("0.9.92", sha256="f9cb5eca40d5fc1d93364815af7608d0b2e89fcf675724541a50e7159617395f") version("0.9.91", sha256="0308b829a8995db90608e8f45b76709d394d9153ec5edee568acdd41ecfab59c") diff --git a/var/spack/repos/builtin/packages/py-ipytree/package.py b/var/spack/repos/builtin/packages/py-ipytree/package.py new file mode 100644 index 00000000000000..3969d08316971a --- /dev/null +++ b/var/spack/repos/builtin/packages/py-ipytree/package.py @@ -0,0 +1,23 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyIpytree(PythonPackage): + """A Tree Widget using jsTree.""" + + homepage = "https://github.com/martinRenou/ipytree" + pypi = "ipytree/ipytree-0.2.2.tar.gz" + + license("MIT") + + version("0.2.2", sha256="d53d739bbaaa45415733cd06e0dc420a2af3d173438617db472a517bc7a61e56") + + with default_args(type="build"): + depends_on("py-jupyter-packaging@0.7") + depends_on("py-jupyterlab@3") + depends_on("py-setuptools@40.8:") + + depends_on("py-ipywidgets@7.5:8", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-iterative-stats/package.py b/var/spack/repos/builtin/packages/py-iterative-stats/package.py index 3dc148c3dba122..c7d4bd3ad6806b 100644 --- a/var/spack/repos/builtin/packages/py-iterative-stats/package.py +++ b/var/spack/repos/builtin/packages/py-iterative-stats/package.py @@ -10,25 +10,28 @@ class PyIterativeStats(PythonPackage): pypi = "iterative-stats/iterative_stats-0.1.0.tar.gz" git = "https://github.com/IterativeStatistics/BasicIterativeStatistics.git" - maintainers("robcaulk") + maintainers("robcaulk", "viperML", "abhishek1297") license("BSD-3-Clause") version("main", branch="main") + version("0.1.1", sha256="c2be6045e720aa7ff5c8dbbcd01d082d1b66f2c2a8613ad825528535e3ce0436") version("0.1.0", sha256="bb4f378a8fa117d1f24e9ea5ac0f1bd13c04b1ab3693a148ba936ffb237f2fba") version("0.0.4", sha256="7e838aa79de867b0e312be8cdf9319bb70824b624c684e968636cc8d4c9d5712") - # main dependencies - depends_on("python@3.8.0:3.10", type=("build", "run")) + with default_args(type=("build", "run")): + depends_on("python@3.8:3.10", when="@:0.1.0") + depends_on("python@3.9:3.12", when="@0.1.1:") + depends_on("py-pyyaml@6.0:") + depends_on("py-numpy@1.19:1") + depends_on("py-poetry-core@1.0.0:", type=("build")) - depends_on("py-pyyaml@6.0", type=("build", "run")) - depends_on("py-numpy@1.19:1", type=("build", "run")) - - # dev dependencies - depends_on("py-pytest@6.2.1:6", type=("test")) - depends_on("py-autopep8@1.6.0", type=("test")) - depends_on("openturns@1.19+python+libxml2", type=("test")) - depends_on("py-scipy@1.8", type=("test")) + + with default_args(type=("test")): + depends_on("py-pytest@6.2.1:6") + depends_on("py-autopep8@1.6.0") + depends_on("openturns@1.19+python+libxml2") + depends_on("py-scipy@1.8:1") @run_after("install") @on_package_attributes(run_tests=True) diff --git a/var/spack/repos/builtin/packages/py-jax/package.py b/var/spack/repos/builtin/packages/py-jax/package.py index 69a645643161ac..f99d02a83a2d4a 100644 --- a/var/spack/repos/builtin/packages/py-jax/package.py +++ b/var/spack/repos/builtin/packages/py-jax/package.py @@ -7,22 +7,26 @@ class PyJax(PythonPackage): - """JAX is Autograd and XLA, brought together for high-performance - machine learning research. With its updated version of Autograd, - JAX can automatically differentiate native Python and NumPy - functions. It can differentiate through loops, branches, - recursion, and closures, and it can take derivatives of - derivatives of derivatives. It supports reverse-mode - differentiation (a.k.a. backpropagation) via grad as well as - forward-mode differentiation, and the two can be composed - arbitrarily to any order.""" + """Differentiate, compile, and transform Numpy code. - homepage = "https://github.com/google/jax" + JAX is a Python library for accelerator-oriented array computation and program transformation, + designed for high-performance numerical computing and large-scale machine learning. + """ + + homepage = "https://github.com/jax-ml/jax" pypi = "jax/jax-0.4.27.tar.gz" license("Apache-2.0") maintainers("adamjstewart", "jonas-eschle") + # version("0.5.0", sha256="49df70bf293a345a7fb519f71193506d37a024c4f850b358042eb32d502c81c8") + # version("0.4.38", sha256="43bae65881628319e0a2148e8f81a202fbc2b8d048e35c7cb1df2416672fa4a8") + # version("0.4.37", sha256="7774f3d9e23fe199c65589c680c5a5be87a183b89598421a632d8245222b637b") + # version("0.4.36", sha256="088bff0575d01fc82682a9af4eb07433d60de7e5164686bd2cea3439492e608a") + # version("0.4.35", sha256="c0c986993026b10bf6f607fecb7417377460254640766ce40f1fef3fd139c12e") + # version("0.4.34", sha256="44196854f40c5f9cea3142824b9f1051f85afc3fcf7593ec5479fc8db01c58db") + # version("0.4.33", sha256="f0d788692fc0179653066c9e1c64e57311b8c15a389837fd7baf328abefcbb92") + # version("0.4.32", sha256="eb703909968da161894fb6135a931c5f3d2aab64fff7cba5fcb803ce6d968e08") version("0.4.31", sha256="fd2d470643a0073d822737f0788f71391656af7e62cc5b2e7995ee390ceac287") version("0.4.30", sha256="94d74b5b2db0d80672b61d83f1f63ebf99d2ab7398ec12b2ca0c9d1e97afe577") version("0.4.29", sha256="12904571eaefddcdc8c3b8d4936482b783d5a216e99ef5adcd3522fdfb4fc186") @@ -59,9 +63,11 @@ class PyJax(PythonPackage): # setup.py depends_on("python@3.10:", when="@0.4.31:") depends_on("python@3.9:", when="@0.4.14:") + depends_on("py-ml-dtypes@0.4:", when="@0.4.29,0.4.35:") depends_on("py-ml-dtypes@0.2:", when="@0.4.14:") depends_on("py-ml-dtypes@0.1:", when="@0.4.9:") depends_on("py-ml-dtypes@0.0.3:", when="@0.4.7:") + depends_on("py-numpy@1.25:", when="@0.5:") depends_on("py-numpy@1.24:", when="@0.4.31:") depends_on("py-numpy@1.22:", when="@0.4.14:") depends_on("py-numpy@1.21:", when="@0.4.7:") @@ -69,6 +75,7 @@ class PyJax(PythonPackage): # https://github.com/google/jax/issues/19246 depends_on("py-numpy@:1", when="@:0.4.25") depends_on("py-opt-einsum") + depends_on("py-scipy@1.11.1:", when="@0.5:") depends_on("py-scipy@1.10:", when="@0.4.31:") depends_on("py-scipy@1.9:", when="@0.4.19:") depends_on("py-scipy@1.7:", when="@0.4.7:") @@ -77,6 +84,14 @@ class PyJax(PythonPackage): # jax/_src/lib/__init__.py # https://github.com/google/jax/commit/8be057de1f50756fe7522f7e98b2f30fad56f7e4 for v in [ + # "0.5.0", + # "0.4.38", + # "0.4.37", + # "0.4.36", + # "0.4.35", + # "0.4.34", + # "0.4.33", + # "0.4.32", "0.4.31", "0.4.30", "0.4.29", @@ -110,6 +125,13 @@ class PyJax(PythonPackage): depends_on(f"py-jaxlib@:{v}", when=f"@{v}") # See _minimum_jaxlib_version in jax/version.py + # depends_on("py-jaxlib@0.5:", when="@0.5:") + # depends_on("py-jaxlib@0.4.38:", when="@0.4.38:") + # depends_on("py-jaxlib@0.4.36:", when="@0.4.36:") + # depends_on("py-jaxlib@0.4.35:", when="@0.4.35:") + # depends_on("py-jaxlib@0.4.34:", when="@0.4.34:") + # depends_on("py-jaxlib@0.4.33:", when="@0.4.33:") + # depends_on("py-jaxlib@0.4.32:", when="@0.4.32:") depends_on("py-jaxlib@0.4.30:", when="@0.4.31:") depends_on("py-jaxlib@0.4.27:", when="@0.4.28:") depends_on("py-jaxlib@0.4.23:", when="@0.4.27:") @@ -124,5 +146,4 @@ class PyJax(PythonPackage): depends_on("py-jaxlib@0.4.1:", when="@0.4.2:") # Historical dependencies - depends_on("py-ml-dtypes@0.4:", when="@0.4.29") depends_on("py-importlib-metadata@4.6:", when="@0.4.11:0.4.30 ^python@:3.9") diff --git a/var/spack/repos/builtin/packages/py-jaxlib/package.py b/var/spack/repos/builtin/packages/py-jaxlib/package.py index 80cfa8c6006184..cd679311a25bc1 100644 --- a/var/spack/repos/builtin/packages/py-jaxlib/package.py +++ b/var/spack/repos/builtin/packages/py-jaxlib/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import tempfile +import glob from spack.build_systems.python import PythonPipBuilder from spack.package import * @@ -26,17 +26,27 @@ class PyJaxlib(PythonPackage, CudaPackage, ROCmPackage): - """XLA library for Jax""" + """XLA library for Jax. - homepage = "https://github.com/google/jax" - url = "https://github.com/google/jax/archive/refs/tags/jaxlib-v0.4.27.tar.gz" + jaxlib is the support library for JAX. While JAX itself is a pure Python package, + jaxlib contains the binary (C/C++) parts of the library, including Python bindings, + the XLA compiler, the PJRT runtime, and a handful of handwritten kernels. + """ - tmp_path = "" - buildtmp = "" + homepage = "https://github.com/jax-ml/jax" + url = "https://github.com/jax-ml/jax/archive/refs/tags/jax-v0.4.34.tar.gz" license("Apache-2.0") maintainers("adamjstewart", "jonas-eschle") + # version("0.5.0", sha256="04cc2eeb2e7ce1916674cea03a7d75a59d583ddb779d5104e103a2798a283ce9") + # version("0.4.38", sha256="ca1e63c488d505b9c92e81499e8b06cc1977319c50d64a0e58adbd2dae1a625c") + # version("0.4.37", sha256="17a8444a931f26edda8ccbc921ab71c6bf46857287b1db186deebd357e526870") + # version("0.4.36", sha256="442bfdf491b509995aa160361e23a9db488d5b97c87e6648cc733501b06eda77") + # version("0.4.35", sha256="65e086708ae56670676b7b2340ad82b901d8c9993d1241a839c8990bdb8d6212") + # version("0.4.34", sha256="d3a75ad667772309ade81350fa70c4a78028a920028800282e46d8383c0ee6bb") + # version("0.4.33", sha256="122a806e80fc1cd7d8ffaf9620701f2cb8e4fe22271c2cec53a9c60b30bd4c31") + # version("0.4.32", sha256="3fe36d596e4d640443c0a5c533845c74fbc4341e024d9bb1cd75cb49f5f419c2") version("0.4.31", sha256="022ea1347f9b21cbea31410b3d650d976ea4452a48ea7317a5f91c238031bf94") version("0.4.30", sha256="0ef9635c734d9bbb44fcc87df4f1c3ccce1cfcfd243572c80d36fcdf826fe1e6") version("0.4.29", sha256="3a8005f4f62d35a5aad7e3dbd596890b47c81cc6e34fcfe3dcb93b3ca7cb1246") @@ -57,12 +67,12 @@ class PyJaxlib(PythonPackage, CudaPackage, ROCmPackage): version("0.4.4", sha256="881f402c7983b56b185e182d5315dd64c9f5320be96213d0415996ece1826806") version("0.4.3", sha256="2104735dc22be2b105e5517bd5bc6ae97f40e8e9e54928cac1585c6112a3d910") - depends_on("c", type="build") - depends_on("cxx", type="build") - variant("cuda", default=True, description="Build with CUDA enabled") variant("nccl", default=True, description="Build with NCCL enabled", when="+cuda") + depends_on("c", type="build") + depends_on("cxx", type="build") + # docs/installation.md (Compatible with) with when("+cuda"): depends_on("cuda@12.1:", when="@0.4.26:") @@ -98,32 +108,42 @@ class PyJaxlib(PythonPackage, CudaPackage, ROCmPackage): depends_on("py-build", when="@0.4.14:") with default_args(type=("build", "run")): + # Based on PyPI wheels depends_on("python@3.10:", when="@0.4.31:") depends_on("python@3.9:", when="@0.4.14:") depends_on("python@3.8:", when="@0.4.6:") - # Based on PyPI wheels depends_on("python@:3.13") depends_on("python@:3.12", when="@:0.4.33") depends_on("python@:3.11", when="@:0.4.16") # jaxlib/setup.py + depends_on("py-scipy@1.11.1:", when="@0.5:") depends_on("py-scipy@1.10:", when="@0.4.31:") depends_on("py-scipy@1.9:", when="@0.4.19:") depends_on("py-scipy@1.7:", when="@0.4.7:") depends_on("py-scipy@1.5:") + depends_on("py-numpy@1.25:", when="@0.5:") depends_on("py-numpy@1.24:", when="@0.4.31:") depends_on("py-numpy@1.22:", when="@0.4.14:") depends_on("py-numpy@1.21:", when="@0.4.7:") depends_on("py-numpy@1.20:", when="@0.3:") - depends_on("py-ml-dtypes@0.2:", when="@0.4.14:") - depends_on("py-ml-dtypes@0.1:", when="@0.4.9:") - depends_on("py-ml-dtypes@0.0.3:", when="@0.4.7:") - - # Historical dependencies # https://github.com/google/jax/issues/19246 depends_on("py-numpy@:1", when="@:0.4.25") depends_on("py-ml-dtypes@0.4:", when="@0.4.29") + depends_on("py-ml-dtypes@0.2:", when="@0.4.14:") + depends_on("py-ml-dtypes@0.1:", when="@0.4.9:") + depends_on("py-ml-dtypes@0.0.3:", when="@0.4.7:") + patch( + "https://github.com/jax-ml/jax/commit/f62af6457a6cc575a7b1ada08d541f0dd0eb5765.patch?full_index=1", + sha256="d3b7ea2cfeba927e40a11f07e4cbf80939f7fe69448c9eb55231a93bd64e5c02", + when="@0.4.36:0.4.38", + ) + patch( + "https://github.com/jax-ml/jax/pull/25473.patch?full_index=1", + sha256="9d6977bc32046600bf8b15863251283fe7546896340367a7f14e3dccf418b4fe", + when="@0.4.36:0.4.37", + ) patch( "https://github.com/google/jax/pull/20101.patch?full_index=1", sha256="4dfb9f32d4eeb0a0fb3a6f4124c4170e3fe49511f1b768cd634c78d489962275", @@ -144,58 +164,68 @@ class PyJaxlib(PythonPackage, CudaPackage, ROCmPackage): # https://github.com/google/jax/issues/19992 conflicts("@0.4.4:", when="target=ppc64le:") - def patch(self): - self.tmp_path = tempfile.mkdtemp(prefix="spack") - self.buildtmp = tempfile.mkdtemp(prefix="spack") - filter_file( - "build --spawn_strategy=standalone", - f""" -# Limit CPU workers to spack jobs instead of using all HOST_CPUS. -build --spawn_strategy=standalone -build --local_cpu_resources={make_jobs} -""".strip(), - ".bazelrc", - string=True, - ) - filter_file( - 'f"--output_path={output_path}",', - 'f"--output_path={output_path}",' - f' "--sources_path={self.tmp_path}",' - ' "--nohome_rc",' - ' "--nosystem_rc",' - f' "--jobs={make_jobs}",', - "build/build.py", - string=True, - ) - build_wheel = join_path("build", "build_wheel.py") - if self.spec.satisfies("@0.4.14:"): - build_wheel = join_path("jaxlib", "tools", "build_wheel.py") - filter_file( - "args = parser.parse_args()", - "args, junk = parser.parse_known_args()", - build_wheel, - string=True, - ) + # Fails to build with freshly released CUDA (#48708). + conflicts("^cuda@12.8:", when="@:0.4.31") + + def url_for_version(self, version): + url = "https://github.com/jax-ml/jax/archive/refs/tags/{}-v{}.tar.gz" + if version >= Version("0.4.33"): + name = "jax" + else: + name = "jaxlib" + return url.format(name, version) def install(self, spec, prefix): - args = [] - args.append("build/build.py") + # https://jax.readthedocs.io/en/latest/developer.html + args = ["build/build.py"] + + if spec.satisfies("@0.4.36:"): + args.append("build") + + if spec.satisfies("+cuda"): + args.append("--wheels=jaxlib,jax-cuda-plugin,jax-cuda-pjrt") + elif spec.satisfies("+rocm"): + args.append("--wheels=jaxlib,jax-rocm-plugin,jax-rocm-pjrt") + else: + args.append("--wheels=jaxlib") + + if spec.satisfies("@0.4.32:"): + if spec.satisfies("%clang"): + args.append("--use_clang=true") + else: + args.append("--use_clang=false") + if "+cuda" in spec: - args.append("--enable_cuda") - args.append("--cuda_path={0}".format(self.spec["cuda"].prefix)) - args.append("--cudnn_path={0}".format(self.spec["cudnn"].prefix)) capabilities = CudaPackage.compute_capabilities(spec.variants["cuda_arch"].value) - args.append("--cuda_compute_capabilities={0}".format(",".join(capabilities))) - args.append( - "--bazel_startup_options=" - "--output_user_root={0}".format(self.wrapped_package_object.buildtmp) - ) + args.append(f"--cuda_compute_capabilities={','.join(capabilities)}") + if spec.satisfies("@:0.4.35"): + args.append("--enable_cuda") + if spec.satisfies("@0.4.32:"): + args.extend( + [ + f"--bazel_options=--repo_env=LOCAL_CUDA_PATH={spec['cuda'].prefix}", + f"--bazel_options=--repo_env=LOCAL_CUDNN_PATH={spec['cudnn'].prefix}", + ] + ) + else: + args.extend( + [f"--cuda_path={spec['cuda'].prefix}", f"--cudnn_path={spec['cudnn'].prefix}"] + ) + + if "+nccl" in spec and spec.satisfies("@0.4.32:"): + args.append(f"--bazel_options=--repo_env=LOCAL_NCCL_PATH={spec['nccl'].prefix}") + if "+rocm" in spec: - args.append("--enable_rocm") - args.append("--rocm_path={0}".format(self.spec["hip"].prefix)) + args.extend(["--enable_rocm", f"--rocm_path={self.spec['hip'].prefix}"]) + + args.extend( + [ + f"--bazel_options=--jobs={make_jobs}", + "--bazel_startup_options=--nohome_rc", + "--bazel_startup_options=--nosystem_rc", + ] + ) python(*args) - with working_dir(self.wrapped_package_object.tmp_path): - pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".") - remove_linked_tree(self.wrapped_package_object.tmp_path) - remove_linked_tree(self.wrapped_package_object.buildtmp) + whl = glob.glob(join_path("dist", "*.whl"))[0] + pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", whl) diff --git a/var/spack/repos/builtin/packages/py-jupyter-leaflet/package.py b/var/spack/repos/builtin/packages/py-jupyter-leaflet/package.py new file mode 100644 index 00000000000000..f8ff31b464b83e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-jupyter-leaflet/package.py @@ -0,0 +1,22 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyJupyterLeaflet(PythonPackage): + """ipyleaflet extensions for JupyterLab and Jupyter Notebook.""" + + homepage = "https://github.com/jupyter-widgets/ipyleaflet" + pypi = "jupyter_leaflet/jupyter_leaflet-0.19.2.tar.gz" + + license("MIT") + + version("0.19.2", sha256="b09b5ba48b1488cb61da37a6f558347269eb53ff6d64dc1a73e005ffc4420063") + + with default_args(type="build"): + depends_on("py-hatchling") + depends_on("py-jupyterlab@4") + depends_on("py-hatch-nodejs-version@0.3.2:") + depends_on("py-hatch-jupyter-builder@0.8.1:") diff --git a/var/spack/repos/builtin/packages/py-jupyter-server/package.py b/var/spack/repos/builtin/packages/py-jupyter-server/package.py index 250f7728993258..78ad5cfc54c966 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-server/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-server/package.py @@ -12,6 +12,7 @@ class PyJupyterServer(PythonPackage): homepage = "https://github.com/jupyter-server/jupyter_server" pypi = "jupyter_server/jupyter_server-1.9.0.tar.gz" + tags = ["build-tools"] license("BSD-3-Clause") diff --git a/var/spack/repos/builtin/packages/py-jupyter-telemetry/package.py b/var/spack/repos/builtin/packages/py-jupyter-telemetry/package.py index a510859f39cfc2..a756499b9afa54 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-telemetry/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-telemetry/package.py @@ -6,9 +6,8 @@ class PyJupyterTelemetry(PythonPackage): - """Jupyter Telemetry enables Jupyter Applications to record events and transmit""" - - """ them to destinations as structured data""" + """Jupyter Telemetry enables Jupyter Applications to record events and transmit them to + destinations as structured data""" pypi = "jupyter-telemetry/jupyter_telemetry-0.1.0.tar.gz" diff --git a/var/spack/repos/builtin/packages/py-jupyterlab/package.py b/var/spack/repos/builtin/packages/py-jupyterlab/package.py index 13bd85b61dd9d2..dee04a29a6bea6 100644 --- a/var/spack/repos/builtin/packages/py-jupyterlab/package.py +++ b/var/spack/repos/builtin/packages/py-jupyterlab/package.py @@ -12,6 +12,7 @@ class PyJupyterlab(PythonPackage): homepage = "https://github.com/jupyterlab/jupyterlab" pypi = "jupyterlab/jupyterlab-2.2.7.tar.gz" + tags = ["build-tools"] license("BSD-3-Clause") @@ -50,7 +51,8 @@ class PyJupyterlab(PythonPackage): depends_on("py-packaging", when="@3:", type=("build", "run")) depends_on("py-traitlets", when="@4:", type=("build", "run")) depends_on("py-tornado@6.2:", when="@4:", type=("build", "run")) - depends_on("py-tomli", when="@3.4.7: ^python@:3.10", type=("build", "run")) + depends_on("py-tomli", when="@4: ^python@:3.10", type=("build", "run")) + depends_on("py-tomli", when="@3.4.7:3", type=("build", "run")) with when("@:3"): depends_on("py-setuptools", when="@:3", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-linear-tree/package.py b/var/spack/repos/builtin/packages/py-linear-tree/package.py new file mode 100644 index 00000000000000..25d96ef577a4b4 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-linear-tree/package.py @@ -0,0 +1,21 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyLinearTree(PythonPackage): + """A python library to build Model Trees with Linear Models at the leaves.""" + + homepage = "https://github.com/cerlymarco/linear-tree" + pypi = "linear-tree/linear-tree-0.3.5.tar.gz" + git = "https://github.com/cerlymarco/linear-tree.git" + + version("0.3.5", sha256="2db9fc976bcd693a66d8d92fdd7f97314125b3330eea4778885bfe62190d586c") + + depends_on("python@3.8:", type=("build", "run")) + depends_on("py-setuptools", type="build") + depends_on("py-scikit-learn@0.24.2:", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("py-scipy", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-llvmlite/package.py b/var/spack/repos/builtin/packages/py-llvmlite/package.py index 4b17a2a4f97645..a4389d9c6c946e 100644 --- a/var/spack/repos/builtin/packages/py-llvmlite/package.py +++ b/var/spack/repos/builtin/packages/py-llvmlite/package.py @@ -14,6 +14,7 @@ class PyLlvmlite(PythonPackage): license("BSD-2-Clause") + version("0.44.0", sha256="07667d66a5d150abed9157ab6c0b9393c9356f229784a4385c02f99e94fc94d4") version("0.43.0", sha256="ae2b5b5c3ef67354824fb75517c8db5fbe93bc02cd9671f3c62271626bc041d5") version("0.42.0", sha256="f92b09243c0cc3f457da8b983f67bd8e1295d0f5b3746c7a1861d7a99403854a") version("0.41.1", sha256="f19f767a018e6ec89608e1f6b13348fa2fcde657151137cb64e56d48598a92db") @@ -51,7 +52,8 @@ class PyLlvmlite(PythonPackage): depends_on("python@:3.8", when="@0.31:0.35", type=("build", "run")) # https://github.com/numba/llvmlite#compatibility - depends_on("llvm@14", when="@0.41:") + depends_on("llvm@15", when="@0.44:") + depends_on("llvm@14", when="@0.41:0.43") depends_on("llvm@11:14", when="@0.40") depends_on("llvm@11", when="@0.37:0.39") for t in [ @@ -66,6 +68,7 @@ class PyLlvmlite(PythonPackage): "x86_64:", ]: depends_on("llvm@10.0", when=f"@0.34:0.36 target={t}") + depends_on("llvm@9.0", when="@0.34:0.36 target=aarch64:") depends_on("llvm@9.0", when="@0.33") depends_on("llvm@7.0:7.1,8.0", when="@0.29:0.32") diff --git a/var/spack/repos/builtin/packages/py-loguru/package.py b/var/spack/repos/builtin/packages/py-loguru/package.py index 530f57b311167b..eaacea5db90580 100644 --- a/var/spack/repos/builtin/packages/py-loguru/package.py +++ b/var/spack/repos/builtin/packages/py-loguru/package.py @@ -13,13 +13,18 @@ class PyLoguru(PythonPackage): license("MIT") + version("0.7.3", sha256="19480589e77d47b8d85b2c827ad95d49bf31b0dcde16593892eb51dd18706eb6") + version("0.7.2", sha256="e671a53522515f34fd406340ee968cb9ecafbc4b36c679da03c18fd8d0bd51ac") + version("0.7.1", sha256="7ba2a7d81b79a412b0ded69bd921e012335e80fd39937a633570f273a343579e") + version("0.7.0", sha256="1612053ced6ae84d7959dd7d5e431a0532642237ec21f7fd83ac73fe539e03e1") version("0.6.0", sha256="066bd06758d0a513e9836fd9c6b5a75bfb3fd36841f4b996bc60b547a309d41c") version("0.3.0", sha256="f2a0fa92f334d37a13351aa36ab18e8039649a3741836b4b6d8b8bce7e8457ac") version("0.2.5", sha256="68297d9f23064c2f4764bb5d0c5c767f3ed7f9fc1218244841878f5fc7c94add") depends_on("python@3.5:", type=("build", "run")) - depends_on("py-setuptools", type="build") - depends_on("py-aiocontextvars@0.2.0:", when="^python@3.6:", type=("build", "run")) + depends_on("py-setuptools", when="@:0.7.2", type="build") + depends_on("py-flit-core@3", when="@0.7.3:", type="build") + depends_on("py-aiocontextvars@0.2.0:", when="^python@:3.6", type=("build", "run")) depends_on("py-colorama@0.3.4:", when="platform=windows", type=("build", "run")) # Missing dependency required for windows # depends_on('py-win32-setctime@1.0.0:', diff --git a/var/spack/repos/builtin/packages/py-maturin/package.py b/var/spack/repos/builtin/packages/py-maturin/package.py index 1747f2da7b0a98..53bf72e66ddcc1 100644 --- a/var/spack/repos/builtin/packages/py-maturin/package.py +++ b/var/spack/repos/builtin/packages/py-maturin/package.py @@ -17,6 +17,7 @@ class PyMaturin(PythonPackage): license("Apache-2.0") + version("1.8.2", sha256="e31abc70f6f93285d6e63d2f4459c079c94c259dd757370482d2d4ceb9ec1fa0") version("1.6.0", sha256="b955025c24c8babc808db49e0ff90db8b4b1320dcc16b14eb26132841737230d") version("1.5.1", sha256="3dd834ece80edb866af18cbd4635e0ecac40139c726428d5f1849ae154b26dca") version("1.4.0", sha256="ed12e1768094a7adeafc3a74ebdb8dc2201fa64c4e7e31f14cfc70378bf93790") @@ -42,4 +43,5 @@ class PyMaturin(PythonPackage): # May be an accidental dependency, remove in the future # https://git.alpinelinux.org/aports/commit/?id=7ad298b467403b96a6b97d050170e367f147a75f # https://patchwork.yoctoproject.org/project/oe-core/patch/8803dc101b641c948805cab9e5784c38f43b0e51.1702791173.git.tim.orling@konsulko.com/ - depends_on("bzip2", when="platform=darwin") + # This seems to still be an issue for others + depends_on("bzip2") diff --git a/var/spack/repos/builtin/packages/py-mdit-py-plugins/package.py b/var/spack/repos/builtin/packages/py-mdit-py-plugins/package.py index b74c0015d55897..e9d5675de92140 100644 --- a/var/spack/repos/builtin/packages/py-mdit-py-plugins/package.py +++ b/var/spack/repos/builtin/packages/py-mdit-py-plugins/package.py @@ -11,36 +11,29 @@ class PyMditPyPlugins(PythonPackage): homepage = "https://github.com/executablebooks/mdit-py-plugins/" git = "https://github.com/executablebooks/mdit-py-plugins/" - pypi = "mdit-py-plugins/mdit-py-plugins-0.3.5.tar.gz" + pypi = "mdit-py-plugins/mdit_py_plugins-0.4.2.tar.gz" license("MIT") + version("0.4.2", sha256="5f2cd1fdb606ddf152d37ec30e46101a60512bc0e5fa1a7002c36647b09e26b5") version("0.4.0", sha256="d8ab27e9aed6c38aa716819fedfde15ca275715955f8a185a8e1cf90fb1d2c1b") version("0.3.5", sha256="eee0adc7195e5827e17e02d2a258a2ba159944a0748f59c5099a4a27f78fcf6a") - version("0.3.4", sha256="3278aab2e2b692539082f05e1243f24742194ffd92481f48844f057b51971283") - version("0.3.3", sha256="5cfd7e7ac582a594e23ba6546a2f406e94e42eb33ae596d0734781261c251260") - version("0.3.2", sha256="c37ca25a4a5244b41cc3b34b9d7762a96ee0416dd43efaa837304d592a84995f") version("0.3.1", sha256="3fc13298497d6e04fe96efdd41281bfe7622152f9caa1815ea99b5c893de9441") version("0.3.0", sha256="ecc24f51eeec6ab7eecc2f9724e8272c2fb191c2e93cf98109120c2cace69750") version("0.2.8", sha256="5991cef645502e80a5388ec4fc20885d2313d4871e8b8e320ca2de14ac0c015f") - depends_on("py-flit-core@3.4:3", when="@0.3.1:", type="build") - depends_on("py-setuptools", when="@:0.3.0", type="build") + def url_for_version(self, version): + prefix = self.url.rsplit("/", maxsplit=1)[0] + package = "mdit-py-plugins" if version < Version("2.0.0") else "mdit_py_plugins" + return f"{prefix}/{package}-{version}.tar.gz" - depends_on("python@3.8:3", when="@0.4.0:", type=("build", "run")) - depends_on("python@3.7:3", when="@0.3.1:0.3", type=("build", "run")) - depends_on("python@3.6:3", when="@0.2.8", type=("build", "run")) + depends_on("python@3.6:3", when="@:0.2", type=("build", "run")) + depends_on("python@3.7:3", when="@0.3", type=("build", "run")) + depends_on("python@3.8:3", when="@0.4:", type=("build", "run")) - depends_on("py-markdown-it-py@1.0:3", when="@0.4.0:", type=("build", "run")) - depends_on("py-markdown-it-py@1.0:2", when="@0.3.1:0.3", type=("build", "run")) - depends_on("py-markdown-it-py@1.0:1", when="@0.2.8", type=("build", "run")) + depends_on("py-setuptools", when="@:0.2", type="build") + depends_on("py-flit-core@3.4:3", when="@0.3:", type="build") - def url_for_version(self, version): - if version >= Version("0.4.0"): - separator = "_" - else: - separator = "-" - return ( - "https://files.pythonhosted.org/packages/source/m/mdit-py-plugins/" - f"mdit{separator}py{separator}plugins-{version}.tar.gz" - ) + depends_on("py-markdown-it-py@1.0:1", when="@:0.2", type=("build", "run")) + depends_on("py-markdown-it-py@1.0:2", when="@0.3", type=("build", "run")) + depends_on("py-markdown-it-py@1.0:3", when="@0.4:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-memray/package.py b/var/spack/repos/builtin/packages/py-memray/package.py index c3f37fcdab37f5..bf2e4bd86ef733 100644 --- a/var/spack/repos/builtin/packages/py-memray/package.py +++ b/var/spack/repos/builtin/packages/py-memray/package.py @@ -13,19 +13,32 @@ class PyMemray(PythonPackage): license("Apache-2.0") + version("1.15.0", sha256="1beffa2bcba3dbe0f095d547927286eca46e272798b83026dd1b5db58e16ed56") version("1.1.0", sha256="876e46e0cd42394be48b33f81314bc946f4eb023b04bf1def084c25ccf1d2bb6") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("python@3.7:", type=("build", "link", "run")) - depends_on("py-setuptools", type="build") - depends_on("py-cython", type="build") - depends_on("py-jinja2", type=("build", "run")) - depends_on("py-typing-extensions", when="^python@:3.7", type=("build", "run")) - depends_on("py-rich", type=("build", "run")) - depends_on("libunwind") + + with default_args(type="build"): + depends_on("py-setuptools") + depends_on("py-pkgconfig", when="@1.10:") + depends_on("py-cython@0.29.31:", when="@1.10:") + depends_on("py-cython") + + with default_args(type=("build", "run")): + depends_on("py-jinja2@2.9:", when="@1.10:") + depends_on("py-jinja2") + depends_on("py-rich@11.2:", when="@1.10:") + depends_on("py-rich") + depends_on("py-textual@0.41:", when="@1.12:") + depends_on("py-textual@0.34:", when="@1.11:") + + # https://github.com/bloomberg/memray#building-from-source + depends_on("elfutils", when="platform=linux @1.13:") + depends_on("libunwind", when="platform=linux") depends_on("lz4") - conflicts("platform=darwin", msg="memray only supports Linux platforms") - conflicts("platform=windows", msg="memray only supports Linux platforms") + conflicts("platform=darwin", when="@:1.9", msg="Memray only works on Linux") + conflicts("platform=windows", msg="Memray only works on Linux and macOS") diff --git a/var/spack/repos/builtin/packages/py-metis/package.py b/var/spack/repos/builtin/packages/py-metis/package.py new file mode 100644 index 00000000000000..3ac1daa65a3e37 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-metis/package.py @@ -0,0 +1,21 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyMetis(PythonPackage): + """Wrapper for the METIS library for partitioning graphs (and other stuff).""" + + homepage = "https://github.com/kw/metis-python" + pypi = "metis/metis-0.2a5.tar.gz" + + maintainers("Chrismarsh") + + license("MIT", checked_by="Chrismarsh") + + version("0.2a5", sha256="c98f4aa129141554bea8d9e62daea5fea8351439f723e8e27fe593c2b7c53903") + + depends_on("py-setuptools", type="build") + depends_on("metis", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-ml-collections/package.py b/var/spack/repos/builtin/packages/py-ml-collections/package.py index 336c2433b7a869..6328689d217773 100644 --- a/var/spack/repos/builtin/packages/py-ml-collections/package.py +++ b/var/spack/repos/builtin/packages/py-ml-collections/package.py @@ -8,7 +8,7 @@ class PyMlCollections(PythonPackage): """ML Collections is a library of Python collections designed for ML usecases.""" - homepage = "https://https://github.com/google/ml_collections" + homepage = "https://github.com/google/ml_collections" pypi = "ml_collections/ml_collections-0.1.0.tar.gz" git = "https://github.com/google/ml_collections" diff --git a/var/spack/repos/builtin/packages/py-mplhep-data/package.py b/var/spack/repos/builtin/packages/py-mplhep-data/package.py index 3962f75056c402..2f852dfe92fa88 100644 --- a/var/spack/repos/builtin/packages/py-mplhep-data/package.py +++ b/var/spack/repos/builtin/packages/py-mplhep-data/package.py @@ -8,13 +8,15 @@ class PyMplhepData(PythonPackage): """Font (Data) sub-package for mplhep""" - homepage = "https://github.com/Scikit-HEP/mplhep_data" + homepage = "https://github.com/scikit-hep/mplhep_data" pypi = "mplhep_data/mplhep_data-0.0.3.tar.gz" license("MIT") + version("0.0.4", sha256="cd1f3ad3af9dbff33aef9e7406d2130d624a0bd1d5aa5970fc713a6421165a4e") version("0.0.3", sha256="b54d257f3f53c93a442cda7a6681ce267277e09173c0b41fd78820f78321772f") depends_on("python@3.7:", type=("build", "run")) + depends_on("python@3.8:", type=("build", "run"), when="@0.0.4:") depends_on("py-setuptools@42:", type="build") depends_on("py-setuptools-scm@3.4:+toml", type="build") diff --git a/var/spack/repos/builtin/packages/py-mplhep/package.py b/var/spack/repos/builtin/packages/py-mplhep/package.py index a64482cef2f21e..af2b4139d31301 100644 --- a/var/spack/repos/builtin/packages/py-mplhep/package.py +++ b/var/spack/repos/builtin/packages/py-mplhep/package.py @@ -11,17 +11,24 @@ class PyMplhep(PythonPackage): homepage = "https://github.com/scikit-hep/mplhep" pypi = "mplhep/mplhep-0.3.15.tar.gz" - license("MIT") + license("MIT", checked_by="wdconinc") + version("0.3.55", sha256="0fb87cd4b025225ba8fd5d82d58324cfb094fbcdd7929e5a9ea1ea7e22108814") version("0.3.26", sha256="d707a95ce59b0bac2fe4fe1c57fede14e15da639f3a7c732e7513a753fd9e9ac") version("0.3.15", sha256="595f796ea65930094e86a805214e0d44537ead267a7487ae16eda02d1670653e") depends_on("python@3.7:", type=("build", "run")) - depends_on("py-setuptools@39.2:", type="build") - depends_on("py-setuptools@42:", when="@0.3.26:", type="build") - depends_on("py-setuptools-scm@3.4:+toml", when="@0.3.2:", type="build") + depends_on("python@3.8:", type=("build", "run"), when="@0.3.29:") + with when("@0.3.53:"): + depends_on("py-hatchling", type="build") + depends_on("py-hatch-vcs", type="build") + with when("@:0.3.52"): + depends_on("py-setuptools@39.2:", type="build") + depends_on("py-setuptools@42:", when="@0.3.26:", type="build") + depends_on("py-setuptools-scm@3.4:+toml", when="@0.3.2:", type="build") depends_on("py-matplotlib@3.4:", type=("build", "run")) depends_on("py-mplhep-data", type=("build", "run")) + depends_on("py-mplhep-data@0.0.4:", type=("build", "run"), when="@0.3.54:") depends_on("py-numpy@1.16.0:", type=("build", "run")) depends_on("py-packaging", type=("build", "run")) depends_on("py-uhi@0.2.0:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-mypy/package.py b/var/spack/repos/builtin/packages/py-mypy/package.py index f4dfe702af4468..ccd2df9fcf623d 100644 --- a/var/spack/repos/builtin/packages/py-mypy/package.py +++ b/var/spack/repos/builtin/packages/py-mypy/package.py @@ -18,6 +18,7 @@ class PyMypy(PythonPackage): version("1.14.1", sha256="7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6") version("1.13.0", sha256="0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e") + version("1.12.1", sha256="f5b3936f7a6d0e8280c9bdef94c7ce4847f5cdfc258fbb2c29a8c1711e8bb96d") version("1.11.2", sha256="7f9993ad3e0ffdc95c2a14b66dee63729f021968bff8ad911867579c65d13a79") version("1.11.1", sha256="f404a0b069709f18bbdb702eb3dcfe51910602995de00bd39cea3050b5772d08") version("1.10.1", sha256="1f8f492d7db9e3593ef42d4f115f04e556130f2819ad33ab84551403e97dd4c0") diff --git a/var/spack/repos/builtin/packages/py-myst-parser/package.py b/var/spack/repos/builtin/packages/py-myst-parser/package.py index e6cad7e7d236b3..3274a31fa1ada4 100644 --- a/var/spack/repos/builtin/packages/py-myst-parser/package.py +++ b/var/spack/repos/builtin/packages/py-myst-parser/package.py @@ -13,31 +13,53 @@ class PyMystParser(PythonPackage): homepage = "https://github.com/executablebooks/MyST-Parser" documentation = "https://myst-parser.readthedocs.io/en/latest/" keywords = ["markdown", "lexer", "parser", "development", "docutils", "sphinx"] - pypi = "myst-parser/myst-parser-1.0.0.tar.gz" + git = "https://github.com/executablebooks/MyST-Parser" + pypi = "myst-parser/myst_parser-4.0.0.tar.gz" license("MIT") maintainers("gartung", "greenc-FNAL", "marcmengel") + version("4.0.0", sha256="851c9dfb44e36e56d15d05e72f02b80da21a9e0d07cba96baf5e2d476bb91531") + version("3.0.1", sha256="88f0cb406cb363b077d176b51c476f62d60604d68a8dcdf4832e080441301a87") + version("3.0.0", sha256="0b4ae0b33a45800a748260cb40348c37089a8a456c35120609240bd1b32f9255") + version("2.0.0", sha256="ea929a67a6a0b1683cdbe19b8d2e724cd7643f8aa3e7bb18dd65beac3483bead") version("1.0.0", sha256="502845659313099542bd38a2ae62f01360e7dd4b1310f025dd014dfc0439cdae") + version("0.19.1", sha256="f2dc168ed380e01d77973ad22a64fff1377cc72a3d1ac4bced423f28258d0a42") + version("0.19.0", sha256="5a278c02015ce89f282dfde2a6e43d0924d957ab57d83555fce1645448810577") version("0.18.1", sha256="79317f4bb2c13053dd6e64f9da1ba1da6cd9c40c8a430c447a7b146a594c246d") - version("0.18.0", sha256="739a4d96773a8e55a2cacd3941ce46a446ee23dcd6b37e06f73f551ad7821d86") - depends_on("python@3.7:", when="@:1", type=("build", "run")) - depends_on("python@3.8:", when="@2:", type=("build", "run")) + def url_for_version(self, version): + prefix = self.url.rsplit("/", maxsplit=1)[0] + package = "myst-parser" if version < Version("2.0.0") else "myst_parser" + return f"{prefix}/{package}-{version}.tar.gz" + + depends_on("python@3.7:", type=("build", "run")) + depends_on("python@3.8:3", type=("build", "run"), when="@2:") + depends_on("python@3.10:3", type=("build", "run"), when="@4:") depends_on("py-flit-core@3.4:3", type="build") - depends_on("py-docutils@0.15:0.19", when="@:1", type=("build", "run")) - depends_on("py-docutils@0.15:0.20", when="@2:", type=("build", "run")) - depends_on("py-jinja2", type=("build", "run")) - depends_on("py-markdown-it-py@1.0.0:2", when="@:1", type=("build", "run")) - depends_on("py-markdown-it-py@3", when="@2:", type=("build", "run")) - depends_on("py-mdit-py-plugins@0.3.1:0", when="@0", type=("build", "run")) - depends_on("py-mdit-py-plugins@0.3.4:0", when="@1", type=("build", "run")) - depends_on("py-mdit-py-plugins@0.4:0", when="@2:", type=("build", "run")) + depends_on("py-docutils@0.15:0.19", type=("build", "run"), when="@:1") + depends_on("py-docutils@0.16:0.20", type=("build", "run"), when="@2:") + depends_on("py-docutils@0.18:0.21", type=("build", "run"), when="@3:") + depends_on("py-docutils@0.19:0.21", type=("build", "run"), when="@4:") + + depends_on("py-jinja2", type=("build", "run")) # let sphinx decide version + + depends_on("py-markdown-it-py@1:2", type=("build", "run"), when="@:1") + depends_on("py-markdown-it-py@3", type=("build", "run"), when="@2:") + + depends_on("py-mdit-py-plugins@0.3.1:0.3", type=("build", "run"), when="@0.18") + depends_on("py-mdit-py-plugins@0.3.4:0.3", type=("build", "run"), when="@0.19:1") + depends_on("py-mdit-py-plugins@0.4", type=("build", "run"), when="@2:3") + depends_on("py-mdit-py-plugins@0.4.1:0.4", type=("build", "run"), when="@4:") + depends_on("py-pyyaml", type=("build", "run")) - depends_on("py-sphinx@4.0.0:5", when="@0", type=("build", "run")) - depends_on("py-sphinx@5.0.0:6", when="@1", type=("build", "run")) - depends_on("py-sphinx@6.0.0:7", when="@2:", type=("build", "run")) - depends_on("py-typing-extensions", when="^python@:3.7", type=("build", "run")) + + depends_on("py-sphinx@4:5", type=("build", "run"), when="@0.18") + depends_on("py-sphinx@5:6", type=("build", "run"), when="@0.19:1") + depends_on("py-sphinx@6:7", type=("build", "run"), when="@2:3") + depends_on("py-sphinx@7:8", type=("build", "run"), when="@4:") + + depends_on("py-typing-extensions", type=("build", "run"), when="@:1") diff --git a/var/spack/repos/builtin/packages/py-nanobind/package.py b/var/spack/repos/builtin/packages/py-nanobind/package.py index d7d6b153a27ff5..0845225a146d44 100644 --- a/var/spack/repos/builtin/packages/py-nanobind/package.py +++ b/var/spack/repos/builtin/packages/py-nanobind/package.py @@ -17,11 +17,17 @@ class PyNanobind(PythonPackage): url = "https://github.com/wjakob/nanobind/archive/refs/tags/v1.2.0.tar.gz" git = "https://github.com/wjakob/nanobind.git" - maintainers("chrisrichardson", "garth-wells", "ma595") + maintainers("chrisrichardson", "garth-wells") license("BSD-3-Clause") version("master", branch="master", submodules=True) + version( + "2.5.0", tag="v2.5.0", commit="4ccbe6e005fc017652312305f280742da49d3dd5", submodules=True + ) + version( + "2.4.0", tag="v2.4.0", commit="0f9ce749b257fdfe701edb3cf6f7027ba029434a", submodules=True + ) version( "2.2.0", tag="v2.2.0", commit="784efa2a0358a4dc5432c74f5685ee026e20f2b6", submodules=True ) diff --git a/var/spack/repos/builtin/packages/py-nanotron/package.py b/var/spack/repos/builtin/packages/py-nanotron/package.py new file mode 100644 index 00000000000000..c08fe169aa1000 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-nanotron/package.py @@ -0,0 +1,37 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyNanotron(PythonPackage): + """Minimalistic large language model 3D-parallelism training.""" + + homepage = "https://github.com/huggingface/nanotron" + url = "https://github.com/huggingface/nanotron/archive/refs/tags/v0.4.tar.gz" + git = "https://github.com/huggingface/nanotron.git" + + maintainers("thomas-bouvier") + + license("Apache-2.0") + + version("main", branch="main") + version("0.4", sha256="30e9cdd07e86166dd9690351d9d995b3560810044fdca64737ed042cd91c792a") + + variant("examples", default=True, description="Build with example scripts support") + + depends_on("python@3.6:3.11") + + depends_on("py-setuptools", type="build") + depends_on("py-torch@1.13.0:", type=("build", "run")) + depends_on("py-pyyaml", type=("build", "run")) + depends_on("py-numpy@:2", type=("build", "run")) + depends_on("py-packaging", type=("build", "run")) + depends_on("py-safetensors", type=("build", "run")) + depends_on("py-dacite", type=("build", "run")) + depends_on("py-tqdm", type=("build", "run")) + depends_on("py-datasets", type=("build", "run"), when="@0.5:") + + depends_on("py-transformers", type=("build", "run"), when="+examples") + depends_on("py-flash-attn", type=("build", "run"), when="+examples") diff --git a/var/spack/repos/builtin/packages/py-nbconvert/package.py b/var/spack/repos/builtin/packages/py-nbconvert/package.py index 15ded6788f2c66..2aa2eec2bc3f08 100644 --- a/var/spack/repos/builtin/packages/py-nbconvert/package.py +++ b/var/spack/repos/builtin/packages/py-nbconvert/package.py @@ -14,6 +14,13 @@ class PyNbconvert(PythonPackage): license("BSD-3-Clause") + version("7.16.4", sha256="86ca91ba266b0a448dc96fa6c5b9d98affabde2867b363258703536807f9f7f4") + version("7.16.3", sha256="a6733b78ce3d47c3f85e504998495b07e6ea9cf9bf6ec1c98dda63ec6ad19142") + version("7.16.2", sha256="8310edd41e1c43947e4ecf16614c61469ebc024898eb808cce0999860fc9fb16") + version("7.16.1", sha256="e79e6a074f49ba3ed29428ed86487bf51509d9aab613bd8522ac08f6d28fd7fd") + version("7.16.0", sha256="813e6553796362489ae572e39ba1bff978536192fb518e10826b0e8cadf03ec8") + version("7.15.0", sha256="ff3f54a1a5e1e024beb9fde8946d05b6d0bf68cd14b5f2f9dc5b545c8bc71055") + version("7.14.2", sha256="a7f8808fd4e082431673ac538400218dd45efd076fbeb07cc6e5aa5a3a4e949e") version("7.14.1", sha256="20cba10e0448dc76b3bebfe1adf923663e3b98338daf77b97b42511ef5a88618") version("7.4.0", sha256="51b6c77b507b177b73f6729dba15676e42c4e92bcb00edc8cc982ee72e7d89d7") version("7.0.0", sha256="fd1e361da30e30e4c5a5ae89f7cae95ca2a4d4407389672473312249a7ba0060") @@ -51,6 +58,7 @@ class PyNbconvert(PythonPackage): variant("serve", default=True, description="Include a webserver") + depends_on("python@3.8:", when="@7.7:", type=("build", "run")) depends_on("python@3.7:", when="@6.2.0:", type=("build", "run")) depends_on("py-hatchling@1.5:", when="@7.14:", type="build") depends_on("py-hatchling@0.25:", when="@7:", type="build") diff --git a/var/spack/repos/builtin/packages/py-numba/package.py b/var/spack/repos/builtin/packages/py-numba/package.py index 2f3042a3aa495f..978c8433adeb46 100644 --- a/var/spack/repos/builtin/packages/py-numba/package.py +++ b/var/spack/repos/builtin/packages/py-numba/package.py @@ -16,6 +16,7 @@ class PyNumba(PythonPackage): license("BSD-2-Clause") + version("0.61.0", sha256="888d2e89b8160899e19591467e8fdd4970e07606e1fbc248f239c89818d5f925") version("0.60.0", sha256="5df6158e5584eece5fc83294b949fd30b9f1125df7708862205217e068aabf16") version("0.59.1", sha256="76f69132b96028d2774ed20415e8c528a34e3299a40581bae178f0994a2f370b") version("0.58.1", sha256="487ded0633efccd9ca3a46364b40006dbdaca0f95e99b8b83e778d1195ebcbaa") @@ -46,6 +47,9 @@ class PyNumba(PythonPackage): variant("tbb", default=False, description="Build with Intel Threading Building Blocks") + # Be careful that the bounds given in setup.py are exclusive on the upper bound + # i.e., [min, max) + depends_on("python@3.10:3.13", when="@0.61:", type=("build", "run")) depends_on("python@3.9:3.12", when="@0.59:", type=("build", "run")) depends_on("python@3.8:3.11", when="@0.57:0.58", type=("build", "run")) depends_on("python@3.7:3.10", when="@0.55:0.56", type=("build", "run")) @@ -53,7 +57,7 @@ class PyNumba(PythonPackage): depends_on("python@3.6:3.9", when="@0.53", type=("build", "run")) depends_on("python@3.6:3.8", when="@0.52", type=("build", "run")) depends_on("python@3.6:3.8", when="@0.48:0.51", type=("build", "run")) - depends_on("py-numpy@2.0", when="@0.60:", type=("build", "run")) + depends_on("py-numpy@2.0:2.2", when="@0.60:", type=("build", "run")) depends_on("py-numpy@1.22:1.26", when="@0.58.1:0.59", type=("build", "run")) depends_on("py-numpy@1.21:1.25", when="@0.58.0", type=("build", "run")) depends_on("py-numpy@1.21:1.24", when="@0.57", type=("build", "run")) @@ -63,6 +67,7 @@ class PyNumba(PythonPackage): depends_on("py-numpy@1.17:1.20", when="@0.54", type=("build", "run")) depends_on("py-numpy@1.15:1.20", when="@0.48:0.53", type=("build", "run")) depends_on("py-setuptools", type=("build", "run")) + depends_on("py-llvmlite@0.44", when="@0.61", type=("build", "run")) depends_on("py-llvmlite@0.43", when="@0.60", type=("build", "run")) depends_on("py-llvmlite@0.42", when="@0.59", type=("build", "run")) depends_on("py-llvmlite@0.41", when="@0.58", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-numcodecs/package.py b/var/spack/repos/builtin/packages/py-numcodecs/package.py index 31fd8792b03e74..ec5f4dad04e975 100644 --- a/var/spack/repos/builtin/packages/py-numcodecs/package.py +++ b/var/spack/repos/builtin/packages/py-numcodecs/package.py @@ -23,6 +23,11 @@ class PyNumcodecs(PythonPackage): version("main", branch="main", submodules=True) version("master", branch="main", submodules=True, deprecated=True) + version( + "0.15.0", + sha256="52fb0c20d99845ef600eb3f8c8ad3e22fe2cb4f2a53394d331210af7cc3375ca", + preferred=True, + ) version("0.13.0", sha256="ba4fac7036ea5a078c7afe1d4dffeb9685080d42f19c9c16b12dad866703aa2e") version("0.12.1", sha256="05d91a433733e7eef268d7e80ec226a0232da244289614a8f3826901aec1098e") version("0.12.0", sha256="6388e5f4e94d18a7165fbd1c9d3637673b74157cff8bc644005f9e2a4c717d6e") @@ -49,7 +54,7 @@ class PyNumcodecs(PythonPackage): depends_on("py-entrypoints", when="@0.10.1:0.11", type=("build", "run")) depends_on("py-msgpack", type=("build", "run"), when="+msgpack") - patch("apple-clang-12.patch", when="%apple-clang@12:") + patch("apple-clang-12.patch", when="%apple-clang@12: @:0.13") # TODO: this package should really depend on blosc, zstd, lz4, zlib, but right now it vendors # those libraries without any way to use the system versions. diff --git a/var/spack/repos/builtin/packages/py-numpy/package.py b/var/spack/repos/builtin/packages/py-numpy/package.py index 85d2b8d0277ce7..0c938fad2c344a 100644 --- a/var/spack/repos/builtin/packages/py-numpy/package.py +++ b/var/spack/repos/builtin/packages/py-numpy/package.py @@ -21,7 +21,11 @@ class PyNumpy(PythonPackage): license("BSD-3-Clause") version("main", branch="main") + version("2.2.3", sha256="dbdc15f0c81611925f382dfa97b3bd0bc2c1ce19d4fe50482cb0ddc12ba30020") + version("2.2.2", sha256="ed6906f61834d687738d25988ae117683705636936cc605be0bb208b23df4d8f") + version("2.2.1", sha256="45681fd7128c8ad1c379f0ca0776a8b0c6583d2f69889ddac01559dfe4390918") version("2.2.0", sha256="140dd80ff8981a583a60980be1a655068f8adebf7a45a06a6858c873fcdcd4a0") + version("2.1.3", sha256="aa08e04e08aaf974d4458def539dece0d28146d866a39da5639596f4921fd761") version("2.1.2", sha256="13532a088217fa624c99b843eeb54640de23b3414b14aa66d023805eb731066c") version("2.1.1", sha256="d0cf7d55b1051387807405b3898efafa862997b4cba8aa5dbe657be794afeafd") version("2.1.0", sha256="7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2") diff --git a/var/spack/repos/builtin/packages/py-ogb/package.py b/var/spack/repos/builtin/packages/py-ogb/package.py index b1e1130f3ec0bc..b53e55d7977934 100644 --- a/var/spack/repos/builtin/packages/py-ogb/package.py +++ b/var/spack/repos/builtin/packages/py-ogb/package.py @@ -21,6 +21,7 @@ class PyOgb(PythonPackage): license("MIT") + version("1.3.6", sha256="ce90418a0e3206483187aa7b7ecac1a2c5d85b3b99aceedb807138ee43115914") version("1.3.5", sha256="ac958094ac3019822e742155b82cb2bf02830aa72a4264ba9ee09b288f0c080c") depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-onnxruntime/package.py b/var/spack/repos/builtin/packages/py-onnxruntime/package.py index a5f9ed8a21b688..12b64fd3e3c61f 100644 --- a/var/spack/repos/builtin/packages/py-onnxruntime/package.py +++ b/var/spack/repos/builtin/packages/py-onnxruntime/package.py @@ -22,6 +22,8 @@ class PyOnnxruntime(CMakePackage, PythonExtension, ROCmPackage): license("MIT") + version("1.19.2", tag="v1.19.2", commit="ffceed9d44f2f3efb9dd69fa75fea51163c91d91") + version("1.19.0", tag="v1.19.0", commit="26250ae74d2c9a3c6860625ba4a147ddfb936907") version("1.18.2", tag="v1.18.2", commit="9691af1a2a17b12af04652f4d8d2a18ce9507025") version("1.18.1", tag="v1.18.1", commit="387127404e6c1d84b3468c387d864877ed1c67fe") version("1.18.0", tag="v1.18.0", commit="45737400a2f3015c11f005ed7603611eaed306a6") @@ -52,6 +54,8 @@ class PyOnnxruntime(CMakePackage, PythonExtension, ROCmPackage): # requirements.txt depends_on("py-coloredlogs", when="@1.17:", type=("build", "run")) depends_on("py-flatbuffers", type=("build", "run")) + depends_on("py-numpy@1.21.6:", when="@1.19:", type=("build", "run")) + depends_on("py-numpy@1.21.6:1", when="@1.18.1:1.18.2", type=("build", "run")) depends_on("py-numpy@1.16.6:", type=("build", "run")) depends_on("py-numpy@1.21.6:", when="@1.18:", type=("build", "run")) depends_on("py-numpy@:1", when="@:1.18", type=("build", "run")) @@ -64,6 +68,7 @@ class PyOnnxruntime(CMakePackage, PythonExtension, ROCmPackage): depends_on("protobuf@:3.19", when="@:1.11") depends_on("py-cerberus", type=("build", "run")) depends_on("py-onnx", type=("build", "run")) + depends_on("py-onnx@:1.16", type=("build", "run"), when="@:1.18") depends_on("py-onnx@:1.15.0", type=("build", "run"), when="@:1.17") depends_on("py-onnx@:1.16", type=("build", "run"), when="@:1.18") depends_on("zlib-api") diff --git a/var/spack/repos/builtin/packages/py-patsy/package.py b/var/spack/repos/builtin/packages/py-patsy/package.py index 0c0a48bf7a3438..146cc168461667 100644 --- a/var/spack/repos/builtin/packages/py-patsy/package.py +++ b/var/spack/repos/builtin/packages/py-patsy/package.py @@ -13,8 +13,11 @@ class PyPatsy(PythonPackage): homepage = "https://github.com/pydata/patsy" pypi = "patsy/patsy-0.5.2.tar.gz" + maintainers("climbfuji") + license("PSF-2.0") + version("0.5.4", sha256="7dabc527597308de0e8f188faa20af7e06a89bdaa306756dfc7783693ea16af4") version("0.5.3", sha256="bdc18001875e319bc91c812c1eb6a10be4bb13cb81eb763f466179dca3b67277") version("0.5.2", sha256="5053de7804676aba62783dbb0f23a2b3d74e35e5bfa238b88b7cbf148a38b69d") version("0.5.1", sha256="f115cec4201e1465cd58b9866b0b0e7b941caafec129869057405bfe5b5e3991") diff --git a/var/spack/repos/builtin/packages/py-perfdump/package.py b/var/spack/repos/builtin/packages/py-perfdump/package.py new file mode 100644 index 00000000000000..66620426f9157e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-perfdump/package.py @@ -0,0 +1,46 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyPerfdump(CMakePackage): + """An MPI- and HDF5- enabled Python module to create PAPI dumps""" + + homepage = "https://github.com/RECUP-DOE/pyperfdump/" + git = "https://github.com/RECUP-DOE/pyperfdump.git" + url = "https://github.com/RECUP-DOE/pyperfdump/archive/refs/tags/v1.1.tar.gz" + + maintainers("chaseleif") + + license("Apache-2.0 WITH LLVM-Exception", checked_by="chaseleif") + + version("1.1", sha256="d2d96e2bd8ba2616ea4a44233ea240a529788390a5c22d35f9de79a22647370d") + + variant("mpi", default=False, description="Use MPI") + variant("hdf5", default=False, description="Enable HDF5 output") + + depends_on("cmake@3.15:", type="build") + depends_on("cxx", type="build") + depends_on("papi", type=("build", "link", "run")) + depends_on("python@3:", type=("build", "link", "run")) + + depends_on("mpi", type=("build", "link", "run"), when="+mpi") + depends_on("py-mpi4py", type="run", when="+mpi") + + depends_on("hdf5+mpi", type=("build", "link", "run"), when="+mpi+hdf5") + depends_on("hdf5~mpi", type=("build", "link", "run"), when="~mpi+hdf5") + + def cmake_args(self): + spec = self.spec + args = [ + self.define_from_variant("USE_MPI", "mpi"), + self.define_from_variant("ENABLE_HDF5", "hdf5"), + self.define("PAPI_PREFIX", spec["papi"].prefix), + ] + if spec.satisfies("+mpi"): + args.append(self.define("MPI_HOME", spec["mpi"].prefix)) + if spec.satisfies("+hdf5"): + args.append(self.define("HDF5_ROOT", spec["hdf5"].prefix)) + return args diff --git a/var/spack/repos/builtin/packages/py-petsc4py/package.py b/var/spack/repos/builtin/packages/py-petsc4py/package.py index 1e8c460f2890e1..f3ebe75a1c2502 100644 --- a/var/spack/repos/builtin/packages/py-petsc4py/package.py +++ b/var/spack/repos/builtin/packages/py-petsc4py/package.py @@ -19,6 +19,7 @@ class PyPetsc4py(PythonPackage): license("BSD-2-Clause") version("main", branch="main") + version("3.22.3", sha256="7ed43cd027f82033e70f53c99fb530713dab743869d0c0827d22bbd5fb651c43") version("3.22.2", sha256="6c56f62ae8819069062436d362a2cc7e44f700026eed72a903c3803afbe59fc3") version("3.22.1", sha256="a7fd321458b72356e46c4bc5bd93d173c9c2f91018cf21f614a631fe2aa6466a") version("3.22.0", sha256="b35fc833d41c7969be8a530494fcc81741d77e0dc33fba2f4050cdbd0ad881ae") diff --git a/var/spack/repos/builtin/packages/py-picmistandard/package.py b/var/spack/repos/builtin/packages/py-picmistandard/package.py index ccd00516623b49..660a9bd44f2e6a 100644 --- a/var/spack/repos/builtin/packages/py-picmistandard/package.py +++ b/var/spack/repos/builtin/packages/py-picmistandard/package.py @@ -10,11 +10,12 @@ class PyPicmistandard(PythonPackage): homepage = "https://picmi-standard.github.io" git = "https://github.com/picmi-standard/picmi.git" - pypi = "picmistandard/picmistandard-0.30.0.tar.gz" + pypi = "picmistandard/picmistandard-0.33.0.tar.gz" maintainers("ax3l", "dpgrote", "RemiLehe") version("master", branch="master") + version("0.33.0", sha256="bdab1643385d85da1462ba8cebc4460dd87c735946f4766181714d7cb8cf2188") version("0.30.0", sha256="28b892b242e0cc044ad987d6bdc12811fe4a478d5096d6bc5989038ee9d9dab6") version("0.29.0", sha256="dc0bf3ddd3635df9935ac569b3085de387150c4f8e9851897078bb12d123dde8") version("0.28.0", sha256="aa980b0fb49fc3ff9c7e32b5927b3700c4660aefbf96567bac1f8c9c93bb7831") diff --git a/var/spack/repos/builtin/packages/py-pint-xarray/package.py b/var/spack/repos/builtin/packages/py-pint-xarray/package.py index d0b9d667259b68..c3248a2660c566 100644 --- a/var/spack/repos/builtin/packages/py-pint-xarray/package.py +++ b/var/spack/repos/builtin/packages/py-pint-xarray/package.py @@ -9,18 +9,35 @@ class PyPintXarray(PythonPackage): """A convenience wrapper for using pint with xarray""" homepage = "https://github.com/xarray-contrib/pint-xarray" - pypi = "pint-xarray/pint-xarray-0.2.1.tar.gz" + pypi = "pint-xarray/pint_xarray-0.4.tar.gz" license("Apache-2.0") + version("0.4", sha256="b6b737a9c46dfb14a8598c27a71100496994c9d79dab61fd77f0d2685ae7065e") version("0.3", sha256="3545dfa78bee3f98eba29b8bd17500e3b5cb7c7b03a2c2781c4d4d59b6a82841") version("0.2.1", sha256="1ee6bf74ee7b52b946f226a96469276fa4f5c68f7381c1b2aae66852562cb275") - depends_on("py-setuptools@42:", type="build") - depends_on("py-setuptools-scm@3.4:+toml", type="build") - - depends_on("python@3.8:", when="@0.3:", type=("build", "run")) - depends_on("py-numpy@1.17:", type=("build", "run")) - depends_on("py-xarray@0.16.1:", type=("build", "run")) - depends_on("py-pint@0.16:", type=("build", "run")) - depends_on("py-importlib-metadata", when="@0.2.1 ^python@:3.7", type=("build", "run")) + with when("@0.4:"): + depends_on("py-setuptools@64:", type="build") + depends_on("py-setuptools-scm@7.0:+toml", type="build") + depends_on("python@3.9:", type=("build", "run")) + depends_on("py-numpy@1.23:", type=("build", "run")) + depends_on("py-xarray@2022.06.0:", type=("build", "run")) + depends_on("py-pint@0.21:", type=("build", "run")) + + with when("@:0.3"): + depends_on("py-setuptools@42:", type="build") + depends_on("py-setuptools-scm@3.4:+toml", type="build") + depends_on("python@3.8:", type=("build", "run")) + depends_on("py-numpy@1.17:", type=("build", "run")) + depends_on("py-xarray@0.16.1:", type=("build", "run")) + depends_on("py-pint@0.16:", type=("build", "run")) + depends_on("py-importlib-metadata", when="@0.2.1 ^python@:3.7", type=("build", "run")) + + def url_for_version(self, version): + + if version >= Version("0.4"): + return super().url_for_version(version) + + url = "https://files.pythonhosted.org/packages/source/p/pint-xarray/pint-xarray-{0}.tar.gz" + return url.format(version) diff --git a/var/spack/repos/builtin/packages/py-psutil/package.py b/var/spack/repos/builtin/packages/py-psutil/package.py index cc9399048afc91..59c1cca291e1de 100644 --- a/var/spack/repos/builtin/packages/py-psutil/package.py +++ b/var/spack/repos/builtin/packages/py-psutil/package.py @@ -15,6 +15,7 @@ class PyPsutil(PythonPackage): license("BSD-3-Clause") + version("6.1.1", sha256="cf8496728c18f2d0b45198f06895be52f36611711746b7f30c464b422b50e2f5") version("5.9.5", sha256="5410638e4df39c54d957fc51ce03048acd8e6d60abc0f5107af51e5fb566eb3c") version("5.9.4", sha256="3d7f9739eb435d4b1338944abe23f49584bde5395f27487d2ee25ad9a8774a62") version("5.9.2", sha256="feb861a10b6c3bb00701063b37e4afc754f8217f0f09c42280586bd6ac712b5c") @@ -26,7 +27,7 @@ class PyPsutil(PythonPackage): version("5.4.5", sha256="ebe293be36bb24b95cdefc5131635496e88b17fabbcf1e4bc9b5c01f5e489cfe") version("5.0.1", sha256="9d8b7f8353a2b2eb6eb7271d42ec99d0d264a9338a37be46424d56b4e473b39e") - depends_on("c", type="build") # generated + depends_on("c", type="build") # pyproject.toml depends_on("py-setuptools@43:", when="@5.9.4:", type="build") diff --git a/var/spack/repos/builtin/packages/py-pybind11/package.py b/var/spack/repos/builtin/packages/py-pybind11/package.py index cedaae85ef0f3b..204886ce9c28d1 100644 --- a/var/spack/repos/builtin/packages/py-pybind11/package.py +++ b/var/spack/repos/builtin/packages/py-pybind11/package.py @@ -26,6 +26,7 @@ class PyPybind11(CMakePackage, PythonExtension): maintainers("ax3l") version("master", branch="master") + version("2.13.6", sha256="e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20") version("2.13.5", sha256="b1e209c42b3a9ed74da3e0b25a4f4cd478d89d5efbb48f04b277df427faf6252") version("2.13.4", sha256="efc901aa0aab439a3fea6efeaf930b5a349fb06394bf845c64ce15a9cf8f0240") version("2.13.3", sha256="6e7a84ec241544f2f5e30c7a82c09c81f0541dd14e9d9ef61051e07105f9c445") diff --git a/var/spack/repos/builtin/packages/py-pycompadre/package.py b/var/spack/repos/builtin/packages/py-pycompadre/package.py index 339852892b6bbb..da1760d87d965f 100644 --- a/var/spack/repos/builtin/packages/py-pycompadre/package.py +++ b/var/spack/repos/builtin/packages/py-pycompadre/package.py @@ -61,7 +61,7 @@ def set_cmake_from_variants(self): with open("cmake_opts.txt", "w") as f: f.write("KokkosCore_PREFIX:PATH=%s\n" % spec["kokkos"].prefix) f.write("KokkosKernels_PREFIX:PATH=%s\n" % spec["kokkos-kernels"].prefix) - f.write("CMAKE_CXX_COMPILER:STRING={0}\n".format(spec["kokkos"].kokkos_cxx)) + f.write("CMAKE_CXX_COMPILER:STRING={0}\n".format(self["kokkos"].kokkos_cxx)) if spec.variants["debug"].value == "0": f.write( "CMAKE_CXX_FLAGS:STRING=%s\n" diff --git a/var/spack/repos/builtin/packages/py-pycuda/package.py b/var/spack/repos/builtin/packages/py-pycuda/package.py index de68453815a888..29244e0231e19b 100644 --- a/var/spack/repos/builtin/packages/py-pycuda/package.py +++ b/var/spack/repos/builtin/packages/py-pycuda/package.py @@ -16,6 +16,7 @@ class PyPycuda(PythonPackage): license("MIT") + version("2024.1.2", sha256="d110b727cbea859da4b63e91b6fa1e9fc32c5bade02d89ff449975996e9ccfab") version("2021.1", sha256="ab87312d0fc349d9c17294a087bb9615cffcf966ad7b115f5b051008a48dd6ed") version("2020.1", sha256="effa3b99b55af67f3afba9b0d1b64b4a0add4dd6a33bdd6786df1aa4cc8761a5") version("2019.1.2", sha256="ada56ce98a41f9f95fe18809f38afbae473a5c62d346cfa126a2d5477f24cc8a") @@ -23,6 +24,28 @@ class PyPycuda(PythonPackage): depends_on("cxx", type="build") # generated + # TODO: replace this with an explicit list of components of Boost, + # for instance depends_on('boost +filesystem') + # See https://github.com/spack/spack/pull/22303 for reference + depends_on(Boost.with_default_variants) + # TODO: for versions before 2024.1.2, find out the exact requirements with version constraints + # and enter them below. See https://github.com/spack/spack/pull/48547 + depends_on("python@3.6:3", type=("build", "run"), when="@2020.1:") + depends_on("python@3.8:3", type=("build", "run"), when="@2024.1.2:") + depends_on("boost+python") + depends_on("cuda", type=("build", "run")) + depends_on("cuda@:8.0.61", when="@2016.1.2") + depends_on("py-appdirs@1.4.0:", type=("build", "run"), when="@:2021.1") + depends_on("py-decorator@3.2.0:", type=("build", "run"), when="@:2020.1") + depends_on("py-mako", type=("build", "run")) + depends_on("py-numpy@1.6:", type=("build", "run"), when="@:2021.1") + depends_on("py-numpy@1.24:", type=("build", "run"), when="@2024.1.2:") + depends_on("py-platformdirs@2.2:", type=("build", "run"), when="@2024.1.2:") + depends_on("py-pytools@2011.2:", type=("build", "run")) + depends_on("py-setuptools", type="build") + depends_on("py-six", type="run", when="@:2020.1") + depends_on("py-pytools@2011.2:", type=("build", "run"), when="@2024.1.2:") + @run_before("install") def configure(self): pyver = self.spec["python"].version.up_to(2).joined @@ -34,20 +57,3 @@ def configure(self): "--boost-python-libname={0}".format(boostlib), ] python("configure.py", *configure_args) - - depends_on("py-setuptools", type="build") - depends_on("cuda") - depends_on("boost+python") - # TODO: replace this with an explicit list of components of Boost, - # for instance depends_on('boost +filesystem') - # See https://github.com/spack/spack/pull/22303 for reference - depends_on(Boost.with_default_variants) - depends_on("python@3.6:3", type=("build", "run"), when="@2020.1:") - depends_on("py-numpy@1.6:", type=("build", "run")) - depends_on("py-pytools@2011.2:", type=("build", "run")) - depends_on("py-six", type="run", when="@:2020.1") - depends_on("py-decorator@3.2.0:", type=("build", "run"), when="@:2020.1") - depends_on("py-appdirs@1.4.0:", type=("build", "run")) - depends_on("py-mako", type=("build", "run")) - - depends_on("cuda@:8.0.61", when="@2016.1.2") diff --git a/var/spack/repos/builtin/packages/py-pyerfa/package.py b/var/spack/repos/builtin/packages/py-pyerfa/package.py index 4044472877fbca..41b79beb0924a8 100644 --- a/var/spack/repos/builtin/packages/py-pyerfa/package.py +++ b/var/spack/repos/builtin/packages/py-pyerfa/package.py @@ -21,19 +21,24 @@ class PyPyerfa(PythonPackage): license("BSD-3-Clause") + version("2.0.1.5", sha256="17d6b24fe4846c65d5e7d8c362dcb08199dc63b30a236aedd73875cc83e1f6c0") version("2.0.1.1", sha256="dbac74ef8d3d3b0f22ef0ad3bbbdb30b2a9e10570b1fa5a98be34c7be36c9a6b") version("2.0.0.1", sha256="2fd4637ffe2c1e6ede7482c13f583ba7c73119d78bef90175448ce506a0ede30") - depends_on("c", type="build") # generated + depends_on("c", type="build") # From setup.cfg depends_on("python@3.7:", type=("build", "run")) - depends_on("py-numpy@1.25:2", when="@2.0.1.1", type=("build", "run")) + depends_on("python@3.9:", type=("build", "run"), when="@2.0.1.5:") + depends_on("py-numpy@2.0.0rc1:", when="@2.0.1.5:", type="build") + depends_on("py-numpy@1.19.3:", when="@2.0.1.5:", type=("build", "run")) + depends_on("py-numpy@1.25:1", when="@2.0.1.1", type=("build", "run")) depends_on("py-numpy@1.17:", type=("build", "run")) - depends_on("py-setuptools-scm@6.2:", when="@2.0.1.1", type="build") + depends_on("py-setuptools-scm@6.2:", when="@2.0.1.1:", type="build") depends_on("py-setuptools-scm@3.4:+toml", type="build") # From pyproject.toml depends_on("py-setuptools@42:", type="build") + depends_on("py-setuptools@61.2:", type="build", when="@2.0.1.5:") depends_on("py-packaging", type="build") depends_on("py-jinja2@2.10.3:", type="build") diff --git a/var/spack/repos/builtin/packages/py-pyomo/package.py b/var/spack/repos/builtin/packages/py-pyomo/package.py index 4ed84791ec8517..4fb9ccf71570d8 100644 --- a/var/spack/repos/builtin/packages/py-pyomo/package.py +++ b/var/spack/repos/builtin/packages/py-pyomo/package.py @@ -14,9 +14,13 @@ class PyPyomo(PythonPackage): pypi = "Pyomo/Pyomo-5.6.6.tar.gz" git = "https://github.com/Pyomo/pyomo.git" - # Maintainer accurate as of 2024-02-21 + # Maintainer accurate as of 2024-12-17 maintainers("mrmundt") + version("6.8.2", sha256="40d8f7b216ad1602bb254f4296591608dd94fe2c961dc1e63ca6b84fb397bed6") + version("6.8.1", sha256="dc3369193a915d6fa9a59382f1c02c17f6bf540584f641b9bd20d1f1a7f8ba8c") + version("6.8.0", sha256="a204a78d8ed5fa7ad8fa94d3c8ed4f6da38b5c02a68b8fe446bc694f16c8d1ea") + version("6.7.3", sha256="b7f0441c405af4f42f38527ae38826a5c0a4984dd7bea1fe07172789d8594770") version("6.7.2", sha256="53bef766854f7607ca1fcfe3f218594ab382f137a275cee3d925d2b2f96876bf") version("6.7.1", sha256="735b66c45937f1caa43f073d8218a4918b6de658914a699397d38d5b8c219a40") version("6.7.0", sha256="a245ec609ef2fd907269f0b8e0923f74d5bf868b2ec0e62bf2a30b3f253bd17b") @@ -76,7 +80,10 @@ class PyPyomo(PythonPackage): ############################ # python_requires - depends_on("python@3.8:3.12", when="@6.7:", type=("build", "run")) + # Preemptively tagging 3.8:3.13 for 6.8.1 and 6.8.2; 3.8 support will + # be removed in 6.9.0(MRM - Dec 2024) + depends_on("python@3.8:3.13", when="@6.8.1:6.8.2", type=("build", "run")) + depends_on("python@3.8:3.12", when="@6.7:6.8.0", type=("build", "run")) depends_on("python@3.7:3.11", when="@6.4:6.6", type=("build", "run")) depends_on("python@3.6:3.10", when="@6.3", type=("build", "run")) depends_on("python@3.6:3.9", when="@6.0:6.2", type=("build", "run")) @@ -98,9 +105,9 @@ class PyPyomo(PythonPackage): # when tests is requested depends_on("py-coverage", when="@6.1:+tests", type=("run")) depends_on("py-nose", when="@6.1:6.2+tests", type=("run")) + depends_on("py-parameterized", when="@6.1:+tests", type=("run")) depends_on("py-pytest", when="@6.3:+tests", type=("run")) depends_on("py-pytest-parallel", when="@6.3:+tests", type=("run")) - depends_on("py-parameterized", when="@6.1:+tests", type=("run")) depends_on("py-pybind11", when="@6.1:+tests", type=("run")) # when docs is requested @@ -112,18 +119,19 @@ class PyPyomo(PythonPackage): depends_on("py-sphinxcontrib-napoleon", when="@6.1:+docs", type=("run")) depends_on("py-sphinx-toolbox@2.16:", when="@6.7.1:+docs", type=("run")) depends_on("py-sphinx-jinja2-compat@0.1.1:", when="@6.7.1:+docs", type=("run")) - depends_on("py-enum-tools", when="@6.7.1:+docs", type=("run")) - # Pyomo does not support NumPy2 (May 9, 2024) - depends_on("py-numpy@1", when="@6.1:+docs", type=("run")) + depends_on("py-enum-tools", when="@6.7.1:6.8.0+docs", type=("run")) + depends_on("py-numpy@1", when="@6.1:6.7+docs", type=("run")) + depends_on("py-numpy", when="@6.8:+docs", type=("run")) depends_on("py-scipy", when="@6.4.2:+docs", type=("run")) # when optional is requested depends_on("py-dill", when="@6.1:+optional", type=("run")) depends_on("py-ipython", when="@6.1:+optional", type=("run")) + depends_on("py-linear-tree", when="@6.8:+optional", type=("run")) depends_on("py-matplotlib@:3.6.0,3.6.2:", when="@6.1:+optional", type=("run")) depends_on("py-networkx", when="@6.1:+optional", type=("run")) - # Pyomo does not support NumPy2 (May 9, 2024) - depends_on("py-numpy@1", when="@6.1:+optional", type=("run")) + depends_on("py-numpy@1", when="@6.1:6.7+optional", type=("run")) + depends_on("py-numpy", when="@6.8:+optional", type=("run")) depends_on("py-openpyxl", when="@6.1:+optional", type=("run")) depends_on("py-pint", when="@6.1:+optional", type=("run")) depends_on("py-plotly", when="@6.6:+optional", type=("run")) diff --git a/var/spack/repos/builtin/packages/py-pyproj/package.py b/var/spack/repos/builtin/packages/py-pyproj/package.py index de3831ed1cc468..0f8d772c74c223 100644 --- a/var/spack/repos/builtin/packages/py-pyproj/package.py +++ b/var/spack/repos/builtin/packages/py-pyproj/package.py @@ -16,6 +16,7 @@ class PyPyproj(PythonPackage): license("MIT") maintainers("citibeth", "adamjstewart") + version("3.7.1", sha256="60d72facd7b6b79853f19744779abcd3f804c4e0d4fa8815469db20c9f640a47") version("3.7.0", sha256="bf658f4aaf815d9d03c8121650b6f0b8067265c36e31bc6660b98ef144d81813") version("3.6.1", sha256="44aa7c704c2b7d8fb3d483bbf75af6cb2350d30a63b144279a09b75fead501bf") version("3.6.0", sha256="a5b111865b3f0f8b77b3983f2fbe4dd6248fc09d3730295949977c8dcd988062") diff --git a/var/spack/repos/builtin/packages/py-pyscf/package.py b/var/spack/repos/builtin/packages/py-pyscf/package.py index c62cbbf545ab88..a37a9629a9e6b2 100644 --- a/var/spack/repos/builtin/packages/py-pyscf/package.py +++ b/var/spack/repos/builtin/packages/py-pyscf/package.py @@ -17,6 +17,7 @@ class PyPyscf(PythonPackage): license("Apache-2.0") + version("2.8.0", sha256="db720372e7f7d1aa2df0fb90c07f483da363730197c937a6378952d34b6abf3d") version("2.7.0", sha256="ca8efc2f28d72c3130f26a967e7fa8d0bbc4a6b47d16a7c4c732ec85a31b7eec") version("2.6.2", sha256="744c89a8e4d38c4b5562f75fa68f9d079faeb23602d255fba0eb6d1bac97bca2") version("2.6.1", sha256="faeaeeb0c07fec5018937655511709a9c2445e3d7c421c0fa1ae5d889e4ab455") @@ -48,6 +49,7 @@ class PyPyscf(PythonPackage): depends_on("py-scipy@0.19:1.10", type=("build", "run"), when="@2.1:2.2") # https://github.com/pyscf/pyscf/issues/1783 depends_on("py-scipy@0.19:", type=("build", "run"), when="@2.3:") + depends_on("py-scipy@1.6.0:", type=("build", "run"), when="@2.7.0:") conflicts("^py-scipy@1.5.0:1.5.1", when="@2:") depends_on("py-h5py@2.3.0:", type=("build", "run")) depends_on("py-h5py@2.7.0:", type=("build", "run"), when="@2:") diff --git a/var/spack/repos/builtin/packages/py-pythran/package.py b/var/spack/repos/builtin/packages/py-pythran/package.py index e45dc4915a3819..b259907ca1489d 100644 --- a/var/spack/repos/builtin/packages/py-pythran/package.py +++ b/var/spack/repos/builtin/packages/py-pythran/package.py @@ -4,8 +4,6 @@ import sys -import llnl.util.filesystem as fs - from spack.package import * @@ -88,7 +86,7 @@ def headers(self): # Pythran is mainly meant to be used as a compiler, so return no headers to # avoid issue https://github.com/spack/spack/issues/33237 This can be refined # later to allow using pythran also as a library. - return fs.HeaderList([]) + return HeaderList([]) def patch(self): # Compiler is used at run-time to determine name of OpenMP library to search for diff --git a/var/spack/repos/builtin/packages/py-regions/package.py b/var/spack/repos/builtin/packages/py-regions/package.py new file mode 100644 index 00000000000000..8bf3563bdb6550 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-regions/package.py @@ -0,0 +1,34 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyRegions(PythonPackage): + """An Astropy coordinated package for region handling""" + + homepage = "https://github.com/astropy/regions" + pypi = "regions/regions-0.10.tar.gz" + + license("BSD-3-Clause", checked_by="lgarrison") + + version("0.10", sha256="961c518ea044268de0003a17953de3d4984623e9d47ad5424c100f6967e69a81") + + variant("all", default=False, description="Install all optional dependencies") + + depends_on("c", type="build") + + depends_on("python@3.10:", type=("build", "run")) + + depends_on("py-setuptools@61.2:", type="build") + depends_on("py-setuptools-scm@6.2:", type="build") + depends_on("py-cython@3.0.0:3.0", type="build") + depends_on("py-numpy@2.0.0rc1:", type="build") + depends_on("py-extension-helpers@1", type="build") + + depends_on("py-numpy@1.23:", type=("build", "run")) + depends_on("py-astropy@5.1:", type=("build", "run")) + + depends_on("py-matplotlib@3.5:", type=("build", "run"), when="+all") + depends_on("py-shapely", type=("build", "run"), when="+all") diff --git a/var/spack/repos/builtin/packages/py-roman-numerals-py/package.py b/var/spack/repos/builtin/packages/py-roman-numerals-py/package.py new file mode 100644 index 00000000000000..6627955068a284 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-roman-numerals-py/package.py @@ -0,0 +1,18 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyRomanNumeralsPy(PythonPackage): + """Manipulate well-formed Roman numerals.""" + + homepage = "https://github.com/AA-Turner/roman-numerals" + pypi = "roman_numerals_py/roman_numerals_py-3.0.0.tar.gz" + + license("0BSD OR CC0-1.0") + + version("3.0.0", sha256="91199c4373658c03d87d9fe004f4a5120a20f6cb192be745c2377cce274ef41c") + + depends_on("py-flit-core@3.7:3", type="build") diff --git a/var/spack/repos/builtin/packages/py-safetensors/package.py b/var/spack/repos/builtin/packages/py-safetensors/package.py index 7dad8a9acc54d3..c2f73bc6cbe52c 100644 --- a/var/spack/repos/builtin/packages/py-safetensors/package.py +++ b/var/spack/repos/builtin/packages/py-safetensors/package.py @@ -11,6 +11,8 @@ class PySafetensors(PythonPackage): homepage = "https://github.com/huggingface/safetensors" pypi = "safetensors/safetensors-0.3.1.tar.gz" + maintainers("thomas-bouvier") + version("0.4.5", sha256="d73de19682deabb02524b3d5d1f8b3aaba94c72f1bbfc7911b9b9d5d391c0310") version("0.4.3", sha256="2f85fc50c4e07a21e95c24e07460fe6f7e2859d0ce88092838352b798ce711c2") version("0.3.1", sha256="571da56ff8d0bec8ae54923b621cda98d36dcef10feb36fd492c4d0c2cd0e869") diff --git a/var/spack/repos/builtin/packages/py-schema-salad/package.py b/var/spack/repos/builtin/packages/py-schema-salad/package.py index 0ea0c7b8721815..47793b15ae393f 100644 --- a/var/spack/repos/builtin/packages/py-schema-salad/package.py +++ b/var/spack/repos/builtin/packages/py-schema-salad/package.py @@ -10,28 +10,54 @@ class PySchemaSalad(PythonPackage): """Schema Annotations for Linked Avro Data (SALAD)""" homepage = "https://github.com/common-workflow-language/schema_salad" - pypi = "schema-salad/schema-salad-8.3.20221209165047.tar.gz" + pypi = "schema-salad/schema_salad-8.7.20241021092521.tar.gz" license("Apache-2.0") - + version( + "8.7.20241021092521", + sha256="287b27adff70e55dd715bfbea18bb1a58fd73de14b4273be4038559308089cdf", + ) version( "8.3.20221209165047", sha256="d97cc9a4d7c4255eb8000bcebaa8ac0d1d31801c921fd4113ab3051c1e326c7c", ) depends_on("python@3.6:", type=("build", "run")) + depends_on("python@3.8:", when="@8.4.20230927144413:", type=("build", "run")) + depends_on("python@3.9:", when="@8.7.20241021092521:", type=("build", "run")) depends_on("py-setuptools@45:", type="build") + depends_on("py-setuptools@50:", when="@8.4.20231117150958:", type="build") depends_on("py-requests@1:", type=("build", "run")) depends_on("py-ruamel-yaml@0.17.6:0.17.21", type=("build", "run")) + depends_on("py-ruamel-yaml@0.17.6:0.18", when="@8.4.20231113094720:", type=("build", "run")) depends_on("py-rdflib@4.2.2:6", type=("build", "run")) depends_on("py-mistune@2.0.3:2.0", type=("build", "run")) depends_on("py-cachecontrol@0.11.7:0.12+filecache", type=("build", "run")) + depends_on( + "py-cachecontrol@0.13.1:0.14+filecache", + when="@8.7.20240820070935:8.7.20241021092521", + type=("build", "run"), + ) depends_on("py-setuptools-scm@6.2:+toml", type="build") - depends_on("py-mypy@0.991", type="build") + depends_on("py-setuptools-scm@8.0.4:8+toml", when="@8.4.20231024070348:", type="build") + depends_on("py-mypy@0.961", when="@8.3.20220717184004:8.3.20221028160159", type="build") + depends_on("py-mypy@0.991", when="@8.3.20221209165047:8.4.20230201194352", type="build") + depends_on("py-mypy@1.12.1", when="@8.7.20241021092521", type="build") depends_on("py-black@19.10b0:", type="build") - depends_on("py-types-pkg-resources", type="build") + depends_on("py-black@19.10b0:24.10", when="@8.7.20241021092521:", type="build") + depends_on("py-types-pkg-resources", when="@:8.4.20231117150958", type="build") depends_on("py-types-requests", type="build") depends_on("py-types-dataclasses", type="build") depends_on("py-types-setuptools", type="build") + + def url_for_version(self, version): + url = ( + "https://files.pythonhosted.org/packages/source/s/schema-salad/schema{}salad-{}.tar.gz" + ) + if version >= Version("8.5.20240503091721"): + sep = "_" + else: + sep = "-" + return url.format(sep, version) diff --git a/var/spack/repos/builtin/packages/py-scikit-image/package.py b/var/spack/repos/builtin/packages/py-scikit-image/package.py index d804e8f4046c2d..16cd0116698f76 100644 --- a/var/spack/repos/builtin/packages/py-scikit-image/package.py +++ b/var/spack/repos/builtin/packages/py-scikit-image/package.py @@ -23,6 +23,8 @@ class PyScikitImage(PythonPackage): "skimage.future.graph", ] + version("0.25.2", sha256="e5a37e6cd4d0c018a7a55b9d601357e3382826d3888c10d0213fc63bff977dde") + version("0.25.1", sha256="d4ab30540d114d37c35fe5c837f89b94aaba2a7643afae8354aa353319e9bbbb") version("0.25.0", sha256="58d94fea11b6b3306b3770417dc1cbca7fa9bcbd6a13945d7910399c88c2018c") version("0.24.0", sha256="5d16efe95da8edbeb363e0c4157b99becbd650a60b77f6e3af5768b66cf007ab") version("0.23.2", sha256="c9da4b2c3117e3e30364a3d14496ee5c72b09eb1a4ab1292b302416faa360590") @@ -38,8 +40,8 @@ class PyScikitImage(PythonPackage): version("0.14.2", sha256="1afd0b84eefd77afd1071c5c1c402553d67be2d7db8950b32d6f773f25850c1f") version("0.12.3", sha256="82da192f0e524701e89c5379c79200bc6dc21373f48bf7778a864c583897d7c7") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") # Get dependencies for: # diff --git a/var/spack/repos/builtin/packages/py-scipy/package.py b/var/spack/repos/builtin/packages/py-scipy/package.py index 51b2bf9f308953..2209dc499c1ada 100644 --- a/var/spack/repos/builtin/packages/py-scipy/package.py +++ b/var/spack/repos/builtin/packages/py-scipy/package.py @@ -17,6 +17,7 @@ class PyScipy(PythonPackage): license("BSD-3-Clause") version("main", branch="main") + version("1.15.2", sha256="cd58a314d92838f7e6f755c8a2167ead4f27e1fd5c1251fd54289569ef3495ec") version("1.15.1", sha256="033a75ddad1463970c96a88063a1df87ccfddd526437136b6ee81ff0312ebdf6") version("1.15.0", sha256="300742e2cc94e36a2880ebe464a1c8b4352a7b0f3e36ec3d2ac006cdbe0219ac") version("1.14.1", sha256="5a275584e726026a5699459aa72f828a610821006228e841b94275c4a7c08417") @@ -185,9 +186,6 @@ class PyScipy(PythonPackage): # https://github.com/spack/spack/issues/48243 conflicts("%intel", when="@1.14:", msg="SciPy 1.14: Use Intel LLVM instead of Intel Classic") - # https://github.com/spack/spack/issues/45718 - conflicts("%aocc", msg="SciPy doesn't compile with AOCC yet") - # https://github.com/scipy/scipy/issues/19831 conflicts("^openblas@0.3.26:", when="@:1.12") @@ -198,6 +196,8 @@ class PyScipy(PythonPackage): # Intel OneAPI ifx claims to support -fvisibility, but this does not work. # Meson adds this flag for all Python extensions which include Fortran code. conflicts("%oneapi@:2023.0", when="@1.9:") + # Unknown build error, version ranges may be incorrect + conflicts("%oneapi@2024:", when="@:1.8") # error: expected unqualified-id (exact compiler versions unknown) conflicts("%apple-clang@15:", when="@:1.9") @@ -265,11 +265,11 @@ def setup_build_environment(self, env): # Pick up BLAS/LAPACK from numpy if self.spec.satisfies("@:1.8"): - self.spec["py-numpy"].package.setup_build_environment(env) + self["py-numpy"].setup_build_environment(env) @when("@1.9:") def config_settings(self, spec, prefix): - blas, lapack = self.spec["py-numpy"].package.blas_lapack_pkg_config() + blas, lapack = self["py-numpy"].blas_lapack_pkg_config() if spec.satisfies("%aocc") or spec.satisfies("%clang@18:"): fortran_std = "none" @@ -287,10 +287,9 @@ def config_settings(self, spec, prefix): }, } - @when("@:1.8") - @run_before("install") + @run_before("install", when="@:1.8") def set_blas_lapack(self): - self.spec["py-numpy"].package.blas_lapack_site_cfg() + self["py-numpy"].blas_lapack_site_cfg() @run_after("install") @on_package_attributes(run_tests=True) diff --git a/var/spack/repos/builtin/packages/py-shapely/package.py b/var/spack/repos/builtin/packages/py-shapely/package.py index 9b30c533b2903a..a6f6c04da27176 100644 --- a/var/spack/repos/builtin/packages/py-shapely/package.py +++ b/var/spack/repos/builtin/packages/py-shapely/package.py @@ -20,6 +20,7 @@ class PyShapely(PythonPackage): license("BSD-3-Clause") version("main", branch="main") + version("2.0.7", sha256="28fe2997aab9a9dc026dc6a355d04e85841546b2a5d232ed953e3321ab958ee5") version("2.0.6", sha256="997f6159b1484059ec239cacaa53467fd8b5564dabe186cd84ac2944663b0bf6") version("2.0.5", sha256="bff2366bc786bfa6cb353d6b47d0443c570c32776612e527ee47b6df63fcfe32") version("2.0.4", sha256="5dc736127fac70009b8d309a0eeb74f3e08979e530cf7017f2f507ef62e6cfb8") diff --git a/var/spack/repos/builtin/packages/py-sphinx-rtd-dark-mode/package.py b/var/spack/repos/builtin/packages/py-sphinx-rtd-dark-mode/package.py index 598f39dce8acb6..67db301bfb63ca 100644 --- a/var/spack/repos/builtin/packages/py-sphinx-rtd-dark-mode/package.py +++ b/var/spack/repos/builtin/packages/py-sphinx-rtd-dark-mode/package.py @@ -13,6 +13,7 @@ class PySphinxRtdDarkMode(PythonPackage): license("MIT") + version("1.3.0", sha256="0272bf3d9ef620921adc67e5634a66969419e744da84ea18830adacfdb160ea8") version("1.2.4", sha256="935bc1f3e62fc76eadd7d2760ac7f48bab907a97e44beda749a48a2706aeed63") depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-sphinx-rtd-theme/package.py b/var/spack/repos/builtin/packages/py-sphinx-rtd-theme/package.py index 854c30da12b634..3a418e51f9d9f6 100644 --- a/var/spack/repos/builtin/packages/py-sphinx-rtd-theme/package.py +++ b/var/spack/repos/builtin/packages/py-sphinx-rtd-theme/package.py @@ -13,6 +13,8 @@ class PySphinxRtdTheme(PythonPackage): license("MIT") + version("3.0.0", sha256="905d67de03217fd3d76fbbdd992034ac8e77044ef8063a544dda1af74d409e08") + version("2.0.0", sha256="bd5d7b80622406762073a04ef8fadc5f9151261563d47027de09910ce03afe6b") version("1.2.2", sha256="01c5c5a72e2d025bd23d1f06c59a4831b06e6ce6c01fdd5ebfe9986c0a880fc7") version("1.2.0", sha256="a0d8bd1a2ed52e0b338cbe19c4b2eef3c5e7a048769753dac6a9f059c7b641b8") version("1.1.1", sha256="6146c845f1e1947b3c3dd4432c28998a1693ccc742b4f9ad7c63129f0757c103") @@ -22,15 +24,19 @@ class PySphinxRtdTheme(PythonPackage): version("0.5.0", sha256="22c795ba2832a169ca301cd0a083f7a434e09c538c70beb42782c073651b707d") version("0.4.3", sha256="728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a") + depends_on("python@3.8:", when="@3:") + depends_on("python@3.6:", when="@:2") + depends_on("python@:3.11", when="@:1.0.0") # distutils was removed in python@3.12 depends_on("py-setuptools", type="build") - - depends_on("py-sphinx@1.6:5", when="@1:1.1.99", type=("build", "run")) - depends_on("py-sphinx@1.6:6", when="@1.2:", type=("build", "run")) - depends_on("python@2.7:2.8,3.4:", when="@1:1.1.99", type=("build", "run")) - depends_on("python@3.6:", when="@1.2:", type=("build", "run")) - depends_on("py-docutils@:0.16", when="@0.5.2:0", type=("build", "run")) + depends_on("py-sphinx@6:8", when="@3:", type=("build", "run")) + depends_on("py-sphinx@5:7", when="@2", type=("build", "run")) + depends_on("py-sphinx@1.6:6", when="@1", type=("build", "run")) + depends_on("py-sphinx@:6", when="@0", type=("build", "run")) + depends_on("py-docutils@0.19:0.21", when="@3:", type=("build", "run")) + depends_on("py-docutils@:0.20", when="@2", type=("build", "run")) + depends_on("py-docutils@:0.18", when="@1.2.0", type=("build", "run")) depends_on("py-docutils@:0.17", when="@1:1.1", type=("build", "run")) - depends_on("py-docutils@:0.18", when="@1.2:", type=("build", "run")) + depends_on("py-docutils@:0.16", when="@0.5.2:0", type=("build", "run")) depends_on("py-sphinxcontrib-jquery@4", when="@1.2.2:", type=("build", "run")) depends_on("py-sphinxcontrib-jquery@2:", when="@1.2:1.2.1", type=("build", "run")) conflicts("^py-sphinxcontrib-jquery@3.0.0") diff --git a/var/spack/repos/builtin/packages/py-sphinx/package.py b/var/spack/repos/builtin/packages/py-sphinx/package.py index 19beac6e97d680..126521db727f07 100644 --- a/var/spack/repos/builtin/packages/py-sphinx/package.py +++ b/var/spack/repos/builtin/packages/py-sphinx/package.py @@ -11,10 +11,13 @@ class PySphinx(PythonPackage): homepage = "https://www.sphinx-doc.org/en/master/" pypi = "Sphinx/sphinx-7.1.0.tar.gz" - maintainers("adamjstewart") - license("BSD-2-Clause") + maintainers("adamjstewart") + version("8.2.0", sha256="5b0067853d6e97f3fa87563e3404ebd008fce03525b55b25da90706764da6215") + version("8.1.3", sha256="43c1911eecb0d3e161ad78611bc905d1ad0e523e4ddc202a58a821773dc4c927") + version("8.1.2", sha256="b19e24b51d1926567e0bb8f4fbd372e40cb19f1f62bcba91b45c9ee0cdd8874e") + version("8.1.1", sha256="65e0ee8f76c9cbfd53ec8466ac8c87a73f9ed911767a8ef36c3bf3c522242bcd") version("8.1.0", sha256="109454425dbf4c78ecfdd481e56f078376d077edbda29804dba05c5161c8de06") version("8.0.2", sha256="0cce1ddcc4fd3532cf1dd283bc7d886758362c5c1de6598696579ce96d8ffa5b") version("8.0.1", sha256="7f762c18cfc1d4493e42f4a06a204c1ca55806c53f80a059e208e88d0668d661") @@ -101,12 +104,17 @@ class PySphinx(PythonPackage): version("1.4.5", sha256="c5df65d97a58365cbf4ea10212186a9a45d89c61ed2c071de6090cdf9ddb4028") version("1.3.1", sha256="1a6e5130c2b42d2de301693c299f78cc4bd3501e78b610c08e45efc70e2b5114") - depends_on("py-flit-core@3.7:", when="@5.2:", type="build") + with default_args(type="build"): + depends_on("py-flit-core@3.10:", when="@8.2:") + depends_on("py-flit-core@3.7:", when="@5.2:") with default_args(type=("build", "run")): + depends_on("python@3.11:", when="@8.2:") depends_on("python@3.10:", when="@8:") depends_on("python@3.9:", when="@7.2:") depends_on("python@3.8:", when="@6:") + # https://github.com/sphinx-doc/sphinx/issues/10440 + depends_on("python@:3.12", when="@:6.1") depends_on("py-sphinxcontrib-applehelp@1.0.7:", when="@8.1:") depends_on("py-sphinxcontrib-applehelp", when="@2:") depends_on("py-sphinxcontrib-devhelp@1.0.6:", when="@8.1:") @@ -154,10 +162,10 @@ class PySphinx(PythonPackage): depends_on("py-requests@2.25:", when="@6:") depends_on("py-requests@2.5:", when="@2:") depends_on("py-requests@2.4:", when="@1.5.2:") + depends_on("py-roman-numerals-py@1:", when="@8.2:") depends_on("py-packaging@23:", when="@7.4:") depends_on("py-packaging@21:", when="@5.2:") depends_on("py-packaging", when="@1.7:") - depends_on("py-tomli@2:", when="@7.3.1: ^python@:3.10") depends_on("py-colorama@0.4.6:", when="@7.4: platform=windows") depends_on("py-colorama@0.4.5:", when="@5.2: platform=windows") depends_on("py-colorama@0.3.5:", when="platform=windows") @@ -173,6 +181,7 @@ class PySphinx(PythonPackage): depends_on("py-sphinxcontrib-websupport", when="@1.6:1") depends_on("py-six@1.5:", when="@:1") depends_on("py-sphinx-rtd-theme@0.1:", when="@:1.3") + depends_on("py-tomli@2:", when="@7.3.1: ^python@:3.10") def url_for_version(self, version): url = "https://files.pythonhosted.org/packages/source/S/Sphinx/{}-{}.tar.gz" diff --git a/var/spack/repos/builtin/packages/py-statsmodels/package.py b/var/spack/repos/builtin/packages/py-statsmodels/package.py index 49a1f5db9985b0..3294e9d328b604 100644 --- a/var/spack/repos/builtin/packages/py-statsmodels/package.py +++ b/var/spack/repos/builtin/packages/py-statsmodels/package.py @@ -15,8 +15,11 @@ class PyStatsmodels(PythonPackage): pypi = "statsmodels/statsmodels-0.8.0.tar.gz" git = "https://github.com/statsmodels/statsmodels.git" + maintainers("climbfuji") + license("BSD-3-Clause") + version("0.14.1", sha256="2260efdc1ef89f39c670a0bd8151b1d0843567781bcafec6cda0534eb47a94f6") version("0.14.0", sha256="6875c7d689e966d948f15eb816ab5616f4928706b180cf470fd5907ab6f647a4") version("0.13.5", sha256="593526acae1c0fda0ea6c48439f67c3943094c542fe769f8b90fe9e6c6cc4871") version("0.13.2", sha256="77dc292c9939c036a476f1770f9d08976b05437daa229928da73231147cde7d4") @@ -33,37 +36,44 @@ class PyStatsmodels(PythonPackage): depends_on("python@3.8:", when="@0.14:", type=("build", "link", "run")) depends_on("python", type=("build", "link", "run")) + depends_on("py-setuptools@69.0.2:", when="@0.14.1: ^python@3.12:", type="build") + depends_on("py-setuptools@63.4.3:", when="@0.14.1:", type="build") depends_on("py-setuptools@59.2:", when="@0.13.3:", type="build") depends_on("py-setuptools@0.6c5:", type="build") # pyproject.toml - depends_on("py-cython@0.29.26:2", when="@0.14:", type="build") + depends_on("py-cython@0.29.33:3", when="@0.14.1", type="build") + depends_on("py-cython@0.29.26:2", when="@0.14.0", type="build") depends_on("py-cython@0.29.32:2", when="@0.13.5:0.13", type="build") - depends_on("py-cython@0.29.22:2", when="@0.13:", type="build") - depends_on("py-cython@0.29.14:2", when="@0.12:", type="build") - depends_on("py-cython@0.29:2", type="build") - depends_on("py-setuptools-scm+toml@7.0", when="@0.13.3:", type="build") + depends_on("py-cython@0.29.22:2", when="@0.13:0.13.4", type="build") + depends_on("py-cython@0.29.14:2", when="@0.12", type="build") + depends_on("py-cython@0.29:2", when="@:0.11", type="build") + depends_on("py-setuptools-scm+toml@8", when="@0.14.1:", type="build") + depends_on("py-setuptools-scm+toml@7.0", when="@0.13.3:0.14.0", type="build") # patsy@0.5.1 works around a Python change # https://github.com/statsmodels/statsmodels/issues/5343 and # https://github.com/pydata/patsy/pull/131 # requirements.txt - depends_on("py-numpy@1.18:", when="@0.14:", type=("build", "link", "run")) + depends_on("py-numpy@1.22.3:1", when="@0.14.1:", type=("build", "link", "run")) + depends_on("py-numpy@1.18:1", when="@0.14:", type=("build", "link", "run")) depends_on("py-numpy@1.17:", when="@0.13:", type=("build", "link", "run")) depends_on("py-numpy@1.15:", when="@0.12.1:", type=("build", "link", "run")) depends_on("py-numpy@1.11:", when="@0.10.1:", type=("build", "link", "run")) # https://github.com/statsmodels/statsmodels/issues/9194 depends_on("py-numpy@:1", when="@:0.14.1", type=("build", "link", "run")) depends_on("py-scipy@1.4:", when="@0.13.5:", type=("build", "run")) - conflicts("^py-scipy@1.9.2") + conflicts("^py-scipy@1.9.2", when="@:0.14.1") depends_on("py-scipy@1.3:", when="@0.13:", type=("build", "run")) depends_on("py-scipy@1.2:", when="@0.12:", type=("build", "run")) depends_on("py-scipy@0.18:", when="@0.10.1:", type=("build", "run")) depends_on("py-pandas@1:", when="@0.14:", type=("build", "run")) + conflicts("^py-scipy@2.1.0", when="@:0.14.1") depends_on("py-pandas@0.25:", when="@0.13:", type=("build", "run")) depends_on("py-pandas@0.23:", when="@0.12:", type=("build", "run")) depends_on("py-pandas@0.19:", when="@0.10.1:", type=("build", "run")) + depends_on("py-patsy@0.5.4:", when="@0.14.1:", type=("build", "run")) depends_on("py-patsy@0.5.2:", when="@0.13:", type=("build", "run")) depends_on("py-patsy@0.5.1:", when="@0.12:", type=("build", "run")) depends_on("py-patsy@0.4:", when="@0.10.1:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-sympy/package.py b/var/spack/repos/builtin/packages/py-sympy/package.py index cd07388e0c93ff..ce35f267fbfc0e 100644 --- a/var/spack/repos/builtin/packages/py-sympy/package.py +++ b/var/spack/repos/builtin/packages/py-sympy/package.py @@ -12,6 +12,7 @@ class PySympy(PythonPackage): license("BSD-3-Clause") + version("1.13.1", sha256="9cebf7e04ff162015ce31c9c6c9144daa34a93bd082f54fd8f12deca4f47515f") version("1.13.0", sha256="3b6af8f4d008b9a1a6a4268b335b984b23835f26d1d60b0526ebc71d48a25f57") version("1.12", sha256="ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8") version("1.11.1", sha256="e32380dce63cb7c0108ed525570092fd45168bdae2faa17e528221ef72e88658") @@ -35,7 +36,6 @@ class PySympy(PythonPackage): depends_on("python@3.6:", when="@1.7:", type=("build", "run")) depends_on("python@3.8:", when="@1.11.1:", type=("build", "run")) - # pip silently replaces distutils with setuptools depends_on("py-setuptools", type="build") depends_on("py-mpmath@0.19:", when="@1.0:1.12", type=("build", "run")) depends_on("py-mpmath@1.1.0:1.3", when="@1.13.0:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py index 7555d46f8337b2..9c63faac9ed813 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import glob -import os import sys import tempfile @@ -46,6 +45,11 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): license("Apache-2.0") maintainers("adamjstewart", "aweits") + version( + "2.18.0-rocm-enhanced", + sha256="85f44bed166927b2e22db28f5c4e4538da22221fedd9c2f47c763c52a0e40814", + url="https://github.com/ROCm/tensorflow-upstream/archive/refs/tags/v2.18.0-rocm-enhanced.tar.gz", + ) version("2.18.0", sha256="d7876f4bb0235cac60eb6316392a7c48676729860da1ab659fb440379ad5186d") version("2.17.1", sha256="2d3cfb48510f92f3a52fb05b820481c6f066a342a9f5296fe26d72c4ea757700") version("2.17.0", sha256="9cc4d5773b8ee910079baaecb4086d0c28939f024dd74b33fc5e64779b6533dc") @@ -449,11 +453,25 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): conflicts("platform=darwin target=aarch64:", when="@:2.4") # https://github.com/tensorflow/tensorflow/pull/39225 conflicts("target=aarch64:", when="@:2.2") - conflicts( - "~rocm", - when="@2.7.4-rocm-enhanced,2.11.0-rocm-enhanced,2.14-rocm-enhanced,2.16.1-rocm-enhanced", - ) - conflicts("+rocm", when="@:2.7.4-a,2.7.4.0:2.11.0-a,2.11.0.0:2.14-a,2.14-z:2.16.1-a,2.16.1-z:") + + rocm_versions = [ + "2.7.4-rocm-enhanced", + "2.11.0-rocm-enhanced", + "2.14-rocm-enhanced", + "2.16.1-rocm-enhanced", + "2.18.0-rocm-enhanced", + ] + rocm_conflicts = [ + ":2.7.4-a", + "2.7.4.0:2.11.0-a", + "2.11.0.0:2.14-a", + "2.14-z:2.16.1-a", + "2.16.1-z:2.18.0-a", + "2.18.0-z:", + ] + conflicts("~rocm", when=f"@{','.join(rocm_versions)}") + conflicts("+rocm", when=f"@{','.join(rocm_conflicts)}") + # wheel 0.40 upgrades vendored packaging, trips over tensorflow-io-gcs-filesystem identifier conflicts("^py-wheel@0.40:", when="@2.11:2.13") @@ -464,6 +482,10 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): conflicts("%gcc@:11", when="@2.17:") conflicts("%gcc@:9.3.0", when="@2.9:") conflicts("%gcc@:7.3.0") + # https://github.com/tensorflow/tensorflow/issues/76908 + conflicts("%clang@:15", when="@2.18:") + # https://github.com/tensorflow/tensorflow/issues/62416 + conflicts("%clang@17:", when="@:2.14") # zlib is vendored and downloaded directly from zlib.org (or mirrors), but # old downloads are removed from that site immediately after a new release. @@ -500,6 +522,14 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): # protobuf definitions. patch("0008-Fix-protobuf-errors-when-using-system-protobuf.patch", when="@2.5:2.6") + # remove unnecessary symbol ignores that cause errors with new compilers + # https://github.com/tensorflow/tensorflow/issues/62416 + patch( + "https://raw.githubusercontent.com/getsolus/packages/dfc56ba57a8af8233a635e309b499ff5d27992f4/packages/t/tensorflow/files/fix-clang-18.diff", + sha256="10d730b59284843d6c9ba92668b068582e51d5cdfc7ccfe8e26791ad0f41d4ac", + when="@2.15", + ) + # see https://github.com/tensorflow/tensorflow/issues/62490 # and https://github.com/abseil/abseil-cpp/issues/1665 patch("absl_neon.patch", when="@2.16.1:2.17 target=aarch64:") @@ -519,26 +549,14 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): patch( "https://github.com/ROCm/tensorflow-upstream/commit/f4f4e8698b90755b0b5ea2d9da1933b0b988b111.patch?full_index=1", sha256="a4c0fd62a0af3ba113c8933fa531dd17fa6667e507202a144715cd87fbdaf476", - when="@2.16.1-rocm-enhanced: +rocm", + when="@2.16.1-rocm-enhanced +rocm", ) patch( "https://github.com/ROCm/tensorflow-upstream/commit/8b7fcccb2914078737689347540cb79ace579bbb.patch?full_index=1", sha256="75a61a79ce3aae51fda920f677f4dc045374b20e25628626eb37ca19c3a3b4c4", when="@2.16.1-rocm-enhanced +rocm", ) - # Fix for compiling with clang 18 which produces the following error - # See https://github.com/tensorflow/tensorflow/issues/62416 - # ld.lld: error: version script assignment of 'global' to symbol 'init_pywrap_tf2' failed: - # symbol not defined - # ld.lld: error: version script assignment of 'global' to symbol 'init__pywrap_tf2' failed: - # symbol not defined - # clang: error: linker command failed with exit code 1 (use -v to see invocation) - # Target //tensorflow/tools/pip_package:build_pip_package failed to build - patch( - "https://raw.githubusercontent.com/getsolus/packages/dfc56ba57a8af8233a635e309b499ff5d27992f4/packages/t/tensorflow/files/fix-clang-18.diff", - sha256="10d730b59284843d6c9ba92668b068582e51d5cdfc7ccfe8e26791ad0f41d4ac", - when="@2.15.0", - ) + patch("set_jit_true.patch", when="@2.18.0-rocm-enhanced +rocm") phases = ["configure", "build", "install"] def flag_handler(self, name, flags): @@ -747,6 +765,7 @@ def setup_build_environment(self, env): # Do you want to use Clang to build TensorFlow? if "%clang" in spec: env.set("TF_NEED_CLANG", "1") + env.set("CLANG_COMPILER_PATH", spack_cc) else: env.set("TF_NEED_CLANG", "0") @@ -872,17 +891,10 @@ def post_configure_fixes(self): with open(".tf_configure.bazelrc", mode="a") as f: f.write('build --action_env LD_LIBRARY_PATH="' + slibs + '"') - if spec.satisfies("@2.16.1-rocm-enhanced +rocm"): - if os.path.exists(spec["llvm-amdgpu"].prefix.bin.clang): - filter_file( - "/usr/lib/llvm-17/bin/clang", spec["llvm-amdgpu"].prefix.bin.clang, ".bazelrc" - ) - else: - filter_file( - "/usr/lib/llvm-17/bin/clang", - spec["llvm-amdgpu"].prefix.llvm.bin.clang, - ".bazelrc", - ) + if spec.satisfies("+rocm"): + before = r"/usr/lib/llvm-\d+/bin/clang" + after = spec["llvm-amdgpu"].prefix.bin.clang + filter_file(before, after, ".bazelrc") filter_file("build:opt --copt=-march=native", "", ".tf_configure.bazelrc") filter_file("build:opt --host_copt=-march=native", "", ".tf_configure.bazelrc") @@ -961,6 +973,11 @@ def build(self, spec, prefix): args.append("--config=v2") + if self.spec.satisfies("@2.18.0-rocm-enhanced: +rocm"): + buildpath = join_path( + self.stage.source_path, "bazel-bin/tensorflow/tools/pip_package/wheel_house/" + ) + args.append(f"--repo_env=OUTPUT_PATH={buildpath}") # https://github.com/tensorflow/tensorflow/issues/63298 if self.spec.satisfies("@2.17:"): args.append("//tensorflow/tools/pip_package:wheel") diff --git a/var/spack/repos/builtin/packages/py-tensorflow/set_jit_true.patch b/var/spack/repos/builtin/packages/py-tensorflow/set_jit_true.patch new file mode 100644 index 00000000000000..9ec775996bfee6 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-tensorflow/set_jit_true.patch @@ -0,0 +1,22 @@ +diff --git a/tensorflow/core/kernels/mlir_generated/build_defs.bzl b/tensorflow/core/kernels/mlir_generated/build_defs.bzl +index f574a8da8fd..fc1fbf68bf8 100644 +--- a/tensorflow/core/kernels/mlir_generated/build_defs.bzl ++++ b/tensorflow/core/kernels/mlir_generated/build_defs.bzl +@@ -360,7 +360,7 @@ def _gen_kernel_library( + extra_args = extra_args, + host_triple = host_triple, + gpu_archs = gpu_archs, +- jit = jit, ++ jit = True, + mlir_op = "{op}_{name}_{platform}_{type}_{output_type}.mlir".format( + op = op, + name = name, +@@ -370,7 +370,7 @@ def _gen_kernel_library( + ), + tile_size = typed_tile_size, + unroll_factors = typed_unroll_factors, +- jit_i64_indexed_for_large_tensors = jit_i64_indexed_for_large_tensors, ++ jit_i64_indexed_for_large_tensors = False, + ) + + # We have to use a sh_test instead of build_test because it doesn't properly find the dependent targets. diff --git a/var/spack/repos/builtin/packages/py-timm/package.py b/var/spack/repos/builtin/packages/py-timm/package.py index ca15e751757c47..b2f2cc50579aa4 100644 --- a/var/spack/repos/builtin/packages/py-timm/package.py +++ b/var/spack/repos/builtin/packages/py-timm/package.py @@ -6,7 +6,7 @@ class PyTimm(PythonPackage): - """(Unofficial) PyTorch Image Models.""" + """PyTorch Image Models.""" homepage = "https://github.com/rwightman/pytorch-image-models" pypi = "timm/timm-0.4.12.tar.gz" @@ -14,6 +14,8 @@ class PyTimm(PythonPackage): license("Apache-2.0") maintainers("adamjstewart") + version("1.0.15", sha256="756a3bc30c96565f056e608a9b559daed904617eaadb6be536f96874879b1055") + version("1.0.14", sha256="00a7f2cc04ce3ed8f80476bbb7eea27eac8cf6f2d59b5e9aa9cdd375dd6550db") version("1.0.13", sha256="39190337cff26a15d180b660374c901ac472b69d91d8cfc5a5bb47c600fb3716") version("1.0.12", sha256="9da490683bd06302ec40e1892f1ccf87985f033e41f3580887d886b9aee9449a") version("1.0.11", sha256="a005f72b87e67ed30cdbf405a9ffd4e723360c780a43b1cefe266af8ecc9d151") @@ -36,12 +38,12 @@ class PyTimm(PythonPackage): # https://github.com/huggingface/pytorch-image-models/pull/1649 depends_on("python@:3.10", when="@:0.6.12") - depends_on("py-torch@1.7:", when="@0.6:") + depends_on("py-torch@1.7:", when="@0.6.11:") depends_on("py-torch@1.4:") depends_on("py-torchvision") depends_on("py-pyyaml", when="@0.6:") depends_on("py-huggingface-hub", when="@0.6:") - depends_on("py-safetensors", when="@0.9:") + depends_on("py-safetensors@0.2:", when="@0.9:") # https://github.com/rwightman/pytorch-image-models/pull/1256 depends_on("pil@:9", when="@:0.5") diff --git a/var/spack/repos/builtin/packages/py-tokenizers/package.py b/var/spack/repos/builtin/packages/py-tokenizers/package.py index 4a5f4de12b0caf..3f0f71bd7f7198 100644 --- a/var/spack/repos/builtin/packages/py-tokenizers/package.py +++ b/var/spack/repos/builtin/packages/py-tokenizers/package.py @@ -12,6 +12,8 @@ class PyTokenizers(PythonPackage): homepage = "https://github.com/huggingface/tokenizers" pypi = "tokenizers/tokenizers-0.6.0.tar.gz" + version("0.21.0", sha256="ee0894bf311b75b0c03079f33859ae4b2334d675d4e93f5a4132e1eae2834fe4") + version("0.20.4", sha256="db50ac15e92981227f499268541306824f49e97dbeec05d118ebdc7c2d22322c") version("0.19.1", sha256="ee59e6680ed0fdbe6b724cf38bd70400a0c1dd623b07ac729087270caeac88e3") version("0.15.0", sha256="10c7e6e7b4cabd757da59e93f5f8d1126291d16f8b54f28510825ef56a3e5d0e") version("0.13.3", sha256="2e546dbb68b623008a5442353137fbb0123d311a6d7ba52f2667c8862a75af2e") diff --git a/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py b/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py index 4e1d33d6f5f9c8..079bac59a1cc8e 100644 --- a/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py +++ b/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py @@ -17,13 +17,17 @@ class PyTorchNvidiaApex(PythonPackage, CudaPackage): license("BSD-3-Clause") version("master", branch="master") - version("24.04.01", sha256="065bc5c0146ee579d5db2b38ca3949da4dc799b871961a2c9eb19e18892166ce") + version( + "24.04.01", + sha256="065bc5c0146ee579d5db2b38ca3949da4dc799b871961a2c9eb19e18892166ce", + preferred=True, + ) version("23.08", tag="23.08") version("23.07", tag="23.07") version("23.06", tag="23.06") version("23.05", tag="23.05") version("22.03", tag="22.03") - version("2020-10-19", commit="8a1ed9e8d35dfad26fb973996319965e4224dcdd") + version("2020-10-19", commit="8a1ed9e8d35dfad26fb973996319965e4224dcdd", deprecated=True) depends_on("c", type="build") depends_on("cxx", type="build") @@ -75,6 +79,17 @@ class PyTorchNvidiaApex(PythonPackage, CudaPackage): # https://github.com/NVIDIA/apex/issues/1498 # https://github.com/NVIDIA/apex/pull/1499 patch("1499.patch", when="@2020-10-19") + patch( + "https://github.com/NVIDIA/apex/pull/1879.patch?full_index=1", + sha256="8e2e21aa883d93e6c0ea0fecb812c8de906b2e77bcffeeb716adabd1dd76650e", + when="@23.05:2019", + ) + + patch( + "https://github.com/NVIDIA/apex/pull/1855.patch?full_index=1", + sha256="8481b1234a9ce1e8bef4e57a259d8528107761e1843777489e815ec3727397fd", + when="@:24.10", + ) conflicts( "cuda_arch=none", diff --git a/var/spack/repos/builtin/packages/py-torch/package.py b/var/spack/repos/builtin/packages/py-torch/package.py index 6b7f8cb1e16940..b635e3e398f92d 100644 --- a/var/spack/repos/builtin/packages/py-torch/package.py +++ b/var/spack/repos/builtin/packages/py-torch/package.py @@ -24,6 +24,7 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): maintainers("adamjstewart") version("main", branch="main") + version("2.6.0", tag="v2.6.0", commit="1eba9b3aa3c43f86f4a2c807ac8e12c4a7767340") version("2.5.1", tag="v2.5.1", commit="a8d6afb511a69687bbb2b7e88a3cf67917e1697e") version("2.5.0", tag="v2.5.0", commit="32f585d9346e316e554c8d9bf7548af9f62141fc") version("2.4.1", tag="v2.4.1", commit="ee1b6804381c57161c477caa380a840a84167676") @@ -113,6 +114,12 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): description="Enable breakpad crash dump library", when="@1.10:1.11", ) + # Flash attention has very high memory requirements that may cause the build to fail + # https://github.com/pytorch/pytorch/issues/111526 + # https://github.com/pytorch/pytorch/issues/124018 + _desc = "Build the flash_attention kernel for scaled dot product attention" + variant("flash_attention", default=True, description=_desc, when="@1.13:+cuda") + variant("flash_attention", default=True, description=_desc, when="@1.13:+rocm") # py-torch has strict dependencies on old protobuf/py-protobuf versions that # cause problems with other packages that require newer versions of protobuf # and py-protobuf --> provide an option to use the internal/vendored protobuf. @@ -164,17 +171,19 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): with default_args(type=("build", "run")): # setup.py depends_on("py-filelock", when="@2:") + depends_on("py-typing-extensions@4.10:", when="@2.6:") depends_on("py-typing-extensions@4.8:", when="@2.2:") depends_on("py-typing-extensions@3.6.2.1:", when="@1.7:") + depends_on("py-setuptools") + depends_on("py-sympy@1.13.1", when="@2.5:") depends_on("py-sympy", when="@2:") depends_on("py-networkx", when="@2:") depends_on("py-jinja2", when="@2:") depends_on("py-fsspec", when="@2.1:") # pyproject.toml - depends_on("py-setuptools") depends_on("py-astunparse", when="@1.13:") - depends_on("py-numpy@1.16.6:") + depends_on("py-numpy") # https://github.com/pytorch/pytorch/issues/107302 depends_on("py-numpy@:1", when="@:2.2") depends_on("py-pyyaml") @@ -188,15 +197,18 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): # Third party dependencies depends_on("fp16@2020-05-14", when="@1.6:") depends_on("fxdiv@2020-04-17", when="@1.6:") + depends_on("nvtx@3.1.0", when="@2.6:") # https://github.com/pytorch/pytorch/issues/60332 - # depends_on("xnnpack@2024-02-29", when="@2.3:+xnnpack") + # depends_on("xnnpack@2024-11-08", when="@2.6:+xnnpack") + # depends_on("xnnpack@2024-02-29", when="@2.3:2.5+xnnpack") # depends_on("xnnpack@2022-12-21", when="@2.0:2.2+xnnpack") # depends_on("xnnpack@2022-02-16", when="@1.12:1+xnnpack") # depends_on("xnnpack@2021-06-21", when="@1.10:1.11+xnnpack") # depends_on("xnnpack@2021-02-22", when="@1.8:1.9+xnnpack") # depends_on("xnnpack@2020-03-23", when="@1.6:1.7+xnnpack") depends_on("benchmark", when="@1.6:+test") - depends_on("cpuinfo@2024-09-06", when="@2.5.1:") + depends_on("cpuinfo@2024-09-26", when="@2.6:") + depends_on("cpuinfo@2024-09-06", when="@2.5.1") depends_on("cpuinfo@2024-08-30", when="@2.5.0") depends_on("cpuinfo@2023-11-04", when="@2.3:2.4") depends_on("cpuinfo@2023-01-13", when="@2.1:2.2") @@ -216,7 +228,8 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): depends_on("gloo+libuv", when="@1.6: platform=darwin") depends_on("nccl", when="+nccl+cuda") # https://github.com/pytorch/pytorch/issues/60331 - # depends_on("onnx@1.16.0", when="@2.3:") + # depends_on("onnx@1.17.0", when="@2.6:") + # depends_on("onnx@1.16.0", when="@2.3:2.5") # depends_on("onnx@1.15.0", when="@2.2") # depends_on("onnx@1.14.1", when="@2.1") # depends_on("onnx@1.13.1", when="@2.0") @@ -242,7 +255,8 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): depends_on("pthreadpool@2020-10-05", when="@1.8") depends_on("pthreadpool@2020-06-15", when="@1.6:1.7") with default_args(type=("build", "link", "run")): - depends_on("py-pybind11@2.13.5:", when="@2.5:") + depends_on("py-pybind11@2.13.6:", when="@2.6:") + depends_on("py-pybind11@2.13.5:", when="@2.5") depends_on("py-pybind11@2.12.0:", when="@2.3:2.4") depends_on("py-pybind11@2.11.0:", when="@2.1:2.2") depends_on("py-pybind11@2.10.1:", when="@2.0") @@ -309,6 +323,14 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): conflicts("%gcc@:9.3", when="@2.2:", msg="C++17 support required") + # https://github.com/pytorch/pytorch/issues/146239 + patch( + "https://github.com/pytorch/pytorch/pull/140275.patch?full_index=1", + sha256="65f56305a27d47d7065711d1131c6ac1611fabcb55b129c27ed6beabe4b94fe0", + when="@2.6:", + reverse=True, + ) + # https://github.com/pytorch/pytorch/issues/90448 patch( "https://github.com/pytorch/pytorch/pull/97270.patch?full_index=1", @@ -343,6 +365,9 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): # https://github.com/pytorch/pytorch/pull/35607 # https://github.com/pytorch/pytorch/pull/37865 patch("xnnpack.patch", when="@1.5") + # https://github.com/pytorch/pytorch/issues/141083 + # https://github.com/google/XNNPACK/commit/5f23827e66cca435fa400b6e221892ac95af0079 + patch("xnnpack2.patch", when="@2.6", working_dir="third_party/XNNPACK") # Fixes build error when ROCm is enabled for pytorch-1.5 release patch("rocm.patch", when="@1.5+rocm") @@ -582,17 +607,13 @@ def enable_or_disable(variant, keyword="USE", var=None): env.set("CUDNN_INCLUDE_DIR", self.spec["cudnn"].prefix.include) env.set("CUDNN_LIBRARY", self.spec["cudnn"].libs[0]) - # Flash attention has very high memory requirements that may cause the build to fail - # https://github.com/pytorch/pytorch/issues/111526 - # https://github.com/pytorch/pytorch/issues/124018 - env.set("USE_FLASH_ATTENTION", "OFF") - enable_or_disable("fbgemm") enable_or_disable("kineto") enable_or_disable("magma") enable_or_disable("metal") enable_or_disable("mps") enable_or_disable("breakpad") + enable_or_disable("flash_attention") enable_or_disable("nccl") if "+cuda+nccl" in self.spec: @@ -678,6 +699,7 @@ def enable_or_disable(variant, keyword="USE", var=None): env.set("USE_SYSTEM_FXDIV", "ON") env.set("USE_SYSTEM_GLOO", "ON") env.set("USE_SYSTEM_NCCL", "ON") + env.set("USE_SYSTEM_NVTX", "ON") # https://github.com/pytorch/pytorch/issues/60331 # env.set("USE_SYSTEM_ONNX", "ON") env.set("USE_SYSTEM_PSIMD", "ON") diff --git a/var/spack/repos/builtin/packages/py-torch/xnnpack2.patch b/var/spack/repos/builtin/packages/py-torch/xnnpack2.patch new file mode 100644 index 00000000000000..d3e0860b300ff3 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-torch/xnnpack2.patch @@ -0,0 +1,34 @@ +diff --git a/src/reference/unary-elementwise.cc b/src/reference/unary-elementwise.cc +index bd95ded6c..da892d8be 100644 +--- a/src/reference/unary-elementwise.cc ++++ b/src/reference/unary-elementwise.cc +@@ -127,6 +127,16 @@ struct ConvertOp { + } + }; + ++#ifdef XNN_HAVE_FLOAT16 ++template <> ++struct ConvertOp { ++ explicit ConvertOp(const xnn_unary_uparams*) {} ++ _Float16 operator()(xnn_bfloat16 x) const { ++ return static_cast<_Float16>(static_cast(x)); ++ } ++}; ++#endif ++ + template + const xnn_unary_elementwise_config* get_convert_config( + std::true_type /*input_quantized*/, std::true_type /*output_quantized*/) { +diff --git a/src/xnnpack/simd/s16-neon.h b/src/xnnpack/simd/s16-neon.h +index 4e8ebcfbd..e8392f4e9 100644 +--- a/src/xnnpack/simd/s16-neon.h ++++ b/src/xnnpack/simd/s16-neon.h +@@ -70,7 +70,7 @@ static XNN_INLINE void xnn_store_tail_s16(int16_t* output, xnn_simd_s16_t v, + v_low = vget_high_s16(v); + } + if (num_elements & 2) { +- vst1_lane_s32((void*) output, vreinterpret_s32_s16(v_low), 0); ++ vst1_lane_s32((int32_t*) output, vreinterpret_s32_s16(v_low), 0); + output += 2; + v_low = vext_s16(v_low, v_low, 2); + } diff --git a/var/spack/repos/builtin/packages/py-torchaudio/package.py b/var/spack/repos/builtin/packages/py-torchaudio/package.py index 6fefbf7f87bf76..6249d470700874 100644 --- a/var/spack/repos/builtin/packages/py-torchaudio/package.py +++ b/var/spack/repos/builtin/packages/py-torchaudio/package.py @@ -17,6 +17,7 @@ class PyTorchaudio(PythonPackage): maintainers("adamjstewart") version("main", branch="main") + version("2.6.0", tag="v2.6.0", commit="d8831425203385077a03c1d92cfbbe3bf2106008") version("2.5.1", tag="v2.5.1", commit="1661daf10599ca8889f092ec37814fabbe202bb0") version("2.5.0", tag="v2.5.0", commit="56bc006d56a0d4960de6a1e0b6340cba4eda05cd") version("2.4.1", tag="v2.4.1", commit="e8cbe17769796ce963fbc71b8990f1474774e6d2") @@ -66,7 +67,8 @@ class PyTorchaudio(PythonPackage): with default_args(type=("build", "link", "run")): # Based on PyPI wheel availability - depends_on("python@3.9:3.12", when="@2.5:") + depends_on("python@3.9:3.13", when="@2.6:") + depends_on("python@3.9:3.12", when="@2.5") depends_on("python@3.8:3.12", when="@2.2:2.4") depends_on("python@3.8:3.11", when="@2.0:2.1") depends_on("python@:3.10", when="@0.12:0") @@ -74,6 +76,7 @@ class PyTorchaudio(PythonPackage): depends_on("python@:3.8", when="@:0.7.0") depends_on("py-torch@main", when="@main") + depends_on("py-torch@2.6.0", when="@2.6.0") depends_on("py-torch@2.5.1", when="@2.5.1") depends_on("py-torch@2.5.0", when="@2.5.0") depends_on("py-torch@2.4.1", when="@2.4.1") @@ -126,7 +129,7 @@ class PyTorchaudio(PythonPackage): patch( "https://github.com/pytorch/audio/pull/3811.patch?full_index=1", sha256="34dce3403abb03f62827e8a1efcdb2bf7742477a01f155ebb9c7fefe9588b132", - when="@2.2:", + when="@2.2:2.5", ) conflicts("^cuda@12.5:", when="@:2.1") diff --git a/var/spack/repos/builtin/packages/py-torchgeo/package.py b/var/spack/repos/builtin/packages/py-torchgeo/package.py index c7c8dc40eb9e39..c4f9ad71900a2a 100644 --- a/var/spack/repos/builtin/packages/py-torchgeo/package.py +++ b/var/spack/repos/builtin/packages/py-torchgeo/package.py @@ -124,8 +124,8 @@ class PyTorchgeo(PythonPackage): depends_on("py-pycocotools@2.0.7:", when="@0.6:") depends_on("py-pycocotools@2.0.5:", when="@0.5:") depends_on("py-pycocotools@2:") - depends_on("py-pyvista@0.34.2:", when="@0.5:") - depends_on("py-pyvista@0.20:", when="@0.4:") + depends_on("py-pyvista@0.34.2:", when="@0.5:0.6") + depends_on("py-pyvista@0.20:", when="@0.4") depends_on("py-scikit-image@0.19:", when="@0.6:") depends_on("py-scikit-image@0.18:", when="@0.4:") depends_on("py-scipy@1.7.2:", when="@0.6:") diff --git a/var/spack/repos/builtin/packages/py-torchvision/package.py b/var/spack/repos/builtin/packages/py-torchvision/package.py index fe97f7f7db6f50..022dab00a60227 100644 --- a/var/spack/repos/builtin/packages/py-torchvision/package.py +++ b/var/spack/repos/builtin/packages/py-torchvision/package.py @@ -18,6 +18,7 @@ class PyTorchvision(PythonPackage): license("BSD-3-Clause") version("main", branch="main") + version("0.21.0", sha256="0a4a967bbb7f9810f792cd0289a07fb98c8fb5d1303fae8b63e3a6b05d720058") version("0.20.1", sha256="7e08c7f56e2c89859310e53d898f72bccc4987cd83e08cfd6303513da15a9e71") version("0.20.0", sha256="b59d9896c5c957c6db0018754bbd17d079c5102b82b9be0b438553b40a7b6029") version("0.19.1", sha256="083e75c467285595ec3eb3c7aa8493c19e53d7eb42f13046fb56a07c8897e5a8") @@ -85,8 +86,6 @@ class PyTorchvision(PythonPackage): variant("png", default=True, description=desc.format("PNG")) variant("jpeg", default=True, description=desc.format("JPEG")) variant("webp", default=False, description=desc.format("WEBP"), when="@0.20:") - variant("heic", default=False, description=desc.format("HEIC"), when="@0.20:") - variant("avif", default=False, description=desc.format("AVIF"), when="@0.20:") variant("nvjpeg", default=False, description=desc.format("NVJPEG")) variant("video_codec", default=False, description=desc.format("video_codec")) variant("ffmpeg", default=False, description=desc.format("FFMPEG")) @@ -97,8 +96,8 @@ class PyTorchvision(PythonPackage): with default_args(type=("build", "link", "run")): # Based on PyPI wheel availability - depends_on("python@3.9:3.13", when="@0.20:") - depends_on("python@3.8:3.12", when="@0.17:0.19") + depends_on("python@3.9:3.13", when="@0.21:") + depends_on("python@3.8:3.12", when="@0.17:0.20") depends_on("python@3.8:3.11", when="@0.15:0.16") depends_on("python@:3.10", when="@0.12:0.14") depends_on("python@:3.9", when="@0.8.2:0.11") @@ -106,6 +105,7 @@ class PyTorchvision(PythonPackage): # https://github.com/pytorch/vision#installation depends_on("py-torch@main", when="@main") + depends_on("py-torch@2.6.0", when="@0.21.0") depends_on("py-torch@2.5.1", when="@0.20.1") depends_on("py-torch@2.5.0", when="@0.20.0") depends_on("py-torch@2.4.1", when="@0.19.1") @@ -156,8 +156,6 @@ class PyTorchvision(PythonPackage): depends_on("libpng@1.6:", when="+png") depends_on("jpeg", when="+jpeg") depends_on("libwebp", when="+webp") - depends_on("libheif", when="+heic") - depends_on("libavif", when="+avif") depends_on("cuda", when="+nvjpeg") depends_on("cuda", when="+video_codec") depends_on("ffmpeg@3.1:", when="+ffmpeg") @@ -214,7 +212,7 @@ def setup_build_environment(self, env): for gpu in ["cuda", "mps"]: env.set(f"FORCE_{gpu.upper()}", int(f"+{gpu}" in self.spec["py-torch"])) - extensions = ["png", "jpeg", "webp", "heic", "avif", "nvjpeg", "video_codec", "ffmpeg"] + extensions = ["png", "jpeg", "webp", "nvjpeg", "video_codec", "ffmpeg"] for extension in extensions: env.set(f"TORCHVISION_USE_{extension.upper()}", int(f"+{extension}" in self.spec)) diff --git a/var/spack/repos/builtin/packages/py-traittypes/package.py b/var/spack/repos/builtin/packages/py-traittypes/package.py new file mode 100644 index 00000000000000..3feac6dbb3c014 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-traittypes/package.py @@ -0,0 +1,19 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyTraittypes(PythonPackage): + """Custom trait types for scientific computing.""" + + homepage = "http://ipython.org/" + pypi = "traittypes/traittypes-0.2.1.tar.gz" + + license("BSD") + + version("0.2.1", sha256="be6fa26294733e7489822ded4ae25da5b4824a8a7a0e0c2dccfde596e3489bd6") + + depends_on("py-setuptools", type="build") + depends_on("py-traitlets@4.2.2:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-transformers/package.py b/var/spack/repos/builtin/packages/py-transformers/package.py index 887a27e7cd662e..76a8638e655743 100644 --- a/var/spack/repos/builtin/packages/py-transformers/package.py +++ b/var/spack/repos/builtin/packages/py-transformers/package.py @@ -17,6 +17,10 @@ class PyTransformers(PythonPackage): license("Apache-2.0") + version("4.48.3", sha256="a5e8f1e9a6430aa78215836be70cecd3f872d99eeda300f41ad6cc841724afdb") + version("4.46.3", sha256="8ee4b3ae943fe33e82afff8e837f4b052058b07ca9be3cb5b729ed31295f72cc") + version("4.44.2", sha256="36aa17cc92ee154058e426d951684a2dab48751b35b49437896f898931270826") + version("4.42.4", sha256="f956e25e24df851f650cb2c158b6f4352dfae9d702f04c113ed24fc36ce7ae2d") version("4.42.3", sha256="7539873ff45809145265cbc94ea4619d2713c41ceaa277b692d8b0be3430f7eb") version("4.38.1", sha256="86dc84ccbe36123647e84cbd50fc31618c109a41e6be92514b064ab55bf1304c") version("4.35.2", sha256="2d125e197d77b0cdb6c9201df9fa7e2101493272e448b9fba9341c695bee2f52") @@ -31,15 +35,17 @@ class PyTransformers(PythonPackage): depends_on("py-setuptools") with default_args(type=("build", "run")): + depends_on("python@3.9:", when="@4.47:") depends_on("py-filelock") + depends_on("py-huggingface-hub@0.24:0", when="@4.47:") depends_on("py-huggingface-hub@0.23.2:", when="@4.42.3:") depends_on("py-huggingface-hub@0.19.3:", when="@4.38.1:") depends_on("py-huggingface-hub@0.16.4:0", when="@4.34:") depends_on("py-huggingface-hub@0.14.1:0", when="@4.26:") depends_on("py-huggingface-hub@0.10:0", when="@4.24:") depends_on("py-huggingface-hub@0.0.8", when="@4.6.1") - depends_on("py-numpy@1.17:1", when="@4.6:") - depends_on("py-numpy@:1") + depends_on("py-numpy@1.17:", when="@4.6:") + depends_on("py-numpy@:1", when="@:4.42") depends_on("py-packaging@20:", when="@4.24:") depends_on("py-packaging", when="@4.6.1") depends_on("py-pyyaml@5.1:", when="@4.24:") @@ -47,7 +53,9 @@ class PyTransformers(PythonPackage): depends_on("py-requests") depends_on("py-safetensors@0.4.1:", when="@4.38.1:") depends_on("py-safetensors@0.3.1:", when="@4.31:") - depends_on("py-tokenizers@0.19", when="@4.40.0:") + depends_on("py-tokenizers@0.21", when="@4.47:") + depends_on("py-tokenizers@0.20", when="@4.45:4.46") + depends_on("py-tokenizers@0.19", when="@4.40:4.44") depends_on("py-tokenizers@0.14:0.18", when="@4.35:4.39.3") depends_on("py-tokenizers@0.11.1:0.11.2,0.11.4:0.13", when="@4.24:4.33") depends_on("py-tokenizers@0.10.1:0.10", when="@4.6.1") diff --git a/var/spack/repos/builtin/packages/py-triton/package.py b/var/spack/repos/builtin/packages/py-triton/package.py index 43bee5800a1af8..78068e590fc565 100644 --- a/var/spack/repos/builtin/packages/py-triton/package.py +++ b/var/spack/repos/builtin/packages/py-triton/package.py @@ -8,9 +8,9 @@ class PyTriton(PythonPackage): """A language and compiler for custom Deep Learning operations.""" - homepage = "https://github.com/openai/triton" - url = "https://github.com/openai/triton/archive/refs/tags/v2.1.0.tar.gz" - git = "https://github.com/openai/triton.git" + homepage = "https://github.com/triton-lang/triton" + url = "https://github.com/triton-lang/triton/archive/refs/tags/v2.1.0.tar.gz" + git = "https://github.com/triton-lang/triton.git" license("MIT") diff --git a/var/spack/repos/builtin/packages/py-virtualenvwrapper/package.py b/var/spack/repos/builtin/packages/py-virtualenvwrapper/package.py index 7c7e3f44eb4aec..1a764012a82202 100644 --- a/var/spack/repos/builtin/packages/py-virtualenvwrapper/package.py +++ b/var/spack/repos/builtin/packages/py-virtualenvwrapper/package.py @@ -12,16 +12,19 @@ class PyVirtualenvwrapper(PythonPackage): workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.""" - homepage = "https://bitbucket.org/virtualenvwrapper/virtualenvwrapper.git" + homepage = "https://github.com/python-virtualenvwrapper/virtualenvwrapper" pypi = "virtualenvwrapper/virtualenvwrapper-4.8.2.tar.gz" license("MIT") + version("6.1.1", sha256="112e7ea34a9a3ce90aaea54182f0d3afef4d1a913eeb75e98a263b4978cd73c6") + version("6.1.0", sha256="d467beac5a44be00fb5cd1bcf332398c3dab5fb3bd3af7815ea86b4d6bb3d3a4") + version("6.0.0", sha256="4cdaca4a01bb11c3343b01439cf2d76ebe97bb28c4b9a653a9b1f1f7585cd097") version("4.8.4", sha256="51a1a934e7ed0ff221bdd91bf9d3b604d875afbb3aa2367133503fee168f5bfa") version("4.8.2", sha256="18d8e4c500c4c4ee794f704e050cf2bbb492537532a4521d1047e7dd1ee4e374") depends_on("python@2.6:") - depends_on("py-pbr", type="build", when="@4.8.4:") + depends_on("py-pbr", type="build", when="@4.8") depends_on("py-virtualenv", type=("build", "run")) depends_on("py-virtualenv-clone", type=("build", "run")) depends_on("py-stevedore", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-wxpython/package.py b/var/spack/repos/builtin/packages/py-wxpython/package.py index dac58dcd9bb5a9..fe9c44db3bbe97 100644 --- a/var/spack/repos/builtin/packages/py-wxpython/package.py +++ b/var/spack/repos/builtin/packages/py-wxpython/package.py @@ -11,6 +11,7 @@ class PyWxpython(PythonPackage): homepage = "https://www.wxpython.org/" pypi = "wxPython/wxPython-4.0.6.tar.gz" + version("4.2.2", sha256="5dbcb0650f67fdc2c5965795a255ffaa3d7b09fb149aa8da2d0d9aa44e38e2ba") version("4.1.1", sha256="00e5e3180ac7f2852f342ad341d57c44e7e4326de0b550b9a5c4a8361b6c3528") version("4.0.6", sha256="35cc8ae9dd5246e2c9861bb796026bbcb9fb083e4d49650f776622171ecdab37") @@ -18,12 +19,21 @@ class PyWxpython(PythonPackage): depends_on("cxx", type="build") # generated depends_on("wxwidgets +gui") + depends_on("wxwidgets@3.2.6 +gui", when="@4.2.2") + # Needed by the buildtools/config.py script + depends_on("pkgconfig", type="build") # Needed for the build.py script depends_on("py-setuptools", type="build") + depends_on("py-setuptools@:75", type="build", when="@:4.1") # deprecated license-file depends_on("py-pathlib2", type="build") # Needed at runtime depends_on("py-numpy", type=("build", "run")) depends_on("pil", type=("build", "run")) depends_on("py-six", type=("build", "run")) + + def setup_build_environment(self, env): + # By default wxWdigets is built as well instead of using spack provided version, + # this tells it to just build the python extensions + env.set("WXPYTHON_BUILD_ARGS", "build_py --use_syswx") diff --git a/var/spack/repos/builtin/packages/py-xarray-regrid/package.py b/var/spack/repos/builtin/packages/py-xarray-regrid/package.py new file mode 100644 index 00000000000000..e3cf09f3285f49 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-xarray-regrid/package.py @@ -0,0 +1,27 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyXarrayRegrid(PythonPackage): + """Regridding utility for xarray""" + + homepage = "https://github.com/xarray-contrib/xarray-regrid" + pypi = "xarray_regrid/xarray_regrid-0.4.0.tar.gz" + + maintainers("Chrismarsh") + + license("Apache-2.0", checked_by="Chrismarsh") + + version("0.4.0", sha256="f0bef6a346e247c657ed293752b5685f3b559b32de546889ca9e9fca14b81f3a") + + depends_on("py-hatchling", type="build") + + depends_on("python@3.10:", type=("build", "run")) + + depends_on("py-numpy", type=("build", "run")) + depends_on("py-xarray", type=("build", "run")) + depends_on("py-flox", type=("build", "run")) + depends_on("py-scipy", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-xesmf/package.py b/var/spack/repos/builtin/packages/py-xesmf/package.py index c511d8d238bca2..eb8f2fe142c6b3 100644 --- a/var/spack/repos/builtin/packages/py-xesmf/package.py +++ b/var/spack/repos/builtin/packages/py-xesmf/package.py @@ -13,6 +13,7 @@ class PyXesmf(PythonPackage): license("MIT") + version("0.8.8", sha256="8588f83007ce7011379991f516be3691df6fb30486741f0e1c33aa962056ea33") version("0.8.4", sha256="c5a2c4b3e8dbbc9fccd5772a940f9067d68e824215ef87ba222b06718c4eeb56") with default_args(type="build"): @@ -21,9 +22,9 @@ class PyXesmf(PythonPackage): with default_args(type=("build", "run")): depends_on("py-cf-xarray@0.5.1:") - # TODO: add optional dependency - # https://github.com/esmf-org/esmf/tree/develop/src/addon/esmpy - # depends_on("py-esmpy@8:") + + # esmf +python is only handled correctly in spack for 8.4+ + depends_on("esmf@8.4.0: +python") depends_on("py-numba@0.55.2:") depends_on("py-numpy@1.16:") depends_on("py-shapely") diff --git a/var/spack/repos/builtin/packages/py-yt/package.py b/var/spack/repos/builtin/packages/py-yt/package.py index cfed224494fd92..3eb33083600459 100644 --- a/var/spack/repos/builtin/packages/py-yt/package.py +++ b/var/spack/repos/builtin/packages/py-yt/package.py @@ -23,6 +23,7 @@ class PyYt(PythonPackage): license("BSD-3-Clause") + version("4.4.0", sha256="0e15df9cb21abe582f8128bf0705a3bc0f4805f97efd6b4f883073703941c0d5") version("4.1.2", sha256="0ae03288b067721baad14c016f253dc791cd444a1f2dd5d804cf91da622a0c76") version("3.6.1", sha256="be454f9d05dcbe0623328b4df43a1bfd1f0925e516be97399710452931a19bb0") version("3.6.0", sha256="effb00536f19fd2bdc18f67dacd5550b82066a6adce5b928f27a01d7505109ec") @@ -39,14 +40,123 @@ class PyYt(PythonPackage): version("3.2.3", sha256="4d6ccf345d9fab965335c9faf8708c7eea79366b81d77f0f302808be3e82c0ed") version("3.2.2", sha256="78866f51e4751534ad60987000f149a8295952b99b37ca249d45e4d11095a5df") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("astropy", default=True, description="enable astropy support") variant("h5py", default=True, description="enable h5py support") variant("scipy", default=True, description="enable scipy support") variant("rockstar", default=False, description="enable rockstar support") + with when("@4.4.0:"): + # Build dependencies: + depends_on("py-setuptools@61.2:", type="build") + depends_on("py-cython@3.0.3:", type="build") + depends_on("py-numpy@2.0.0:", type="build") + depends_on("py-ewah-bool-utils@1.2.0:", type=("build", "run")) + + # Main dependencies: + depends_on("py-cmyt@1.1.2:", type=("build", "run")) + depends_on("py-matplotlib@3.5:", type=("build", "run")) + depends_on("py-numpy@1.21:2", type=("build", "run")) + conflicts("^py-numpy@2.0.1", when="target=aarch64 platform=darwin") + depends_on("py-pillow@8.3.2:", type=("build", "run")) + depends_on("py-unyt@2.9.2:", type=("build", "run")) + depends_on("py-typing-extensions@4.4.0:", type=("build", "run"), when="^python@:3.11") + + depends_on("py-h5py@3.1.0:", type=("build", "run"), when="+h5py") + conflicts("^py-h5py@3.12.0", when="platform=windows") + + depends_on("py-netcdf4@1.5.3:", type=("build", "run"), when="+netCDF4") + conflicts("^py-netcdf4@1.6.1", when="+netCDF4") + + depends_on("py-f90nml@1.1:", type=("build", "run"), when="+Fortran") + depends_on("py-astropy@4.0.1:", type=("build", "run"), when="+astropy") + + # Extras: + variant("netCDF4", default=False, description="enable netCDF4 support") + variant("Fortran", default=False, description="enable Fortran support") + + variant("adaptahop", default=False, description="enable adaptahop support (no-op)") + variant("ahf", default=False, description="enable ahf support (no-op)") + variant("amrex", default=False, description="enable amrex support (no-op)") + variant("amrvac", default=False, description="enable amrvac support") + variant("art", default=False, description="enable art support (no-op)") + variant("arepo", default=False, description="enable arepo support") + variant("artio", default=False, description="enable artio support (no-op)") + variant("athena", default=False, description="enable athena support (no-op)") + variant("athena_pp", default=False, description="enable athena-pp support (no-op)") + variant("boxlib", default=False, description="enable boxlib support (no-op)") + # variant("cf_radial", default=False, description="enable cf-radial support") + variant("chimera", default=False, description="enable chimera support") + variant("chombo", default=False, description="enable chombo support") + variant("cholla", default=False, description="enable cholla support") + variant("eagle", default=False, description="enable eagle support") + variant("enzo_e", default=False, description="enable enzo-e support") + variant("enzo", default=False, description="enable enzo support") + variant("exodus_ii", default=False, description="enable exodus-ii support") + variant("fits", default=False, description="enable fits support") + variant("flash", default=False, description="enable flash support") + variant("gadget", default=False, description="enable gadget support") + variant("gadget_fof", default=False, description="enable gadget-fof support") + variant("gamer", default=False, description="enable gamer support") + variant("gdf", default=False, description="enable gdf support") + variant("gizmo", default=False, description="enable gizmo support") + variant("halo_catalog", default=False, description="enable halo-catalog support") + variant("http_stream", default=False, description="enable http-stream support") + variant("idefix", default=False, description="enable idefix support") + variant("moab", default=False, description="enable moab support") + variant("nc4_cm1", default=False, description="enable nc4-cm1 support") + variant("open_pmd", default=False, description="enable open-pmd support") + variant("owls", default=False, description="enable owls support") + variant("owls_subfind", default=False, description="enable owls-subfind support") + variant("parthenon", default=False, description="enable parthenon support") + variant("ramses", default=False, description="enable ramses support") + variant("sdf", default=False, description="enable sdf support") + variant("stream", default=False, description="enable stream support (no-op)") + variant("swift", default=False, description="enable swift support") + variant("tipsy", default=False, description="enable tipsy support (no-op)") + variant("ytdata", default=False, description="enable ytdata support") + + conflicts("~Fortran", when="+amrvac") + + conflicts("~h5py", when="+arepo") + # depends_on("py-xarray@0.16.1:", when="+cf_radial", type=('build', 'run')) + # depends_on("py-arm-pyart@1.19.2:", when="+cf_radial", type=('build', 'run')) + conflicts("~h5py", when="+chimera") + conflicts("~h5py", when="+chombo") + conflicts("~h5py", when="+cholla") + conflicts("~h5py", when="+eagle") + conflicts("~h5py", when="+enzo_e") + depends_on("py-libconf@1.0.1:", when="+enzo_e", type=("build", "run")) + conflicts("~h5py", when="+enzo") + depends_on("py-libconf@1.0.1:", when="+enzo", type=("build", "run")) + conflicts("~netCDF4", when="+exodus_ii") + depends_on("py-astropy@4.0.1:", when="+fits", type=("build", "run")) + depends_on("py-regions@0.7:", when="+fits", type=("build", "run")) + conflicts("~h5py", when="+flash") + conflicts("~h5py", when="+gadget") + conflicts("~h5py", when="+gadget_fof") + conflicts("~h5py", when="+gamer") + conflicts("~h5py", when="+gdf") + conflicts("~h5py", when="+gizmo") + conflicts("~h5py", when="+halo_catalog") + depends_on("py-requests@2.20.0:", when="+http_stream", type=("build", "run")) + conflicts("~h5py", when="+idefix") + conflicts("~h5py", when="+moab") + conflicts("~netCDF4", when="+nc4_cm1") + conflicts("~h5py", when="+open_pmd") + conflicts("~h5py", when="+owls") + conflicts("~h5py", when="+owls_subfind") + conflicts("~h5py", when="+parthenon") + conflicts("~Fortran", when="+ramses") + depends_on("py-scipy", when="+ramses", type=("build", "run")) + depends_on("py-requests@2.20.0:", when="+sdf", type=("build", "run")) + conflicts("~h5py", when="+swift") + conflicts("~h5py", when="+ytdata") + + # variant('full', default=False, description='Enable all optional dependencies') + # Main dependencies: # See https://github.com/yt-project/yt/blob/yt-4.1.2/setup.cfg#L40 depends_on("py-cmyt@0.2.2:", type=("build", "run"), when="@4.1.2:") @@ -55,7 +165,7 @@ class PyYt(PythonPackage): depends_on("py-matplotlib@:3.2.2", type=("build", "run"), when="@:3.6.0") depends_on("py-matplotlib@3.1:", type=("build", "run"), when="@4.1.2:") conflicts("^py-matplotlib@3.4.2", when="@4.1.2:") - depends_on("py-more-itertools@8.4:", when="@4.1.2:") + depends_on("py-more-itertools@8.4:", type=("build", "run"), when="@4.1.2:") depends_on("py-numpy@1.10.4:", type=("build", "run")) depends_on("py-numpy@1.14.5:", type=("build", "run"), when="@4.1.2:") # https://github.com/yt-project/yt/pull/4859 @@ -64,7 +174,7 @@ class PyYt(PythonPackage): # PIL/pillow and pyparsing dependency is handled by matplotlib depends_on("py-tomli-w@0.4:", type=("build", "run"), when="@4.1.2:") depends_on("py-tqdm@3.4.0:", type=("build", "run"), when="@4.1.2:") - depends_on("py-unyt@2.8:2", type=("build", "run"), when="@4.1.2:") + depends_on("py-unyt@2.8:2", type=("build", "run"), when="@4.1.2") depends_on("py-importlib-metadata@1.4:", type=("build", "run"), when="@4.1.2: ^python@:3.7") depends_on("py-tomli@1.2.3:", type=("build", "run"), when="@4.1.2: ^python@:3.10") depends_on("py-typing-extensions@4.2:", type=("build", "run"), when="@4.1.2: ^python@:3.7") @@ -73,15 +183,15 @@ class PyYt(PythonPackage): # Extras: # See https://github.com/yt-project/yt/blob/yt-4.1.2/setup.cfg#L80 - depends_on("py-h5py@3.1:3", type=("build", "run"), when="+h5py") + depends_on("py-h5py@3.1:3", type=("build", "run"), when="@:4.1.2 +h5py") depends_on("py-scipy@1.5.0:", type=("build", "run"), when="+scipy") depends_on("rockstar@yt", type=("build", "run"), when="+rockstar") - depends_on("py-astropy@4.0.1:5", type=("build", "run"), when="+astropy") + depends_on("py-astropy@4.0.1:5", type=("build", "run"), when="@:4.1.2 +astropy") # Build dependencies: # See https://github.com/yt-project/yt/blob/yt-4.1.2/pyproject.toml#L2 depends_on("py-cython@0.24:", type="build") - depends_on("py-cython@0.29.21:2", type="build", when="@4.1.2:") + depends_on("py-cython@0.29.21:2", type="build", when="@4.1.2") depends_on("py-wheel@0.36.2:", type="build", when="@4.1.2:") depends_on("py-setuptools@19.6:", type=("build", "run")) depends_on("py-setuptools@59.0.1:", type=("build", "run"), when="@4.1.2:") @@ -99,3 +209,6 @@ def check_install(self): # yt = Executable(join_path(prefix.bin, "yt")) # yt("--help") python(join_path(self.prefix.bin, "yt"), "--help") + + def setup_build_environment(self, env): + env.set("MAX_BUILD_CORES", str(make_jobs)) diff --git a/var/spack/repos/builtin/packages/py-zarr/package.py b/var/spack/repos/builtin/packages/py-zarr/package.py index ce4ad1aff6968f..f2a66edccede7f 100644 --- a/var/spack/repos/builtin/packages/py-zarr/package.py +++ b/var/spack/repos/builtin/packages/py-zarr/package.py @@ -14,6 +14,7 @@ class PyZarr(PythonPackage): license("MIT") + version("3.0.1", sha256="033859c5603dc9c29e53af494ede24b42f1b761d2bb625466990a3b8a9afb792") version("2.17.0", sha256="6390a2b8af31babaab4c963efc45bf1da7f9500c9aafac193f84cf019a7c66b0") version("2.10.2", sha256="5c6ae914ab9215631bb95c09e76b9b9b4fffa70fec0c7bca26b68387d858ebe2") version("2.6.1", sha256="fa7eac1e4ff47ff82d09c42bb4679e18e8a05a73ee81ce59cee6a441a210b2fd") @@ -21,21 +22,33 @@ class PyZarr(PythonPackage): version("2.4.0", sha256="53aa21b989a47ddc5e916eaff6115b824c0864444b1c6f3aaf4f6cf9a51ed608") version("2.3.2", sha256="c62d0158fb287151c978904935a177b3d2d318dea3057cfbeac8541915dfa105") - depends_on("python@3.9:", type=("build", "run"), when="@2.17:") - depends_on("python@3.7:3", type=("build", "run"), when="@2.10") - depends_on("py-setuptools@64:", type="build", when="@2.17:") - depends_on("py-setuptools@38.6.0:", type="build", when="@2.4.0:") - depends_on("py-setuptools@18.0:", type="build") - depends_on("py-setuptools-scm@1.5.5:", type="build") - depends_on("py-asciitree", type=("build", "run")) - depends_on("py-numpy@1.21.1:", type=("build", "run"), when="@2.17:") - depends_on("py-numpy@1.7:", type=("build", "run")) - # https://github.com/zarr-developers/zarr-python/issues/1818 - depends_on("py-numpy@:1", when="@:2.17", type=("build", "run")) - depends_on("py-fasteners", type=("build", "run")) - depends_on("py-numcodecs@0.10:", type=("build", "run"), when="@2.17:") - depends_on("py-numcodecs@0.6.4:", type=("build", "run"), when="@2.4.0:") - depends_on("py-numcodecs@0.6.2:", type=("build", "run")) - - # Historical dependencies - depends_on("py-msgpack", type=("build", "run"), when="@:2.3.2") + with when("@:2"): + depends_on("python@3.9:", type=("build", "run"), when="@2.17:") + depends_on("python@3.7:3", type=("build", "run"), when="@2.10") + depends_on("py-setuptools@64:", type="build", when="@2.17:") + depends_on("py-setuptools@38.6.0:", type="build", when="@2.4.0:") + depends_on("py-setuptools@18.0:", type="build") + depends_on("py-setuptools-scm@1.5.5:", type="build") + + depends_on("py-asciitree", type=("build", "run")) + depends_on("py-numpy@1.21.1:", type=("build", "run"), when="@2.17:") + depends_on("py-numpy@1.7:", type=("build", "run")) + # https://github.com/zarr-developers/zarr-python/issues/1818 + depends_on("py-numpy@:1", when="@:2.17", type=("build", "run")) + depends_on("py-fasteners", type=("build", "run")) + depends_on("py-numcodecs@0.10:", type=("build", "run"), when="@2.17:") + depends_on("py-numcodecs@0.6.4:", type=("build", "run"), when="@2.4.0:") + depends_on("py-numcodecs@0.6.2:", type=("build", "run")) + + # Historical dependencies + depends_on("py-msgpack", type=("build", "run"), when="@:2.3.2") + + with when("@3:"): + depends_on("python@3.11:", type=("build", "run")) + depends_on("py-hatchling", type="build") + depends_on("py-hatch-vcs", type="build") + depends_on("py-packaging@:22.0", type=("build", "run")) + depends_on("py-numpy@0.14:", type=("build", "run")) + depends_on("py-numcodecs@0.14:", type=("build", "run")) + depends_on("py-typing-extensions@4.9:", type=("build", "run")) + depends_on("py-donfig@0.8:", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/pythia6/package.py b/var/spack/repos/builtin/packages/pythia6/package.py index 63dd4b6e3f6c10..f446fbf71c15db 100644 --- a/var/spack/repos/builtin/packages/pythia6/package.py +++ b/var/spack/repos/builtin/packages/pythia6/package.py @@ -40,7 +40,8 @@ class Pythia6(CMakePackage): sha256="01cbff47e99365b5e46f6d62c1735d3cae1932c4710604850d59f538cb758020", ) - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("fortran", type="build") # Root's TPythia6 interface requires extra sources to be built into # the Pythia6 library. diff --git a/var/spack/repos/builtin/packages/pythia8/package.py b/var/spack/repos/builtin/packages/pythia8/package.py index 08306cb0529460..299f2d760b7c62 100644 --- a/var/spack/repos/builtin/packages/pythia8/package.py +++ b/var/spack/repos/builtin/packages/pythia8/package.py @@ -179,7 +179,9 @@ def configure_args(self): args.append("--with-yoda=" + self.spec["yoda"].prefix) args += self.with_or_without("python", activation_value="prefix") - args += self.with_or_without("openmp", activation_value="prefix", variant="openmpi") + args += self.with_or_without( + "openmp", activation_value=lambda x: self.spec["openmpi"].prefix, variant="openmpi" + ) args += self.with_or_without("mpich", activation_value="prefix") args += self.with_or_without("hdf5", activation_value="prefix") diff --git a/var/spack/repos/builtin/packages/python-venv/package.py b/var/spack/repos/builtin/packages/python-venv/package.py index d08dd646bf56a7..f085ccbaa4812b 100644 --- a/var/spack/repos/builtin/packages/python-venv/package.py +++ b/var/spack/repos/builtin/packages/python-venv/package.py @@ -5,8 +5,6 @@ import os import shutil -import llnl.util.filesystem as fs - from spack.package import * @@ -36,7 +34,7 @@ def add_files_to_view(self, view, merge_map: Dict[str, str], skip_if_exists=True # Replace the VIRTUAL_ENV variable in the activate scripts after copying if name.lower().startswith("activate"): shutil.copy(src, dst) - fs.filter_file( + filter_file( self.spec.prefix, os.path.abspath(view.get_projection_for_spec(self.spec)), dst, diff --git a/var/spack/repos/builtin/packages/python/intel-3.7.patch b/var/spack/repos/builtin/packages/python/intel-3.7.patch deleted file mode 100644 index f2277624af27a7..00000000000000 --- a/var/spack/repos/builtin/packages/python/intel-3.7.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 87ed388f41d761ddddc8447e5104569f2436c005 Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Fri, 11 Oct 2019 15:13:51 +0200 -Subject: [PATCH] bpo-37415: Fix stdatomic.h header check for ICC compiler - -Fix stdatomic.h header check for ICC compiler: the ICC implementation -lacks atomic_uintptr_t type which is needed by Python. - -Test: - -* atomic_int and atomic_uintptr_t types -* atomic_load_explicit() and atomic_store_explicit() -* memory_order_relaxed and memory_order_seq_cst constants - -But don't test ATOMIC_VAR_INIT(): it's not used in Python. ---- - configure | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index f1979c1b8124c..1b30a848a77e7 100755 ---- a/configure -+++ b/configure -@@ -16734,9 +16722,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext - - - #include -- atomic_int value = ATOMIC_VAR_INIT(1); -+ atomic_int int_var; -+ atomic_uintptr_t uintptr_var; - int main() { -- int loaded_value = atomic_load(&value); -+ atomic_store_explicit(&int_var, 5, memory_order_relaxed); -+ atomic_store_explicit(&uintptr_var, 0, memory_order_relaxed); -+ int loaded_value = atomic_load_explicit(&int_var, memory_order_seq_cst); - return 0; - } - diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 4f43a408272cdd..34afb2afa03fe5 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -12,13 +12,11 @@ from shutil import copy from typing import Dict, List -import llnl.util.tty as tty from llnl.util.lang import dedupe import spack.paths from spack.build_environment import dso_suffix, stat_suffix from spack.package import * -from spack.util.prefix import Prefix def make_pyvenv_cfg(python_spec: Spec, venv_prefix: str) -> str: @@ -59,61 +57,175 @@ class Python(Package): license("0BSD") + version("3.13.2", sha256="b8d79530e3b7c96a5cb2d40d431ddb512af4a563e863728d8713039aa50203f9") version("3.13.1", sha256="1513925a9f255ef0793dbf2f78bb4533c9f184bdd0ad19763fd7f47a400a7c55") version("3.13.0", sha256="12445c7b3db3126c41190bfdc1c8239c39c719404e844babbd015a1bc3fafcd4") + version("3.12.9", sha256="45313e4c5f0e8acdec9580161d565cf5fea578e3eabf25df7cc6355bf4afa1ee") version("3.12.8", sha256="5978435c479a376648cb02854df3b892ace9ed7d32b1fead652712bee9d03a45") - version("3.12.5", sha256="38dc4e2c261d49c661196066edbfb70fdb16be4a79cc8220c224dfeb5636d405") - version("3.12.4", sha256="01b3c1c082196f3b33168d344a9c85fb07bfe0e7ecfe77fee4443420d1ce2ad9") - version("3.12.3", sha256="a6b9459f45a6ebbbc1af44f5762623fa355a0c87208ed417628b379d762dddb0") - version("3.12.2", sha256="a7c4f6a9dc423d8c328003254ab0c9338b83037bd787d680826a5bf84308116e") - version("3.12.1", sha256="d01ec6a33bc10009b09c17da95cc2759af5a580a7316b3a446eb4190e13f97b2") - version("3.12.0", sha256="51412956d24a1ef7c97f1cb5f70e185c13e3de1f50d131c0aac6338080687afb") - version("3.11.9", sha256="e7de3240a8bc2b1e1ba5c81bf943f06861ff494b69fda990ce2722a504c6153d") - version("3.11.8", sha256="d3019a613b9e8761d260d9ebe3bd4df63976de30464e5c0189566e1ae3f61889") - version("3.11.7", sha256="068c05f82262e57641bd93458dfa883128858f5f4997aad7a36fd25b13b29209") - version("3.11.6", sha256="c049bf317e877cbf9fce8c3af902436774ecef5249a29d10984ca3a37f7f4736") - version("3.11.5", sha256="a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58") - version("3.11.4", sha256="85c37a265e5c9dd9f75b35f954e31fbfc10383162417285e30ad25cc073a0d63") - version("3.11.3", sha256="1a79f3df32265d9e6625f1a0b31c28eb1594df911403d11f3320ee1da1b3e048") - version("3.11.2", sha256="2411c74bda5bbcfcddaf4531f66d1adc73f247f529aee981b029513aefdbf849") - version("3.11.1", sha256="baed518e26b337d4d8105679caf68c5c32630d702614fc174e98cb95c46bdfa4") - version("3.11.0", sha256="64424e96e2457abbac899b90f9530985b51eef2905951febd935f0e73414caeb") - version("3.10.14", sha256="cefea32d3be89c02436711c95a45c7f8e880105514b78680c14fe76f5709a0f6") - version("3.10.13", sha256="698ec55234c1363bd813b460ed53b0f108877c7a133d48bde9a50a1eb57b7e65") - version("3.10.12", sha256="a43cd383f3999a6f4a7db2062b2fc9594fefa73e175b3aedafa295a51a7bb65c") - version("3.10.11", sha256="f3db31b668efa983508bd67b5712898aa4247899a346f2eb745734699ccd3859") - version("3.10.10", sha256="fba64559dde21ebdc953e4565e731573bb61159de8e4d4cedee70fb1196f610d") - version("3.10.9", sha256="4ccd7e46c8898f4c7862910a1703aa0e63525913a519abb2f55e26220a914d88") - version("3.10.8", sha256="f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a") - version("3.10.7", sha256="1b2e4e2df697c52d36731666979e648beeda5941d0f95740aafbf4163e5cc126") - version("3.10.6", sha256="848cb06a5caa85da5c45bd7a9221bb821e33fc2bdcba088c127c58fad44e6343") - version("3.10.5", sha256="18f57182a2de3b0be76dfc39fdcfd28156bb6dd23e5f08696f7492e9e3d0bf2d") - version("3.10.4", sha256="f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28") - version("3.10.3", sha256="5a3b029bad70ba2a019ebff08a65060a8b9b542ffc1a83c697f1449ecca9813b") - version("3.10.2", sha256="3c0ede893011319f9b0a56b44953a3d52c7abf9657c23fb4bc9ced93b86e9c97") - version("3.10.1", sha256="b76117670e7c5064344b9c138e141a377e686b9063f3a8a620ff674fa8ec90d3") - version("3.10.0", sha256="c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758") - version("3.9.19", sha256="f5f9ec8088abca9e399c3b62fd8ef31dbd2e1472c0ccb35070d4d136821aaf71") - version("3.9.18", sha256="504ce8cfd59addc04c22f590377c6be454ae7406cb1ebf6f5a350149225a9354") - version("3.9.17", sha256="8ead58f669f7e19d777c3556b62fae29a81d7f06a7122ff9bc57f7dd82d7e014") - version("3.9.16", sha256="1ad539e9dbd2b42df714b69726e0693bc6b9d2d2c8e91c2e43204026605140c5") - version("3.9.15", sha256="48d1ccb29d5fbaf1fb8f912271d09f7450e426d4dfe95978ef6aaada70ece4d8") - version("3.9.14", sha256="9201836e2c16361b2b7408680502393737d44f227333fe2e5729c7d5f6041675") - version("3.9.13", sha256="829b0d26072a44689a6b0810f5b4a3933ee2a0b8a4bfc99d7c5893ffd4f97c44") - version("3.9.12", sha256="70e08462ebf265012bd2be88a63d2149d880c73e53f1712b7bbbe93750560ae8") - version("3.9.11", sha256="3442400072f582ac2f0df30895558f08883b416c8c7877ea55d40d00d8a93112") - version("3.9.10", sha256="1aa9c0702edbae8f6a2c95f70a49da8420aaa76b7889d3419c186bfc8c0e571e") - version("3.9.9", sha256="2cc7b67c1f3f66c571acc42479cdf691d8ed6b47bee12c9b68430413a17a44ea") - version("3.9.8", sha256="7447fb8bb270942d620dd24faa7814b1383b61fa99029a240025fd81c1db8283") - version("3.9.7", sha256="a838d3f9360d157040142b715db34f0218e535333696a5569dc6f854604eb9d1") - version("3.9.6", sha256="d0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866") - version("3.9.5", sha256="e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab") - version("3.9.4", sha256="66c4de16daa74a825cf9da9ddae1fe020b72c3854b73b1762011cc33f9e4592f") - version("3.9.3", sha256="3afeb61a45b5a2e6f1c0f621bd8cf925a4ff406099fdb3d8c97b993a5f43d048") - version("3.9.2", sha256="7899e8a6f7946748830d66739f2d8f2b30214dad956e56b9ba216b3de5581519") - version("3.9.1", sha256="29cb91ba038346da0bd9ab84a0a55a845d872c341a4da6879f462e94c741f117") - version("3.9.0", sha256="df796b2dc8ef085edae2597a41c1c0a63625ebd92487adaef2fed22b567873e8") + version("3.12.7", sha256="73ac8fe780227bf371add8373c3079f42a0dc62deff8d612cd15a618082ab623") + version("3.11.11", sha256="883bddee3c92fcb91cf9c09c5343196953cbb9ced826213545849693970868ed") + version("3.10.16", sha256="f2e22ed965a93cfeb642378ed6e6cdbc127682664b24123679f3d013fafe9cd0") + version("3.9.21", sha256="667c3ba2ca98d39ead1162f6548c3475768582e2ff89e0821d25eb956ac09944") + + # EOL versions we still want to be able to install + with default_args(deprecated=True): + version( + "3.8.20", sha256="9f2d5962c2583e67ef75924cd56d0c1af78bf45ec57035cf8a2cc09f74f4bf78" + ) + version( + "3.7.17", sha256="fd50161bc2a04f4c22a0971ff0f3856d98b4bf294f89740a9f06b520aae63b49" + ) + version( + "3.6.15", sha256="54570b7e339e2cfd72b29c7e2fdb47c0b7b18b7412e61de5b463fc087c13b043" + ) + + # Old patch versions to be removed in the next Spack version with default_args(deprecated=True): + version( + "3.12.6", sha256="85a4c1be906d20e5c5a69f2466b00da769c221d6a684acfd3a514dbf5bf10a66" + ) + version( + "3.12.5", sha256="38dc4e2c261d49c661196066edbfb70fdb16be4a79cc8220c224dfeb5636d405" + ) + version( + "3.12.4", sha256="01b3c1c082196f3b33168d344a9c85fb07bfe0e7ecfe77fee4443420d1ce2ad9" + ) + version( + "3.12.3", sha256="a6b9459f45a6ebbbc1af44f5762623fa355a0c87208ed417628b379d762dddb0" + ) + version( + "3.12.2", sha256="a7c4f6a9dc423d8c328003254ab0c9338b83037bd787d680826a5bf84308116e" + ) + version( + "3.12.1", sha256="d01ec6a33bc10009b09c17da95cc2759af5a580a7316b3a446eb4190e13f97b2" + ) + version( + "3.12.0", sha256="51412956d24a1ef7c97f1cb5f70e185c13e3de1f50d131c0aac6338080687afb" + ) + version( + "3.11.10", sha256="92f2faf242681bfa406d53a51e17d42c5373affe23a130cd9697e132ef574706" + ) + version( + "3.11.9", sha256="e7de3240a8bc2b1e1ba5c81bf943f06861ff494b69fda990ce2722a504c6153d" + ) + version( + "3.11.8", sha256="d3019a613b9e8761d260d9ebe3bd4df63976de30464e5c0189566e1ae3f61889" + ) + version( + "3.11.7", sha256="068c05f82262e57641bd93458dfa883128858f5f4997aad7a36fd25b13b29209" + ) + version( + "3.11.6", sha256="c049bf317e877cbf9fce8c3af902436774ecef5249a29d10984ca3a37f7f4736" + ) + version( + "3.11.5", sha256="a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58" + ) + version( + "3.11.4", sha256="85c37a265e5c9dd9f75b35f954e31fbfc10383162417285e30ad25cc073a0d63" + ) + version( + "3.11.3", sha256="1a79f3df32265d9e6625f1a0b31c28eb1594df911403d11f3320ee1da1b3e048" + ) + version( + "3.11.2", sha256="2411c74bda5bbcfcddaf4531f66d1adc73f247f529aee981b029513aefdbf849" + ) + version( + "3.11.1", sha256="baed518e26b337d4d8105679caf68c5c32630d702614fc174e98cb95c46bdfa4" + ) + version( + "3.11.0", sha256="64424e96e2457abbac899b90f9530985b51eef2905951febd935f0e73414caeb" + ) + version( + "3.10.15", sha256="a27864e5ba2a4474f8f6c58ab92ff52767ac8b66f1646923355a53fe3ef15074" + ) + version( + "3.10.14", sha256="cefea32d3be89c02436711c95a45c7f8e880105514b78680c14fe76f5709a0f6" + ) + version( + "3.10.13", sha256="698ec55234c1363bd813b460ed53b0f108877c7a133d48bde9a50a1eb57b7e65" + ) + version( + "3.10.12", sha256="a43cd383f3999a6f4a7db2062b2fc9594fefa73e175b3aedafa295a51a7bb65c" + ) + version( + "3.10.11", sha256="f3db31b668efa983508bd67b5712898aa4247899a346f2eb745734699ccd3859" + ) + version( + "3.10.10", sha256="fba64559dde21ebdc953e4565e731573bb61159de8e4d4cedee70fb1196f610d" + ) + version( + "3.10.9", sha256="4ccd7e46c8898f4c7862910a1703aa0e63525913a519abb2f55e26220a914d88" + ) + version( + "3.10.8", sha256="f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a" + ) + version( + "3.10.7", sha256="1b2e4e2df697c52d36731666979e648beeda5941d0f95740aafbf4163e5cc126" + ) + version( + "3.10.6", sha256="848cb06a5caa85da5c45bd7a9221bb821e33fc2bdcba088c127c58fad44e6343" + ) + version( + "3.10.5", sha256="18f57182a2de3b0be76dfc39fdcfd28156bb6dd23e5f08696f7492e9e3d0bf2d" + ) + version( + "3.10.4", sha256="f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28" + ) + version( + "3.10.3", sha256="5a3b029bad70ba2a019ebff08a65060a8b9b542ffc1a83c697f1449ecca9813b" + ) + version( + "3.10.2", sha256="3c0ede893011319f9b0a56b44953a3d52c7abf9657c23fb4bc9ced93b86e9c97" + ) + version( + "3.10.1", sha256="b76117670e7c5064344b9c138e141a377e686b9063f3a8a620ff674fa8ec90d3" + ) + version( + "3.10.0", sha256="c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758" + ) + version( + "3.9.20", sha256="1e71f006222666e0a39f5a47be8221415c22c4dd8f25334cc41aee260b3d379e" + ) + version( + "3.9.19", sha256="f5f9ec8088abca9e399c3b62fd8ef31dbd2e1472c0ccb35070d4d136821aaf71" + ) + version( + "3.9.18", sha256="504ce8cfd59addc04c22f590377c6be454ae7406cb1ebf6f5a350149225a9354" + ) + version( + "3.9.17", sha256="8ead58f669f7e19d777c3556b62fae29a81d7f06a7122ff9bc57f7dd82d7e014" + ) + version( + "3.9.16", sha256="1ad539e9dbd2b42df714b69726e0693bc6b9d2d2c8e91c2e43204026605140c5" + ) + version( + "3.9.15", sha256="48d1ccb29d5fbaf1fb8f912271d09f7450e426d4dfe95978ef6aaada70ece4d8" + ) + version( + "3.9.14", sha256="9201836e2c16361b2b7408680502393737d44f227333fe2e5729c7d5f6041675" + ) + version( + "3.9.13", sha256="829b0d26072a44689a6b0810f5b4a3933ee2a0b8a4bfc99d7c5893ffd4f97c44" + ) + version( + "3.9.12", sha256="70e08462ebf265012bd2be88a63d2149d880c73e53f1712b7bbbe93750560ae8" + ) + version( + "3.9.11", sha256="3442400072f582ac2f0df30895558f08883b416c8c7877ea55d40d00d8a93112" + ) + version( + "3.9.10", sha256="1aa9c0702edbae8f6a2c95f70a49da8420aaa76b7889d3419c186bfc8c0e571e" + ) + version("3.9.9", sha256="2cc7b67c1f3f66c571acc42479cdf691d8ed6b47bee12c9b68430413a17a44ea") + version("3.9.8", sha256="7447fb8bb270942d620dd24faa7814b1383b61fa99029a240025fd81c1db8283") + version("3.9.7", sha256="a838d3f9360d157040142b715db34f0218e535333696a5569dc6f854604eb9d1") + version("3.9.6", sha256="d0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866") + version("3.9.5", sha256="e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab") + version("3.9.4", sha256="66c4de16daa74a825cf9da9ddae1fe020b72c3854b73b1762011cc33f9e4592f") + version("3.9.3", sha256="3afeb61a45b5a2e6f1c0f621bd8cf925a4ff406099fdb3d8c97b993a5f43d048") + version("3.9.2", sha256="7899e8a6f7946748830d66739f2d8f2b30214dad956e56b9ba216b3de5581519") + version("3.9.1", sha256="29cb91ba038346da0bd9ab84a0a55a845d872c341a4da6879f462e94c741f117") + version("3.9.0", sha256="df796b2dc8ef085edae2597a41c1c0a63625ebd92487adaef2fed22b567873e8") version( "3.8.19", sha256="c7fa55a36e5c7a19ec37d8f90f60a2197548908c9ac8b31e7c0dbffdd470eeac" ) @@ -154,15 +266,9 @@ class Python(Package): version("3.8.2", sha256="e634a7a74776c2b89516b2e013dda1728c89c8149b9863b8cea21946daf9d561") version("3.8.1", sha256="c7cfa39a43b994621b245e029769e9126caa2a93571cee2e743b213cceac35fb") version("3.8.0", sha256="f1069ad3cae8e7ec467aa98a6565a62a48ef196cb8f1455a245a08db5e1792df") - version( - "3.7.17", sha256="fd50161bc2a04f4c22a0971ff0f3856d98b4bf294f89740a9f06b520aae63b49" - ) - version( - "3.6.15", sha256="54570b7e339e2cfd72b29c7e2fdb47c0b7b18b7412e61de5b463fc087c13b043" - ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") extendable = True @@ -251,8 +357,6 @@ class Python(Package): # C/C++ modules, consider installing a Spack-managed Python with # this patch instead. For more information, see: # https://github.com/spack/spack/pull/16856 - patch("python-3.7.2-distutils-C++.patch", when="@3.7.2") - patch("python-3.7.3-distutils-C++.patch", when="@3.7.3") patch("python-3.7.4+-distutils-C++.patch", when="@3.7.4:3.10") patch("python-3.7.4+-distutils-C++-testsuite.patch", when="@3.7.4:3.11") patch("python-3.11-distutils-C++.patch", when="@3.11.0:3.11") @@ -271,10 +375,6 @@ class Python(Package): patch("fj-rpath-3.1.patch", when="@:3.9.7,3.10.0 %fj") patch("fj-rpath-3.9.patch", when="@3.9.8:3.9,3.10.1:3.11 %fj") - # Fixes build with the Intel compilers - # https://github.com/python/cpython/pull/16717 - patch("intel-3.7.patch", when="@3.7.1:3.7.5 %intel") - # CPython tries to build an Objective-C file with GCC's C frontend # https://github.com/spack/spack/pull/16222 # https://github.com/python/cpython/pull/13306 @@ -388,6 +488,11 @@ def patch(self): r"^(.*)setup\.py(.*)((build)|(install))(.*)$", r"\1setup.py\2 --no-user-cfg \3\6" ) + # limit the number of processes to use for compileall in older Python versions + # https://github.com/python/cpython/commit/9a7e9f9921804f3f90151ca42703e612697dd430 + if self.spec.satisfies("@:3.11"): + ff.filter("-j0 ", f"-j{make_jobs} ") + # disable building the nis module (there is no flag to disable it). if self.spec.satisfies("@3.8:3.10"): filter_file( @@ -689,7 +794,7 @@ def install(self, spec, prefix): self.win_installer(prefix) else: # See https://github.com/python/cpython/issues/102007 - make(*self.install_targets, parallel=False) + make(*self.install_targets, f"COMPILEALL_OPTS=-j{make_jobs}", parallel=False) @run_after("install") def filter_compilers(self): diff --git a/var/spack/repos/builtin/packages/python/python-3.7.2-distutils-C++.patch b/var/spack/repos/builtin/packages/python/python-3.7.2-distutils-C++.patch deleted file mode 100644 index 5728fad6f77f33..00000000000000 --- a/var/spack/repos/builtin/packages/python/python-3.7.2-distutils-C++.patch +++ /dev/null @@ -1,241 +0,0 @@ ---- a/Lib/_osx_support.py -+++ b/Lib/_osx_support.py -@@ -14,13 +14,13 @@ __all__ = [ - # configuration variables that may contain universal build flags, - # like "-arch" or "-isdkroot", that may need customization for - # the user environment --_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', -- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX', -- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', -- 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS') -+_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS', -+ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED', -+ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', -+ 'PY_CPPFLAGS', 'PY_CORE_LDFLAGS', 'PY_CORE_CFLAGS') - - # configuration variables that may contain compiler calls --_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX') -+_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX') - - # prefix added to original configuration variable names - _INITPRE = '_OSX_SUPPORT_INITIAL_' ---- a/Lib/distutils/cygwinccompiler.py -+++ b/Lib/distutils/cygwinccompiler.py -@@ -125,8 +125,10 @@ class CygwinCCompiler(UnixCCompiler): - # dllwrap 2.10.90 is buggy - if self.ld_version >= "2.10.90": - self.linker_dll = "gcc" -+ self.linker_dll_cxx = "g++" - else: - self.linker_dll = "dllwrap" -+ self.linker_dll_cxx = "dllwrap" - - # ld_version >= "2.13" support -shared so use it instead of - # -mdll -static -@@ -140,9 +142,13 @@ class CygwinCCompiler(UnixCCompiler): - self.set_executables(compiler='gcc -mcygwin -O -Wall', - compiler_so='gcc -mcygwin -mdll -O -Wall', - compiler_cxx='g++ -mcygwin -O -Wall', -+ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall', - linker_exe='gcc -mcygwin', - linker_so=('%s -mcygwin %s' % -- (self.linker_dll, shared_option))) -+ (self.linker_dll, shared_option)), -+ linker_exe_cxx='g++ -mcygwin', -+ linker_so_cxx=('%s -mcygwin %s' % -+ (self.linker_dll_cxx, shared_option))) - - # cygwin and mingw32 need different sets of libraries - if self.gcc_version == "2.91.57": -@@ -166,8 +172,12 @@ class CygwinCCompiler(UnixCCompiler): - raise CompileError(msg) - else: # for other files use the C-compiler - try: -- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + -- extra_postargs) -+ if self.detect_language(src) == 'c++': -+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + -+ extra_postargs) -+ else: -+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + -+ extra_postargs) - except DistutilsExecError as msg: - raise CompileError(msg) - -@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler): - self.set_executables(compiler='gcc -O -Wall', - compiler_so='gcc -mdll -O -Wall', - compiler_cxx='g++ -O -Wall', -+ compiler_so_cxx='g++ -mdll -O -Wall', - linker_exe='gcc', - linker_so='%s %s %s' - % (self.linker_dll, shared_option, -+ entry_point), -+ linker_exe_cxx='g++', -+ linker_so_cxx='%s %s %s' -+ % (self.linker_dll_cxx, shared_option, - entry_point)) - # Maybe we should also append -mthreads, but then the finished - # dlls need another dll (mingwm10.dll see Mingw32 docs) ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -170,9 +170,11 @@ def customize_compiler(compiler): - _osx_support.customize_compiler(_config_vars) - _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' - -- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ -- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', -- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') -+ (cc, cxx, cflags, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \ -+ get_config_vars('CC', 'CXX', 'CFLAGS', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED', -+ 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') -+ -+ cxxflags = cflags - - if 'CC' in os.environ: - newcc = os.environ['CC'] -@@ -187,19 +189,27 @@ def customize_compiler(compiler): - cxx = os.environ['CXX'] - if 'LDSHARED' in os.environ: - ldshared = os.environ['LDSHARED'] -+ if 'LDCXXSHARED' in os.environ: -+ ldcxxshared = os.environ['LDCXXSHARED'] - if 'CPP' in os.environ: - cpp = os.environ['CPP'] - else: - cpp = cc + " -E" # not always - if 'LDFLAGS' in os.environ: - ldshared = ldshared + ' ' + os.environ['LDFLAGS'] -+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] - if 'CFLAGS' in os.environ: -- cflags = opt + ' ' + os.environ['CFLAGS'] -+ cflags = os.environ['CFLAGS'] - ldshared = ldshared + ' ' + os.environ['CFLAGS'] -+ if 'CXXFLAGS' in os.environ: -+ cxxflags = os.environ['CXXFLAGS'] -+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] - if 'CPPFLAGS' in os.environ: - cpp = cpp + ' ' + os.environ['CPPFLAGS'] - cflags = cflags + ' ' + os.environ['CPPFLAGS'] -+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] - ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] -+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] - if 'AR' in os.environ: - ar = os.environ['AR'] - if 'ARFLAGS' in os.environ: -@@ -208,13 +218,17 @@ def customize_compiler(compiler): - archiver = ar + ' ' + ar_flags - - cc_cmd = cc + ' ' + cflags -+ cxx_cmd = cxx + ' ' + cxxflags - compiler.set_executables( - preprocessor=cpp, - compiler=cc_cmd, - compiler_so=cc_cmd + ' ' + ccshared, -- compiler_cxx=cxx, -+ compiler_cxx=cxx_cmd, -+ compiler_so_cxx=cxx_cmd + ' ' + ccshared, - linker_so=ldshared, - linker_exe=cc, -+ linker_so_cxx=ldcxxshared, -+ linker_exe_cxx=cxx, - archiver=archiver) - - compiler.shared_lib_extension = shlib_suffix ---- a/Lib/distutils/unixccompiler.py -+++ b/Lib/distutils/unixccompiler.py -@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler): - # are pretty generic; they will probably have to be set by an outsider - # (eg. using information discovered by the sysconfig about building - # Python extensions). -- executables = {'preprocessor' : None, -- 'compiler' : ["cc"], -- 'compiler_so' : ["cc"], -- 'compiler_cxx' : ["cc"], -- 'linker_so' : ["cc", "-shared"], -- 'linker_exe' : ["cc"], -- 'archiver' : ["ar", "-cr"], -- 'ranlib' : None, -+ executables = {'preprocessor' : None, -+ 'compiler' : ["cc"], -+ 'compiler_so' : ["cc"], -+ 'compiler_cxx' : ["c++"], -+ 'compiler_so_cxx' : ["c++"], -+ 'linker_so' : ["cc", "-shared"], -+ 'linker_exe' : ["cc"], -+ 'linker_so_cxx' : ["c++", "-shared"], -+ 'linker_exe_cxx' : ["c++"], -+ 'archiver' : ["ar", "-cr"], -+ 'ranlib' : None, - } - - if sys.platform[:6] == "darwin": -@@ -110,12 +113,19 @@ class UnixCCompiler(CCompiler): - - def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): - compiler_so = self.compiler_so -+ compiler_so_cxx = self.compiler_so_cxx - if sys.platform == 'darwin': - compiler_so = _osx_support.compiler_fixup(compiler_so, - cc_args + extra_postargs) -+ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx, -+ cc_args + extra_postargs) - try: -- self.spawn(compiler_so + cc_args + [src, '-o', obj] + -- extra_postargs) -+ if self.detect_language(src) == 'c++': -+ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] + -+ extra_postargs) -+ else: -+ self.spawn(compiler_so + cc_args + [src, '-o', obj] + -+ extra_postargs) - except DistutilsExecError as msg: - raise CompileError(msg) - -@@ -173,22 +183,16 @@ class UnixCCompiler(CCompiler): - ld_args.extend(extra_postargs) - self.mkpath(os.path.dirname(output_filename)) - try: -- if target_desc == CCompiler.EXECUTABLE: -- linker = self.linker_exe[:] -+ if target_lang == "c++": -+ if target_desc == CCompiler.EXECUTABLE: -+ linker = self.linker_exe_cxx[:] -+ else: -+ linker = self.linker_so_cxx[:] - else: -- linker = self.linker_so[:] -- if target_lang == "c++" and self.compiler_cxx: -- # skip over environment variable settings if /usr/bin/env -- # is used to set up the linker's environment. -- # This is needed on OSX. Note: this assumes that the -- # normal and C++ compiler have the same environment -- # settings. -- i = 0 -- if os.path.basename(linker[0]) == "env": -- i = 1 -- while '=' in linker[i]: -- i += 1 -- linker[i] = self.compiler_cxx[i] -+ if target_desc == CCompiler.EXECUTABLE: -+ linker = self.linker_exe[:] -+ else: -+ linker = self.linker_so[:] - - if sys.platform == 'darwin': - linker = _osx_support.compiler_fixup(linker, ld_args) ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -584,10 +584,10 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CFLAGS='$(PY_CFLAGS)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CFLAGS='$(PY_CFLAGS)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/var/spack/repos/builtin/packages/python/python-3.7.3-distutils-C++.patch b/var/spack/repos/builtin/packages/python/python-3.7.3-distutils-C++.patch deleted file mode 100644 index e29323bf0b51b3..00000000000000 --- a/var/spack/repos/builtin/packages/python/python-3.7.3-distutils-C++.patch +++ /dev/null @@ -1,256 +0,0 @@ -diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py -index db6674e..ccbe09a 100644 ---- a/Lib/_osx_support.py -+++ b/Lib/_osx_support.py -@@ -14,13 +14,13 @@ __all__ = [ - # configuration variables that may contain universal build flags, - # like "-arch" or "-isdkroot", that may need customization for - # the user environment --_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', -- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX', -- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', -- 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS') -+_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS', -+ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED', -+ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', -+ 'PY_CPPFLAGS', 'PY_CORE_LDFLAGS', 'PY_CORE_CFLAGS') - - # configuration variables that may contain compiler calls --_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX') -+_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX') - - # prefix added to original configuration variable names - _INITPRE = '_OSX_SUPPORT_INITIAL_' -diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py -index 6c5d777..640fa2d 100644 ---- a/Lib/distutils/cygwinccompiler.py -+++ b/Lib/distutils/cygwinccompiler.py -@@ -125,8 +125,10 @@ class CygwinCCompiler(UnixCCompiler): - # dllwrap 2.10.90 is buggy - if self.ld_version >= "2.10.90": - self.linker_dll = "gcc" -+ self.linker_dll_cxx = "g++" - else: - self.linker_dll = "dllwrap" -+ self.linker_dll_cxx = "dllwrap" - - # ld_version >= "2.13" support -shared so use it instead of - # -mdll -static -@@ -140,9 +142,13 @@ class CygwinCCompiler(UnixCCompiler): - self.set_executables(compiler='gcc -mcygwin -O -Wall', - compiler_so='gcc -mcygwin -mdll -O -Wall', - compiler_cxx='g++ -mcygwin -O -Wall', -+ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall', - linker_exe='gcc -mcygwin', - linker_so=('%s -mcygwin %s' % -- (self.linker_dll, shared_option))) -+ (self.linker_dll, shared_option)), -+ linker_exe_cxx='g++ -mcygwin', -+ linker_so_cxx=('%s -mcygwin %s' % -+ (self.linker_dll_cxx, shared_option))) - - # cygwin and mingw32 need different sets of libraries - if self.gcc_version == "2.91.57": -@@ -166,8 +172,12 @@ class CygwinCCompiler(UnixCCompiler): - raise CompileError(msg) - else: # for other files use the C-compiler - try: -- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + -- extra_postargs) -+ if self.detect_language(src) == 'c++': -+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + -+ extra_postargs) -+ else: -+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + -+ extra_postargs) - except DistutilsExecError as msg: - raise CompileError(msg) - -@@ -302,9 +312,14 @@ class Mingw32CCompiler(CygwinCCompiler): - self.set_executables(compiler='gcc -O -Wall', - compiler_so='gcc -mdll -O -Wall', - compiler_cxx='g++ -O -Wall', -+ compiler_so_cxx='g++ -mdll -O -Wall', - linker_exe='gcc', - linker_so='%s %s %s' - % (self.linker_dll, shared_option, -+ entry_point), -+ linker_exe_cxx='g++', -+ linker_so_cxx='%s %s %s' -+ % (self.linker_dll_cxx, shared_option, - entry_point)) - # Maybe we should also append -mthreads, but then the finished - # dlls need another dll (mingwm10.dll see Mingw32 docs) -diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index 83160f8..b735369 100644 ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -183,9 +183,11 @@ def customize_compiler(compiler): - _osx_support.customize_compiler(_config_vars) - _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' - -- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ -+ (cc, cxx, opt, cflags, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \ - get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', -- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') -+ 'CCSHARED', 'LDSHARED', 'LDCXXSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') -+ -+ cxxflags = cflags - - if 'CC' in os.environ: - newcc = os.environ['CC'] -@@ -200,19 +202,27 @@ def customize_compiler(compiler): - cxx = os.environ['CXX'] - if 'LDSHARED' in os.environ: - ldshared = os.environ['LDSHARED'] -+ if 'LDCXXSHARED' in os.environ: -+ ldcxxshared = os.environ['LDCXXSHARED'] - if 'CPP' in os.environ: - cpp = os.environ['CPP'] - else: - cpp = cc + " -E" # not always - if 'LDFLAGS' in os.environ: - ldshared = ldshared + ' ' + os.environ['LDFLAGS'] -+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] - if 'CFLAGS' in os.environ: - cflags = opt + ' ' + os.environ['CFLAGS'] - ldshared = ldshared + ' ' + os.environ['CFLAGS'] -+ if 'CXXFLAGS' in os.environ: -+ cxxflags = opt + ' ' + os.environ['CXXFLAGS'] -+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] - if 'CPPFLAGS' in os.environ: - cpp = cpp + ' ' + os.environ['CPPFLAGS'] -+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] - cflags = cflags + ' ' + os.environ['CPPFLAGS'] - ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] -+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] - if 'AR' in os.environ: - ar = os.environ['AR'] - if 'ARFLAGS' in os.environ: -@@ -221,13 +231,17 @@ def customize_compiler(compiler): - archiver = ar + ' ' + ar_flags - - cc_cmd = cc + ' ' + cflags -+ cxx_cmd = cxx + ' ' + cxxflags - compiler.set_executables( - preprocessor=cpp, - compiler=cc_cmd, - compiler_so=cc_cmd + ' ' + ccshared, -- compiler_cxx=cxx, -+ compiler_cxx=cxx_cmd, -+ compiler_so_cxx=cxx_cmd + ' ' + ccshared, - linker_so=ldshared, - linker_exe=cc, -+ linker_so_cxx=ldcxxshared, -+ linker_exe_cxx=cxx, - archiver=archiver) - - compiler.shared_lib_extension = shlib_suffix -diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py -index d10a78d..7e88781 100644 ---- a/Lib/distutils/unixccompiler.py -+++ b/Lib/distutils/unixccompiler.py -@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler): - # are pretty generic; they will probably have to be set by an outsider - # (eg. using information discovered by the sysconfig about building - # Python extensions). -- executables = {'preprocessor' : None, -- 'compiler' : ["cc"], -- 'compiler_so' : ["cc"], -- 'compiler_cxx' : ["cc"], -- 'linker_so' : ["cc", "-shared"], -- 'linker_exe' : ["cc"], -- 'archiver' : ["ar", "-cr"], -- 'ranlib' : None, -+ executables = {'preprocessor' : None, -+ 'compiler' : ["cc"], -+ 'compiler_so' : ["cc"], -+ 'compiler_cxx' : ["c++"], -+ 'compiler_so_cxx' : ["c++"], -+ 'linker_so' : ["cc", "-shared"], -+ 'linker_exe' : ["cc"], -+ 'linker_so_cxx' : ["c++", "-shared"], -+ 'linker_exe_cxx' : ["c++"], -+ 'archiver' : ["ar", "-cr"], -+ 'ranlib' : None, - } - - if sys.platform[:6] == "darwin": -@@ -110,12 +113,19 @@ class UnixCCompiler(CCompiler): - - def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): - compiler_so = self.compiler_so -+ compiler_so_cxx = self.compiler_so_cxx - if sys.platform == 'darwin': - compiler_so = _osx_support.compiler_fixup(compiler_so, - cc_args + extra_postargs) -+ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx, -+ cc_args + extra_postargs) - try: -- self.spawn(compiler_so + cc_args + [src, '-o', obj] + -- extra_postargs) -+ if self.detect_language(src) == 'c++': -+ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] + -+ extra_postargs) -+ else: -+ self.spawn(compiler_so + cc_args + [src, '-o', obj] + -+ extra_postargs) - except DistutilsExecError as msg: - raise CompileError(msg) - -@@ -173,30 +183,16 @@ class UnixCCompiler(CCompiler): - ld_args.extend(extra_postargs) - self.mkpath(os.path.dirname(output_filename)) - try: -- if target_desc == CCompiler.EXECUTABLE: -- linker = self.linker_exe[:] -+ if target_lang == "c++": -+ if target_desc == CCompiler.EXECUTABLE: -+ linker = self.linker_exe_cxx[:] -+ else: -+ linker = self.linker_so_cxx[:] - else: -- linker = self.linker_so[:] -- if target_lang == "c++" and self.compiler_cxx: -- # skip over environment variable settings if /usr/bin/env -- # is used to set up the linker's environment. -- # This is needed on OSX. Note: this assumes that the -- # normal and C++ compiler have the same environment -- # settings. -- i = 0 -- if os.path.basename(linker[0]) == "env": -- i = 1 -- while '=' in linker[i]: -- i += 1 -- -- if os.path.basename(linker[i]) == 'ld_so_aix': -- # AIX platforms prefix the compiler with the ld_so_aix -- # script, so we need to adjust our linker index -- offset = 1 -+ if target_desc == CCompiler.EXECUTABLE: -+ linker = self.linker_exe[:] - else: -- offset = 0 -- -- linker[i+offset] = self.compiler_cxx[i] -+ linker = self.linker_so[:] - - if sys.platform == 'darwin': - linker = _osx_support.compiler_fixup(linker, ld_args) -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 2d2e11f..8456e3f 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -615,10 +615,10 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -- echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CFLAGS='$(PY_CFLAGS)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \ -- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ -+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' CFLAGS='$(PY_CFLAGS)' \ - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ - $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - diff --git a/var/spack/repos/builtin/packages/qemacs/package.py b/var/spack/repos/builtin/packages/qemacs/package.py index a34bd0b8a47359..ba014eb3bb9403 100644 --- a/var/spack/repos/builtin/packages/qemacs/package.py +++ b/var/spack/repos/builtin/packages/qemacs/package.py @@ -15,6 +15,7 @@ class Qemacs(MakefilePackage): maintainers("Buldram") version("master", branch="master") + version("6.4.1", commit="43b5851958ee13fe0b96cf92b5cfc0aaa085d740") version("6.3.3", commit="e3c5bfd457614773508feefdc12dbc60073030ed") version("6.3.2", commit="0e90c181078f3d85d0d44d985d541184223668e1") version("6.3.1", commit="288eeb450e534a39adb337396aa9ffcdc629f94e") @@ -24,18 +25,17 @@ class Qemacs(MakefilePackage): depends_on("which", type="build") - variant("docs", default=False, description="Build documentation") + variant("doc", default=True, description="Install documentation") variant("plugins", default=False, description="Enable plugin support") variant("X", default=False, description="Build with X11 support") variant("png", default=True, when="+X", description="Build with PNG support") variant("xshm", default=True, when="+X", description="Build with XShm support") variant("xv", default=True, when="+X", description="Build with X Video support") - conflicts("+docs", when="platform=freebsd") conflicts("+plugins", when="platform=freebsd") conflicts("+plugins", when="platform=darwin") + conflicts("+plugins", when="platform=windows") - depends_on("texi2html", type="build", when="+docs") depends_on("libx11", type="link", when="+X") depends_on("libxcb", type="link", when="+X") depends_on("libxau", type="link", when="+X") @@ -57,3 +57,17 @@ def edit(self, spec, prefix): "--disable-ffmpeg", # Currently broken "--disable-xrender", # Currently broken ) + + if spec.satisfies("~doc"): + filter_file( + "$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1", "", "Makefile", string=True + ) + filter_file( + "$(INSTALL) -m 644 qe.1 $(DESTDIR)$(mandir)/man1", "", "Makefile", string=True + ) + + @run_after("install", when="+doc") + def install_docs(self): + doc_dir = self.prefix.share.join("qe") + install("config.eg", doc_dir) + install("qe-doc.html", doc_dir) diff --git a/var/spack/repos/builtin/packages/qgis/package.py b/var/spack/repos/builtin/packages/qgis/package.py index cbc87e63618e97..f49cc5249b04b1 100644 --- a/var/spack/repos/builtin/packages/qgis/package.py +++ b/var/spack/repos/builtin/packages/qgis/package.py @@ -198,7 +198,7 @@ class Qgis(CMakePackage): @run_before("cmake", when="^py-pyqt5") def fix_pyqt5_cmake(self): cmfile = FileFilter(join_path("cmake", "FindPyQt5.cmake")) - pyqtpath = join_path(self.spec["py-pyqt5"].package.module.python_platlib, "PyQt5") + pyqtpath = join_path(self["py-pyqt5"].module.python_platlib, "PyQt5") cmfile.filter( 'SET(PYQT5_MOD_DIR "${Python_SITEARCH}/PyQt5")', 'SET(PYQT5_MOD_DIR "' + pyqtpath + '")', diff --git a/var/spack/repos/builtin/packages/qmcpack/package.py b/var/spack/repos/builtin/packages/qmcpack/package.py index 879c6233c02c9d..cd6095f4f385a0 100644 --- a/var/spack/repos/builtin/packages/qmcpack/package.py +++ b/var/spack/repos/builtin/packages/qmcpack/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.tty as tty from spack.package import * @@ -17,13 +16,14 @@ class Qmcpack(CMakePackage, CudaPackage): maintainers("ye-luo") tags = ["ecp", "ecp-apps"] - license("CC0-1.0") + license("NCSA", checked_by="prckent") # This download method is untrusted, and is not recommended by the # Spack manual. However, it is easier to maintain because github hashes # can occasionally change. # NOTE: 12/19/2017 QMCPACK 3.0.0 does not build properly with Spack. version("develop") + version("4.0.0", tag="v4.0.0", commit="0199944fb644b4798446fdfc0549c81666a4a943") version("3.17.1", tag="v3.17.1", commit="9d0d968139fc33f71dbf9159f526dd7b47f10a3b") version("3.17.0", tag="v3.17.0", commit="9049a90626d1fe3c431f55c56a7197f8a13d5fc6") version("3.16.0", tag="v3.16.0", commit="5b7544c40be105b0aafa1602601ccb0cf23ea547") diff --git a/var/spack/repos/builtin/packages/qorts/package.py b/var/spack/repos/builtin/packages/qorts/package.py index d5586116cadf5f..8a811acda69bb0 100644 --- a/var/spack/repos/builtin/packages/qorts/package.py +++ b/var/spack/repos/builtin/packages/qorts/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/qt-base/package.py b/var/spack/repos/builtin/packages/qt-base/package.py index d175262f1b32ae..36869caba59500 100644 --- a/var/spack/repos/builtin/packages/qt-base/package.py +++ b/var/spack/repos/builtin/packages/qt-base/package.py @@ -8,8 +8,6 @@ import sys import tempfile -import llnl.util.tty as tty - from spack.operating_systems.mac_os import macos_version from spack.package import * diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 899980cca16448..ec95dc66a48c4b 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -6,8 +6,6 @@ import platform import sys -import llnl.util.tty as tty - from spack.operating_systems.linux_distro import kernel_version from spack.operating_systems.mac_os import macos_version from spack.package import * diff --git a/var/spack/repos/builtin/packages/quantum-espresso/package.py b/var/spack/repos/builtin/packages/quantum-espresso/package.py index 490a114577a238..a1b2f2f2a36872 100644 --- a/var/spack/repos/builtin/packages/quantum-espresso/package.py +++ b/var/spack/repos/builtin/packages/quantum-espresso/package.py @@ -24,6 +24,7 @@ class QuantumEspresso(CMakePackage, Package): license("GPL-2.0-only") version("develop", branch="develop") + version("7.4.1", sha256="6ef9c53dbf0add2a5bf5ad2a372c0bff935ad56c4472baa001003e4f932cab97") version("7.4", sha256="b15dcfe25f4fbf15ccd34c1194021e90996393478226e601d876f7dea481d104") version("7.3.1", sha256="2c58b8fadfe4177de5a8b69eba447db5e623420b070dea6fd26c1533b081d844") version("7.3", sha256="edc2a0f3315c69966df4f82ec86ab9f682187bc9430ef6d2bacad5f27f08972c") @@ -500,18 +501,6 @@ def install(self, pkg, spec, prefix): prefix_path = prefix.bin if "@:5.4.0" in spec else prefix options = ["-prefix={0}".format(prefix_path)] - # This additional flag is needed anytime the target architecture - # does not match the host architecture, which results in a binary that - # configure cannot execute on the login node. This is how we detect - # cross compilation: If the platform is NOT either Linux or Darwin - # and the target=backend, that we are in the cross-compile scenario - # scenario. This should cover Cray, BG/Q, and other custom platforms. - # The other option is to list out all the platform where you would be - # cross compiling explicitly. - if not (spec.satisfies("platform=linux") or spec.satisfies("platform=darwin")): - if spec.satisfies("target=backend"): - options.append("--host") - # QE autoconf compiler variables has some limitations: # 1. There is no explicit MPICC variable so we must re-purpose # CC for the case of MPI. diff --git a/var/spack/repos/builtin/packages/quda/package.py b/var/spack/repos/builtin/packages/quda/package.py new file mode 100644 index 00000000000000..16f3b2716217e7 --- /dev/null +++ b/var/spack/repos/builtin/packages/quda/package.py @@ -0,0 +1,198 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Quda(CMakePackage, CudaPackage, ROCmPackage): + """QUDA is a library for performing calculations in lattice QCD on GPUs.""" + + homepage = "https://lattice.github.io/quda/" + url = "https://github.com/lattice/quda/archive/refs/tags/v1.1.0.tar.gz" + git = "https://github.com/lattice/quda.git" + + tags = ["hep", "lattice"] + + maintainers("chaoos") + + license("MIT OR BSD-3-Clause", checked_by="chaoos") + + version("develop", branch="develop") + + # git describe --tags --match 'v*' 18bf43ed40c75ae276e55bb8ddf2f64aa5510c37 + version( + "1.1.0-4597-g18bf43ed4", preferred=True, commit="18bf43ed40c75ae276e55bb8ddf2f64aa5510c37" + ) + + version("1.1.0", sha256="b4f635c993275010780ea09d8e593e0713a6ca1af1db6cc86c64518714fcc745") + version( + "1.0.0", + deprecated=True, + sha256="32b883bd4af45b76a832d8a070ab020306c94ff6590410cbe7c3eab3b630b938", + ) + version( + "0.9.0", + deprecated=True, + sha256="0a9f2e028fb40e4a09f78af51702d2de4099a9bf10fb8ce350eacb2d8327e481", + ) + version( + "0.8.0", + deprecated=True, + sha256="58d9a94b7fd38ec1f79bea7a0e9b470f0fa517cbf5fce42d5776e1c65607aeda", + ) + + # build dependencies + generator("ninja") + depends_on("cmake@3.18:", type="build") + depends_on("ninja", type="build") + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build", when="+tifr") + depends_on("fortran", type="build", when="+bqcd") + + variant("mpi", default=False, description="Enable MPI support") + variant("qmp", default=False, description="Enable QMP") + variant("qio", default=False, description="Enable QIO") + variant("openqcd", default=False, description="Enable openQCD interface") + variant("milc", default=False, description="Enable MILC interface") + variant("qdp", default=False, description="Enable QDP interface") + variant("bqcd", default=False, description="Enable BQCD interface") + variant("cps", default=False, description="Enable CPS interface") + variant("qdpjit", default=False, description="Enable QDPJIT interface") + variant("tifr", default=False, description="Enable TIFR interface") + variant("multigrid", default=False, description="Enable multigrid") + variant("nvshmem", default=False, description="Enable NVSHMEM", when="+cuda") + + variant("clover", default=False, description="Build clover Dirac operators") + variant( + "clover_hasenbusch", default=False, description="Build clover Hasenbusch twist operators" + ) + variant("domain_wall", default=False, description="Build domain wall Dirac operators") + variant("laplace", default=False, description="Build laplace operator") + variant( + "ndeg_twisted_clover", + default=False, + description="Build non-degenerate twisted clover Dirac operators", + ) + variant( + "ndeg_twisted_mass", + default=False, + description="Build non-degenerate twisted mass Dirac operators", + ) + variant("staggered", default=False, description="Build staggered Dirac operators") + variant("twisted_clover", default=False, description="Build twisted clover Dirac operators") + variant("twisted_mass", default=False, description="Build twisted mass Dirac operators") + variant("wilson", default=True, description="Build Wilson Dirac operators") + + with when("+multigrid"): + variant( + "mg_mrhs_list", + default=16, + multi=True, + description="The list of multi-rhs sizes that get compiled", + ) + variant( + "mg_nvec_list", + default="6,24,32", + multi=True, + description="The list of null space vector sizes that get compiled", + ) + + # dependencies + depends_on("mpi", when="+mpi") + depends_on("cuda", when="+cuda") + depends_on("nvshmem", when="+nvshmem") + depends_on("gdrcopy", when="+nvshmem") + with when("+rocm"): + depends_on("hip") + depends_on("hipblas") + depends_on("hipfft") + depends_on("hiprand") + depends_on("hipcub") + + conflicts("+qmp +mpi", msg="Specifying both QMP and MPI might result in undefined behavior") + conflicts("+cuda +rocm", msg="CUDA and ROCm support are mutually exclusive") + conflicts("~cuda ~rocm", msg="Either CUDA or ROCm support is required") + conflicts("cuda_arch=none", when="+cuda", msg="Please indicate a cuda_arch value") + conflicts( + "+nvshmem", when="~mpi ~qmp", msg="NVSHMEM requires either +mpi or +qmp to be enabled" + ) + + # CMAKE_BUILD_TYPE + variant( + "build_type", + default="STRICT", + description="The build type to build", + values=("STRICT", "RELEASE", "DEVEL", "DEBUG", "HOSTDEBUG", "SANITIZE"), + ) + + def cmake_args(self): + if self.spec.satisfies("+cuda"): + target = "CUDA" + cuda_archs = self.spec.variants["cuda_arch"].value + arch = " ".join(f"sm_{i}" for i in cuda_archs) + elif self.spec.satisfies("+rocm"): + target = "HIP" + arch = self.spec.variants["amdgpu_target"].value + + args = [ + self.define("QUDA_BUILD_ALL_TESTS", False), + self.define("QUDA_TARGET_TYPE", target), + self.define("QUDA_GPU_ARCH", arch), + self.define("QUDA_PRECISION", 14), + self.define("QUDA_RECONSTRUCT", 7), + self.define("QUDA_DOWNLOAD_USQCD", False), + self.define("QUDA_DIRAC_DEFAULT_OFF", True), + self.define_from_variant("QUDA_DIRAC_CLOVER", "clover"), + self.define_from_variant("QUDA_DIRAC_CLOVER_HASENBUSCH", "clover_hasenbusch"), + self.define_from_variant("QUDA_DIRAC_DOMAIN_WALL", "domain_wall"), + self.define_from_variant("QUDA_DIRAC_LAPLACE", "laplace"), + self.define_from_variant("QUDA_DIRAC_NDEG_TWISTED_CLOVER", "ndeg_twisted_clover"), + self.define_from_variant("QUDA_DIRAC_NDEG_TWISTED_MASS", "ndeg_twisted_mass"), + self.define_from_variant("QUDA_DIRAC_STAGGERED", "staggered"), + self.define_from_variant("QUDA_DIRAC_TWISTED_CLOVER", "twisted_clover"), + self.define_from_variant("QUDA_DIRAC_TWISTED_MASS", "twisted_mass"), + self.define_from_variant("QUDA_DIRAC_WILSON", "wilson"), + self.define_from_variant("QUDA_MPI", "mpi"), + self.define_from_variant("QUDA_QMP", "qmp"), + self.define_from_variant("QUDA_QIO", "qio"), + self.define_from_variant("QUDA_INTERFACE_OPENQCD", "openqcd"), + self.define_from_variant("QUDA_INTERFACE_MILC", "milc"), + self.define_from_variant("QUDA_INTERFACE_QDP", "qdp"), + self.define_from_variant("QUDA_INTERFACE_BQCD", "bqcd"), + self.define_from_variant("QUDA_INTERFACE_CPS", "cps"), + self.define_from_variant("QUDA_INTERFACE_QDPJIT", "qdpjit"), + self.define_from_variant("QUDA_INTERFACE_TIFR", "tifr"), + self.define_from_variant("QUDA_MULTIGRID", "multigrid"), + self.define_from_variant("QUDA_NVSHMEM", "nvshmem"), + ] + if self.spec.satisfies("+multigrid"): + args.append( + self.define( + "QUDA_MULTIGRID_NVEC_LIST", ",".join(self.spec.variants["mg_nvec_list"].value) + ) + ) + args.append( + self.define( + "QUDA_MULTIGRID_MRHS_LIST", ",".join(self.spec.variants["mg_mrhs_list"].value) + ) + ) + + if self.spec.satisfies("+nvshmem"): + args.append(self.define("QUDA_NVSHMEM_HOME", self.spec["nvshmem"].prefix)) + args.append(self.define("QUDA_GDRCOPY_HOME", self.spec["gdrcopy"].prefix)) + + if self.spec.satisfies("+cuda"): + args.append(self.define("QUDA_GPU_ARCH_SUFFIX", "real")) # real or virtual + elif self.spec.satisfies("+rocm"): + args.append(self.define("CMAKE_C_COMPILER", self.spec["hip"].hipcc)) + args.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)) + # args.append(self.define("ROCM_PATH", self.spec["hip"].prefix)) + + # required when building on a machine with no AMD GPU present + args.append(self.define("AMDGPU_TARGETS", arch)) + + # suppress _GLIBCXX17_DEPRECATED warnings when compiling c++17 + args.append(self.define("CMAKE_CXX_FLAGS", "-Wno-deprecated-declarations")) + return args diff --git a/var/spack/repos/builtin/packages/r-curl/package.py b/var/spack/repos/builtin/packages/r-curl/package.py index 183a54fd0f2dc8..5ef3167c7ff768 100644 --- a/var/spack/repos/builtin/packages/r-curl/package.py +++ b/var/spack/repos/builtin/packages/r-curl/package.py @@ -22,6 +22,7 @@ class RCurl(RPackage): license("MIT") + version("6.2.0", sha256="0399bb6bcad5f31ad2a2a7165ff8c976111707125ca0a9c4b8ccf40bb5eb1635") version("5.2.1", sha256="4a7a4d8c08aa1bca2fcd9c58ade7b4b0ea2ed9076d0521071be29baac8adfa90") version("5.0.0", sha256="d7f3cac9b513914ffa8f6f64e6fa5dd96c8273378ace6b0c16b71bc6ba59c9b2") version("4.3.3", sha256="3567b6acad40dad68acfe07511c853824839d451a50219a96dd6d125ed617c9e") @@ -63,3 +64,11 @@ class RCurl(RPackage): depends_on("r@3.0.0:", type=("build", "run")) depends_on("curl", when="@4.3:") depends_on("curl@:7.63", when="@:4.0") + + # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282908 + requires("curl@:8.10", when="@:5.2.1") + + # (Jan 2025) MacOS ships a very buggy libcurl 8.7.1 so we avoid this until apple updates it + # See: https://github.com/jeroen/curl/issues/376 + # from: https://github.com/jeroen/curl/blob/v6.2.0/configure#L18 + depends_on("curl@8.8.0:", when="@6.2.0: platform=darwin") diff --git a/var/spack/repos/builtin/packages/r-dmrcate/package.py b/var/spack/repos/builtin/packages/r-dmrcate/package.py index c1b2be0eae2cf0..038a44cd19cc52 100644 --- a/var/spack/repos/builtin/packages/r-dmrcate/package.py +++ b/var/spack/repos/builtin/packages/r-dmrcate/package.py @@ -16,6 +16,9 @@ class RDmrcate(RPackage): bioc = "DMRcate" + version("3.2.0", commit="1f46517bcdea269a2c9726d1156495d6dd172067") + version("3.0.0", commit="9cd77dedef76528990487b931ae0cc314423c3b9") + version("2.16.0", commit="9e42d8c8eb26dbd2d36a70bf32be322062ecc850") version("2.14.0", commit="6e7bae0917001e7664f01c3f8d261f9fe28c2f4d") version("2.12.0", commit="560dd5067b05715631739d0fb58ef9cebdbf7078") version("2.10.0", commit="81e83701da5c55ac83d0e0b5e640a9d431f09551") @@ -23,13 +26,15 @@ class RDmrcate(RPackage): version("2.4.1", commit="bc6242a0291a9b997872f575a4417d38550c9550") depends_on("r@3.6.0:", type=("build", "run")) - depends_on("r@4.0.0:", type=("build", "run"), when="@2.8.5:") + depends_on("r@4.0.0:", type=("build", "run"), when="@2.8.5:2.17.1") + depends_on("r@4.3.0:", type=("build", "run"), when="@2.99.0:") + depends_on("r-annotationhub", type=("build", "run"), when="@2.99.0:") depends_on("r-experimenthub", type=("build", "run")) depends_on("r-bsseq", type=("build", "run")) depends_on("r-genomeinfodb", type=("build", "run")) depends_on("r-limma", type=("build", "run")) depends_on("r-edger", type=("build", "run")) - depends_on("r-dss", type=("build", "run")) + depends_on("r-dss", type=("build", "run"), when="@:2.17.1") depends_on("r-minfi", type=("build", "run")) depends_on("r-missmethyl", type=("build", "run")) depends_on("r-genomicranges", type=("build", "run")) @@ -38,3 +43,4 @@ class RDmrcate(RPackage): depends_on("r-iranges", type=("build", "run")) depends_on("r-s4vectors", type=("build", "run")) depends_on("r-summarizedexperiment", type=("build", "run")) + depends_on("r-biomart", type=("build", "run"), when="@2.99.0:") diff --git a/var/spack/repos/builtin/packages/r-rcpp/package.py b/var/spack/repos/builtin/packages/r-rcpp/package.py index bc7458470522fb..da2c4a8e90093d 100644 --- a/var/spack/repos/builtin/packages/r-rcpp/package.py +++ b/var/spack/repos/builtin/packages/r-rcpp/package.py @@ -22,6 +22,7 @@ class RRcpp(RPackage): cran = "Rcpp" + version("1.0.13-1", sha256="1d1fc623d27082b5749f9584a9204de410134b6412a192157a3e42e2ba43969a") version("1.0.13", sha256="21fec650c113e57935fd86c7d1be190811f1ae036c1ee203bfbbf3ad5cdb22ce") version("1.0.12", sha256="0c7359cc43beee02761aa3df2baccede1182d29d28c9cd49964b609305062bd0") version("1.0.11", sha256="df757c3068599c6c05367900bcad93547ba3422d59802dbaca20fd74d4d2fa5f") @@ -53,3 +54,6 @@ class RRcpp(RPackage): # leave the r dependency also for newer versions # (not listed in Description for @1.0.5:) depends_on("r@3.0.0:", type=("build", "run")) + + # https://github.com/RcppCore/Rcpp/issues/1341 + conflicts("^r@4.4.2", when="@=1.0.13", msg="Rcpp@1.0.13 fails to compile under R@4.4.2") diff --git a/var/spack/repos/builtin/packages/r/package.py b/var/spack/repos/builtin/packages/r/package.py index b9004bf3119f75..8cfe4c395dd584 100644 --- a/var/spack/repos/builtin/packages/r/package.py +++ b/var/spack/repos/builtin/packages/r/package.py @@ -23,6 +23,7 @@ class R(AutotoolsPackage): license("GPL-2.0-or-later") + version("4.4.2", sha256="1578cd603e8d866b58743e49d8bf99c569e81079b6a60cf33cdf7bdffeb817ec") version("4.4.1", sha256="b4cb675deaaeb7299d3b265d218cde43f192951ce5b89b7bb1a5148a36b2d94d") version("4.4.0", sha256="ace4125f9b976d2c53bcc5fca30c75e30d4edc401584859cbadb080e72b5f030") version("4.3.3", sha256="80851231393b85bf3877ee9e39b282e750ed864c5ec60cbd68e6e139f0520330") diff --git a/var/spack/repos/builtin/packages/rccl/package.py b/var/spack/repos/builtin/packages/rccl/package.py index 6be20fc5961dea..e39ddca453ff39 100644 --- a/var/spack/repos/builtin/packages/rccl/package.py +++ b/var/spack/repos/builtin/packages/rccl/package.py @@ -20,6 +20,18 @@ class Rccl(CMakePackage): maintainers("srekolam", "renjithravindrankannath", "afzpatel") libraries = ["librccl"] + version( + "6.3.2", + tag="rocm-6.3.2", + commit="9a0e6a114c8f7371fa3050b413a350d6945fb7db", + submodules=True, + ) + version( + "6.3.1", + tag="rocm-6.3.1", + commit="4ab67f5a5946d851a963b281cd9aa7b86eee752a", + submodules=True, + ) version( "6.3.0", tag="rocm-6.3.0", @@ -86,6 +98,8 @@ class Rccl(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}") depends_on(f"hip@{ver}", when=f"@{ver}") @@ -108,6 +122,8 @@ class Rccl(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rclone/package.py b/var/spack/repos/builtin/packages/rclone/package.py index e12f3fef360163..7d98ecfb4db5bf 100644 --- a/var/spack/repos/builtin/packages/rclone/package.py +++ b/var/spack/repos/builtin/packages/rclone/package.py @@ -10,12 +10,15 @@ class Rclone(GoPackage): to and from various cloud storage providers""" homepage = "https://rclone.org" - url = "https://github.com/rclone/rclone/releases/download/v1.57.0/rclone-v1.57.0.tar.gz" + url = "https://github.com/rclone/rclone/releases/download/v1.69.1/rclone-v1.69.1.tar.gz" maintainers("alecbcs") license("MIT") + version("1.69.1", sha256="02ea0fa75c0895b14153a7faf7b1a1273224c4782e6deeb60a366a48786e0722") + version("1.69.0", sha256="45e6a329af4f98e0c71233511ab8543e454eaa22adeeb73179bfdb22456a2123") + version("1.68.2", sha256="2a16f040e824d4ba4ec9c1c395d891af7aa7bf08fd5251b8e28d017157cee925") version("1.68.1", sha256="c5d45b83dd008d08a0903eebf1578a11a40a77152226e22ce5e9287b9db05579") version("1.65.2", sha256="1305c913ac3684d02ce2bade0a23a2115c1ec03c9447d1562bb6cd9fa2573412") version("1.65.1", sha256="904b906cc465dd679a00487497e3891d33fca6b6e25c184400bccfb248344f39") diff --git a/var/spack/repos/builtin/packages/rdc/package.py b/var/spack/repos/builtin/packages/rdc/package.py index 4fc5cc899983ee..9f48a9a875cb01 100644 --- a/var/spack/repos/builtin/packages/rdc/package.py +++ b/var/spack/repos/builtin/packages/rdc/package.py @@ -26,6 +26,8 @@ def url_for_version(self, version): return url.format(version) license("MIT") + version("6.3.2", sha256="e0780b8ef46d7b9885eb06a0b9eb56924fdf090ade71a66360a0bee1d9d7295d") + version("6.3.1", sha256="88a96f13c0010a7f9e63f7a5a5531ae1d57ef1a722bac232c8544cde6245e120") version("6.3.0", sha256="419afd9c8e50a872fb0a922e29c8578664ed88e0b79bf558db0a1e864aa8fecf") version("6.2.4", sha256="cdebbc0c1a49f067fb8ff17bd91cd92f6f83b2aee142e5b576e5eb1742983a7f") version("6.2.1", sha256="63c0cffd772a43d0984505646023485ca2bc8512f5a87ece016f1d381cded075") @@ -78,6 +80,8 @@ def url_for_version(self, version): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-smi-lib@{ver}", type=("build", "link"), when=f"@{ver}") depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") @@ -98,9 +102,11 @@ def url_for_version(self, version): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") - for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"amdsmi@{ver}", when=f"@{ver}") def patch(self): diff --git a/var/spack/repos/builtin/packages/redis-ai/package.py b/var/spack/repos/builtin/packages/redis-ai/package.py index 9c34b582259212..e5364c698add6a 100644 --- a/var/spack/repos/builtin/packages/redis-ai/package.py +++ b/var/spack/repos/builtin/packages/redis-ai/package.py @@ -77,9 +77,7 @@ def with_torch(self): @property def torch_dir(self): return ( - join_path(self.spec["py-torch"].package.cmake_prefix_paths[0], "Torch") - if self.with_torch - else None + join_path(self["py-torch"].cmake_prefix_paths[0], "Torch") if self.with_torch else None ) @property diff --git a/var/spack/repos/builtin/packages/reframe/package.py b/var/spack/repos/builtin/packages/reframe/package.py index 7f78940b4f6f5e..9201153fa5d087 100644 --- a/var/spack/repos/builtin/packages/reframe/package.py +++ b/var/spack/repos/builtin/packages/reframe/package.py @@ -25,6 +25,11 @@ class Reframe(Package): license("BSD-3-Clause") version("develop", branch="develop") + version("4.7.3", sha256="74b8f56dc622d1c75fc1152d15d45e00edab9d2db1f6bc8fd7290125d69c74dd") + version("4.7.2", sha256="90e04eaaa21afd5c29a9c6218204c3df4503f624f21f2fe773f90e148d30c152") + version("4.7.1", sha256="ed693368d8b47327981a0db2b984c88d7dd703add1ffe736c95f9193ef727baf") + version("4.7.0", sha256="4a2604616cd492ab21b09f8234482239eff1a07e1ee61f4e4493fd973e7d5dc2") + version("4.6.4", sha256="6167ecfe6711fb9c412c0198cab549f4826eae502c9b592f18eb0192390e740e") version("4.6.3", sha256="0f335e588d21a26d76beb011bc86baf80ba633d875512ecd564d0aeb320fcf2c") version("4.6.2", sha256="d3343815ee3d2c330b91a1cdb924ba184119ed7d9fc88a4a754b939a4259df82") version("4.6.1", sha256="058b05c430af26d2958851af0da32bac0f4bff1af7d78ce6a132c32bbe40ec5c") @@ -133,6 +138,8 @@ class Reframe(Package): depends_on("py-pyyaml", when="@3.4.1:", type="run") depends_on("py-requests", when="@3.4.1:", type="run") depends_on("py-semver", when="@3.4.2:", type="run") + depends_on("py-filelock", when="@4.7:", type="run") + depends_on("py-tabulate", when="@4.7:", type="run") # extension dependencies depends_on("py-pygelf", when="+gelf", type="run") @@ -144,7 +151,7 @@ class Reframe(Package): # sanity check sanity_check_is_file = ["bin/reframe"] - sanity_check_is_dir = ["bin", "config", "docs", "reframe", "tutorials", "unittests"] + sanity_check_is_dir = ["bin", "docs", "reframe"] # check if we can run reframe @run_after("install") diff --git a/var/spack/repos/builtin/packages/rivet/package.py b/var/spack/repos/builtin/packages/rivet/package.py index a95ba02b322a23..cdaeae5efd1f4d 100644 --- a/var/spack/repos/builtin/packages/rivet/package.py +++ b/var/spack/repos/builtin/packages/rivet/package.py @@ -104,6 +104,12 @@ class Rivet(AutotoolsPackage): filter_compiler_wrappers("rivet-build", relative_root="bin") + # fix missing header in 3.1.10 + patch( + "https://gitlab.com/hepcedar/rivet/-/merge_requests/800.diff", + sha256="9ff3429f20a4497d100627551c75a6b76dd8666d40fb5e21fdc83df4e539a6b5", + when="@3.1.10", + ) # fix missing headers in 4.0.x patch( "https://gitlab.com/hepcedar/rivet/-/merge_requests/973.diff", diff --git a/var/spack/repos/builtin/packages/rna-seqc/package.py b/var/spack/repos/builtin/packages/rna-seqc/package.py index 010d4cb566bf7b..12ab75429cd0f3 100644 --- a/var/spack/repos/builtin/packages/rna-seqc/package.py +++ b/var/spack/repos/builtin/packages/rna-seqc/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/rocal/package.py b/var/spack/repos/builtin/packages/rocal/package.py index e29ec49dcc99af..9dc3451835ba05 100644 --- a/var/spack/repos/builtin/packages/rocal/package.py +++ b/var/spack/repos/builtin/packages/rocal/package.py @@ -15,7 +15,8 @@ class Rocal(CMakePackage): maintainers("afzpatel", "srekolam", "renjithravindrankannath") license("MIT") - + version("6.3.2", sha256="ceae8a86770c1f5d8cb56f4c38d6b354e16bda6b877cf93417d6a3e4e33354c6") + version("6.3.1", sha256="e332c9c2b2eb4081d7dd8a66a141f95fe8c7fccbbfdd0fea7572a62a28a62bbb") version("6.3.0", sha256="162a0c15e6e7e09c0e13a9d01a493ba3199b77919addf396cd5d273ebf44d759") version("6.2.4", sha256="630813669e75a8ee179b89f489101931a26f7a7ee486fcbe1b0e3cb1803c582c") version("6.2.1", sha256="77d3e63e02afaee6f1ee1d877d88b48c6ea66a0afca96a1313d0f1c4f8e86b2a") @@ -25,8 +26,9 @@ class Rocal(CMakePackage): depends_on("libjpeg-turbo@3.0.2:", when="@6.2.1:") depends_on("rapidjson") depends_on("ffmpeg@4.4:") + depends_on("abseil-cpp", when="@6.3:") - for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"mivisionx@{ver}", when=f"@{ver}") depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") depends_on(f"rpp@{ver}", when=f"@{ver}") @@ -96,12 +98,18 @@ def patch(self): ) def cmake_args(self): + abspath = self.spec["abseil-cpp"].prefix.include + rapidjsonpath = self.spec["rapidjson"].prefix.include args = [ self.define("AMDRPP_PATH", self.spec["rpp"].prefix), self.define("TURBO_JPEG_PATH", self.spec["libjpeg-turbo"].prefix), self.define("MIVisionX_PATH", self.spec["mivisionx"].prefix), self.define("CMAKE_INSTALL_PREFIX_PYTHON", self.spec.prefix), ] + if "@6.3.0:" in self.spec: + args.append( + self.define("CMAKE_CXX_FLAGS", "-I{0} -I{1}".format(abspath, rapidjsonpath)) + ) return args def check(self): diff --git a/var/spack/repos/builtin/packages/rocalution/package.py b/var/spack/repos/builtin/packages/rocalution/package.py index 915125c57c5a00..b38a66995cb05d 100644 --- a/var/spack/repos/builtin/packages/rocalution/package.py +++ b/var/spack/repos/builtin/packages/rocalution/package.py @@ -25,6 +25,8 @@ class Rocalution(CMakePackage): libraries = ["librocalution_hip"] license("MIT") + version("6.3.2", sha256="b13118a5c0af08a666d80af78d52bdfba12ed134f6745ab36d8de75ed3bc7584") + version("6.3.1", sha256="94b78b34ac750c09831aa70a3d7f8cd220c540a75e4f91c391ba435de420c536") version("6.3.0", sha256="a7476e1ce79915cb8e01917de372ae6b15d7e51b1a25e15cde346dadf2391068") version("6.2.4", sha256="993c55e732d0ee390746890639486649f36ae806110cf7490b9bb5d49b0663c0") version("6.2.1", sha256="94f15add5316c81529ce84ae8bf2701e9a4df57d08eda04a2f70147d31b12632") @@ -84,6 +86,8 @@ class Rocalution(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"rocprim@{ver}", when=f"@{ver}") @@ -143,7 +147,7 @@ def cmake_args(self): if self.spec.satisfies("^cmake@3.21.0:3.21.2"): args.append(self.define("__skip_rocmclang", "ON")) - if self.spec.satisfies("@5.2:"): + if self.spec.satisfies("@5.2:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3:"): diff --git a/var/spack/repos/builtin/packages/rocblas/package.py b/var/spack/repos/builtin/packages/rocblas/package.py index e963d0d1d6e234..2fddd57d0e8771 100644 --- a/var/spack/repos/builtin/packages/rocblas/package.py +++ b/var/spack/repos/builtin/packages/rocblas/package.py @@ -22,6 +22,8 @@ class Rocblas(CMakePackage): version("develop", branch="develop") version("master", branch="master") + version("6.3.2", sha256="455cad760d926c21101594197c4456f617e5873a8f17bb3e14bd762018545a9e") + version("6.3.1", sha256="88d2de6ce6b23a157eea8be63408350848935e4dfc3e27e5f2add78834c6d6ba") version("6.3.0", sha256="051f53bb69a9aba55a0c66c32688bf6af80e29e4a6b56b380b3c427e7a6aff9d") version("6.2.4", sha256="8bacf74e3499c445f1bb0a8048df1ef3ce6f72388739b1823b5784fd1e8aa22a") version("6.2.1", sha256="cf3bd7b47694f95f387803191615e2ff5c1106175473be7a5b2e8eb6fb99179f") @@ -86,10 +88,12 @@ class Rocblas(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-openmp-extras@{ver}", type="test", when=f"@{ver}") - for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"rocm-smi-lib@{ver}", type="test", when=f"@{ver}") depends_on("rocm-cmake@master", type="build", when="@master:") @@ -114,13 +118,16 @@ class Rocblas(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"llvm-amdgpu@{ver}", type="build", when=f"@{ver}") depends_on(f"rocminfo@{ver}", type="build", when=f"@{ver}") depends_on(f"rocm-cmake@{ver}", type="build", when=f"@{ver}") - depends_on("hipblaslt@6.3.0", when="@6.3.0") + for ver in ["6.3.0", "6.3.1", "6.3.2"]: + depends_on(f"hipblaslt@{ver}", when=f"@{ver}") depends_on("python@3.6:", type="build") with when("+tensile"): @@ -155,6 +162,8 @@ class Rocblas(CMakePackage): ("@6.2.1", "dbc2062dced66e4cbee8e0591d76e0a1588a4c70"), ("@6.2.4", "81ae9537671627fe541332c0a5d953bfd6af71d6"), ("@6.3.0", "aca95d1743c243dd0dd0c8b924608bc915ce1ae7"), + ("@6.3.1", "aca95d1743c243dd0dd0c8b924608bc915ce1ae7"), + ("@6.3.2", "aca95d1743c243dd0dd0c8b924608bc915ce1ae7"), ]: resource( name="Tensile", @@ -245,7 +254,7 @@ def cmake_args(self): if self.spec.satisfies("^cmake@3.21.0:3.21.2"): args.append(self.define("__skip_rocmclang", "ON")) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): args.append("-DCMAKE_INSTALL_LIBDIR=lib") diff --git a/var/spack/repos/builtin/packages/rocdecode/package.py b/var/spack/repos/builtin/packages/rocdecode/package.py index a3a0c192ddddef..6b5f2204660172 100644 --- a/var/spack/repos/builtin/packages/rocdecode/package.py +++ b/var/spack/repos/builtin/packages/rocdecode/package.py @@ -17,6 +17,8 @@ class Rocdecode(CMakePackage): maintainers("afzpatel", "srekolam", "renjithravindrankannath") license("MIT") + version("6.3.2", sha256="39ff3c21c81a73910dcfe6a147edaddecc21575a3077f0f99971c8d2f6d0e7d5") + version("6.3.1", sha256="94da1a61167abaf3f983ae5d62bffb22bb8ba3eb1c9d9fc7c68ed9a066aa4e52") version("6.3.0", sha256="931f49ff86fa34929b03cec8e7becde78d0c49c1c3a23a13203fecd2b392b242") version("6.2.4", sha256="37aaa1299cfc517ddaf60b0e8a5cf06d672f59e8acc0da3862b40b810d4931cb") version("6.2.1", sha256="d4a636415d61fef94f97197cb9ebbff59e3a18dc4850612ee142e3e14a35e6d4") @@ -36,7 +38,7 @@ class Rocdecode(CMakePackage): depends_on("libva", type="build", when="@6.2:") - for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"hip@{ver}", when=f"@{ver}") def patch(self): diff --git a/var/spack/repos/builtin/packages/rocfft/package.py b/var/spack/repos/builtin/packages/rocfft/package.py index 2803e1ba0fe4fe..542d3515e754ba 100644 --- a/var/spack/repos/builtin/packages/rocfft/package.py +++ b/var/spack/repos/builtin/packages/rocfft/package.py @@ -20,6 +20,8 @@ class Rocfft(CMakePackage): license("MIT") version("master", branch="master") + version("6.3.2", sha256="0511d04d2367dcac6b35bc6b449337ba37bb623b8382fb11178fc608b5435437") + version("6.3.1", sha256="f8aa0e68d8e303725d0be8ae1d7c0113b6ca019a3b9f08572abf8a02db690662") version("6.3.0", sha256="afc716c95d1c80097f7a965e0c3cf1fe246c9fdf10a8fd9a303202156bd3811d") version("6.2.4", sha256="8ddc4e779a84b73c21b054ae37fec69e5c2f248589c7fb1b84a2197baf6ce995") version("6.2.1", sha256="662d56cbc4c40a82e2f320bfc8e48a571a448e19c04a9ce30d3419b47fcf3574") @@ -95,6 +97,8 @@ class Rocfft(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"hip@{ver}", when=f"@{ver}") @@ -161,7 +165,7 @@ def cmake_args(self): if self.spec.satisfies("^cmake@3.21.0:3.21.2"): args.append(self.define("__skip_rocmclang", "ON")) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): diff --git a/var/spack/repos/builtin/packages/rocjpeg/package.py b/var/spack/repos/builtin/packages/rocjpeg/package.py new file mode 100644 index 00000000000000..627b8d93c90fb0 --- /dev/null +++ b/var/spack/repos/builtin/packages/rocjpeg/package.py @@ -0,0 +1,43 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class Rocjpeg(CMakePackage): + """rocJPEG is a high-performance jpeg decode SDK for decoding jpeg images + using a hardware-accelerated jpeg decoder on AMD's GPUs.""" + + homepage = "https://github.com/ROCm/rocJPEG" + git = "https://github.com/ROCm/rocJPEG.git" + url = "https://github.com/ROCm/rocJPEG/archive/refs/tags/rocm-6.3.0.tar.gz" + + maintainers("afzpatel", "srekolam", "renjithravindrankannath") + + license("MIT") + + version("6.3.2", sha256="4e1ec9604152e818afa85360f1e0ef9e98bfb8a97ca0989980063e2ece015c16") + version("6.3.1", sha256="f4913cbc63e11b9b418d33b0f9ba0fec0aa00b23285090acfd435e1ba1c21e42") + version("6.3.0", sha256="2623b8f8bb61cb418d00c695e8ff0bc5979e1bb2d61d6c327a27d676c89e89cb") + + depends_on("cxx", type="build") + + for ver in ["6.3.0", "6.3.1", "6.3.2"]: + depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") + depends_on(f"hip@{ver}", when=f"@{ver}") + + depends_on("libva", type="build", when="@6.2:") + + def patch(self): + filter_file( + r"${ROCM_PATH}/lib/llvm/bin/clang++", + "{0}/bin/clang++".format(self.spec["llvm-amdgpu"].prefix), + "CMakeLists.txt", + string=True, + ) + + def cmake_args(self): + args = [self.define("LIBVA_INCLUDE_DIR", self.spec["libva"].prefix.include)] + return args diff --git a/var/spack/repos/builtin/packages/rocm-bandwidth-test/package.py b/var/spack/repos/builtin/packages/rocm-bandwidth-test/package.py index d4151c84f8c7c3..04a54a9bb09d22 100644 --- a/var/spack/repos/builtin/packages/rocm-bandwidth-test/package.py +++ b/var/spack/repos/builtin/packages/rocm-bandwidth-test/package.py @@ -17,6 +17,8 @@ class RocmBandwidthTest(CMakePackage): maintainers("srekolam", "renjithravindrankannath", "afzpatel") version("master", branch="master") + version("6.3.2", sha256="3754831244d7c4f6314fc25b3e929adf9abe44c9cb60621dd8ae5d1aa930ae55") + version("6.3.1", sha256="98002e4104929a62a308114ed82fba530880359a17f90ebd62a2ca49c2baac78") version("6.3.0", sha256="6d1e444b962e7a40fb9f20c87631865d3e04e8c9027fd21b439bee9b62d0070c") version("6.2.4", sha256="4d25c62d81f60eba8042f57ca0905adc853a214333ffc70238d91e2f53606a79") version("6.2.1", sha256="042cfe3adc0f0ad0b8620e361b2846eb57c7b54837ed7a8c3a773e6fdc4e1af4") @@ -84,6 +86,8 @@ class RocmBandwidthTest(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") @@ -104,6 +108,8 @@ class RocmBandwidthTest(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocm-cmake/package.py b/var/spack/repos/builtin/packages/rocm-cmake/package.py index 600da1fc3bfaf0..05cff118b27d21 100644 --- a/var/spack/repos/builtin/packages/rocm-cmake/package.py +++ b/var/spack/repos/builtin/packages/rocm-cmake/package.py @@ -20,6 +20,8 @@ class RocmCmake(CMakePackage): license("MIT") version("master", branch="master") + version("6.3.2", sha256="f5104c2289da99a70d8c4c1befbca4f8efa7c89711eaac7b6b63592cd4bd99a8") + version("6.3.1", sha256="6994a5bdeea55cd41ec01ab4142785ea02bbdcb83e70f6911095c7cea766ebe8") version("6.3.0", sha256="45a1b96f85ae28a7f62895ddc4d6648500b883af250f52f6417bafb31b3cc75d") version("6.2.4", sha256="76bfac6fba31a9c4ec196d9b9b2d5ec51b8b68840b3fba8686aa42323d76a425") version("6.2.1", sha256="5ea05ad58186ac9bac40ab083c1e769a36ecaed950f82e88863169a25bc6ac8f") @@ -61,6 +63,8 @@ class RocmCmake(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocm-core/package.py b/var/spack/repos/builtin/packages/rocm-core/package.py index 722439411bbb09..7d7573ff6c33ea 100644 --- a/var/spack/repos/builtin/packages/rocm-core/package.py +++ b/var/spack/repos/builtin/packages/rocm-core/package.py @@ -19,6 +19,8 @@ class RocmCore(CMakePackage): libraries = ["librocm-core"] license("MIT") + version("6.3.2", sha256="3243f661e5e995341e81127a6096ac80169b8481826ebadc02e24020f1ff985d") + version("6.3.1", sha256="f8196f3aafe03bd93ae2947162f34098fd08ddbad4eb3deaf92acd434b480304") version("6.3.0", sha256="4fa981335426195028dd6b3a05228a2ebe8e601023a1e99130bba1b14bf60178") version("6.2.4", sha256="46dcfb5d20d242cd0ce6d02ba64d92bdd3ea59c103cf47b665c7d7a4ea7dc7f1") version("6.2.1", sha256="35cb5f6dfb1847469930bf0fa0913499b6c3f59b2b573a9f598b0956104ba5e2") @@ -43,7 +45,7 @@ class RocmCore(CMakePackage): depends_on("cxx", type="build") # generated - for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on("llvm-amdgpu", when=f"@{ver}+asan") def setup_build_environment(self, env): diff --git a/var/spack/repos/builtin/packages/rocm-dbgapi/package.py b/var/spack/repos/builtin/packages/rocm-dbgapi/package.py index fd676df4a8bb16..21c96803c01429 100644 --- a/var/spack/repos/builtin/packages/rocm-dbgapi/package.py +++ b/var/spack/repos/builtin/packages/rocm-dbgapi/package.py @@ -24,6 +24,8 @@ class RocmDbgapi(CMakePackage): license("MIT") version("master", branch="amd-master") + version("6.3.2", sha256="0e7cea6ae2eb737ad378787d2ef5f6cbaf9dfb483bb5e61e716601a145677adf") + version("6.3.1", sha256="1843423c91a22cf83bef5f14cb50f55ba333047e03e75296b9f9522facde5822") version("6.3.0", sha256="c46ca562fbbac8673c22ee5c92d62ddf6c7dfd7faceeb66d3876cde6beda8872") version("6.2.4", sha256="004e9ace3ead840e44f98fc033b621d5489a554965deecfdb7df768482068282") version("6.2.1", sha256="40064ca031e41ff3c87bfa31406b7192fa65709ab36734eddad87e0ecc01bb80") @@ -76,6 +78,8 @@ class RocmDbgapi(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"hsa-rocr-dev@{ver}", type="build", when=f"@{ver}") @@ -97,6 +101,8 @@ class RocmDbgapi(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocm-debug-agent/package.py b/var/spack/repos/builtin/packages/rocm-debug-agent/package.py index 4b96b94a3b6291..a0ac44bf1500c1 100644 --- a/var/spack/repos/builtin/packages/rocm-debug-agent/package.py +++ b/var/spack/repos/builtin/packages/rocm-debug-agent/package.py @@ -17,6 +17,8 @@ class RocmDebugAgent(CMakePackage): maintainers("srekolam", "renjithravindrankannath", "afzpatel") libraries = ["librocm-debug-agent"] + version("6.3.2", sha256="578aa08b10a456eebd2b548afd86339bd5a5df807611ffd20cc3006eaae74836") + version("6.3.1", sha256="0e28a9febf3b95cc6bbf8eae91091bf22a8f49fe9558171251f8f9afe666f9d7") version("6.3.0", sha256="c8c3461395b2fc1e136d61eb5a36ba9f3f751eb00cb9d830f498de2e5d4299d5") version("6.2.4", sha256="a4f213a9e28a1e82543135c0b6d16c5a252186f83fc842f980631943f7e11398") version("6.2.1", sha256="933223ff6e0aefb54917f4102ac6679dcd67e25ade4bce5e49f5212f45e3bae5") @@ -91,6 +93,8 @@ class RocmDebugAgent(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") depends_on(f"rocm-dbgapi@{ver}", when=f"@{ver}") @@ -111,6 +115,8 @@ class RocmDebugAgent(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocm-device-libs/package.py b/var/spack/repos/builtin/packages/rocm-device-libs/package.py index 50ac8f506f58ea..1a085c7ad0c48a 100644 --- a/var/spack/repos/builtin/packages/rocm-device-libs/package.py +++ b/var/spack/repos/builtin/packages/rocm-device-libs/package.py @@ -24,6 +24,8 @@ def url_for_version(self, version): maintainers("srekolam", "renjithravindrankannath", "haampie", "afzpatel") version("master", branch="amd-stg-open") + version("6.3.2", sha256="1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827") + version("6.3.1", sha256="e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c") version("6.3.0", sha256="79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c") version("6.2.4", sha256="7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528") version("6.2.1", sha256="4840f109d8f267c28597e936c869c358de56b8ad6c3ed4881387cf531846e5a7") @@ -80,6 +82,8 @@ def url_for_version(self, version): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") @@ -100,6 +104,8 @@ def url_for_version(self, version): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocm-examples/package.py b/var/spack/repos/builtin/packages/rocm-examples/package.py new file mode 100644 index 00000000000000..e107ab8ad7e278 --- /dev/null +++ b/var/spack/repos/builtin/packages/rocm-examples/package.py @@ -0,0 +1,66 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack.package import * + + +class RocmExamples(CMakePackage): + """A collection of examples for the ROCm software stack""" + + homepage = "https://github.com/ROCm/rocm-examples" + url = "https://github.com/ROCm/rocm-examples/archive/refs/tags/rocm-6.2.1.tar.gz" + + tags = ["rocm"] + + maintainers("srekolam", "renjithravindrankannath", "afzpatel") + + license("MIT") + + version("6.3.2", sha256="7a71dcfec782338af1d838f86b692974368e362de8ad85d5ec26c23b0afbab9e") + version("6.3.1", sha256="c5093cd6641de478b940d2e36d6723f7ef1ccad3f4f96caf0394def2e6c7e325") + version("6.3.0", sha256="809b5212d86d182586d676752b192967aee3bde6df8bbbe67558b221d63f5c7c") + version("6.2.4", sha256="510931103e4a40b272123b5c731d2ea795215c6171810beb1d5335d73bcc9b03") + version("6.2.1", sha256="2e426572aa5f5b44c7893ea256945c8733b79db39cca84754380f40c8b44a563") + version("6.2.0", sha256="6fb1f954ed32b5c4085c7f071058d278c2e1e8b7b71118ee5e85cf9bbc024df0") + + depends_on("cxx", type="build") + + depends_on("glfw", type="build") + + for ver in ["6.3.2", "6.3.1", "6.3.0", "6.2.4", "6.2.1", "6.2.0"]: + depends_on(f"hip@{ver}", when=f"@{ver}") + depends_on(f"hipify-clang@{ver}", when=f"@{ver}") + depends_on(f"hipcub@{ver}", when=f"@{ver}") + depends_on(f"hiprand@{ver}", when=f"@{ver}") + depends_on(f"hipsolver@{ver}", when=f"@{ver}") + depends_on(f"rocblas@{ver}", when=f"@{ver}") + depends_on(f"rocthrust@{ver}", when=f"@{ver}") + depends_on(f"hipblas@{ver}", when=f"@{ver}") + depends_on(f"rocsparse@{ver}", when=f"@{ver}") + depends_on(f"rocsolver@{ver}", when=f"@{ver}") + + def patch(self): + filter_file( + r"${ROCM_ROOT}/bin/hipify-perl", + f"{self.spec['hipify-clang'].prefix}/bin/hipify-perl", + "HIP-Basic/hipify/CMakeLists.txt", + string=True, + ) + + def cmake_args(self): + args = [] + args.append( + self.define( + "OFFLOAD_BUNDLER_COMMAND", + f"{self.spec['llvm-amdgpu'].prefix}/bin/clang-offload-bundler", + ) + ) + args.append( + self.define("LLVM_MC_COMMAND", f"{self.spec['llvm-amdgpu'].prefix}/bin/llvm-mc") + ) + args.append( + self.define("LLVM_DIS_COMMAND", f"{self.spec['llvm-amdgpu'].prefix}/bin/llvm-dis") + ) + return args diff --git a/var/spack/repos/builtin/packages/rocm-gdb/package.py b/var/spack/repos/builtin/packages/rocm-gdb/package.py index b8eee9c95eb3ca..507eb4d26b5e4e 100644 --- a/var/spack/repos/builtin/packages/rocm-gdb/package.py +++ b/var/spack/repos/builtin/packages/rocm-gdb/package.py @@ -17,6 +17,8 @@ class RocmGdb(AutotoolsPackage): license("LGPL-2.0-or-later") maintainers("srekolam", "renjithravindrankannath") + version("6.3.2", sha256="85b03c1fb99f55272f4732dff58e8ba0a1add454a79d2b9d471df200366d0c7e") + version("6.3.1", sha256="954236518491ba547f849be7c86e71ff95ef24535f66acabfd45040e11c25d7b") version("6.3.0", sha256="4a41ffbc4f7a5970181ee0aae07f0ea4cda278870cd60a562b25001f1365e29f") version("6.2.4", sha256="061d00f3d02ca64094008c5da185712712ccd3a922f6e126d5f203cdae2b9e04") version("6.2.1", sha256="bed312c3fbb9982166538036bb9fd4a75053117c65ba80e34dbdae629a8fe6e4") @@ -75,6 +77,8 @@ class RocmGdb(AutotoolsPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-dbgapi@{ver}", type="link", when=f"@{ver}") depends_on(f"comgr@{ver}", type="link", when=f"@{ver}") @@ -95,6 +99,8 @@ class RocmGdb(AutotoolsPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocm-opencl/package.py b/var/spack/repos/builtin/packages/rocm-opencl/package.py index df977b0a97c334..9a7251b6b6f498 100644 --- a/var/spack/repos/builtin/packages/rocm-opencl/package.py +++ b/var/spack/repos/builtin/packages/rocm-opencl/package.py @@ -35,6 +35,8 @@ def url_for_version(self, version): license("MIT") version("master", branch="main") + version("6.3.2", sha256="ec13dc4ffe212beee22171cb2825d2b16cdce103c835adddb482b9238cf4f050"), + version("6.3.1", sha256="bfb8a4a59e7bd958e2cd4bf6f14c6cdea601d9827ebf6dc7af053a90e963770f") version("6.3.0", sha256="829e61a5c54d0c8325d02b0191c0c8254b5740e63b8bfdb05eec9e03d48f7d2c") version("6.2.4", sha256="0a3164af7f997a4111ade634152957378861b95ee72d7060eb01c86c87208c54") version("6.2.1", sha256="e9cff3a8663defdbda833d49c9e7160171eca14dc285ffe4061378607d6c890d") @@ -127,12 +129,26 @@ def url_for_version(self, version): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"comgr@{ver}", type="build", when=f"@{ver}") depends_on(f"hsa-rocr-dev@{ver}", type="link", when=f"@{ver}") - for ver in ["6.0.0", "6.0.2", "6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in [ + "6.0.0", + "6.0.2", + "6.1.0", + "6.1.1", + "6.1.2", + "6.2.0", + "6.2.1", + "6.2.4", + "6.3.0", + "6.3.1", + "6.3.2", + ]: depends_on(f"aqlprofile@{ver}", type="link", when=f"@{ver}") for ver in [ @@ -151,6 +167,8 @@ def url_for_version(self, version): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") @@ -196,7 +214,7 @@ def setup_build_environment(self, env): env.set("LDFLAGS", "-fuse-ld=lld") def setup_run_environment(self, env): - env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib), + env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib) env.set("OCL_ICD_VENDORS", self.prefix.vendors + "/") @run_after("install") diff --git a/var/spack/repos/builtin/packages/rocm-openmp-extras/package.py b/var/spack/repos/builtin/packages/rocm-openmp-extras/package.py index 780332351ea21e..8c0f7d49ed261f 100644 --- a/var/spack/repos/builtin/packages/rocm-openmp-extras/package.py +++ b/var/spack/repos/builtin/packages/rocm-openmp-extras/package.py @@ -34,6 +34,8 @@ "ac82e8da0c210ee14b911c833ae09a029a41541689930759737c135db52464a3", "ad5674b5626ed6720ca5f8772542e8ed3fb7a9150ed7a86a1adbcd70a2074e8e", "8c8240d948817ab1874eff0406d6053ee0518902427e0236e6b4d2cee84ff882", + "8fefdd0d9eecd11866ddecbe039347560469eb69d974934005d480eac4432b81", + "eeda81dafd17df7e1d2b9dbf91a23924c6dd8de29f0792725fc25a6cd1d9c5fa", ] devlib = [ @@ -56,6 +58,8 @@ "4840f109d8f267c28597e936c869c358de56b8ad6c3ed4881387cf531846e5a7", "7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528", "79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c", + "e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c", + "1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827", ] llvm = [ @@ -78,6 +82,8 @@ "4840f109d8f267c28597e936c869c358de56b8ad6c3ed4881387cf531846e5a7", "7af782bf5835fcd0928047dbf558f5000e7f0207ca39cf04570969343e789528", "79580508b039ca6c50dfdfd7c4f6fbcf489fe1931037ca51324818851eea0c1c", + "e9c2481cccacdea72c1f8d3970956c447cec47e18dfb9712cbbba76a2820552c", + "1f52e45660ea508d3fe717a9903fe27020cee96de95a3541434838e0193a4827", ] flang = [ @@ -100,6 +106,8 @@ "409ee98bf15e51ac68b7ed351f4582930dfa0288de042006e17eea6b64df5ad6", "51c1308f324101e4b637e78cd2eb652e22f68f6d820991a76189c15131f971dc", "43f10662706dbf22b0090839fd590d9fc633e7339b19aaee7578322ea6809275", + "2e38ba138312d18b2677347839a960802bb04090bb92b5e6a15ac06ed789dbc0", + "4b4d8025a215c52e62dd6317cafce224d95f91040e90942c9a93ade568a8dd48", ] extras = [ @@ -122,6 +130,8 @@ "4b0d250b5ebd997ed6d5d057689c3f67dfb4d82f09f582ebb439ca9134fae48d", "34c3506b0f6aefbf0bc7981ff2901b7a2df975a5b40c5eb078522499d81057f0", "22cdd87b1d66e7e7f9e30fd9031fcbf01ce0b631551959144bb42e7f1dba28cb", + "4050c60cbbf582122cc0a30b4a99200341c426f2fa3d81ac8dc61f5a0890ed15", + "70b49c1198bf176498ec4a94584b8ed8a07f623ebfa567e4fcf1a6545b635185", ] versions = [ @@ -144,6 +154,8 @@ "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ] versions_dict = dict() # type: Dict[str,Dict[str,str]] components = ["aomp", "devlib", "llvm", "flang", "extras"] @@ -161,12 +173,14 @@ class RocmOpenmpExtras(Package): """OpenMP support for ROCm LLVM.""" homepage = tools_url + "/aomp" - url = tools_url + "/aomp/archive/rocm-6.2.4.tar.gz" + url = tools_url + "/aomp/archive/rocm-6.3.2.tar.gz" tags = ["rocm"] license("Apache-2.0") maintainers("srekolam", "renjithravindrankannath", "estewart08", "afzpatel") + version("6.3.2", sha256=versions_dict["6.3.2"]["aomp"]) + version("6.3.1", sha256=versions_dict["6.3.1"]["aomp"]) version("6.3.0", sha256=versions_dict["6.3.0"]["aomp"]) version("6.2.4", sha256=versions_dict["6.2.4"]["aomp"]) version("6.2.1", sha256=versions_dict["6.2.1"]["aomp"]) @@ -221,6 +235,8 @@ class RocmOpenmpExtras(Package): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") @@ -284,7 +300,7 @@ class RocmOpenmpExtras(Package): for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4"]: depends_on(f"hsakmt-roct@{ver}", when=f"@{ver}") - for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.1.0", "6.1.1", "6.1.2", "6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"comgr@{ver}", when=f"@{ver}") depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") @@ -591,8 +607,10 @@ def install(self, spec, prefix): "-DNUMACTL_DIR={0}".format(numactl_prefix), ] if self.spec.satisfies("@:6.2"): - "-DHSAKMT_LIB={0}/lib".format(hsakmt_prefix), - "-DHSAKMT_LIB64={0}/lib64".format(hsakmt_prefix), + openmp_common_args += [ + "-DHSAKMT_LIB={0}/lib".format(hsakmt_prefix), + "-DHSAKMT_LIB64={0}/lib64".format(hsakmt_prefix), + ] components["openmp"] = ["../rocm-openmp-extras/llvm-project/openmp"] components["openmp"] += openmp_common_args diff --git a/var/spack/repos/builtin/packages/rocm-smi-lib/package.py b/var/spack/repos/builtin/packages/rocm-smi-lib/package.py index a290423acc8c5e..ac3f16bb74eab2 100644 --- a/var/spack/repos/builtin/packages/rocm-smi-lib/package.py +++ b/var/spack/repos/builtin/packages/rocm-smi-lib/package.py @@ -23,6 +23,8 @@ class RocmSmiLib(CMakePackage): libraries = ["librocm_smi64"] version("master", branch="master") + version("6.3.2", sha256="29a9190143dfcbafeac93d8064b00c9320dbca57a3344adb009ec17d9b09d036") + version("6.3.1", sha256="0f45e4823e361a1c6ac560eabf6000c3b59e08bcd96e87150149149e861c6a63") version("6.3.0", sha256="573cfb759f8c7700fdcb0c28d045aed0f2d950692bb66a10bd589b89b8f48d0f") version("6.2.4", sha256="eb8986dd571f5862c2db693398c0dbec28e2754f764f6bd3cfb21be7699e4452") version("6.2.1", sha256="28543d099fa44b4b79644533644aba4b67fa48d477628dd5802c3b50cc78583a") @@ -68,6 +70,9 @@ class RocmSmiLib(CMakePackage): "6.2.0", "6.2.1", "6.2.4", + "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocm-tensile/package.py b/var/spack/repos/builtin/packages/rocm-tensile/package.py index 127b9ee3dfc158..5862109bec2f76 100644 --- a/var/spack/repos/builtin/packages/rocm-tensile/package.py +++ b/var/spack/repos/builtin/packages/rocm-tensile/package.py @@ -18,6 +18,8 @@ class RocmTensile(CMakePackage): license("MIT") maintainers("srekolam", "renjithravindrankannath", "haampie", "afzpatel") + version("6.3.2", sha256="700e43a22d7e6309bf74624b18a42bb0132ef35716fccec897d3045a97759e6a") + version("6.3.1", sha256="9882e8f949e1eb1d4b7dbd215370ecce643852dd2ce6e021d59cd49d32ba9dea") version("6.3.0", sha256="7ae90d1a513dc6f000a45f644b360305ef212ab3dff7b0217b6addabebf932e1") version("6.2.4", sha256="dd0721e4371c8752aa4b14362f75d7ebb7805f57dcb990e03ae08cef4a291383") version("6.2.1", sha256="29802dc65a7cea29f0e2608782c75db87e9c71eea8aeb485e856cf2861d83098") @@ -85,6 +87,8 @@ class RocmTensile(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-cmake@{ver}", type="build", when=f"@{ver}") depends_on(f"hip@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocm-validation-suite/009-replacing-rocm-path-with-package-path-6.3.patch b/var/spack/repos/builtin/packages/rocm-validation-suite/009-replacing-rocm-path-with-package-path-6.3.patch deleted file mode 100644 index 9314e302304d75..00000000000000 --- a/var/spack/repos/builtin/packages/rocm-validation-suite/009-replacing-rocm-path-with-package-path-6.3.patch +++ /dev/null @@ -1,687 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 77065a7..709a10b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -76,14 +76,18 @@ endif(rocblas_FOUND) - # Making ROCM_PATH, CMAKE_INSTALL_PREFIX, CPACK_PACKAGING_INSTALL_PREFIX as CACHE - # variables since we will pass them as cmake params appropriately, and - # all find_packages relevant to this build will be in ROCM path hence appending it to CMAKE_PREFIX_PATH --set(ROCM_PATH "/opt/rocm" CACHE PATH "ROCM install path") --set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "CMAKE installation directory") --set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm" CACHE PATH "Prefix used in built packages") -+set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -+set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - list(APPEND CMAKE_PREFIX_PATH "${ROCM_PATH}") --set(ROCR_INC_DIR "${ROCM_PATH}/include" CACHE PATH "Contains header files exported by ROC Runtime" FORCE) --set(ROCR_LIB_DIR "${ROCM_PATH}/lib" CACHE PATH "Contains library files exported by ROC Runtime" FORCE) --set(HIP_INC_DIR "${ROCM_PATH}" CACHE PATH "Contains header files exported by ROC Runtime") --set(ROCT_INC_DIR "${ROCM_PATH}/include" CACHE PATH "Contains header files exported by ROC Trunk" FORCE) -+set(ROCR_INC_DIR "${HSA_PATH}/include" CACHE PATH "Contains header files exported by ROC Runtime") -+set(ROCR_LIB_DIR "${HSA_PATH}/lib" CACHE PATH "Contains library files exported by ROC Runtime") -+set(HIP_INC_DIR "${HIP_PATH}" CACHE PATH "Contains header files exported by ROC Runtime") -+set(ROCT_INC_DIR "${ROCM_PATH}/include" CACHE PATH "Contains header files exported by ROC Trunk") -+set(HIPRAND_INC_DIR "${HIPRAND_DIR}/include" CACHE PATH "Contains header files exported by ROC Trunk") -+set(HIPRAND_LIB_DIR "${HIPRAND_DIR}/lib" CACHE PATH "Contains header files exported by ROC Trunk") -+set(ROCRAND_INC_DIR "${ROCRAND_DIR}/include" CACHE PATH "Contains header files exported by ROC Trunk") -+set(ROCRAND_LIB_DIR "${ROCRAND_DIR}/lib" CACHE PATH "Contains header files exported by ROC Trunk") - - add_definitions(-DROCM_PATH="${ROCM_PATH}") - if(FETCH_ROCMPATH_FROM_ROCMCORE) -@@ -446,18 +450,20 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/rvs_smi-build/librocm_smi64.so - ) - - endif() # if (RVS_ROCMSMI EQUAL 1) -- --set(HIPRAND_INC_DIR "${ROCM_PATH}/include") --set(HIPRAND_LIB_DIR "${ROCM_PATH}/lib") --set(HIPBLASLT_INC_DIR "${ROCM_PATH}/include") --set(HIPBLASLT_LIB_DIR "${ROCM_PATH}/lib") -+find_package( hipblas-common REQUIRED CONFIG PATHS ${HIP_DIR} ${ROCM_PATH} /opt/rocm) -+set(HIPRAND_INC_DIR "${HIPRAND_DIR}/include") -+set(HIPRAND_LIB_DIR "${HIPRAND_DIR}/lib") -+set(HIPBLASLT_INC_DIR "${HIPBLASLT_DIR}/include") -+set(HIPBLASLT_LIB_DIR "${HIPBLASLT_DIR}/lib") -+set(ROCRAND_INC_DIR "${ROCRAND_DIR}/include") -+set(ROCRAND_LIB_DIR "${ROCRAND_DIR}/lib") - - if (RVS_ROCBLAS EQUAL 1) - set(ROCBLAS_INC_DIR "${CMAKE_BINARY_DIR}/rvs_rblas-src/build/release/rocblas-install") - set(ROCBLAS_LIB_DIR "${CMAKE_BINARY_DIR}/rvs_rblas-src/build/release/rocblas-install/lib/") - else() -- set(ROCBLAS_INC_DIR "${ROCM_PATH}/include") -- set(ROCBLAS_LIB_DIR "${ROCM_PATH}/lib") -+ set(ROCBLAS_INC_DIR "${ROCBLAS_DIR}/include") -+ set(ROCBLAS_LIB_DIR "${ROCBLAS_DIR}/lib") - endif() - - if (RVS_ROCMSMI EQUAL 1) -@@ -472,8 +478,8 @@ else() - set(ROCM_SMI_LIB_DIR "${ROCM_PATH}/rocm_smi/lib") - else() - message( STATUS "ROCBLAS REORG Enabled Version: ${RVS_ROCBLAS_VERSION_FLAT}" ) -- set(ROCM_SMI_INC_DIR "${ROCM_PATH}/include") -- set(ROCM_SMI_LIB_DIR "${ROCM_PATH}/lib") -+ set(ROCM_SMI_INC_DIR "${ROCM_SMI_DIR}/include") -+ set(ROCM_SMI_LIB_DIR "${ROCM_SMI_DIR}/lib") - endif() - endif() - set(ROCM_SMI_LIB "rocm_smi64" CACHE STRING "rocm_smi library name") -diff --git a/babel.so/CMakeLists.txt b/babel.so/CMakeLists.txt -index ca29a5b..36ff304 100644 ---- a/babel.so/CMakeLists.txt -+++ b/babel.so/CMakeLists.txt -@@ -109,13 +109,13 @@ set(HIP_HCC_LIB "amdhip64") - add_compile_options(-DRVS_ROCBLAS_VERSION_FLAT=${RVS_ROCBLAS_VERSION_FLAT}) - - # Determine Roc Runtime header files are accessible --if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime.h) -- message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR}) -+if(NOT EXISTS ${HIP_PATH}/include/hip/hip_runtime.h) -+ message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_PATH path. Current value is : " ${HIP_PATH}) - RETURN() - endif() - --if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime_api.h) -- message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR}) -+if(NOT EXISTS ${HIP_PATH}/include/hip/hip_runtime_api.h) -+ message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_PATH path. Current value is : " ${HIP_PATH}) - RETURN() - endif() - -@@ -135,16 +135,16 @@ if(DEFINED RVS_ROCMSMI) - endif() - - --if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so") -- message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR}) -+if(NOT EXISTS "${HIP_PATH}/lib/lib${HIP_HCC_LIB}.so") -+ message("ERROR: ROC Runtime libraries can't be found under specified path. Please set HIP_PATH path. Current value is : " ${HIP_PATH}) - RETURN() - endif() - - ## define include directories --include_directories(./ ../ ${ROCR_INC_DIR} ${HIP_INC_DIR}) -+include_directories(./ ../ ${HIP_PATH}) - - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${HIP_PATH}/lib/ ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries - set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) - -@@ -156,7 +156,7 @@ add_library( ${RVS_TARGET} SHARED ${SOURCES}) - set_target_properties(${RVS_TARGET} PROPERTIES - SUFFIX .so.${LIB_VERSION_STRING} - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) --target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_HCC_LIB} ${ROCBLAS_LIB}) -+target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_HCC_LIB} ${ROCBLAS_LIB} ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - add_dependencies(${RVS_TARGET} rvslib) - - add_custom_command(TARGET ${RVS_TARGET} POST_BUILD -diff --git a/cmake_modules/tests_unit.cmake b/cmake_modules/tests_unit.cmake -index 9760b72..d585f8b 100644 ---- a/cmake_modules/tests_unit.cmake -+++ b/cmake_modules/tests_unit.cmake -@@ -27,7 +27,7 @@ - ## define additional unit testing include directories - include_directories(${UT_INC}) - ## define additional unit testing lib directories --link_directories(${UT_LIB} ${RVS_LIB_DIR}) -+link_directories(${UT_LIB} ${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - - file(GLOB TESTSOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} test/test*.cpp ) - #message ( "TESTSOURCES: ${TESTSOURCES}" ) -@@ -46,6 +46,7 @@ FOREACH(SINGLE_TEST ${TESTSOURCES}) - add_dependencies(${TEST_NAME} rvs_gtest_target) - target_link_libraries(${TEST_NAME} - ${UT_LINK_LIBS} rvslibut rvslib gtest_main gtest pthread pci -+ ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so - ) - target_compile_definitions(${TEST_NAME} PUBLIC RVS_UNIT_TEST) - if(DEFINED tcd.${TEST_NAME}) -diff --git a/edp.so/CMakeLists.txt b/edp.so/CMakeLists.txt -index 4466edc..8c739bb 100644 ---- a/edp.so/CMakeLists.txt -+++ b/edp.so/CMakeLists.txt -@@ -128,17 +128,17 @@ if(DEFINED RVS_ROCMSMI) - endif() - - --if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so") -+if(NOT EXISTS "${HIP_INC_DIR}/lib/lib${HIP_HCC_LIB}.so") - message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR}) - RETURN() - endif() - - ## define include directories --include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR}) -+include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR} ${YAML_CPP_INCLUDE_DIRS} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpciaccess.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpciaccess.so libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set (SOURCES src/rvs_module.cpp src/action.cpp src/edp_worker.cpp ) -@@ -148,7 +148,7 @@ add_library( ${RVS_TARGET} SHARED ${SOURCES}) - set_target_properties(${RVS_TARGET} PROPERTIES - SUFFIX .so.${LIB_VERSION_STRING} - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) --target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_HCC_LIB} ${ROCBLAS_LIB}) -+target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_HCC_LIB} ${ROCBLAS_LIB} ${HIPRAND_LIB} ${ROCRAND_LIB}) - add_dependencies(${RVS_TARGET} rvslib) - - add_custom_command(TARGET ${RVS_TARGET} POST_BUILD -diff --git a/gm.so/CMakeLists.txt b/gm.so/CMakeLists.txt -index d3caa84..94a06be 100644 ---- a/gm.so/CMakeLists.txt -+++ b/gm.so/CMakeLists.txt -@@ -118,11 +118,11 @@ if(DEFINED RVS_ROCMSMI) - endif() - - ## define include directories --include_directories(./ ../ ${ROCM_SMI_INC_DIR}) -+include_directories(./ ../ ${ROCM_SMI_INC_DIR} ${YAML_CPP_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so librocm_smi64.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp src/worker.cpp) -@@ -133,7 +133,7 @@ add_library( ${RVS_TARGET} SHARED ${SOURCES}) - set_target_properties(${RVS_TARGET} PROPERTIES - SUFFIX .so.${LIB_VERSION_STRING} - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) --target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${ROCM_SMI_LIB}) -+target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS}) - add_dependencies(${RVS_TARGET} rvslib) - - add_custom_command(TARGET ${RVS_TARGET} POST_BUILD -@@ -149,7 +149,7 @@ install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib${RVS}.so" - - # TEST SECTION - if (RVS_BUILD_TESTS) -- add_custom_command(TARGET ${RVS_TARGET} POST_BUILD -+ B_add_custom_command(TARGET ${RVS_TARGET} POST_BUILD - COMMAND ln -fs ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib${RVS}.so.${VERSION_MAJOR} ${RVS_BINTEST_FOLDER}/lib${RVS}.so WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - ) - include(${CMAKE_CURRENT_SOURCE_DIR}/tests.cmake) -diff --git a/gm.so/tests.cmake b/gm.so/tests.cmake -index 71dabc8..7898dee 100644 ---- a/gm.so/tests.cmake -+++ b/gm.so/tests.cmake -@@ -31,11 +31,11 @@ set(CORE_RUNTIME_NAME "hsa-runtime") - set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64") - - set(UT_LINK_LIBS libpthread.so libpci.so libm.so libdl.so "lib${ROCM_SMI_LIB}.so" -- ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB} -+ ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} "lib${HIPRAND_LIB}.so" "lib${ROCRAND_LIB}.so" "lib${HIPBLASLT_LIB}.so" - ) - - # Add directories to look for library files to link --link_directories(${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR}) -+link_directories(${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - - set (UT_SOURCES src/action.cpp src/worker.cpp - ) -diff --git a/gpup.so/CMakeLists.txt b/gpup.so/CMakeLists.txt -index 43d337a..c92d8ba 100644 ---- a/gpup.so/CMakeLists.txt -+++ b/gpup.so/CMakeLists.txt -@@ -109,11 +109,11 @@ else() - endif() - - ## define include directories --include_directories(./ ../ include ../include) -+include_directories(./ ../ include ../include ${YAML_CPP_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp) -diff --git a/gpup.so/tests.cmake b/gpup.so/tests.cmake -index 566508f..a64622c 100644 ---- a/gpup.so/tests.cmake -+++ b/gpup.so/tests.cmake -@@ -26,12 +26,13 @@ - set(ROCBLAS_LIB "rocblas") - set(HIPRAND_LIB "hiprand") - set(HIPBLASLT_LIB "hipblaslt") -+set(ROCRAND_LIB "rocrand") - set(ROC_THUNK_NAME "hsakmt") - set(CORE_RUNTIME_NAME "hsa-runtime") - set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64") - - set(UT_LINK_LIBS libpthread.so libm.so libdl.so ${ROCM_SMI_LIB} -- ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB}) -+ ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB} ${ROCRAND_LIB}) - - # Add directories to look for library files to link - link_directories(${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR}) -diff --git a/gst.so/CMakeLists.txt b/gst.so/CMakeLists.txt -index fd346ce..eebc90b 100644 ---- a/gst.so/CMakeLists.txt -+++ b/gst.so/CMakeLists.txt -@@ -137,17 +137,17 @@ if(DEFINED RVS_ROCMSMI) - endif() - - --if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so") -+if(NOT EXISTS "${HIP_INC_DIR}/lib/lib${HIP_HCC_LIB}.so") - message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR}) - RETURN() - endif() - - ## define include directories --include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR}) -+include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR} ${YAML_CPP_INCLUDE_DIRS} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${HIP_INC_DIR}/lib/ ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_DIR} ${ROCRAND_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp src/gst_worker.cpp) -diff --git a/iet.so/CMakeLists.txt b/iet.so/CMakeLists.txt -index 002c03c..e0383a6 100644 ---- a/iet.so/CMakeLists.txt -+++ b/iet.so/CMakeLists.txt -@@ -145,7 +145,7 @@ if(DEFINED RVS_ROCMSMI) - endif() - endif() - --if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so") -+if(NOT EXISTS "${HIP_INC_DIR}/lib/lib${HIP_HCC_LIB}.so") - message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR}) - RETURN() - endif() -@@ -160,11 +160,11 @@ if(DEFINED RVS_ROCMSMI) - endif() - - ## define include directories --include_directories(./ ../ ${ROCM_SMI_INC_DIR} ${ROCBLAS_INC_DIR} ${ROCR_INC_DIR} ${HIP_INC_DIR}) -+include_directories(./ ../ ${ROCM_SMI_INC_DIR} ${ROCBLAS_INC_DIR} ${ROCR_INC_DIR} ${HIP_INC_DIR} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so librocm_smi64.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so ) - - set(SOURCES src/rvs_module.cpp src/action.cpp src/iet_worker.cpp ) - -@@ -173,7 +173,7 @@ add_library( ${RVS_TARGET} SHARED ${SOURCES}) - set_target_properties(${RVS_TARGET} PROPERTIES - SUFFIX .so.${LIB_VERSION_STRING} - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) --target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_HCC_LIB} ${ROCBLAS_LIB} ${ROCM_SMI_LIB}) -+target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_INC_DIR}/lib/ ${HIP_HCC_LIB} ${ROCBLAS_LIB}) - add_dependencies(${RVS_TARGET} rvslib) - - add_custom_command(TARGET ${RVS_TARGET} POST_BUILD -diff --git a/mem.so/CMakeLists.txt b/mem.so/CMakeLists.txt -index 5133337..1f05dc6 100644 ---- a/mem.so/CMakeLists.txt -+++ b/mem.so/CMakeLists.txt -@@ -134,18 +134,18 @@ if(DEFINED RVS_ROCMSMI) - endif() - - --if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so") -+if(NOT EXISTS "${HIP_INC_DIR}/lib/lib${HIP_HCC_LIB}.so") - message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR}) - RETURN() - endif() - - ## define include directories --include_directories(./ ../ ${ROCR_INC_DIR} ${HIP_INC_DIR}) -+include_directories(./ ../ ${ROCR_INC_DIR} ${HIP_INC_DIR} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${HIP_INC_DIR}/lib ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp src/rvs_memtest.cpp src/rvs_memworker.cpp) -diff --git a/pbqt.so/CMakeLists.txt b/pbqt.so/CMakeLists.txt -index 5ae675a..8b7e5a6 100644 ---- a/pbqt.so/CMakeLists.txt -+++ b/pbqt.so/CMakeLists.txt -@@ -136,11 +136,11 @@ if(NOT EXISTS ${ROCR_LIB_DIR}/${CORE_RUNTIME_LIBRARY}.so) - endif() - - ## define include directories --include_directories(./ ../ pci ${ROCR_INC_DIR}) -+include_directories(./ ../ pci ${ROCR_INC_DIR} ${YAML_CPP_INCLUDE_DIRS} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCT_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${HSAKMT_LIB_DIR} ${ROCT_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp src/action_run.cpp -diff --git a/pebb.so/CMakeLists.txt b/pebb.so/CMakeLists.txt -index c4e2964..a37e78a 100644 ---- a/pebb.so/CMakeLists.txt -+++ b/pebb.so/CMakeLists.txt -@@ -137,11 +137,11 @@ if(NOT EXISTS ${ROCR_LIB_DIR}/${CORE_RUNTIME_LIBRARY}.so) - endif() - - ## define include directories --include_directories(./ ../ pci ${ROCR_INC_DIR}) -+include_directories(./ ../ pci ${ROCR_INC_DIR} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCT_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${HSAKMT_LIB_DIR} ${ROCT_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR}/.. ${ROCRAND_LIB_DIR}/..) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp src/action_run.cpp -diff --git a/peqt.so/CMakeLists.txt b/peqt.so/CMakeLists.txt -index ead507d..d83c9e5 100644 ---- a/peqt.so/CMakeLists.txt -+++ b/peqt.so/CMakeLists.txt -@@ -107,11 +107,11 @@ else() - endif() - - ## define include directories --include_directories(./ ../) -+include_directories(./ ../ ${HSA_PATH}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${HSA_PATH}/lib/ ${HSAKMT_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpci.so libm.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp) -@@ -121,7 +121,7 @@ add_library( ${RVS_TARGET} SHARED ${SOURCES}) - set_target_properties(${RVS_TARGET} PROPERTIES - SUFFIX .so.${LIB_VERSION_STRING} - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) --target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ) -+target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - add_dependencies(${RVS_TARGET} rvslib) - - add_custom_command(TARGET ${RVS_TARGET} POST_BUILD -diff --git a/perf.so/CMakeLists.txt b/perf.so/CMakeLists.txt -index 518dac9..5cc54c1 100644 ---- a/perf.so/CMakeLists.txt -+++ b/perf.so/CMakeLists.txt -@@ -137,17 +137,17 @@ if(DEFINED RVS_ROCMSMI) - endif() - - --if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so") -+if(NOT EXISTS "${HIP_INC_DIR}/lib/lib${HIP_HCC_LIB}.so") - message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR}) - RETURN() - endif() - - ## define include directories --include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR}) -+include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${HIP_INC_DIR}/lib ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp src/perf_worker.cpp) -@@ -157,7 +157,7 @@ add_library( ${RVS_TARGET} SHARED ${SOURCES}) - set_target_properties(${RVS_TARGET} PROPERTIES - SUFFIX .so.${LIB_VERSION_STRING} - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) --target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_HCC_LIB} ${ROCBLAS_LIB}) -+target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS}) - add_dependencies(${RVS_TARGET} rvslib) - - add_custom_command(TARGET ${RVS_TARGET} POST_BUILD -diff --git a/pesm.so/CMakeLists.txt b/pesm.so/CMakeLists.txt -index 1f27f34..502c1c8 100644 ---- a/pesm.so/CMakeLists.txt -+++ b/pesm.so/CMakeLists.txt -@@ -107,11 +107,11 @@ else() - endif() - - ## define include directories --include_directories(./ ../ pci) -+include_directories(./ ../ pci ${YAML_CPP_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_DIR} ${ROCRAND_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS libpthread.so libpci.so libm.so ${PROJECT_LINK_LIBS} ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp src/worker.cpp) -diff --git a/pesm.so/tests.cmake b/pesm.so/tests.cmake -index e255144..b3f2660 100644 ---- a/pesm.so/tests.cmake -+++ b/pesm.so/tests.cmake -@@ -31,11 +31,11 @@ set(CORE_RUNTIME_NAME "hsa-runtime") - set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64") - - set(UT_LINK_LIBS libpthread.so libpci.so libm.so libdl.so "lib${ROCM_SMI_LIB}.so" -- ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB} -+ ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} "lib${HIPRAND_LIB}.so" "lib${HIPBLASLT_LIB}.so" - ) - - # Add directories to look for library files to link --link_directories(${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR} ${HIPRAND_LIB_DIR}) -+link_directories(${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - - set (UT_SOURCES test/unitactionbase.cpp - ) -diff --git a/rcqt.so/CMakeLists.txt b/rcqt.so/CMakeLists.txt -index c0099ab..fcc82f3 100644 ---- a/rcqt.so/CMakeLists.txt -+++ b/rcqt.so/CMakeLists.txt -@@ -108,11 +108,11 @@ else() - endif() - - ## define include directories --include_directories(./ ../) -+include_directories(./ ../ ${YAML_CPP_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH} ${ASAN_LIB_PATH} ${HSAKMT_LIB_DIR} ${ROCM_SMI_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib) -+set (PROJECT_LINK_LIBS rvslib ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES -diff --git a/rvs/CMakeLists.txt b/rvs/CMakeLists.txt -index 5c1c124..70fa609 100644 ---- a/rvs/CMakeLists.txt -+++ b/rvs/CMakeLists.txt -@@ -34,6 +34,7 @@ set ( RVS "rvs" ) - set ( RVS_PACKAGE "rvs-roct" ) - set ( RVS_COMPONENT "lib${RVS}" ) - set ( RVS_TARGET "${RVS}" ) -+set ( YAML_CPP_LIBRARIES "${YAML_CPP_LIB_PATH}") - - project ( ${RVS_TARGET} ) - -@@ -115,21 +116,23 @@ endif() - ## define include directories - include_directories(./ ../ ${YAML_CPP_INCLUDE_DIRS}) - ## define lib directories --link_directories(${CMAKE_CURRENT_BINARY_DIR} ${RVS_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH} ${HIPRAND_LIB_DIR}) -+link_directories(${CMAKE_CURRENT_BINARY_DIR} ${RVS_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR} ${RVS_LIB_DIR}/.. ${YAML_CPP_LIBRARIES}) - - ## additional libraries --set(ROCBLAS_LIB "rocblas") --set(ROC_THUNK_NAME "hsakmt") --set(CORE_RUNTIME_NAME "hsa-runtime") --set(HIPRAND_LIB "hiprand") --set(HIPBLASLT_LIB "hipblaslt") --set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64") --set(PROJECT_LINK_LIBS libdl.so libpthread.so libpci.so ${YAML_CPP_LIBRARIES}) -+set(ROCBLAS_LIB "${ROCBLAS_LIB_DIR}/librocblas.so") -+set(ROC_THUNK_NAME "${HSAKMT_LIB_DIR}/libhsakmt.a") -+set(CORE_RUNTIME_NAME "${HSA_PATH}/lib/libhsa-runtime64.so") -+set(YAML_CPP_LIB "${YAML_CPP_LIBRARIES}/libyaml-cpp.a") -+set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}") -+set(PROJECT_LINK_LIBS libdl.so libpthread.so libpci.so) -+set(HIPRAND_LIB "${HIPRAND_LIB_DIR}/libhiprand.so") -+set(ROCRAND_LIB "${ROCRAND_LIB_DIR}/librocrand.so") -+set(HIPBLASLT_LIB "${HIPBLASLT_LIB_DIR}/libhipblaslt.so") - - ## define target - add_executable(${RVS_TARGET} src/rvs.cpp) - target_link_libraries(${RVS_TARGET} rvslib -- ${ROCBLAS_LIB} ${ROCM_SMI_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${PROJECT_LINK_LIBS} ${HIPRAND_LIB} ${HIPBLASLT_LIB}) -+ ${ROCBLAS_LIB} ${ROCM_SMI_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${PROJECT_LINK_LIBS} ${HIPRAND_LIB} ${HIPBLASLT_LIB} ${YAML_CPP_LIB} ${ROCRAND_LIB}) - add_dependencies(${RVS_TARGET} rvslib) - - install(TARGETS ${RVS_TARGET} -diff --git a/rvs/tests.cmake b/rvs/tests.cmake -index 15e72c2..36fc223 100644 ---- a/rvs/tests.cmake -+++ b/rvs/tests.cmake -@@ -38,12 +38,12 @@ set(CORE_RUNTIME_NAME "hsa-runtime") - set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64") - - ## define lib directories --link_directories(${RVS_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${HIPRAND_LIB_DIR}) -+link_directories(${RVS_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - - ## define target for "test-to-fail" - add_executable(${RVS_TARGET}fail src/rvs.cpp) - target_link_libraries(${RVS_TARGET}fail rvslib rvslibut ${PROJECT_LINK_LIBS} -- ${ROCM_SMI_LIB} ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${ROCM_CORE} ${CORE_RUNTIME_TARGET} ${HIPRAND_LIB} ${HIPBLASLT_LIB}) -+ ${ROCM_SMI_LIB} ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${ROCM_CORE} ${CORE_RUNTIME_TARGET} ${HIPRAND_LIB} ${HIPBLASLT_LIB} ${ROCRAND_LIB}) - - target_compile_definitions(${RVS_TARGET}fail PRIVATE RVS_INVERT_RETURN_STATUS) - set_target_properties(${RVS_TARGET}fail PROPERTIES -@@ -212,7 +212,7 @@ FOREACH(SINGLE_TEST ${TESTSOURCES}) - ${PROJECT_LINK_LIBS} - ${PROJECT_TEST_LINK_LIBS} - rvslib rvslibut gtest_main gtest pthread -- ${ROCM_SMI_LIB} ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${HIPRAND_LIB} ${HIPBLASLT_LIB} -+ ${ROCM_SMI_LIB} ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${HIPRAND_LIB} ${HIPBLASLT_LIB} ${ROCRAND_LIB} - ) - add_dependencies(${TEST_NAME} rvs_gtest_target) - -diff --git a/rvslib/CMakeLists.txt b/rvslib/CMakeLists.txt -index bf806a0..7693b0e 100644 ---- a/rvslib/CMakeLists.txt -+++ b/rvslib/CMakeLists.txt -@@ -116,7 +116,7 @@ endif() - - ## define include directories - include_directories(./ ../ ../rvs -- ${ROCM_SMI_INC_DIR} ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR} ${HIPBLASLT_INC_DIR}) -+ ${ROCM_SMI_INC_DIR} ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_PATH} ${YAML_CPP_INCLUDE_DIRS} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - - link_directories(${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR}) - -diff --git a/smqt.so/CMakeLists.txt b/smqt.so/CMakeLists.txt -index 042586f..285cb17 100644 ---- a/smqt.so/CMakeLists.txt -+++ b/smqt.so/CMakeLists.txt -@@ -106,11 +106,11 @@ else() - endif() - - ## define include directories --include_directories(./ ../ pci) -+include_directories(./ ../ pci ${YAML_CPP_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - ## define source files - set(SOURCES src/rvs_module.cpp src/action.cpp) -diff --git a/smqt.so/tests.cmake b/smqt.so/tests.cmake -index 8b6ea93..329a967 100644 ---- a/smqt.so/tests.cmake -+++ b/smqt.so/tests.cmake -@@ -31,11 +31,11 @@ set(CORE_RUNTIME_NAME "hsa-runtime") - set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64") - - set(UT_LINK_LIBS libpthread.so libpci.so libm.so libdl.so "lib${ROCM_SMI_LIB}.so" -- ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB} -+ ${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} "lib${HIPRAND_LIB}.so" "lib${HIPBLASLT_LIB}.so" - ) - - # Add directories to look for library files to link --link_directories(${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR} ${HIPRAND_LIB_DIR}) -+link_directories(${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR}) - - set (UT_SOURCES src/action.cpp test/unitsmqt.cpp - ) -diff --git a/testif.so/CMakeLists.txt b/testif.so/CMakeLists.txt -index 4cba0f9..691534a 100644 ---- a/testif.so/CMakeLists.txt -+++ b/testif.so/CMakeLists.txt -@@ -108,11 +108,11 @@ endif() - - - ## define include directories --include_directories(./ ../ pci) -+include_directories(./ ../ pci ${YAML_CPP_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR}) - ## additional libraries --set (PROJECT_LINK_LIBS libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS libpthread.so libpci.so libm.so ${ROCBLAS_LIB_DIR}/librocblas.so ${HSAKMT_LIB_DIR}/libhsakmt.a ${HSA_PATH}/lib/libhsa-runtime64.so) - - ## define source files - ## set(SOURCES src/rvs_module.cpp src/action.cpp src/worker.cpp) -diff --git a/tst.so/CMakeLists.txt b/tst.so/CMakeLists.txt -index 1a1a8b0..7c70b04 100644 ---- a/tst.so/CMakeLists.txt -+++ b/tst.so/CMakeLists.txt -@@ -140,7 +140,7 @@ if(DEFINED RVS_ROCMSMI) - endif() - endif() - --if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so") -+if(NOT EXISTS "${HIP_INC_DIR}/lib/lib${HIP_HCC_LIB}.so") - message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR}) - RETURN() - endif() -@@ -155,11 +155,11 @@ if(DEFINED RVS_ROCMSMI) - endif() - - ## define include directories --include_directories(./ ../ ${ROCM_SMI_INC_DIR} ${ROCBLAS_INC_DIR} ${ROCR_INC_DIR} ${HIP_INC_DIR}) -+include_directories(./ ../ ${ROCM_SMI_INC_DIR} ${ROCBLAS_INC_DIR} ${ROCR_INC_DIR} ${HIP_INC_DIR} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIRS}) - # Add directories to look for library files to link --link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH}) -+link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH} ${HIPRAND_LIB_DIR}/.. ${ROCRAND_LIB_DIR}/..) - ## additional libraries --set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so) -+set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so ${HIPRAND_LIB_DIR}/libhiprand.so ${ROCRAND_LIB_DIR}/librocrand.so) - - set(SOURCES src/rvs_module.cpp src/action.cpp src/tst_worker.cpp ) - diff --git a/var/spack/repos/builtin/packages/rocm-validation-suite/package.py b/var/spack/repos/builtin/packages/rocm-validation-suite/package.py index 800952faa65bed..b767021e2855a4 100644 --- a/var/spack/repos/builtin/packages/rocm-validation-suite/package.py +++ b/var/spack/repos/builtin/packages/rocm-validation-suite/package.py @@ -21,6 +21,8 @@ class RocmValidationSuite(CMakePackage): license("MIT") maintainers("srekolam", "renjithravindrankannath", "afzpatel") + version("6.3.2", sha256="c13d1efc21358901074f73c48f9cc8531cd5c6d28b7702d022f3efbbaf4b4286") + version("6.3.1", sha256="5a5ec682729292d57838191e217a3475d662c5c25a7bd79c4996fdf4b5e36a5a") version("6.3.0", sha256="1e2b7eee002dd922625bcf792104e265cc5a57bec21f13d79d68036aa84b422f") version("6.2.4", sha256="ccdea6e955ca145a29d47da74d77b14196c935b57502edaed37fd18029b5220c") version("6.2.1", sha256="7e1f4f391a5b31087585b250136f3a8c1fdf4c609880499575291c61b3ebbc15") @@ -61,7 +63,11 @@ class RocmValidationSuite(CMakePackage): patch("009-replacing-rocm-path-with-package-path.patch", when="@6.0") patch("009-replacing-rocm-path-with-package-path-6.1.patch", when="@6.1:6.2.0") patch("009-replacing-rocm-path-with-package-path-6.2.1.patch", when="@6.2.1:6.2.4") - patch("009-replacing-rocm-path-with-package-path-6.3.patch", when="@6.3.0") + patch( + "https://github.com/ROCm/ROCmValidationSuite/commit/bd63256d43d11ae09a2c203e05cb002c7a730c59.patch?full_index=1", + sha256="bd63baeb4dea00ac4104ef7e9fab907bc04a1eccb93036478c005d0ac11034de", + when="@6.3.0:", + ) depends_on("cmake@3.5:", type="build") depends_on("zlib-api", type="link") depends_on("yaml-cpp~shared") @@ -114,17 +120,20 @@ def setup_build_environment(self, build_env): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"rocminfo@{ver}", when=f"@{ver}") depends_on(f"rocblas@{ver}", when=f"@{ver}") depends_on(f"rocm-smi-lib@{ver}", when=f"@{ver}") depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") - for ver in ["6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"hiprand@{ver}", when=f"@{ver}") depends_on(f"rocrand@{ver}", when=f"@{ver}") - depends_on("hipblaslt@6.3.0", when="@6.3.0") + for ver in ["6.3.0", "6.3.1", "6.3.2"]: + depends_on(f"hipblaslt@{ver}", when=f"@{ver}") def patch(self): if self.spec.satisfies("@5.2:5.4"): @@ -143,31 +152,33 @@ def patch(self): def cmake_args(self): args = [ self.define("RVS_BUILD_TESTS", False), - self.define("HIP_PATH", self.spec["hip"].prefix), - self.define("HSA_PATH", self.spec["hsa-rocr-dev"].prefix), - self.define("ROCM_SMI_DIR", self.spec["rocm-smi-lib"].prefix), - self.define("ROCBLAS_DIR", self.spec["rocblas"].prefix), - self.define("YAML_CPP_INCLUDE_DIRS", self.spec["yaml-cpp"].prefix.include), self.define("UT_INC", self.spec["googletest"].prefix.include), ] - if self.spec.satisfies("@6.2.1:"): + + if self.spec.satisfies("@6.2.1:6.2.4"): args.append(self.define("HIPRAND_DIR", self.spec["hiprand"].prefix)), args.append(self.define("ROCRAND_DIR", self.spec["rocrand"].prefix)), + libloc = self.spec["googletest"].prefix.lib64 if not os.path.isdir(libloc): libloc = self.spec["googletest"].prefix.lib args.append(self.define("UT_LIB", libloc)) if self.spec.satisfies("@:6.2"): + args.append(self.define("HIP_PATH", self.spec["hip"].prefix)), + args.append(self.define("HSA_PATH", self.spec["hsa-rocr-dev"].prefix)), + args.append(self.define("ROCM_SMI_DIR", self.spec["rocm-smi-lib"].prefix)), + args.append(self.define("ROCBLAS_DIR", self.spec["rocblas"].prefix)), + args.append( + self.define("YAML_CPP_INCLUDE_DIRS", self.spec["yaml-cpp"].prefix.include) + ), + libloc = self.spec["hsakmt-roct"].prefix.lib64 if not os.path.isdir(libloc): libloc = self.spec["hsakmt-roct"].prefix.lib args.append(self.define("HSAKMT_LIB_DIR", libloc)) - else: - args.append(self.define("HSAKMT_LIB_DIR", self.spec["hsa-rocr-dev"].prefix.lib)) - libloc = self.spec["yaml-cpp"].prefix.lib64 - if not os.path.isdir(libloc): - libloc = self.spec["yaml-cpp"].prefix.lib - args.append(self.define("YAML_CPP_LIB_PATH", libloc)) + if self.spec.satisfies("@6.3.0:"): - args.append(self.define("HIPBLASLT_DIR", self.spec["hipblaslt"].prefix)) + args.append(self.define("CMAKE_INSTALL_RPATH", self.spec.prefix.lib)), + args.append(self.define("CPACK_PACKAGING_INSTALL_PREFIX", self.spec.prefix)), + return args diff --git a/var/spack/repos/builtin/packages/rocminfo/package.py b/var/spack/repos/builtin/packages/rocminfo/package.py index e382f04ac188e3..96eaa52e710d2e 100644 --- a/var/spack/repos/builtin/packages/rocminfo/package.py +++ b/var/spack/repos/builtin/packages/rocminfo/package.py @@ -17,6 +17,8 @@ class Rocminfo(CMakePackage): maintainers("srekolam", "renjithravindrankannath", "haampie") version("master", branch="master") + version("6.3.2", sha256="a98a32bae0e118397b5559b4a584c9363191bb2d1f45fe13b09f502016745e8f") + version("6.3.1", sha256="30cf7ed537c066e325a8731d0fbe62be2f0f66c8700a06f334e787e9f0f87437") version("6.3.0", sha256="40e2ef89e135770196022761cb929af93c80c41869082b3ef80e42b7772267d0") version("6.2.4", sha256="14d4b0e22e2314156091ac9ad1646dd20909dba3a43e037584a503a6754e7f9e") version("6.2.1", sha256="ae6e08962535e76a81ed872cbd6bf6860c46fa6e4e4bc8f7849c8781359798d8") @@ -85,6 +87,8 @@ class Rocminfo(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", "master", ]: depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") @@ -105,6 +109,8 @@ class Rocminfo(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocmlir/package.py b/var/spack/repos/builtin/packages/rocmlir/package.py index a5526e1d1c4df6..1d81681f9d3b83 100644 --- a/var/spack/repos/builtin/packages/rocmlir/package.py +++ b/var/spack/repos/builtin/packages/rocmlir/package.py @@ -17,6 +17,8 @@ class Rocmlir(CMakePackage): maintainers("srekolam", "afzpatel", "renjithravindrankannath") + version("6.3.2", sha256="5911e880a66faecb08d242efa3e5eb6f8ce32cb21ea09dec36f4aef111c395fb") + version("6.3.1", sha256="b9e0ea8cfb83c20553b1ec1556752958afaa421a8d7326b1da748395ba7b75ac") version("6.3.0", sha256="8dd167250e138fac0609f4ed06fc6a4dca5edad346166a291f20b4dad99bbd0b") version("6.2.4", sha256="3283685431fd59e20a6ac5737df22c7c7421901779a2a0b6dbd6c1ab1f1b5adb") version("6.2.1", sha256="eff594c6b6b97ac21bf268da49fcd016584cfe28c8ff64b0a20b8a9144dca683") @@ -76,6 +78,8 @@ def patch(self): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"llvm-amdgpu@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocprim/package.py b/var/spack/repos/builtin/packages/rocprim/package.py index 36ff91fbf3e0b5..df9585b8559f4f 100644 --- a/var/spack/repos/builtin/packages/rocprim/package.py +++ b/var/spack/repos/builtin/packages/rocprim/package.py @@ -16,6 +16,8 @@ class Rocprim(CMakePackage): license("MIT") maintainers("cgmb", "srekolam", "renjithravindrankannath", "afzpatel") + version("6.3.2", sha256="fbb4839992eaba838f798408636da30f0d61b669513dae185ab790c5fa5595c4") + version("6.3.1", sha256="37690d9f326d68379d52a21fe9184061d38b15263a566f1f182d539e4b3277d5") version("6.3.0", sha256="d97c6edcf1f636721f8c023b54f3fad968b48b0709a95ecd640ec0ab1057069e") version("6.2.4", sha256="c567aa5e3209dd00aefe5052dde8ceb5bcc3a4aeeeb3ad8dc322f8d0791fc07f") version("6.2.1", sha256="55cfa8a4224bcd2dcf2298e7938c983a8bb0c1c072fc8295c198e53785b521ac") @@ -77,6 +79,8 @@ class Rocprim(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"comgr@{ver}", when=f"@{ver}") @@ -112,7 +116,7 @@ def cmake_args(self): args.append(self.define("__skip_rocmclang", "ON")) if self.spec.satisfies("@5.2:"): args.append(self.define("CMAKE_MODULE_PATH", self.spec["hip"].prefix.lib.cmake.hip)) - if self.spec.satisfies("@5.2:"): + if self.spec.satisfies("@5.2:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) return args diff --git a/var/spack/repos/builtin/packages/rocprofiler-compute/package.py b/var/spack/repos/builtin/packages/rocprofiler-compute/package.py new file mode 100644 index 00000000000000..63a5563601dde7 --- /dev/null +++ b/var/spack/repos/builtin/packages/rocprofiler-compute/package.py @@ -0,0 +1,45 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class RocprofilerCompute(CMakePackage): + """Advanced Profiling and Analytics for AMD Hardware""" + + homepage = "https://github.com/ROCm/rocprofiler-compute" + git = "https://github.com/ROCm/rocprofiler-compute.git" + url = "https://github.com/ROCm/rocprofiler-compute/archive/refs/tags/rocm-6.3.2.tar.gz" + + tags = ["rocm"] + + maintainers("afzpatel", "srekolam", "renjithravindrankannath") + + license("MIT") + version("6.3.2", sha256="317f19acfa6e6780923e6c8144c3c223b523c382588df528b6df001fae38d13d") + + depends_on("python@3.8:") + depends_on("py-pip", type="run") + depends_on("py-astunparse@1.6.2", type=("build", "run")) # wants exact version + depends_on("py-colorlover", type=("build", "run")) + depends_on("py-pyyaml") + depends_on("py-matplotlib") + depends_on("py-pandas@1.4.3:") + depends_on("py-numpy@1.17.5:") + depends_on("py-pymongo") + depends_on("py-tabulate") + depends_on("py-tqdm") + depends_on("py-kaleido") + depends_on("py-plotille") + depends_on("py-dash-svg", type=("build", "run")) + depends_on("py-dash", type=("build", "run")) + depends_on("py-dash-bootstrap-components", type=("build", "run")) + + def cmake_args(self): + args = [self.define("ENABLE_TESTS", self.run_tests)] + return args + + @run_before("cmake") + def before_cmake(self): + touch(join_path(self.stage.source_path, "VERSION.sha")) diff --git a/var/spack/repos/builtin/packages/rocprofiler-dev/package.py b/var/spack/repos/builtin/packages/rocprofiler-dev/package.py index 8bdb35f7e236cb..34d023458ad66c 100644 --- a/var/spack/repos/builtin/packages/rocprofiler-dev/package.py +++ b/var/spack/repos/builtin/packages/rocprofiler-dev/package.py @@ -18,6 +18,8 @@ class RocprofilerDev(CMakePackage): maintainers("srekolam", "renjithravindrankannath", "afzpatel") libraries = ["librocprofiler64"] license("MIT") + version("6.3.2", sha256="c440ac79fa9f3e8c1decbfd83557d5cbbc4bb720927880b33dc36e682f37ec26") + version("6.3.1", sha256="c4666c1167e551cfafc343b092506834477556ba6f7b0739552d660fd69c30fb") version("6.3.0", sha256="45ddc1d87a33bb27e9445e642a3495fef21cec1e545793b2ca5f551743961b1f") version("6.2.4", sha256="898eae91938c2d08207b615db03a784c7f3090989bcf09260635d18aa5930a2c") version("6.2.1", sha256="6eb36dad67e3b294f210e21987c52aec666652cffa87b8af1f8077d5b7812245") @@ -86,6 +88,8 @@ class RocprofilerDev(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") depends_on(f"rocminfo@{ver}", when=f"@{ver}") @@ -103,6 +107,8 @@ class RocprofilerDev(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"rocm-smi-lib@{ver}", when=f"@{ver}") @@ -123,6 +129,8 @@ class RocprofilerDev(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"aqlprofile@{ver}", when=f"@{ver}") depends_on(f"comgr@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocprofiler-register/package.py b/var/spack/repos/builtin/packages/rocprofiler-register/package.py index fe5ccd7f0d11de..e3e0aa8d779e08 100644 --- a/var/spack/repos/builtin/packages/rocprofiler-register/package.py +++ b/var/spack/repos/builtin/packages/rocprofiler-register/package.py @@ -19,6 +19,8 @@ class RocprofilerRegister(CMakePackage): maintainers("afzpatel", "srekolam", "renjithravindrankannath") license("MIT") + version("6.3.2", sha256="2e973dd10af220cd37838c13f3c7d52671f5cf846a3f06311b138770b62f51f4") + version("6.3.1", sha256="82e2fbd2da058503398848c3e662f518e99f9bccb7b98880aa321c1f6511fca9") version("6.3.0", sha256="51aae00e7a8bb44a369de9626fca360c80879034ab43092eb6e4ccfa1b51ca47") version("6.2.4", sha256="e7c31d5e1100c1e8ae0a2c6de3bfea75341abc4a68d02b58089421e2a54bba54") version("6.2.1", sha256="161d3502863147df4daeadc538d0eb156c314c94634f8c34ee5994f046f8753f") diff --git a/var/spack/repos/builtin/packages/rocprofiler-systems/add_cstdint.patch b/var/spack/repos/builtin/packages/rocprofiler-systems/add_cstdint.patch new file mode 100644 index 00000000000000..810671f8a75578 --- /dev/null +++ b/var/spack/repos/builtin/packages/rocprofiler-systems/add_cstdint.patch @@ -0,0 +1,12 @@ +diff --git a/external/timemory/source/timemory/backends/gperftools.hpp b/external/timemory/source/timemory/backends/gperftools.hpp +index 9177da5..d4c6d74 100644 +--- a/external/timemory/source/timemory/backends/gperftools.hpp ++++ b/external/timemory/source/timemory/backends/gperftools.hpp +@@ -26,6 +26,7 @@ + +#include +#include ++#include +#include + +#if defined(TIMEMORY_USE_GPERFTOOLS) || defined(TIMEMORY_USE_GPERFTOOLS_TCMALLOC) diff --git a/var/spack/repos/builtin/packages/rocprofiler-systems/package.py b/var/spack/repos/builtin/packages/rocprofiler-systems/package.py new file mode 100644 index 00000000000000..c38e344b0616b9 --- /dev/null +++ b/var/spack/repos/builtin/packages/rocprofiler-systems/package.py @@ -0,0 +1,182 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class RocprofilerSystems(CMakePackage): + """Application Profiling, Tracing, and Analysis""" + + homepage = "https://github.com/ROCm/rocprofiler-systems" + git = "https://github.com/ROCm/rocprofiler-systems.git" + url = "https://github.com/ROCm/rocprofiler-systems/archive/refs/tags/rocm-6.3.1.tar.gz" + + maintainers("dgaliffiAMD", "afzpatel", "srekolam", "renjithravindrankannath", "jrmadsen") + + license("MIT") + + version("amd-mainline", branch="amd-mainline", submodules=True) + version("amd-staging", branch="amd-staging", submodules=True) + version( + "6.3.2", + git="https://github.com/ROCm/rocprofiler-systems", + tag="rocm-6.3.2", + commit="2fd5fbbef941ff219a1ecef702f8cfaae6e8e5ba", + submodules=True, + ) + version( + "6.3.1", + git="https://github.com/ROCm/rocprofiler-systems", + tag="rocm-6.3.1", + commit="04a84dd0b0df3dfd61f7765696e0e474ec29f10b", + submodules=True, + ) + + version( + "6.3.0", + git="https://github.com/ROCm/rocprofiler-systems", + tag="rocm-6.3.0", + commit="71a5e271b5e07efd2948fb6e7b451db5e8e40cb8", + submodules=True, + ) + + depends_on("c", type="build") # generated + depends_on("cxx", type="build") # generated + depends_on("fortran", type="build") # generated + + variant( + "rocm", + default=True, + description="Enable ROCm API, kernel tracing, and GPU HW counters support", + ) + variant("strip", default=False, description="Faster binary instrumentation, worse debugging") + variant( + "python", default=False, description="Enable support for Python function profiling and API" + ) + variant("papi", default=True, description="Enable HW counters support via PAPI") + variant("ompt", default=True, description="Enable OpenMP Tools support") + variant( + "tau", + default=False, + description="Enable support for using TAU markers in omnitrace instrumentation", + ) + variant( + "caliper", + default=False, + description="Enable support for using Caliper markers in omnitrace instrumentation", + ) + variant( + "perfetto_tools", + default=False, + description="Install perfetto tools (e.g. traced, perfetto)", + ) + variant( + "mpi", + default=False, + description=( + "Enable intercepting MPI functions and aggregating output during finalization " + "(requires target application to use same MPI installation)" + ), + ) + variant( + "mpi_headers", + default=True, + description=( + "Enable intercepting MPI functions but w/o support for aggregating output " + "(target application can use any MPI installation)" + ), + ) + + extends("python", when="+python") + + # hard dependencies + depends_on("cmake@3.16:", type="build") + depends_on("dyninst@11.0.1:", type=("build", "run")) + depends_on("libunwind", type=("build", "run")) + depends_on("papi+shared", when="+papi") + depends_on("mpi", when="+mpi") + depends_on("tau", when="+tau") + depends_on("caliper", when="+caliper") + depends_on("python@3:", when="+python", type=("build", "run")) + depends_on("dyninst@12:", when="+rocm") + depends_on("m4", when="+rocm") + depends_on("texinfo", when="+rocm") + depends_on("libunwind", when="+rocm") + depends_on("autoconf", when="+rocm") + depends_on("automake", when="+rocm") + depends_on("libtool", when="+rocm") + with when("+rocm"): + for ver in ["6.3.0", "6.3.1", "6.3.2"]: + depends_on(f"rocm-smi-lib@{ver}", when=f"@{ver}") + depends_on(f"hip@{ver}", when=f"@{ver}") + depends_on(f"roctracer-dev@{ver}", when=f"@{ver}") + depends_on(f"rocprofiler-dev@{ver}", when=f"@{ver}") + + patch("add_cstdint.patch", when="%gcc@13:") + + def cmake_args(self): + spec = self.spec + + args = [ + self.define("SPACK_BUILD", True), + self.define("ROCPROFSYS_BUILD_PAPI", False), + self.define("ROCPROFSYS_BUILD_PYTHON", True), + self.define("ROCPROFSYS_BUILD_LIBUNWIND", False), + self.define("ROCPROFSYS_BUILD_STATIC_LIBGCC", False), + self.define("ROCPROFSYS_BUILD_STATIC_LIBSTDCXX", False), + self.define_from_variant("ROCPROFSYS_BUILD_LTO", "ipo"), + self.define_from_variant("ROCPROFSYS_USE_HIP", "rocm"), + self.define_from_variant("ROCPROFSYS_USE_MPI", "mpi"), + self.define_from_variant("ROCPROFSYS_USE_OMPT", "ompt"), + self.define_from_variant("ROCPROFSYS_USE_PAPI", "papi"), + self.define_from_variant("ROCPROFSYS_USE_RCCL", "rocm"), + self.define_from_variant("ROCPROFSYS_USE_ROCM_SMI", "rocm"), + self.define_from_variant("ROCPROFSYS_USE_ROCTRACER", "rocm"), + self.define_from_variant("ROCPROFSYS_USE_ROCPROFILER", "rocm"), + self.define_from_variant("ROCPROFSYS_USE_PYTHON", "python"), + self.define_from_variant("ROCPROFSYS_USE_MPI_HEADERS", "mpi_headers"), + self.define_from_variant("ROCPROFSYS_STRIP_LIBRARIES", "strip"), + self.define_from_variant("ROCPROFSYS_INSTALL_PERFETTO_TOOLS", "perfetto_tools"), + # timemory arguments + self.define("TIMEMORY_UNITY_BUILD", False), + self.define("TIMEMORY_BUILD_CALIPER", False), + self.define_from_variant("TIMEMORY_USE_TAU", "tau"), + self.define_from_variant("TIMEMORY_USE_CALIPER", "caliper"), + ] + + if "+tau" in spec: + tau_root = spec["tau"].prefix + args.append(self.define("TAU_ROOT_DIR", tau_root)) + + if "+mpi" in spec: + args.append(self.define("MPI_C_COMPILER", spec["mpi"].mpicc)) + args.append(self.define("MPI_CXX_COMPILER", spec["mpi"].mpicxx)) + + if spec.satisfies("@6.3:"): + args.append(self.define("dl_LIBRARY", "dl")) + args.append( + self.define("libunwind_INCLUDE_DIR", self.spec["libunwind"].prefix.include) + ) + if spec.satisfies("%gcc@13:"): + self.define("ROCPROFSYS_BUILD_DYNINST", True), + self.define("DYNINST_BUILD_TBB", True), + else: + self.define("ROCPROFSYS_BUILD_DYNINST", False), + return args + + def flag_handler(self, name, flags): + if self.spec.satisfies("@6.3:"): + if name == "ldflags": + flags.append("-lintl") + return (flags, None, None) + + def setup_build_environment(self, env): + if "+tau" in self.spec: + import glob + + # below is how TAU_MAKEFILE is set in packages/tau/package.py + pattern = join_path(self.spec["tau"].prefix.lib, "Makefile.*") + files = glob.glob(pattern) + if files: + env.set("TAU_MAKEFILE", files[0]) diff --git a/var/spack/repos/builtin/packages/rocpydecode/package.py b/var/spack/repos/builtin/packages/rocpydecode/package.py index 2151f4c06ce64f..ea2c2eb689df33 100644 --- a/var/spack/repos/builtin/packages/rocpydecode/package.py +++ b/var/spack/repos/builtin/packages/rocpydecode/package.py @@ -13,6 +13,8 @@ class Rocpydecode(CMakePackage): url = "https://github.com/ROCm/rocPyDecode/archive/refs/tags/rocm-6.2.0.tar.gz" maintainers("afzpatel", "srekolam", "renjithravindrankannath") + version("6.3.2", sha256="c1b4dba9f8a28299279ad4e4aeb0c857c3a9772d016fcc0f164940f22faa6dee") + version("6.3.1", sha256="77ed22ee23409b004676fb1a11b963324b878e786dae0a56fdef58375716c9eb") version("6.3.0", sha256="4d0d969fb32328d8277b5cc451ee875428f58c12c1d4b3ff33247774ecc6caf8") version("6.2.4", sha256="9cdb8bdc65b54b2c02d6c950dd34cd702ec50d903aa4d252d1eb1f8cae8c0afb") version("6.2.1", sha256="34c595cfe40ad74fcec2f52e7cc7be3ad8c8334030b0e98eb36305b6f63edc0d") @@ -22,7 +24,7 @@ class Rocpydecode(CMakePackage): depends_on("ffmpeg@4.4:6") depends_on("dlpack") - for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0"]: + for ver in ["6.2.0", "6.2.1", "6.2.4", "6.3.0", "6.3.1", "6.3.2"]: depends_on(f"rocdecode@{ver}", when=f"@{ver}") def patch(self): diff --git a/var/spack/repos/builtin/packages/rocrand/package.py b/var/spack/repos/builtin/packages/rocrand/package.py index f7b53f6f6de2c8..a1006c85f7f8b8 100644 --- a/var/spack/repos/builtin/packages/rocrand/package.py +++ b/var/spack/repos/builtin/packages/rocrand/package.py @@ -24,6 +24,8 @@ class Rocrand(CMakePackage): version("develop", branch="develop") version("master", branch="master") + version("6.3.2", sha256="57f364806369ddb80761ce44187920075cf446de527dd1fbc6adbb4b4b3e9bb8") + version("6.3.1", sha256="80d86c31ec9cb40f5c5532281b42cf99fbc8a81e3ffd3bc8b3bbe4a7e509bf5f") version("6.3.0", sha256="396d2dc842c64d29f577365c348fbccd6260a11431eec61f233fdb0f38b7625d") version("6.2.4", sha256="94a2ea2413623b427ddf69365b3996c18721456965024c0dfac506a13c8dc547") version("6.2.1", sha256="ed07f638b5e30199251ddda6dd9ee53ee0ec49bcf37cc571a3de85c3a9833248") @@ -127,6 +129,8 @@ class Rocrand(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"rocm-cmake@{ver}:", type="build", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocsolver/package.py b/var/spack/repos/builtin/packages/rocsolver/package.py index 3100430110b11a..b19babea1af61c 100644 --- a/var/spack/repos/builtin/packages/rocsolver/package.py +++ b/var/spack/repos/builtin/packages/rocsolver/package.py @@ -45,6 +45,8 @@ class Rocsolver(CMakePackage): version("develop", branch="develop") version("master", branch="master") + version("6.3.2", sha256="834f532c54bdf0e4900e73ffb0544068071976175559c8bf3c50d7a3b7230a3a") + version("6.3.1", sha256="ffa70c4dedeb20a33cf79d4ae3e95ade2ae5202f819459b19a0ebf62c380bba0") version("6.3.0", sha256="48861f7b86379f2b825c0496d1d9318c6e29426d083b361c10f685b0ddd66274") version("6.2.4", sha256="022863df6a9d51bd216e56dd4dc7d437584e48304cfdbc9c5751be1abfd7c73f") version("6.2.1", sha256="e1c19cd25f7119c116d1c63e2384e9c47a4ff7ae14bb42dfcef766a4d3a011d5") @@ -109,6 +111,8 @@ class Rocsolver(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"rocblas@{ver}", when=f"@{ver}") @@ -141,7 +145,7 @@ def cmake_args(self): if self.spec.satisfies("^cmake@3.21.0:3.21.2"): args.append(self.define("__skip_rocmclang", "ON")) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): args.append("-DCMAKE_INSTALL_LIBDIR=lib") diff --git a/var/spack/repos/builtin/packages/rocsparse/package.py b/var/spack/repos/builtin/packages/rocsparse/package.py index 5d56b24884739d..0da9389624e916 100644 --- a/var/spack/repos/builtin/packages/rocsparse/package.py +++ b/var/spack/repos/builtin/packages/rocsparse/package.py @@ -38,6 +38,8 @@ class Rocsparse(CMakePackage): conflicts("+asan", when="os=centos8") license("MIT") + version("6.3.2", sha256="665a85517d50e5ef37b1f953ccb17108d6a5cb30db21c5364bd50a41d44c61f2") + version("6.3.1", sha256="95c9dcc8421711f2f203a34c2830c5ac504e127922e0a83dbc68bccd5509c72f") version("6.3.0", sha256="38aaf1cc55f57566a3056a970f73f40a9a4930583d6e57fc9c7745a127029227") version("6.2.4", sha256="1f86c2d439e777cd17724269da66997d351b3a1b83f44143361e9c77d80e2370") version("6.2.1", sha256="4691d689db0a03fc950dbc9d88471752f6d17f5382a4bd2f7e23dfb43fc7074c") @@ -85,6 +87,8 @@ class Rocsparse(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"rocprim@{ver}", when=f"@{ver}") @@ -287,7 +291,7 @@ def cmake_args(self): if self.spec.satisfies("^cmake@3.21.0:3.21.2"): args.append(self.define("__skip_rocmclang", "ON")) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) if self.spec.satisfies("@5.3.0:"): diff --git a/var/spack/repos/builtin/packages/rocthrust/package.py b/var/spack/repos/builtin/packages/rocthrust/package.py index e99b0357d725f2..b945c5e56cd454 100644 --- a/var/spack/repos/builtin/packages/rocthrust/package.py +++ b/var/spack/repos/builtin/packages/rocthrust/package.py @@ -17,6 +17,8 @@ class Rocthrust(CMakePackage): tags = ["rocm"] maintainers("cgmb", "srekolam", "renjithravindrankannath", "afzpatel") + version("6.3.2", sha256="c3991bbd9f8b0e3ecbc18a7d014446608bfe2a3660a8d9e3dcc136d784883935") + version("6.3.1", sha256="a63dd161f4b30be7fcc4ad4184b948646233d59b5ca13c239f723ab59c607a1a") version("6.3.0", sha256="553e67bc0a7fb2d129b15fd4b8889f9ee56ebd29bc885a1fb32918dfcfa3b955") version("6.2.4", sha256="ec212f3f5ff1ff3c71b85dae50d19c1faa344d400b5d1fa376471c2390361dc8") version("6.2.1", sha256="de6121e354e4d2d5f90243acc1071e9afb2a335e17570d293b590b85f3f58fa2") @@ -75,6 +77,8 @@ class Rocthrust(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hip@{ver}", when=f"@{ver}") depends_on(f"rocprim@{ver}", when=f"@{ver}") @@ -99,7 +103,7 @@ def cmake_args(self): if self.spec.satisfies("^cmake@3.21.0:3.21.2"): args.append(self.define("__skip_rocmclang", "ON")) - if self.spec.satisfies("@5.2.0:"): + if self.spec.satisfies("@5.2.0:6.3.1"): args.append(self.define("BUILD_FILE_REORG_BACKWARD_COMPATIBILITY", True)) return args diff --git a/var/spack/repos/builtin/packages/roctracer-dev-api/package.py b/var/spack/repos/builtin/packages/roctracer-dev-api/package.py index f321542942ba39..c2ef134c9a779d 100644 --- a/var/spack/repos/builtin/packages/roctracer-dev-api/package.py +++ b/var/spack/repos/builtin/packages/roctracer-dev-api/package.py @@ -18,6 +18,8 @@ class RoctracerDevApi(Package): license("MIT") maintainers("srekolam", "renjithravindrankannath", "afzpatel") + version("6.3.2", sha256="ca8e93fc37f4671db28df5cb7a24b48f3d4879a188e4780e45961bba3725bb8a") + version("6.3.1", sha256="89e4ab249f527131f684714c9135c69eaad1a63b7e74bae718b1617543b94426") version("6.3.0", sha256="6eb09e3b3b45ed68b2ac7ed6848521e645569bcd4a1f3a336cf2473a801308a2") version("6.2.4", sha256="b94c7db8ac57a4a1d7f8115020c36551220c20f33289fd06830495b4914a7d7b") version("6.2.1", sha256="9e69c90b9dc650e0d8642ec675082c9566e576285a725c3a5d07a37cebb18810") diff --git a/var/spack/repos/builtin/packages/roctracer-dev/package.py b/var/spack/repos/builtin/packages/roctracer-dev/package.py index e0905a98cea368..5f4e4adc636c50 100644 --- a/var/spack/repos/builtin/packages/roctracer-dev/package.py +++ b/var/spack/repos/builtin/packages/roctracer-dev/package.py @@ -21,6 +21,8 @@ class RoctracerDev(CMakePackage, ROCmPackage): libraries = ["libroctracer64"] license("MIT") + version("6.3.2", sha256="ca8e93fc37f4671db28df5cb7a24b48f3d4879a188e4780e45961bba3725bb8a") + version("6.3.1", sha256="89e4ab249f527131f684714c9135c69eaad1a63b7e74bae718b1617543b94426") version("6.3.0", sha256="6eb09e3b3b45ed68b2ac7ed6848521e645569bcd4a1f3a336cf2473a801308a2") version("6.2.4", sha256="b94c7db8ac57a4a1d7f8115020c36551220c20f33289fd06830495b4914a7d7b") version("6.2.1", sha256="9e69c90b9dc650e0d8642ec675082c9566e576285a725c3a5d07a37cebb18810") @@ -93,6 +95,8 @@ class RoctracerDev(CMakePackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"hsa-rocr-dev@{ver}", when=f"@{ver}") depends_on(f"rocminfo@{ver}", when=f"@{ver}") @@ -117,6 +121,8 @@ class RoctracerDev(CMakePackage, ROCmPackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on(f"rocm-core@{ver}", when=f"@{ver}") diff --git a/var/spack/repos/builtin/packages/rocwmma/package.py b/var/spack/repos/builtin/packages/rocwmma/package.py index ddf618c8d926d3..513a6f40aee635 100644 --- a/var/spack/repos/builtin/packages/rocwmma/package.py +++ b/var/spack/repos/builtin/packages/rocwmma/package.py @@ -26,6 +26,8 @@ class Rocwmma(CMakePackage): license("MIT") maintainers("srekolam", "renjithravindrankannath", "afzpatel") + version("6.3.2", sha256="f9dc5e837ac30efe4600775fb309e46ed8ef112a673435663d2ef7fdf28f8f12") + version("6.3.1", sha256="9afd06c58b405dd86535ea1ca479fd6f9d717fa8665710bb64fc8027a26e6ac7") version("6.3.0", sha256="8dcd06599083dc3a67958a1b6f7c29c1880758eb6ff579143e0fb162985b0612") version("6.2.4", sha256="eaa2f313a1bfe455d9641df44d7b890ea7334b58a643c75f0b7f108cae5f777c") version("6.2.1", sha256="f05fcb3612827502d2a15b30f0e46228625027145013652b8f591ad403fa9ddc") @@ -92,6 +94,8 @@ class Rocwmma(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on("rocm-cmake@%s:" % ver, type="build", when="@" + ver) depends_on("llvm-amdgpu@" + ver, type="build", when="@" + ver) @@ -113,6 +117,8 @@ class Rocwmma(CMakePackage): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on("rocm-smi-lib@" + ver, when="@" + ver) diff --git a/var/spack/repos/builtin/packages/root/package.py b/var/spack/repos/builtin/packages/root/package.py index 181f6503a32185..83442b59168796 100644 --- a/var/spack/repos/builtin/packages/root/package.py +++ b/var/spack/repos/builtin/packages/root/package.py @@ -6,10 +6,9 @@ import os import sys -import spack.util.environment from spack.operating_systems.mac_os import macos_version from spack.package import * -from spack.util.environment import is_system_path +from spack.util.environment import EnvironmentModifications, is_system_path _is_macos = sys.platform == "darwin" @@ -44,6 +43,9 @@ class Root(CMakePackage): ) # Production version + version("6.34.04", sha256="e320c5373a8e87bb29b7280954ca8355ad8c4295cf49235606f0c8b200acb374") + version("6.34.02", sha256="166bec562e420e177aaf3133fa3fb09f82ecddabe8a2e1906345bad442513f94") + version("6.34.00", sha256="f3b00f3db953829c849029c39d7660a956468af247efd946e89072101796ab03") version("6.32.08", sha256="29ad4945a72dff1a009c326a65b6fa5ee2478498823251d3cef86a2cbeb77b27") version("6.32.06", sha256="3fc032d93fe848dea5adb1b47d8f0a86279523293fee0aa2b3cd52a1ffab7247") version("6.32.04", sha256="132f126aae7d30efbccd7dcd991b7ada1890ae57980ef300c16421f9d4d07ea8") @@ -215,6 +217,10 @@ class Root(CMakePackage): default=True, description="Ignore most of Root's feature defaults except for " "basic graphic options", ) + variant("geom", default=True, description="Enable support for the geometry library") + conflicts("~geom", when="@:6.33", msg="geom is always enabled through 6.33") + variant("geombuilder", default=False, description="Enable support for the geombuilder library") + conflicts("~geombuilder", when="@:6.33", msg="geombuilder is always enabled through 6.33") variant("gsl", default=True, description="Enable linking against shared libraries for GSL") variant("http", default=False, description="Enable HTTP server support") variant( @@ -266,11 +272,17 @@ class Root(CMakePackage): default=True, description="Build TMVA with CPU support for deep learning (requires BLAS)", ) + variant( + "tmva-cudnn", + when="@6.34.00:", + default=True, + description="Enable support for cuDNN in TMVA", + ) variant( "tmva-gpu", when="@6.15.02:", default=False, - description="Build TMVA with GPU support for deep learning (requries CUDA)", + description="Build TMVA with GPU support for deep learning (requires CUDA)", ) variant( "tmva-pymva", @@ -285,6 +297,12 @@ class Root(CMakePackage): description="Build TMVA with support for sofie - " "fast inference code generation (requires protobuf 3)", ) + variant( + "tpython", + when="@6.34.00: +python", + default=True, + description="Build the TPython class to run Python code from C++", + ) variant("unuran", default=True, description="Use UNURAN for random number generation") variant("vc", default=False, description="Enable Vc for adding new types for SIMD programming") variant("vdt", default=True, description="Enable set of fast and vectorisable math functions") @@ -317,6 +335,7 @@ class Root(CMakePackage): depends_on("cmake@3.9:", type="build", when="@6.18.00:") depends_on("cmake@3.16:", type="build", when="@6.26.00:") depends_on("cmake@3.19:", type="build", when="@6.28.00: platform=darwin") + depends_on("cmake@3.20:", type="build", when="@6.34.00:") depends_on("pkgconfig", type="build") # 6.32.00 requires sys/random.h @@ -362,6 +381,7 @@ class Root(CMakePackage): # Python depends_on("python@2.7:", when="+python", type=("build", "run")) depends_on("python@2.7:3.10", when="@:6.26.09 +python", type=("build", "run")) + depends_on("python@3.8:", when="@6.34.00: +python", type=("build", "run")) depends_on("py-numpy", type=("build", "run"), when="+tmva-pymva") # See: https://sft.its.cern.ch/jira/browse/ROOT-10626 depends_on("py-numpy", type=("build", "run"), when="@6.20.00:6.20.05 +python") @@ -393,6 +413,7 @@ class Root(CMakePackage): depends_on("pythia8", when="+pythia8") depends_on("r", when="+r", type=("build", "run")) depends_on("r-rcpp", when="+r", type=("build", "run")) + depends_on("r-rcpp@:1.0.12", when="+r @:6.32.02", type=("build", "run")) depends_on("r-rinside", when="+r", type=("build", "run")) depends_on("readline", when="+r") depends_on("shadow", when="+shadow") @@ -428,11 +449,14 @@ class Root(CMakePackage): conflicts("%intel") # ROOT <6.08 was incompatible with the GCC 5+ ABI - conflicts("%gcc@5.0.0:", when="@:6.07") + conflicts("%gcc@5:", when="@:6.07") # The version of Clang featured in ROOT <6.12 fails to build with # GCC 9.2.1, which we can safely extrapolate to the GCC 9 series. - conflicts("%gcc@9.0.0:", when="@:6.11") + conflicts("%gcc@9:", when="@:6.11") + + # GCC 15 support was added in 6.34.04 + conflicts("%gcc@15:", when="@:6.34.02") # See https://github.com/root-project/root/issues/9297 conflicts("target=ppc64le:", when="@:6.24") @@ -549,6 +573,8 @@ def _add_variant(variants, features, featurename, variantname): _add_variant(v, f, "fitsio", "+fits") _add_variant(v, f, ("ftgl", "opengl"), "+opengl") _add_variant(v, f, "gdml", "+gdml") + _add_variant(v, f, "geom", "+geom") + _add_variant(v, f, "geombuilder", "+geombuilder") _add_variant(v, f, "mathmore", "+math") _add_variant(v, f, "gviz", "+graphviz") _add_variant(v, f, "http", "+http") @@ -692,6 +718,8 @@ def cmake_args(self): define_from_variant("fitsio", "fits"), define_from_variant("ftgl", "opengl"), define_from_variant("gdml"), + define_from_variant("geom"), + define_from_variant("geombuilder"), define_from_variant("genvector", "math"), define("geocad", False), define("gfal", False), @@ -776,6 +804,11 @@ def cmake_args(self): if self.spec.satisfies("@:6.30"): options.append(define_from_variant("minuit2", "minuit")) + if self.spec.satisfies("@6.34:"): + options.append(define_from_variant("tmva-cudnn", "tmva-cudnn")) + options.append(define_from_variant("tmva-cudnn", "cudnn")) + options.append(define_from_variant("tpython")) + # #################### Compiler options #################### if _is_macos and self.compiler.cc == "gcc": @@ -856,14 +889,13 @@ def setup_run_environment(self, env): # the following vars are copied from thisroot.sh; silence a cppyy warning env.set("CLING_STANDARD_PCH", "none") env.set("CPPYY_API_PATH", "none") + env.set("CPPYY_BACKEND_LIBRARY", self.prefix.lib.root.libcppyy_backend) if "+rpath" not in self.spec: env.prepend_path(self.root_library_path, self.prefix.lib.root) # Cleanup. self.sanitize_environments(env) - def setup_dependent_build_environment( - self, env: spack.util.environment.EnvironmentModifications, dependent_spec - ): + def setup_dependent_build_environment(self, env: EnvironmentModifications, dependent_spec): env.set("ROOTSYS", self.prefix) env.set("ROOT_VERSION", "v{0}".format(self.version.up_to(1))) env.prepend_path("PYTHONPATH", self.prefix.lib.root) @@ -878,9 +910,7 @@ def setup_dependent_build_environment( # Cleanup. self.sanitize_environments(env) - def setup_dependent_run_environment( - self, env: spack.util.environment.EnvironmentModifications, dependent_spec - ): + def setup_dependent_run_environment(self, env: EnvironmentModifications, dependent_spec): env.prepend_path("ROOT_INCLUDE_PATH", dependent_spec.prefix.include) # For dependents that build dictionaries, ROOT needs to know where the # dictionaries have been installed. This can be facilitated by @@ -893,7 +923,7 @@ def setup_dependent_run_environment( # Cleanup. self.sanitize_environments(env) - def sanitize_environments(self, env: spack.util.environment.EnvironmentModifications, *vars): + def sanitize_environments(self, env: EnvironmentModifications, *vars): special_separators = {"LDSHARED": " -L"} if not vars: vars = ( diff --git a/var/spack/repos/builtin/packages/rpcsvc-proto/package.py b/var/spack/repos/builtin/packages/rpcsvc-proto/package.py index 9bba1f90581023..2cb75e10b099ec 100644 --- a/var/spack/repos/builtin/packages/rpcsvc-proto/package.py +++ b/var/spack/repos/builtin/packages/rpcsvc-proto/package.py @@ -20,7 +20,7 @@ class RpcsvcProto(AutotoolsPackage): version("1.4.1", sha256="9429e143bb8dd33d34bf0663f571d4d4a1103e1afd7c49791b367b7ae1ef7f35") version("1.4", sha256="4149d5f05d8f7224a4d207362fdfe72420989dc1b028b28b7b62b6c2efe22345") - depends_on("c", type="build") # generated + depends_on("c", type="build") depends_on("gettext") diff --git a/var/spack/repos/builtin/packages/rpm/package.py b/var/spack/repos/builtin/packages/rpm/package.py index 15380a9af659ff..23b86e454bc84e 100644 --- a/var/spack/repos/builtin/packages/rpm/package.py +++ b/var/spack/repos/builtin/packages/rpm/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.tty as tty from spack.package import * diff --git a/var/spack/repos/builtin/packages/rpp/package.py b/var/spack/repos/builtin/packages/rpp/package.py index b04332219b0a18..842d52eb418fd6 100644 --- a/var/spack/repos/builtin/packages/rpp/package.py +++ b/var/spack/repos/builtin/packages/rpp/package.py @@ -27,6 +27,8 @@ def url_for_version(self, version): maintainers("srekolam", "afzpatel") license("MIT") + version("6.3.2", sha256="05f0e063c61f5039661a4d5a80113ebb7b9782d0958c29375a8e1e2e759b88bc") + version("6.3.1", sha256="6e7da82bf7b6d642d605370329e4e719af10bb5c6af30079b5d0b60cdcb91a48") version("6.3.0", sha256="130a6bd2fc4278956c6450a3c49243651576b1031e6a485aa62453b9dc3b4d51") version("6.2.4", sha256="e733350e938ce8d2f7d6d43d2bfd0febd270d52673bafa0265ed97bb850289de") version("6.2.1", sha256="5ae9d0c6733ba0e00be1cda13003e98acebd3f86de59e6f1969e297d673f124e") @@ -168,6 +170,8 @@ def patch(self): "6.2.1", "6.2.4", "6.3.0", + "6.3.1", + "6.3.2", ]: depends_on("hip@" + ver, when="@" + ver) with when("@:1.2"): diff --git a/var/spack/repos/builtin/packages/rsync/package.py b/var/spack/repos/builtin/packages/rsync/package.py index aedfcba9bc27b1..39836f28ec9287 100644 --- a/var/spack/repos/builtin/packages/rsync/package.py +++ b/var/spack/repos/builtin/packages/rsync/package.py @@ -15,10 +15,31 @@ class Rsync(AutotoolsPackage): license("GPL-3.0-or-later") - version("3.3.0", sha256="7399e9a6708c32d678a72a63219e96f23be0be2336e50fd1348498d07041df90") - version("3.2.7", sha256="4e7d9d3f6ed10878c58c5fb724a67dacf4b6aac7340b13e488fb2dc41346f2bb") - version("3.2.6", sha256="fb3365bab27837d41feaf42e967c57bd3a47bc8f10765a3671efd6a3835454d3") - version("3.2.5", sha256="2ac4d21635cdf791867bc377c35ca6dda7f50d919a58be45057fd51600c69aba") + version("3.4.1", sha256="2924bcb3a1ed8b551fc101f740b9f0fe0a202b115027647cf69850d65fd88c52") + version("3.4.0", sha256="8e942f95a44226a012fe822faffa6c7fc38c34047add3a0c941e9bc8b8b93aa4") + + # Releases before 3.4.0 are deprecated because of CVE-2024-12084 + # https://nvd.nist.gov/vuln/detail/CVE-2024-12084 + version( + "3.3.0", + sha256="7399e9a6708c32d678a72a63219e96f23be0be2336e50fd1348498d07041df90", + deprecated=True, + ) + version( + "3.2.7", + sha256="4e7d9d3f6ed10878c58c5fb724a67dacf4b6aac7340b13e488fb2dc41346f2bb", + deprecated=True, + ) + version( + "3.2.6", + sha256="fb3365bab27837d41feaf42e967c57bd3a47bc8f10765a3671efd6a3835454d3", + deprecated=True, + ) + version( + "3.2.5", + sha256="2ac4d21635cdf791867bc377c35ca6dda7f50d919a58be45057fd51600c69aba", + deprecated=True, + ) # Releases before 3.2.5 are deprecated because of CVE-2022-29154 # https://nvd.nist.gov/vuln/detail/CVE-2022-29154 diff --git a/var/spack/repos/builtin/packages/salt/package.py b/var/spack/repos/builtin/packages/salt/package.py new file mode 100644 index 00000000000000..9742ae8212cda2 --- /dev/null +++ b/var/spack/repos/builtin/packages/salt/package.py @@ -0,0 +1,25 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Salt(CMakePackage): + """SALT: A next generation LLVM-based Source Analysis Toolkit for performance instrumentation + of HPC applications""" + + homepage = "https://github.com/ParaToolsInc/salt" + url = "https://github.com/ParaToolsInc/salt/archive/refs/tags/v0.2.0.tar.gz" + git = "https://github.com/ParaToolsInc/salt.git" + + maintainers("zbeekman", "wspear") + + license("Apache-2.0", checked_by="wspear") + + version("master", branch="master") + version("0.3.0", sha256="7df4c060c292ed625d4c1cc8c0e794cd4380a263df63693b648b3c8e0cf51ccf") + version("0.2.0", sha256="55c80f9d0591752b1e5b40e924718dc28f928ee0a3c7008adec3feab1280c57f") + + depends_on("cxx", type="build") + depends_on("llvm+clang+flang@19", type=("build", "link", "run")) diff --git a/var/spack/repos/builtin/packages/sarus/package.py b/var/spack/repos/builtin/packages/sarus/package.py index 8a91932759505d..7f2f051b4a55c1 100644 --- a/var/spack/repos/builtin/packages/sarus/package.py +++ b/var/spack/repos/builtin/packages/sarus/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.tty as tty from spack.package import * diff --git a/var/spack/repos/builtin/packages/scorep/package.py b/var/spack/repos/builtin/packages/scorep/package.py index f556afb1184e4b..dbbecaaa3e94db 100644 --- a/var/spack/repos/builtin/packages/scorep/package.py +++ b/var/spack/repos/builtin/packages/scorep/package.py @@ -228,8 +228,7 @@ def configure_args(self): # but add similar spec.satisfies clauses for any that you need. # -- wrwilliams 12/2024 if spec.satisfies("^binutils"): - config_args.append("--with-libbfd-lib=%s" % spec["binutils"].prefix.lib) - config_args.append("--with-libbfd-include=%s" % spec["binutils"].prefix.include) + config_args.append("--with-libbfd=%s" % spec["binutils"].prefix) config_args.extend( [ diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py index eed97087e00b34..9a5e91360b445e 100644 --- a/var/spack/repos/builtin/packages/scotch/package.py +++ b/var/spack/repos/builtin/packages/scotch/package.py @@ -19,6 +19,7 @@ class Scotch(CMakePackage, MakefilePackage): maintainers("pghysels") + version("7.0.6", sha256="b44acd0d2f53de4b578fa3a88944cccc45c4d2961cd8cefa9b9a1d5431de8e2b") version("7.0.4", sha256="8ef4719d6a3356e9c4ca7fefd7e2ac40deb69779a5c116f44da75d13b3d2c2c3") version("7.0.3", sha256="5b5351f0ffd6fcae9ae7eafeccaa5a25602845b9ffd1afb104db932dd4d4f3c5") version("7.0.1", sha256="0618e9bc33c02172ea7351600fce4fccd32fe00b3359c4aabb5e415f17c06fed") @@ -121,8 +122,8 @@ def libs(self): class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): + def cmake_args(self): - spec = self.spec args = [ self.define_from_variant("BUILD_LIBSCOTCHMETIS", "metis"), self.define_from_variant("INSTALL_METIS_HEADERS", "metis"), @@ -133,7 +134,10 @@ def cmake_args(self): self.define_from_variant("MPI_THREAD_MULTIPLE", "mpi_thread"), ] - if "+int64" in spec: + if self.pkg.version > Version("7.0.4"): + args.append(self.define("ENABLE_TESTS", self.pkg.run_tests)) + + if "+int64" in self.spec: args.append("-DINTSIZE=64") return args diff --git a/var/spack/repos/builtin/packages/seacas/package.py b/var/spack/repos/builtin/packages/seacas/package.py index 7989c78a4a4e1d..9a1ec46934339b 100644 --- a/var/spack/repos/builtin/packages/seacas/package.py +++ b/var/spack/repos/builtin/packages/seacas/package.py @@ -295,6 +295,9 @@ class Seacas(CMakePackage): ) conflicts("+shared", when="platform=windows") conflicts("+x11", when="platform=windows") + + conflicts("@2024-06-27 platform=windows") + # Remove use of variable in array assignment (triggers c2057 on MSVC) # See https://github.com/sandialabs/seacas/issues/438 patch( diff --git a/var/spack/repos/builtin/packages/serialbox/package.py b/var/spack/repos/builtin/packages/serialbox/package.py index d1da33355ede16..a2987aba8cb557 100644 --- a/var/spack/repos/builtin/packages/serialbox/package.py +++ b/var/spack/repos/builtin/packages/serialbox/package.py @@ -18,6 +18,7 @@ class Serialbox(CMakePackage): license("BSD-2-Clause") + version("2.6.2", sha256="d1b4c79078e3b1d4a45b7b024eb647d21873498ac666e41a5ee8b8e13c95a7ac") version("2.6.1", sha256="b795ce576e8c4fd137e48e502b07b136079c595c82c660cfa2e284b0ef873342") version("2.6.0", sha256="9199f8637afbd7f2b3c5ba932d1c63e9e14d553a0cafe6c29107df0e04ee9fae") version("2.5.4", sha256="f4aee8ef284f58e6847968fe4620e222ac7019d805bbbb26c199e4b6a5094fee") diff --git a/var/spack/repos/builtin/packages/sherpa/package.py b/var/spack/repos/builtin/packages/sherpa/package.py index d7f2a01954844f..24d491c45b141d 100644 --- a/var/spack/repos/builtin/packages/sherpa/package.py +++ b/var/spack/repos/builtin/packages/sherpa/package.py @@ -39,7 +39,7 @@ class Sherpa(CMakePackage, AutotoolsPackage): depends_on("cxx", type="build") # generated depends_on("fortran", type="build") # generated - _cxxstd_values = ("11", "14", "17") + _cxxstd_values = (conditional("11", "14", "17", when="@:"), conditional("20", when="@3:")) variant( "cxxstd", default="11", @@ -53,7 +53,12 @@ class Sherpa(CMakePackage, AutotoolsPackage): variant("python", default=False, description="Enable Python API") variant("hepmc2", default=True, when="@:2", description="Enable HepMC (version 2.x) support") variant("hepmc3", default=True, description="Enable HepMC (version 3.x) support") - variant("hepmc3root", default=False, description="Enable HepMC (version 3.1+) ROOT support") + variant( + "hepmc3root", + default=False, + description="Enable HepMC (version 3.1+) ROOT support", + when="+root", + ) variant("rivet", default=False, description="Enable Rivet support") variant("fastjet", default=True, when="@:2", description="Enable FASTJET") variant("openloops", default=False, description="Enable OpenLoops") @@ -114,7 +119,8 @@ class Sherpa(CMakePackage, AutotoolsPackage): filter_compiler_wrappers("share/SHERPA-MC/makelibs") for std in _cxxstd_values: - depends_on("root cxxstd=" + std, when="+root cxxstd=" + std) + for v in std: + depends_on(f"root cxxstd={v.value}", when=f"+root cxxstd={v.value}") def patch(self): filter_file( diff --git a/var/spack/repos/builtin/packages/simgrid/package.py b/var/spack/repos/builtin/packages/simgrid/package.py index d3e2abe1127a01..122d1d9de0ef9d 100644 --- a/var/spack/repos/builtin/packages/simgrid/package.py +++ b/var/spack/repos/builtin/packages/simgrid/package.py @@ -20,6 +20,7 @@ class Simgrid(CMakePackage): license("LGPL-2.1-or-later") + version("3.36", sha256="cfdf6b98270c59be5c112457793c540bdd6a10deece91cbdb4793fbda190b95d") version("3.35", sha256="b4570d3de18d319cbd2e16c5a669f90760307673c0cc9940d4d11cfc537e69a8") version("3.34", sha256="161f1c6c0ebb588c587aea6388114307bb31b3c6d5332fa3dc678151f1d0564d") version("3.32", sha256="837764eb81562f04e49dd20fbd8518d9eb1f94df00a4e4555e7ec7fa8aa341f0") diff --git a/var/spack/repos/builtin/packages/singularity-eos/package.py b/var/spack/repos/builtin/packages/singularity-eos/package.py index d850e358666657..d300575d39b578 100644 --- a/var/spack/repos/builtin/packages/singularity-eos/package.py +++ b/var/spack/repos/builtin/packages/singularity-eos/package.py @@ -5,7 +5,6 @@ import os import spack -import spack.version from spack.package import * @@ -112,19 +111,17 @@ class SingularityEos(CMakePackage, CudaPackage): for _flag in ("~cuda", "+cuda", "~openmp", "+openmp"): depends_on("kokkos ~shared" + _flag, when="+kokkos" + _flag) depends_on("kokkos-kernels" + _flag, when="+kokkos-kernels" + _flag) - depends_on("spiner" + _flag, when="+kokkos" + _flag) # specfic specs when using GPU/cuda offloading depends_on("kokkos +wrapper+cuda_lambda", when="+cuda+kokkos") # fix for older spacks - if spack.version.Version(spack.spack_version) >= spack.version.Version("0.17"): + if Version(spack.spack_version) >= Version("0.17"): depends_on("kokkos-kernels ~shared", when="+kokkos-kernels") for _flag in list(CudaPackage.cuda_arch_values): depends_on("kokkos cuda_arch=" + _flag, when="+cuda+kokkos cuda_arch=" + _flag) depends_on("kokkos-kernels cuda_arch=" + _flag, when="+cuda+kokkos cuda_arch=" + _flag) - depends_on("spiner cuda_arch=" + _flag, when="+cuda+kokkos cuda_arch=" + _flag) conflicts("cuda_arch=none", when="+cuda", msg="CUDA architecture is required") @@ -187,7 +184,7 @@ def cmake_args(self): ] if "+kokkos+cuda" in self.spec: - args.append(self.define("CMAKE_CXX_COMPILER", self.spec["kokkos"].kokkos_cxx)) + args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx)) return args diff --git a/var/spack/repos/builtin/packages/singularityce/package.py b/var/spack/repos/builtin/packages/singularityce/package.py index cffa6dfca64164..a5c4a4b50ec2b6 100644 --- a/var/spack/repos/builtin/packages/singularityce/package.py +++ b/var/spack/repos/builtin/packages/singularityce/package.py @@ -5,14 +5,12 @@ import os import shutil -import llnl.util.tty as tty - import spack.tengine from spack.package import * class SingularityBase(MakefilePackage): - variant("suid", default=True, description="install SUID binary") + variant("suid", default=False, description="install SUID binary") variant("network", default=True, description="install network plugins") depends_on("pkgconfig", type="build") diff --git a/var/spack/repos/builtin/packages/sirius/libxc7.patch b/var/spack/repos/builtin/packages/sirius/libxc7.patch new file mode 100644 index 00000000000000..d6d388e1397226 --- /dev/null +++ b/var/spack/repos/builtin/packages/sirius/libxc7.patch @@ -0,0 +1,16 @@ +--- a/src/potential/xc_functional_base.hpp ++++ b/src/potential/xc_functional_base.hpp +@@ -15,6 +15,13 @@ + #define __XC_FUNCTIONAL_BASE_HPP__ + + #include ++ ++/* libxc >= 7 split the functional definition in a different file from xc.h */ ++ ++#if (XC_MAJOR_VERSION >= 7) ++#include ++#endif ++ + #include + #include + #include diff --git a/var/spack/repos/builtin/packages/sirius/package.py b/var/spack/repos/builtin/packages/sirius/package.py index c51db984995b48..2da6d6feafc697 100644 --- a/var/spack/repos/builtin/packages/sirius/package.py +++ b/var/spack/repos/builtin/packages/sirius/package.py @@ -22,6 +22,7 @@ class Sirius(CMakePackage, CudaPackage, ROCmPackage): version("develop", branch="develop") version("master", branch="master") + version("7.6.2", sha256="1ba92942aa39b49771677cc8bf1c94a0b4350eb45bf3009318a6c2350b46a276") version("7.6.1", sha256="16a114dc17e28697750585820e69718a96e6929f88406d266c75cf9a7cdbdaaa") version("7.6.0", sha256="e424206fecb35bb2082b5c87f0865a9536040e984b88b041e6f7d531f8a65b20") version("7.5.2", sha256="9ae01935578532c84f1d0d673dbbcdd490e26be22efa6c4acf7129f9dc1a0c60") @@ -130,7 +131,7 @@ class Sirius(CMakePackage, CudaPackage, ROCmPackage): depends_on("fftw-api@3") depends_on("libxc@3.0.0:") depends_on("libxc@4.0.0:", when="@7.2.0:") - depends_on("libxc@:6", when="@:7.6.1") + depends_on("libxc@:7", when="@:7.5") depends_on("spglib") depends_on("hdf5+hl") depends_on("pkgconfig", type="build") @@ -164,6 +165,13 @@ class Sirius(CMakePackage, CudaPackage, ROCmPackage): # spla removed the openmp option in 1.6.0 conflicts("^spla@:1.5~openmp", when="+openmp") + patch("libxc7.patch", when="@7.6.0:7.6.1") + patch( + "https://github.com/electronic-structure/SIRIUS/commit/dd07010f7b49f31b7e3bb1b4e47f3d9ac3a0c0b4.patch?full_index=1", + sha256="dd680f8c47a0fc29097cae5cd1e72dfdbcf95f93089f73fb3f2fe9e750125d6f", + when="@7.6.0:7.6.1 +pugixml", + ) + depends_on("nlcglib", when="+nlcglib") depends_on("nlcglib+rocm", when="+nlcglib+rocm") depends_on("nlcglib+cuda", when="+nlcglib+cuda") diff --git a/var/spack/repos/builtin/packages/slate/package.py b/var/spack/repos/builtin/packages/slate/package.py index 44c622d18aaac5..9da8e8c553dcae 100644 --- a/var/spack/repos/builtin/packages/slate/package.py +++ b/var/spack/repos/builtin/packages/slate/package.py @@ -165,8 +165,8 @@ def cmake_args(self): def cache_test_sources(self): if self.spec.satisfies("@2020.10.00"): return - """Copy the example source files after the package is installed to an - install test subdirectory for use during `spack test run`.""" + # Copy the example source files after the package is installed to an + # install test subdirectory for use during `spack test run`. cache_extra_test_sources(self, ["examples"]) def mpi_launcher(self): diff --git a/var/spack/repos/builtin/packages/slirp4netns/package.py b/var/spack/repos/builtin/packages/slirp4netns/package.py index 51543c2ec0084b..7284de55cb711d 100644 --- a/var/spack/repos/builtin/packages/slirp4netns/package.py +++ b/var/spack/repos/builtin/packages/slirp4netns/package.py @@ -14,6 +14,8 @@ class Slirp4netns(AutotoolsPackage): license("GPL-2.0-or-later") + version("1.3.1", sha256="a3b7c7b593b279c46d25a48b583371ab762968e98b6a46457d8d52a755852eb9") + version("1.2.3", sha256="acce648fab8fe5f113c41a8fd6d20177708519b4ddaa60f845e1998a17b22ca5") version("1.2.0", sha256="b584edde686d3cfbac210cbdb93c4b0ba5d8cc0a6a4d92b9dfc3c5baec99c727") version("1.1.12", sha256="279dfe58a61b9d769f620b6c0552edd93daba75d7761f7c3742ec4d26aaa2962") diff --git a/var/spack/repos/builtin/packages/slurm-drmaa/package.py b/var/spack/repos/builtin/packages/slurm-drmaa/package.py index 7d44096c4edba0..32128186cc638e 100644 --- a/var/spack/repos/builtin/packages/slurm-drmaa/package.py +++ b/var/spack/repos/builtin/packages/slurm-drmaa/package.py @@ -27,13 +27,6 @@ class SlurmDrmaa(AutotoolsPackage): depends_on("c", type="build") # generated - # Remove this patch when it is merged into main: - patch( - "https://github.com/natefoo/slurm-drmaa/pull/62.patch?full_index=1", - sha256="ec8d2963c731f7054f7d3c130232e731bc92366280100e108d93a3685fddfca7", - when="@main", - ) - depends_on("autoconf", type="build", when="@main") depends_on("automake", type="build", when="@main") depends_on("libtool", type="build", when="@main") diff --git a/var/spack/repos/builtin/packages/smee-client/package.py b/var/spack/repos/builtin/packages/smee-client/package.py index 95800392bf8ff1..750ce408efd43d 100644 --- a/var/spack/repos/builtin/packages/smee-client/package.py +++ b/var/spack/repos/builtin/packages/smee-client/package.py @@ -19,6 +19,7 @@ class SmeeClient(Package): license("ISC") + version("2.0.4", sha256="b0c959f52e384bbd3f913955cb68102fef11d85b7cc8e5a83404ee325f1ccfe4") version("2.0.3", sha256="98ca658cf3214c5116651f2a788c793bc2fe76543f24ada20e8751fcf1de8e1a") version("1.2.3", sha256="b9afff843fc7a3c2b5d6659acf45357b5db7a739243b99f6d18a9b110981a328") diff --git a/var/spack/repos/builtin/packages/snappy/package.py b/var/spack/repos/builtin/packages/snappy/package.py index dbd68d8fc462cb..0c830485fd3936 100644 --- a/var/spack/repos/builtin/packages/snappy/package.py +++ b/var/spack/repos/builtin/packages/snappy/package.py @@ -19,7 +19,8 @@ class Snappy(CMakePackage): version("1.1.8", sha256="16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f") version("1.1.7", sha256="3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("shared", default=True, description="Build shared libraries") variant("pic", default=True, description="Build position independent code") diff --git a/var/spack/repos/builtin/packages/snpeff/package.py b/var/spack/repos/builtin/packages/snpeff/package.py index c13afba0b520aa..c4e0a58cf433eb 100644 --- a/var/spack/repos/builtin/packages/snpeff/package.py +++ b/var/spack/repos/builtin/packages/snpeff/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/spdlog/package.py b/var/spack/repos/builtin/packages/spdlog/package.py index 718155f9d5a457..60f74d9ee5a32b 100644 --- a/var/spack/repos/builtin/packages/spdlog/package.py +++ b/var/spack/repos/builtin/packages/spdlog/package.py @@ -13,6 +13,7 @@ class Spdlog(CMakePackage): license("MIT") + version("1.15.0", sha256="9962648c9b4f1a7bbc76fd8d9172555bad1871fdb14ff4f842ef87949682caa5") version("1.14.1", sha256="1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b") version("1.13.0", sha256="534f2ee1a4dcbeb22249856edfb2be76a1cf4f708a20b0ac2ed090ee24cfdbc9") version("1.12.0", sha256="4dccf2d10f410c1e2feaff89966bfc49a1abb29ef6f08246335b110e001e09a9") @@ -70,6 +71,20 @@ class Spdlog(CMakePackage): when="@1.11.0 ^fmt@10:", ) + # spdlog@1.15.0 with fmt@11 https://github.com/gabime/spdlog/pull/3314 + # (with https://github.com/gabime/spdlog/pull/3301 as a prerequisite) + patch( + "https://github.com/gabime/spdlog/commit/276ee5f5c0eb13626bd367b006ace5eae9526d8a.patch?full_index=1", + sha256="fd4cbb10a795a03c7182a4070056c2b004d47b120a86e1958ff82316627bb565", + when="@1.13.0:1.15.0", + ) + patch( + "https://github.com/gabime/spdlog/commit/96a8f6250cbf4e8c76387c614f666710a2fa9bad.patch?full_index=1", + sha256="5ed92f4c131fd31eb3d28390615ecff3ade3789cdecfd3db18cadb07cc8095e3", + when="@1.13.0:1.15.0", + ) + conflicts("^fmt@11.1:", when="@:1.12") + def cmake_args(self): args = [] diff --git a/var/spack/repos/builtin/packages/spectre/package.py b/var/spack/repos/builtin/packages/spectre/package.py index ed7a9c9e5db7c8..42b5991fcaccfe 100644 --- a/var/spack/repos/builtin/packages/spectre/package.py +++ b/var/spack/repos/builtin/packages/spectre/package.py @@ -30,6 +30,9 @@ class Spectre(CMakePackage): license("MIT") version("develop", branch="develop") + version( + "2025.01.30", sha256="1b79c297ca85e9c2c6242e3880144587fc8a1791124887a83f428c6301a80fe3" + ) version( "2024.12.16", sha256="ddd53fc6e5b42bca5d636862b69859ff7040ac243e097a4a6c0a8d0a8c58ffce" ) diff --git a/var/spack/repos/builtin/packages/spfft/package.py b/var/spack/repos/builtin/packages/spfft/package.py index cf227b15b45910..72e0fb6f89fb42 100644 --- a/var/spack/repos/builtin/packages/spfft/package.py +++ b/var/spack/repos/builtin/packages/spfft/package.py @@ -20,6 +20,7 @@ class Spfft(CMakePackage, CudaPackage, ROCmPackage): version("develop", branch="develop") version("master", branch="master") + version("1.1.1", sha256="9aebb9b50adeaa989f531973a95fde0692def1134100e4c0a513b52b1d1ca0ce") version("1.1.0", sha256="231454a3142bc56249b1b551ac5175882311365509cc111d7ad0e91ed5537102") version("1.0.6", sha256="e1b927c61f8abbb4a9937653f917169e6253e8c40b850df491594310943ca14b") version("1.0.5", sha256="2a59d856286ea8559f00a32fc38f9f7546209cfa90112232a5288a69689a6e05") @@ -62,7 +63,7 @@ class Spfft(CMakePackage, CudaPackage, ROCmPackage): with when("+rocm"): depends_on("rocfft") - depends_on("hipfft") + depends_on("hipfft+rocm") # hip 6.0 requires v1.1.0 and later conflicts("^hip@6.0.0:", when="@:1.0.6 +rocm") diff --git a/var/spack/repos/builtin/packages/spiner/package.py b/var/spack/repos/builtin/packages/spiner/package.py index 0688ec1952341f..be219868cfa78f 100644 --- a/var/spack/repos/builtin/packages/spiner/package.py +++ b/var/spack/repos/builtin/packages/spiner/package.py @@ -5,7 +5,7 @@ from spack.package import * -class Spiner(CMakePackage, CudaPackage): +class Spiner(CMakePackage): """Spiner: Performance portable routines for generic, tabulated, multi-dimensional data""" @@ -18,6 +18,7 @@ class Spiner(CMakePackage, CudaPackage): license("BSD-3-Clause") version("main", branch="main") + version("1.6.3", sha256="f78c50e0b4d7c4fd3f380432f12a528941e2bee5171d6f200e9a52bbcea940e9") version("1.6.2", sha256="91fb403ce3b151fbdf8b6ff5aed0d8dde1177749f5633951027b100ebc7080d3") version("1.6.1", sha256="52774322571d3b9b0dc3c6b255257de9af0e8e6170834360f2252c1ac272cbe7") version("1.6.0", sha256="afa5526d87c78c1165ead06c09c5c2b9e4a913687443e5adff7b709ea4dd7edf") @@ -44,7 +45,6 @@ class Spiner(CMakePackage, CudaPackage): # "when" clauses. Therefore, call the whens FIRST then the non-whens. # https://spack.readthedocs.io/en/latest/packaging_guide.html#overriding-variants variant("kokkos", default=False, description="Enable kokkos") - variant("openmp", default=False, description="Enable openmp kokkos backend") variant("hdf5", default=False, description="Enable hdf5") variant("mpi", default=False, description="Support parallel hdf5") @@ -61,11 +61,8 @@ class Spiner(CMakePackage, CudaPackage): # Currently the raw cuda backend of ports-of-call is not supported. depends_on("ports-of-call portability_strategy=Kokkos", when="@:1.5.1 +kokkos") depends_on("ports-of-call portability_strategy=None", when="@:1.5.1 ~kokkos") - for _flag in list(CudaPackage.cuda_arch_values): - depends_on("kokkos@3.3.00: cuda_arch=" + _flag, when="+cuda+kokkos cuda_arch=" + _flag) - for _flag in ("~cuda", "+cuda", "~openmp", "+openmp"): - depends_on("kokkos@3.3.00: " + _flag, when="+kokkos" + _flag) - depends_on("kokkos@3.3.00: ~shared+wrapper+cuda_lambda+cuda_constexpr", when="+cuda+kokkos") + depends_on("kokkos@3.3.00:", when="+kokkos") + requires("^kokkos+cuda_lambda+cuda_constexpr", when="+kokkos ^kokkos+cuda") depends_on("hdf5+hl~mpi", when="+hdf5~mpi") depends_on("hdf5+hl+mpi", when="+hdf5+mpi") @@ -75,26 +72,31 @@ class Spiner(CMakePackage, CudaPackage): depends_on("py-matplotlib", when="+python") conflicts("+mpi", when="~hdf5") - conflicts("+cuda", when="~kokkos") - conflicts("+openmp", when="~kokkos") - conflicts("cuda_arch=none", when="+cuda", msg="CUDA architecture is required") def cmake_args(self): if self.spec.satisfies("@1.6.0:"): use_kokkos_option = "SPINER_TEST_USE_KOKKOS" - use_cuda_option = "SPINER_TEST_USE_CUDA" else: use_kokkos_option = "SPINER_USE_KOKKOS" - use_cuda_option = "SPINER_USE_CUDA" args = [ self.define("BUILD_TESTING", self.run_tests), + self.define("SPINER_BUILD_TESTS", self.run_tests), + self.define( + "SPINER_TEST_USE_KOKKOS", self.run_tests and self.spec.satisfies("+kokkos") + ), self.define_from_variant(use_kokkos_option, "kokkos"), - self.define_from_variant(use_cuda_option, "cuda"), self.define_from_variant("SPINER_USE_HDF", "hdf5"), ] - if "+cuda" in self.spec: + if self.spec.satisfies("^kokkos+cuda"): args.append( - self.define("CMAKE_CUDA_ARCHITECTURES", self.spec.variants["cuda_arch"].value) + self.define( + "CMAKE_CUDA_ARCHITECTURES", self.spec["kokkos"].variants["cuda_arch"].value + ) ) + if self.spec.satisfies("^kokkos+rocm"): + args.append(self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)) + args.append(self.define("CMAKE_C_COMPILER", self.spec["hip"].hipcc)) + if self.spec.satisfies("^kokkos+cuda"): + args.append(self.define("CMAKE_CXX_COMPILER", self["kokkos"].kokkos_cxx)) return args diff --git a/var/spack/repos/builtin/packages/stat/package.py b/var/spack/repos/builtin/packages/stat/package.py index d398933b7b962a..e6020237dec9a0 100644 --- a/var/spack/repos/builtin/packages/stat/package.py +++ b/var/spack/repos/builtin/packages/stat/package.py @@ -35,11 +35,6 @@ class Stat(AutotoolsPackage): sha256="9ece10dde8e1579c9db469ac8d2391b26e59498c0947dbb271c2d01d7ef0a65d", url="https://github.com/LLNL/STAT/releases/download/v4.0.2/stat-4.0.2.tar.gz", ) - version( - "4.0.1", - sha256="ae3fbd6946003fb16233d82d40285780a9a802da5fe30d09adb8a8b2a2cc4ad6", - url="https://github.com/LLNL/STAT/files/2489327/stat-4.0.1.tar.gz", - ) depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated @@ -56,8 +51,7 @@ class Stat(AutotoolsPackage): depends_on("libtool", type="build") depends_on("dyninst", when="@4.2.1:") depends_on("dyninst@:11.9", when="~dysect @:4.2.0") - depends_on("dyninst@:9", when="@:4.0.1") - depends_on("dyninst@8.2.1+stat_dysect", when="+dysect") + depends_on("dyninst +stat_dysect", when="+dysect") # we depend on fgfs@master to avoid seg faults with fgfs 1.1 depends_on("fast-global-file-status@1.1.1:", when="+fgfs") depends_on("graphlib@3.0.0") diff --git a/var/spack/repos/builtin/packages/strumpack/package.py b/var/spack/repos/builtin/packages/strumpack/package.py index 2342f0d65609ac..5ebead85410485 100644 --- a/var/spack/repos/builtin/packages/strumpack/package.py +++ b/var/spack/repos/builtin/packages/strumpack/package.py @@ -4,8 +4,6 @@ import os -import llnl.util.tty as tty - from spack.package import * from spack.util.environment import set_env diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py index 39aa3f983828e4..389f312493ba7a 100644 --- a/var/spack/repos/builtin/packages/suite-sparse/package.py +++ b/var/spack/repos/builtin/packages/suite-sparse/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/surfer/package.py b/var/spack/repos/builtin/packages/surfer/package.py new file mode 100644 index 00000000000000..95aa2e7b89e4e1 --- /dev/null +++ b/var/spack/repos/builtin/packages/surfer/package.py @@ -0,0 +1,33 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Surfer(CargoPackage): + """A waveform viewer with a focus on a snappy usable interface, and extensibility.""" + + homepage = "https://surfer-project.org" + url = "https://gitlab.com/surfer-project/surfer/-/archive/v0.3.0/surfer-v0.3.0.tar.gz" + git = "https://gitlab.com/surfer-project/surfer.git" + + maintainers("davekeeshan") + + license("EUPL-1.2") + + version("main", branch="main", submodules=True) + + version( + "0.3.0", tag="v0.3.0", commit="1a6b34c44ea0e5089bd55d0bce1297aa1a02e6ef", submodules=True + ) + + depends_on("rust@1.82:") + depends_on("c", type="build") + depends_on("openssl") + + def build(self, spec, prefix): + cargo("build", "--release") + + def install(self, spec, prefix): + cargo("install", "--path", "surfer", "--root", prefix) diff --git a/var/spack/repos/builtin/packages/survey/package.py b/var/spack/repos/builtin/packages/survey/package.py index 578910ef7a46a3..76147b5c0d20db 100644 --- a/var/spack/repos/builtin/packages/survey/package.py +++ b/var/spack/repos/builtin/packages/survey/package.py @@ -18,7 +18,7 @@ class Survey(CMakePackage): available for tools inside current MPI implementations including: MPICH, MVAPICH, MPT, and OpenMPI. It also supports multiple architectures and has been tested on machines based on Intel, - AMD, ARM, and IBM P8/9 processors and integrated NVIDIA GPUs. + AMD, ARM, and IBM P8/9 processors and integrated AMD and NVIDIA GPUs. Survey is a licensed product with the source not openly available. To access the survey source and build with spack please contact: @@ -31,8 +31,9 @@ class Survey(CMakePackage): maintainers("jgalarowicz") - version("master", branch="master") - version("1.0.9", branch="1.0.9") + version("1.1.1", branch="1.1.1") + version("1.1.0", tag="1.1.0") + version("1.0.9", tag="1.0.9") version("1.0.8.1", branch="1.0.8.1") version("1.0.8", tag="1.0.8") version("1.0.7", tag="1.0.7") @@ -59,14 +60,14 @@ class Survey(CMakePackage): depends_on("cmake@3.12:", type="build") # for collectors - depends_on("libmonitor@2021.04.27+commrank", type=("build", "link", "run"), when="@:1.0.2") - depends_on("libmonitor@2021.11.08+commrank", type=("build", "link", "run"), when="@1.0.3:") + depends_on("libmonitor@2021.11.08+commrank", type=("build", "link", "run"), when="@:1.0.9") + depends_on("libmonitor@2023.03.15+commrank", type=("build", "link", "run"), when="@1.1.0:") depends_on("papi@5:", type=("build", "link", "run")) depends_on("gotcha@master", type=("build", "link"), when="@:1.0.7") depends_on("gotcha@1.0.4", type=("build", "link"), when="@1.0.8:") - depends_on("llvm-openmp@9.0.0", type=("build", "link"), when="@:1.0.2") - depends_on("llvm-openmp@12.0.1", type=("build", "link"), when="@1.0.3:") + depends_on("llvm-openmp@9.0.0", type=("build", "link"), when="@:1.0.3") + depends_on("llvm-openmp@12.0.1+multicompat", type=("build", "link"), when="@1.0.4:") # MPI Installation depends_on("mpi", type="build", when="+mpi") @@ -88,6 +89,14 @@ class Survey(CMakePackage): depends_on("py-humanize", type=("build", "run"), when="@1.0.8:") depends_on("py-importlib-resources", type=("build", "run"), when="@1.0.8:") depends_on("py-gitpython", type=("build", "run"), when="@1.0.9:") + depends_on("py-smmap", type=("build", "run"), when="@1.0.9:") + depends_on("py-gitdb", type=("build", "run"), when="@1.0.9:") + depends_on("py-pyparsing", type=("build", "run"), when="@1.0.9:") + depends_on("py-markupsafe", type=("build", "run"), when="@1.0.9:") + depends_on("py-packaging", type=("build", "run"), when="@1.0.9:") + depends_on("py-pillow", type=("build", "run"), when="@1.0.9:") + depends_on("py-cycler", type=("build", "run"), when="@1.0.9:") + depends_on("py-kiwisolver", type=("build", "run"), when="@1.0.9:") extends("python") @@ -131,6 +140,15 @@ def cmake_args(self): return cmake_args + @property + def python_lib_dir(self): + python_vers_phrase = "python{0}".format(self.spec["python"].version.up_to(2)) + return join_path("lib", python_vers_phrase) + + @property + def site_packages_dir(self): + return join_path(self.python_lib_dir, "site-packages") + def setup_run_environment(self, env): """Set up the compile and runtime environments for a package.""" @@ -144,3 +162,92 @@ def setup_run_environment(self, env): # Add paths for sub-tools that are used by survey env.prepend_path("PATH", self.spec["papi"].prefix.bin) env.prepend_path("PATH", self.spec["libmonitor"].prefix.bin) + + env.prepend_path( + "PYTHONPATH", join_path(self.spec["python"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-pandas"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-python-dateutil"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-setuptools"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-numpy"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-pytz"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-six"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-psutil"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-sqlalchemy"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-pyyaml"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-matplotlib"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-filelock"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-humanize"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", + join_path(self.spec["py-importlib-resources"].prefix, self.site_packages_dir), + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-pip"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-seaborn"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-jinja2"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-more-itertools"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-versioneer"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-zipp"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-gitpython"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-smmap"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-gitdb"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-pyparsing"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-markupsafe"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-packaging"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-pillow"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-cycler"].prefix, self.site_packages_dir) + ) + env.prepend_path( + "PYTHONPATH", join_path(self.spec["py-kiwisolver"].prefix, self.site_packages_dir) + ) diff --git a/var/spack/repos/builtin/packages/sw4/package.py b/var/spack/repos/builtin/packages/sw4/package.py index 2c59c50e85d45d..8a50b9eedc1206 100644 --- a/var/spack/repos/builtin/packages/sw4/package.py +++ b/var/spack/repos/builtin/packages/sw4/package.py @@ -8,70 +8,88 @@ class Sw4(MakefilePackage): - """This package builds SW4 with MPI, OpenMP, HDF5, FFTW, PROJ, and ZFP.""" + """SW4 implements substantial capabilities for 3-D seismic modeling.""" homepage = "https://github.com/geodynamics/sw4" git = "https://github.com/geodynamics/sw4.git" maintainers("houjun", "andersp") + license("GPL-2.0-or-later") + version("master", branch="master") version("developer", branch="developer") version("3.0", tag="v3.0", commit="13e6d431976f7fc49124c997bf87353aa7afd35e") - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated - - variant("openmp", default=True, description="build with OpenMP") - variant("hdf5", default=True, description="build with HDF5") - variant("proj", default=True, description="build with proj") - variant("zfp", default=False, description="build with ZFP") - variant("fftw", default=True, description="build with FFTW") + variant("openmp", default=True, description="Build with OpenMP") + variant("proj", default=True, description="Build with PROJ") + variant("hdf5", default=True, description="Build with HDF5") + variant("zfp", default=False, when="+hdf5", description="Build with ZFP") + variant("fftw", default=True, description="Build with FFTW") + variant("debug", default=False, description="Build with debugging symbols") + depends_on("cxx", type="build") + depends_on("fortran", type="build") depends_on("mpi") depends_on("blas") depends_on("lapack") - depends_on("proj", when="+proj") - depends_on("hdf5+mpi", when="+hdf5") - depends_on("fftw@3.0: +mpi", when="+fftw") + depends_on("python") + depends_on("proj@9:", when="+proj") + depends_on("hdf5@1.14: +mpi", when="+hdf5") + depends_on("py-h5py", when="+hdf5") depends_on("zfp", when="+zfp") depends_on("h5z-zfp@develop", when="+zfp") - depends_on("python") - depends_on("py-h5py") + depends_on("fftw@3: +mpi", when="+fftw") depends_on("llvm-openmp", when="%apple-clang +openmp") - def edit(self, spec, prefix): - os.environ["CXX"] = spec["mpi"].mpicxx - os.environ["FC"] = spec["mpi"].mpifc - os.environ["proj"] = "yes" - os.environ["openmp"] = "yes" - os.environ["hdf5"] = "yes" - os.environ["zfp"] = "yes" - os.environ["fftw"] = "yes" - os.environ["SW4ROOT"] = spec["proj"].prefix - os.environ["HDF5ROOT"] = spec["hdf5"].prefix - os.environ["H5ZROOT"] = spec["h5z-zfp"].prefix - os.environ["ZFPROOT"] = spec["zfp"].prefix - os.environ["FFTWHOME"] = spec["fftw"].prefix - os.environ["EXTRA_LINK_FLAGS"] = "-lstdc++ -lm -ldl " - os.environ["EXTRA_LINK_FLAGS"] += spec["blas"].libs.ld_flags + " " - os.environ["EXTRA_LINK_FLAGS"] += spec["blas"].libs.ld_flags + " " - - if "+openmp" in spec: - if spec.satisfies("%apple-clang"): - os.environ["EXTRA_LINK_FLAGS"] += spec["llvm-openmp"].libs.ld_flags + " " - + def setup_build_environment(self, env): + env.set("CXX", self.spec["mpi"].mpicxx) + env.set("FC", self.spec["mpi"].mpifc) + # openmp is enabled by default + if self.spec.satisfies("~openmp"): + env.set("openmp", "no") + if self.spec.satisfies("+proj"): + env.set("proj", "yes") + env.set("SW4ROOT", self.spec["proj"].prefix) + if self.spec.satisfies("+hdf5"): + env.set("hdf5", "yes") + env.set("HDF5ROOT", self.spec["hdf5"].prefix) + if self.spec.satisfies("+zfp"): + env.set("zfp", "yes") + env.set("ZFPROOT", self.spec["zfp"].prefix) + env.set("H5ZROOT", self.spec["h5z-zfp"].prefix) + if self.spec.satisfies("+fftw"): + env.set("fftw", "yes") + env.set("FFTWHOME", self.spec["fftw"].prefix) + if self.spec.satisfies("+debug"): + env.set("debug", "yes") + env.set("EXTRA_LINK_FLAGS", "-lstdc++ -lm -ldl") + env.append_flags("EXTRA_LINK_FLAGS", self.spec["blas"].libs.ld_flags) + env.append_flags("EXTRA_LINK_FLAGS", self.spec["lapack"].libs.ld_flags) + if self.spec.satisfies("%apple-clang +openmp"): + env.append_flags("EXTRA_LINK_FLAGS", self.spec["llvm-openmp"].libs.ld_flags) # From spack/trilinos - if spec.satisfies("%gcc") or spec.satisfies("%clang") or spec.satisfies("%apple-clang"): + if ( + self.spec.satisfies("%gcc") + or self.spec.satisfies("%clang") + or self.spec.satisfies("%apple-clang") + ): fc = Executable(self.compiler.fc) libgfortran = fc("--print-file-name", "libgfortran." + dso_suffix, output=str).strip() if libgfortran == "libgfortran." + dso_suffix: libgfortran = fc("--print-file-name", "libgfortran.a", output=str).strip() - os.environ["EXTRA_LINK_FLAGS"] += " -L{0} -lgfortran ".format( - os.path.dirname(libgfortran) + env.append_flags( + "EXTRA_LINK_FLAGS", "-L{0} -lgfortran".format(os.path.dirname(libgfortran)) ) def install(self, spec, prefix): mkdir(prefix.bin) - install("optimize_mp/sw4", prefix.bin) + if spec.satisfies("+openmp~debug"): + install("optimize_mp/sw4", prefix.bin) + elif spec.satisfies("+openmp+debug"): + install("debug_mp/sw4", prefix.bin) + elif spec.satisfies("~openmp~debug"): + install("optimize/sw4", prefix.bin) + elif spec.satisfies("~openmp+debug"): + install("debug/sw4", prefix.bin) install_tree("pytest", prefix.test) diff --git a/var/spack/repos/builtin/packages/swiftsim/package.py b/var/spack/repos/builtin/packages/swiftsim/package.py index c17d59514b4742..7e09609dd5f329 100644 --- a/var/spack/repos/builtin/packages/swiftsim/package.py +++ b/var/spack/repos/builtin/packages/swiftsim/package.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import llnl.util.tty as tty from spack.package import * diff --git a/var/spack/repos/builtin/packages/tau/package.py b/var/spack/repos/builtin/packages/tau/package.py index 6c3382ce001c9c..6c8773d00f432a 100644 --- a/var/spack/repos/builtin/packages/tau/package.py +++ b/var/spack/repos/builtin/packages/tau/package.py @@ -104,6 +104,9 @@ class Tau(Package): variant( "rocprofv2", default=False, description="Activates ROCm rocprofiler support", when="@2.34:" ) + variant( + "salt", default=False, description="Activates SALT source instrumentation", when="@2.34:" + ) variant("opencl", default=False, description="Activates OpenCL support") variant("fortran", default=darwin_default, description="Activates Fortran support") variant("io", default=True, description="Activates POSIX I/O support") @@ -167,6 +170,7 @@ class Tau(Package): depends_on("hsa-rocr-dev", when="+rocm") depends_on("rocm-smi-lib", when="@2.32.1: +rocm") depends_on("rocm-core", when="@2.34: +rocm") + depends_on("salt", when="+salt", type="run") depends_on("hip", when="@2.34: +roctracer") depends_on("java", type="run") # for paraprof depends_on("oneapi-level-zero", when="+level_zero") diff --git a/var/spack/repos/builtin/packages/tcl/package.py b/var/spack/repos/builtin/packages/tcl/package.py index c2a9bd656731be..5d5419a5c991b5 100644 --- a/var/spack/repos/builtin/packages/tcl/package.py +++ b/var/spack/repos/builtin/packages/tcl/package.py @@ -5,8 +5,6 @@ import os import sys -from llnl.util.filesystem import find_first - import spack.build_systems.autotools import spack.build_systems.nmake from spack.package import * diff --git a/var/spack/repos/builtin/packages/tesseract/package.py b/var/spack/repos/builtin/packages/tesseract/package.py index 2afc19372fe2cc..b0c7d97d01a395 100644 --- a/var/spack/repos/builtin/packages/tesseract/package.py +++ b/var/spack/repos/builtin/packages/tesseract/package.py @@ -13,33 +13,36 @@ class Tesseract(AutotoolsPackage): license("Apache-2.0") + version("5.5.0", sha256="f2fb34ca035b6d087a42875a35a7a5c4155fa9979c6132365b1e5a28ebc3fc11") version("4.1.1", sha256="2a66ff0d8595bff8f04032165e6c936389b1e5727c3ce5a27b3e059d218db1cb") version("4.1.0", sha256="5c5ed5f1a76888dc57a83704f24ae02f8319849f5c4cf19d254296978a1a1961") version("4.0.0", sha256="a1f5422ca49a32e5f35c54dee5112b11b99928fc9f4ee6695cdc6768d69f61dd") + variant("doc", default=False, description="Build with documentation.") + depends_on("cxx", type="build") # generated # do not fetch the jar files from Makefile - patch("java_Makefile.patch") + patch("java_Makefile.patch", when="@:4.1.1") jars = ["piccolo2d-core-3.0.1", "piccolo2d-extras-3.0.1", "jaxb-api-2.3.1"] resource( name=jars[0], - url="https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0.1/piccolo2d-core-3.0.1.jar", + url="https://repo1.maven.org/maven2/org/piccolo2d/piccolo2d-core/3.0.1/piccolo2d-core-3.0.1.jar", sha256="9acad723136ddb996e96f5d488b9b046753a1d4c60ea639d5e3f9701deaf60ad", placement=jars[0], expand=False, ) resource( name=jars[1], - url="https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0.1/piccolo2d-extras-3.0.1.jar", + url="https://repo1.maven.org/maven2/org/piccolo2d/piccolo2d-extras/3.0.1/piccolo2d-extras-3.0.1.jar", sha256="ba45f343e9ebc06c9b4ce165c8bb539b11cbf59e93d1df48489ab173f74375a8", placement=jars[1], expand=False, ) resource( name=jars[2], - url="https://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar", + url="https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar", sha256="88b955a0df57880a26a74708bc34f74dcaf8ebf4e78843a28b50eae945732b06", placement=jars[2], expand=False, @@ -49,11 +52,11 @@ class Tesseract(AutotoolsPackage): depends_on("automake", type="build") depends_on("libtool", type="build") depends_on("m4", type="build") - depends_on("doxygen", type="build") - depends_on("asciidoc", type="build") - depends_on("libxslt", type="build") + depends_on("doxygen", type="build", when="+doc") + depends_on("asciidoc", type="build", when="+doc") + depends_on("libxslt", type="build", when="+doc") depends_on("pkgconfig", type="build") - depends_on("leptonica") + depends_on("leptonica@1.74:") depends_on("libarchive") depends_on("curl") depends_on("icu4c") @@ -65,9 +68,17 @@ def autoreconf(self, spec, prefix): autogen = Executable(join_path(".", "autogen.sh")) autogen() + def configure_args(self): + return self.enable_or_disable("doc") + def setup_run_environment(self, env): env.set("SCROLLVIEW_PATH", prefix.share.tessdata) + @when("@5.5.0:") + def patch(self): + with working_dir("java"): + filter_file(r"^.*curl.*$", "", "Makefile.am") + @run_after("install") def training(self): make("training") diff --git a/var/spack/repos/builtin/packages/thepeg/package.py b/var/spack/repos/builtin/packages/thepeg/package.py index b0063144ec6090..feb1d7d257a8f6 100644 --- a/var/spack/repos/builtin/packages/thepeg/package.py +++ b/var/spack/repos/builtin/packages/thepeg/package.py @@ -40,7 +40,6 @@ class Thepeg(AutotoolsPackage): version("1.9.0", sha256="3ee58e5e3a26184567df1b9a10ca70df228e86f322e72f018dd7d8d5a4700a5d") version("1.8.3", sha256="55ede3a3dd0bd07b90d0d49cf7ae28c18cd965780fdf53528508b97d57152fc7") - depends_on("cxx", type="build") # generated # version('1.8.2', sha256='44ccd0d70e42bb6ecd801a51bade6c25b3953c56f33017402d4f52ee6492dffa') # version('1.8.1', sha256='84c2a212a681545cddd541dca191eb65d96f41df86c87480b6f4f7d4f9683562') # version('1.8.0', sha256='4b22fda1078f410b999a23a17f611c9ae3a7f0f4cee4e83dc82c9336b7adf037') @@ -63,6 +62,9 @@ class Thepeg(AutotoolsPackage): force_autoreconf = True + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("gsl") depends_on("lhapdf") depends_on("lhapdf@:6.2", when="@:1.9") @@ -72,7 +74,7 @@ class Thepeg(AutotoolsPackage): depends_on("fastjet", when="@2.0.0:") depends_on("rivet hepmc=2", when="@2.0.3: +rivet hepmc=2") depends_on("rivet hepmc=3", when="@2.0.3: +rivet hepmc=3") - depends_on("rivet@:3", when="@:2.2 +rivet") + depends_on("rivet@:3", when="@:2.3 +rivet") depends_on("boost +test", when="@2.1.1:") depends_on("autoconf", type="build") diff --git a/var/spack/repos/builtin/packages/tinyxml/package.py b/var/spack/repos/builtin/packages/tinyxml/package.py index 3c91b5cefd09f0..b3b706bc603acd 100644 --- a/var/spack/repos/builtin/packages/tinyxml/package.py +++ b/var/spack/repos/builtin/packages/tinyxml/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/tk/package.py b/var/spack/repos/builtin/packages/tk/package.py index b4c2bfa02bd7b9..91e461a41b8520 100644 --- a/var/spack/repos/builtin/packages/tk/package.py +++ b/var/spack/repos/builtin/packages/tk/package.py @@ -4,8 +4,6 @@ import os -from llnl.util.filesystem import find_first - from spack.package import * diff --git a/var/spack/repos/builtin/packages/toml11/package.py b/var/spack/repos/builtin/packages/toml11/package.py index 66bd4374b71c0c..62d1848d6cb672 100644 --- a/var/spack/repos/builtin/packages/toml11/package.py +++ b/var/spack/repos/builtin/packages/toml11/package.py @@ -17,6 +17,8 @@ class Toml11(CMakePackage): license("MIT") + version("4.3.0", sha256="af95dab1bbb9b05a597e73d529a7269e13f1869e9ca9bd4779906c5cd96e282b") + version("4.2.0", sha256="9287971cd4a1a3992ef37e7b95a3972d1ae56410e7f8e3f300727ab1d6c79c2c") version("4.0.2", sha256="d1bec1970d562d328065f2667b23f9745a271bf3900ca78e92b71a324b126070") version("4.0.1", sha256="96965cb00ca7757c611c169cd5a6fb15736eab1cd1c1a88aaa62ad9851d926aa") version("4.0.0", sha256="f3dc3095f22e38745a5d448ac629f69b7ee76d2b3e6d653e4ce021deb7f7266e") diff --git a/var/spack/repos/builtin/packages/toybox/package.py b/var/spack/repos/builtin/packages/toybox/package.py index ac08265d5f13ef..714f8420d6fdec 100644 --- a/var/spack/repos/builtin/packages/toybox/package.py +++ b/var/spack/repos/builtin/packages/toybox/package.py @@ -16,6 +16,7 @@ class Toybox(MakefilePackage): license("0BSD", checked_by="Buldram") + version("0.8.12", sha256="ad88a921133ae2231d9f2df875ec0bd42af4429145caea7d7db9e02208a6fd2e") version("0.8.11", sha256="15aa3f832f4ec1874db761b9950617f99e1e38144c22da39a71311093bfe67dc") version("0.8.10", sha256="d3afee05ca90bf425ced73f527e418fecd626c5340b5f58711a14531f8d7d108") version("0.8.9", sha256="06913dde3de7139b40f947bd7f23869dfc8796e9c6ff39de02719f8b7b2d47ad") @@ -54,7 +55,7 @@ class Toybox(MakefilePackage): sha256="2c6ffad53102db23b620fd883636daad15c70a08c72f802a1fbcf96c331280cc", when="@=0.8.7", ) - # Fixes segfault when building with more recent toolchains. + # Fixes segfaults when building with more recent toolchains. patch( "https://github.com/landley/toybox/commit/78289203031afc23585035c362beec10db54958d.patch?full_index=1", sha256="a27a831eb80f9d46809f619b52018eb2e481758581f7a6932423b95422f23911", diff --git a/var/spack/repos/builtin/packages/tree/package.py b/var/spack/repos/builtin/packages/tree/package.py index df2520038c13f2..da9386c00e538d 100644 --- a/var/spack/repos/builtin/packages/tree/package.py +++ b/var/spack/repos/builtin/packages/tree/package.py @@ -26,6 +26,8 @@ class Tree(Package): version("1.8.0", sha256="715d5d4b434321ce74706d0dd067505bb60c5ea83b5f0b3655dae40aa6f9b7c2") version("1.7.0", sha256="6957c20e82561ac4231638996e74f4cfa4e6faabc5a2f511f0b4e3940e8f7b12") + depends_on("c", type="build") + depends_on("gmake", type="build") @when("@2:") diff --git a/var/spack/repos/builtin/packages/trexio/package.py b/var/spack/repos/builtin/packages/trexio/package.py index eb8261181cb64c..7c0684ec4cd97e 100644 --- a/var/spack/repos/builtin/packages/trexio/package.py +++ b/var/spack/repos/builtin/packages/trexio/package.py @@ -47,18 +47,16 @@ class Trexio(AutotoolsPackage, CMakePackage): depends_on("hdf5@1.8:+hl", when="@:2.3.0 +hdf5") depends_on("hdf5@1.8:", when="+hdf5") - # Append -lhdf5_hl to LIBS when hdf5 variant is activated - # or use --without-hdf5 option otherwise. - class AutotoolsBuilder(autotools.AutotoolsBuilder): def configure_args(self): config_args = [] if "+hdf5" in self.spec: - if self.spec("@:2.3.0"): + if self.spec.satisfies("@:2.3.0"): + # Autotools should take care of adding the necessary flags for HDF5 + # In older versions, it is not always the case for "hdf5_hl" + # Append -lhdf5_hl to LIBS when hdf5 variant is activated config_args.append("LIBS=-lhdf5_hl") - else: - config.args.append("LIBS=-lhdf5") else: config_args.append("--without-hdf5") diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 840b15bc417f18..d346b5e0a10a42 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -421,7 +421,7 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): depends_on("kokkos-kernels@4.5.01", when="@master:") depends_on("kokkos-kernels@4.3.01", when="@16") depends_on("kokkos-kernels@4.2.01", when="@15.1:15") - depends_on("kokkos-kernels@4.1.00", when="@15.0") + depends_on("kokkos+openmp", when="+openmp") for a in CudaPackage.cuda_arch_values: arch_str = f"+cuda cuda_arch={a}" @@ -589,21 +589,22 @@ def setup_dependent_run_environment(self, env, dependent_spec): # in case the dependent app also run a CUDA backend via Trilinos env.set("CUDA_LAUNCH_BLOCKING", "1") - def setup_dependent_package(self, module, dependent_spec): - if "+wrapper" in self.spec: - self.spec.kokkos_cxx = self.spec["kokkos-nvcc-wrapper"].kokkos_cxx - else: - self.spec.kokkos_cxx = spack_cxx + @property + def kokkos_cxx(self) -> str: + if self.spec.satisfies("+wrapper"): + return self["kokkos-nvcc-wrapper"].kokkos_cxx + # Assumes build-time globals have been set already + return spack_cxx def setup_build_environment(self, env): spec = self.spec if "+cuda" in spec and "+wrapper" in spec: if "+mpi" in spec: - env.set("OMPI_CXX", spec["kokkos-nvcc-wrapper"].kokkos_cxx) - env.set("MPICH_CXX", spec["kokkos-nvcc-wrapper"].kokkos_cxx) - env.set("MPICXX_CXX", spec["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("OMPI_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("MPICH_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("MPICXX_CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) else: - env.set("CXX", spec["kokkos-nvcc-wrapper"].kokkos_cxx) + env.set("CXX", self["kokkos-nvcc-wrapper"].kokkos_cxx) if "+rocm" in spec: if "+mpi" in spec: @@ -906,7 +907,7 @@ def define_tpl(trilinos_name, spack_name, have_dep): # External Kokkos if spec.satisfies("@14.4.0: +kokkos"): options.append(define_tpl_enable("Kokkos")) - if spec.satisfies("@15.0: +kokkos"): + if spec.satisfies("@15.1: +kokkos"): options.append(define_tpl_enable("KokkosKernels", True)) # MPI settings diff --git a/var/spack/repos/builtin/packages/trimmomatic/package.py b/var/spack/repos/builtin/packages/trimmomatic/package.py index 07b2855b338bb1..4bb6662d30fd96 100644 --- a/var/spack/repos/builtin/packages/trimmomatic/package.py +++ b/var/spack/repos/builtin/packages/trimmomatic/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/turbine/package.py b/var/spack/repos/builtin/packages/turbine/package.py index 7bf28e15a10021..8bda89db0fe468 100644 --- a/var/spack/repos/builtin/packages/turbine/package.py +++ b/var/spack/repos/builtin/packages/turbine/package.py @@ -63,7 +63,7 @@ def configure_args(self): ] if self.spec.satisfies("^intel-oneapi-mpi"): - args.append("--with-mpi=" + self.spec["intel-oneapi-mpi"].package.component_prefix) + args.append("--with-mpi=" + self["intel-oneapi-mpi"].component_prefix) else: args.append("--with-mpi=" + self.spec["mpi"].prefix) diff --git a/var/spack/repos/builtin/packages/typescript/package.py b/var/spack/repos/builtin/packages/typescript/package.py index eef215b47ceaac..d069bb684f6a21 100644 --- a/var/spack/repos/builtin/packages/typescript/package.py +++ b/var/spack/repos/builtin/packages/typescript/package.py @@ -3,6 +3,8 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re + from spack.package import * @@ -12,6 +14,8 @@ class Typescript(Package): homepage = "https://www.typescriptlang.org" url = "https://github.com/microsoft/TypeScript/archive/refs/tags/v5.3.2.tar.gz" + tags = ["build-tools"] + license("Apache-2.0") version("5.3.2", sha256="c5a12507006e7d2b8020dec9589191ce070fd88203f2c80aca00d641cee7866f") @@ -19,6 +23,14 @@ class Typescript(Package): depends_on("node-js", type=("build", "link", "run")) depends_on("npm", type="build") + executables = ["^tsc$"] + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str) + match = re.match(r"Version\s+([\d.]+)\s*", output) + return match.group(1) if match else None + def install(self, spec, prefix): npm = which("npm", required=True) npm("install", "--global", f"--prefix={prefix}") diff --git a/var/spack/repos/builtin/packages/typst/package.py b/var/spack/repos/builtin/packages/typst/package.py index 0d7dd1bcf6e25a..fe3a9839ad4556 100644 --- a/var/spack/repos/builtin/packages/typst/package.py +++ b/var/spack/repos/builtin/packages/typst/package.py @@ -18,19 +18,17 @@ class Typst(CargoPackage): license("Apache-2.0", checked_by="upsj") + version("0.13.0", commit="8dce676dcd691f75696719e0480cd619829846a9", tag="v0.13.0") version("0.12.0", commit="737895d769188f6fc154523e67a9102bc24c872e", tag="v0.12.0") - depends_on("rust@1.81.0:") + depends_on("rust@1.80:", type="build") depends_on("openssl") depends_on("pkgconfig", type="build") + build_directory = "crates/typst-cli" + @classmethod def determine_version(cls, exe): output = Executable(exe)("--version", output=str, error=str) match = re.search(r"typst ([0-9.]+)", output) return match.group(1) if match else None - - def build(self, spec, prefix): - # The cargopackage installer doesn't allow for an option to install from a subdir - # see: https://github.com/rust-lang/cargo/issues/7599 - cargo("install", "--root", "out", "--path", "crates/typst-cli") diff --git a/var/spack/repos/builtin/packages/ucx/package.py b/var/spack/repos/builtin/packages/ucx/package.py index 89e5b44ec67527..e8118fbdad378c 100644 --- a/var/spack/repos/builtin/packages/ucx/package.py +++ b/var/spack/repos/builtin/packages/ucx/package.py @@ -19,9 +19,10 @@ class Ucx(AutotoolsPackage, CudaPackage): license("BSD-3-Clause") # Current - version("1.17.0", sha256="34658e282f99f89ce7a991c542e9727552734ac6ad408c52f22b4c2653b04276") + version("1.18.0", sha256="fa75070f5fa7442731b4ef5fc9549391e147ed3d859afeb1dad2d4513b39dc33") # Still supported + version("1.17.0", sha256="34658e282f99f89ce7a991c542e9727552734ac6ad408c52f22b4c2653b04276") version("1.16.0", sha256="f73770d3b583c91aba5fb07557e655ead0786e057018bfe42f0ebe8716e9d28c") version("1.15.0", sha256="4b202087076bc1c98f9249144f0c277a8ea88ad4ca6f404f94baa9cb3aebda6d") version("1.14.1", sha256="baa0634cafb269a3112f626eb226bcd2ca8c9fcf0fec3b8e2a3553baad5f77aa") diff --git a/var/spack/repos/builtin/packages/unifyfs/package.py b/var/spack/repos/builtin/packages/unifyfs/package.py index 366657716558d6..568675121e7160 100644 --- a/var/spack/repos/builtin/packages/unifyfs/package.py +++ b/var/spack/repos/builtin/packages/unifyfs/package.py @@ -112,10 +112,12 @@ def setup_build_environment(self, env): if self.spec.satisfies("%oneapi"): env.append_flags("CFLAGS", "-Wno-unused-function") - @when("%cce@11.0.3:") def patch(self): - filter_file("-Werror", "", "client/src/Makefile.in") - filter_file("-Werror", "", "client/src/Makefile.am") + if self.spec.satisfies("%cce@11.0.3:"): + filter_file("-Werror", "", "client/src/Makefile.in") + filter_file("-Werror", "", "client/src/Makefile.am") + if self.spec.satisfies("@2.0 %oneapi@2025:"): + filter_file("static int asprintf", "int asprintf", "examples/src/testutil.c") @when("@develop") def autoreconf(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/upcxx/package.py b/var/spack/repos/builtin/packages/upcxx/package.py index de6a43a70869e5..fe5fee91e14122 100644 --- a/var/spack/repos/builtin/packages/upcxx/package.py +++ b/var/spack/repos/builtin/packages/upcxx/package.py @@ -194,6 +194,12 @@ def install(self, spec, prefix): if env.get("LDLIBS"): env["LIBS"] = env["LDLIBS"] + if spec.satisfies("%oneapi@2025:"): + env["CXXFLAGS"] = ( + "-Wno-error=missing-template-arg-list-after-template-kw " + "-Wno-missing-template-arg-list-after-template-kw" + ) + options = ["--prefix=%s" % prefix] if "cross=none" in spec: diff --git a/var/spack/repos/builtin/packages/ut/package.py b/var/spack/repos/builtin/packages/ut/package.py index 55fe2be98dc377..a6907006ecba16 100644 --- a/var/spack/repos/builtin/packages/ut/package.py +++ b/var/spack/repos/builtin/packages/ut/package.py @@ -17,6 +17,7 @@ class Ut(CMakePackage): license("BSL-1.0") version("master", branch="master") + version("2.3.0", sha256="9c07a2b7947cc169fc1713ad462ccc43a704076447893a1fd25bdda5eec4aab6") version("2.1.1", sha256="016ac5ece1808cd1100be72f90da4fa59ea41de487587a3283c6c981381cc216") version("2.1.0", sha256="1c9c35c039ad3a9795a278447db6da0a4ec1a1d223bf7d64687ad28f673b7ae8") version("2.0.1", sha256="1e43be17045a881c95cedc843d72fe9c1e53239b02ed179c1e39e041ebcd7dad") diff --git a/var/spack/repos/builtin/packages/varscan/package.py b/var/spack/repos/builtin/packages/varscan/package.py index 5d60d0ecbbdf06..a693e3df377aae 100644 --- a/var/spack/repos/builtin/packages/varscan/package.py +++ b/var/spack/repos/builtin/packages/varscan/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/vc/package.py b/var/spack/repos/builtin/packages/vc/package.py index 83d1119b96cbb1..638950c8a67c92 100644 --- a/var/spack/repos/builtin/packages/vc/package.py +++ b/var/spack/repos/builtin/packages/vc/package.py @@ -24,7 +24,8 @@ class Vc(CMakePackage): version("1.2.0", sha256="9cd7b6363bf40a89e8b1d2b39044b44a4ce3f1fd6672ef3fc45004198ba28a2b") version("1.1.0", sha256="281b4c6152fbda11a4b313a0a0ca18565ee049a86f35f672f1383967fef8f501") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("cmake@3.5:", type="build", when="@1.4.5:") diff --git a/var/spack/repos/builtin/packages/veccore/package.py b/var/spack/repos/builtin/packages/veccore/package.py index 4f885c6f367fbc..a5e1d931b0e5b2 100644 --- a/var/spack/repos/builtin/packages/veccore/package.py +++ b/var/spack/repos/builtin/packages/veccore/package.py @@ -34,6 +34,7 @@ class Veccore(CMakePackage): version("0.4.0", sha256="0a38b958c92647c30b5709d17edaf39d241b92b988f1040c0fbe24932b42927e") version("0.3.2", sha256="d72b03df00f5e94b2d07f78ab3af6d9d956c19e9a1fae07267b48f6fc8d7713f") + depends_on("c", type="build") depends_on("cxx", type="build") variant("vc", default=False, description="Enable Vc backend") diff --git a/var/spack/repos/builtin/packages/vecgeom/package.py b/var/spack/repos/builtin/packages/vecgeom/package.py index 769352b4b0c4b2..fab6046f8735bc 100644 --- a/var/spack/repos/builtin/packages/vecgeom/package.py +++ b/var/spack/repos/builtin/packages/vecgeom/package.py @@ -73,6 +73,7 @@ class Vecgeom(CMakePackage, CudaPackage): deprecated=True, ) + depends_on("c", type="build") depends_on("cxx", type="build") _cxxstd_values = (conditional("11", "14", when="@:1.1"), "17", conditional("20", when="@1.2:")) @@ -96,17 +97,11 @@ class Vecgeom(CMakePackage, CudaPackage): conflicts("+cuda", when="@:1.1.5") - # Fix missing CMAKE_CUDA_STANDARD + # Fix empty -Xcompiler= with nvcc patch( - "https://gitlab.cern.ch/VecGeom/VecGeom/-/commit/7094dd180ef694f2abb7463cafcedfb8b8ed30a1.diff", - sha256="34f1a6899616e40bce33d80a38a9b409f819cbaab07b2e3be7f4ec4bedb52b29", - when="@1.1.7 +cuda", - ) - # Fix installed target properties to not propagate flags to nvcc - patch( - "https://gitlab.cern.ch/VecGeom/VecGeom/-/commit/ac398bd109dd9175e4a898cd4b62571a3cc88252.diff", - sha256="a9ba136d3ed4282ec950069da2199f22beadea27d89a4264d8773ba329e253df", - when="@1.1.18 +cuda ^cuda@:11.4", + "https://gitlab.cern.ch/VecGeom/VecGeom/-/commit/0bf9b675ab70eb5cb9409ff73c1152fd1326dbf4.diff", + sha256="f172b0a9ee1de4931b106d8500d1a60d5688c9bce324cf12ca107ec866a16c56", + when="@1.2.7:1.2.10 +cuda ^cuda@:11", ) def std_when(values): diff --git a/var/spack/repos/builtin/packages/vecmem/package.py b/var/spack/repos/builtin/packages/vecmem/package.py index 67ba53e95e6b3b..1c6aa51eb3e190 100644 --- a/var/spack/repos/builtin/packages/vecmem/package.py +++ b/var/spack/repos/builtin/packages/vecmem/package.py @@ -16,6 +16,7 @@ class Vecmem(CMakePackage, CudaPackage): license("MPL-2.0-no-copyleft-exception") + version("1.14.0", sha256="3fac19e2766e5f997712b0799bd820f65c17ea9cddcb9e765cbdf214f41c4783") version("1.13.0", sha256="fc21cea04140e1210c83a32579b0a7194601889b6c895404214ac55ce547342b") version("1.12.0", sha256="59a5ef061fc9949c3159cb920a717dee7aa1e9a98b3672495200071d3d4b61cf") version("1.11.0", sha256="8f4ef9b50da45ea245291e2a4fef86025245150df4a4654ecb708a20adec5c42") @@ -67,6 +68,11 @@ class Vecmem(CMakePackage, CudaPackage): depends_on("hip", when="+hip") depends_on("sycl", when="+sycl") + # NOTE: this package uses a non-standard "SYCLCXX" environment variable which we can + # set easily only by requiring the OneAPI compiler, as this is automatically capable + # of compiling SYCL code. + requires("%oneapi", when="+sycl") + # FIXME: due to #29447, googletest is not available to cmake when building with --test, # and we can choose between always depending on googletest, or using FetchContent # depends_on("googletest", type="test") diff --git a/var/spack/repos/builtin/packages/verible/package.py b/var/spack/repos/builtin/packages/verible/package.py index 4f2060c3e86ecf..1555d0cf409044 100644 --- a/var/spack/repos/builtin/packages/verible/package.py +++ b/var/spack/repos/builtin/packages/verible/package.py @@ -33,6 +33,11 @@ class Verible(Package): version("master", branch="master") + version( + "0.0.3929", + sha256="dc37ea4e07aca5770c43c51a9cc3dbd3a3e5fa8027da701c3ebf8873fc086157", + url="https://github.com/chipsalliance/verible/archive/refs/tags/v0.0-3929-g931a6910.tar.gz", + ) version( "0.0.3876", sha256="42b933b52cf394fa2cfcb841edb6cf3649f5453bf43178f8f630fc3e626f3e03", diff --git a/var/spack/repos/builtin/packages/vtk-h/package.py b/var/spack/repos/builtin/packages/vtk-h/package.py index 1a93d29fea9134..4a20bc2c5d4412 100644 --- a/var/spack/repos/builtin/packages/vtk-h/package.py +++ b/var/spack/repos/builtin/packages/vtk-h/package.py @@ -8,8 +8,6 @@ import sys from os import environ as env -import llnl.util.tty as tty - from spack.package import * @@ -123,11 +121,9 @@ def _get_host_config_path(self, spec): @run_before("cmake") def hostconfig(self): + """This method creates a 'host-config' file that specifies all of the options used to + configure and build vtkh.""" spec = self.spec - """ - This method creates a 'host-config' file that specifies - all of the options used to configure and build vtkh. - """ if not os.path.isdir(spec.prefix): os.mkdir(spec.prefix) diff --git a/var/spack/repos/builtin/packages/vtk-m/package.py b/var/spack/repos/builtin/packages/vtk-m/package.py index 7033013c1eeeda..765cda84c840b4 100644 --- a/var/spack/repos/builtin/packages/vtk-m/package.py +++ b/var/spack/repos/builtin/packages/vtk-m/package.py @@ -238,7 +238,7 @@ def cmake_args(self): os.environ["TBB_ROOT"] = spec["tbb"].prefix if "+kokkos" in spec and "+rocm" in spec and spec.satisfies("^kokkos@4:"): - options.append(f"-DCMAKE_CXX_COMPILER:BOOL={spec['hip'].prefix.bin.hipcc}") + options.append(f"-DCMAKE_CXX_COMPILER:FILEPATH={spec['hip'].prefix.bin.hipcc}") # Support for relocatable code if "~shared" in spec and "+fpic" in spec: diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py index 666866713eaeab..e502540ac106b4 100644 --- a/var/spack/repos/builtin/packages/vtk/package.py +++ b/var/spack/repos/builtin/packages/vtk/package.py @@ -87,6 +87,10 @@ class Vtk(CMakePackage): conflicts("%gcc@13", when="@9.2") + # VTK 8 vendors a heavily outdated version of CMake's GenerateExportHeader module, which + # has a bogus version check for GCC/Intel version to early exit. This drops the early exit. + patch("vtk-bogus-compiler-check.patch", when="@7.1:8") + # Based on PyPI wheel availability with when("+python"), default_args(type=("build", "link", "run")): depends_on("python@:3.13") @@ -197,22 +201,17 @@ class Vtk(CMakePackage): depends_on("proj@8:", when="@9.2:") depends_on("cgns@4.1.1:+mpi", when="@9.1: +mpi") depends_on("cgns@4.1.1:~mpi", when="@9.1: ~mpi") + + # VTK introduced Seacas IOSS dependency on 9.1 with when("@9.1:"): depends_on("seacas+mpi", when="+mpi") depends_on("seacas~mpi", when="~mpi") - depends_on("seacas@2021-05-12:") - with when("@9.4:"): - depends_on("seacas@2024-06-27:") - - # seacas@2023-05-30 does not provide needed SEACASIoss_INCLUDE_DIRS: - # CMake Error at CMake/vtkModule.cmake:5552 (message): - # The variable `SEACASIoss_INCLUDE_DIRS` was expected to have been available, - # but was not defined: - conflicts("seacas@2023-05-30", when="@:9.2") - - # vtk@9.2: need Ioss::Utils::get_debug_stream() which only 2022-10-14 provides, - # and to be safe against other issues, make them build with this version only: - depends_on("seacas@2022-10-14", when="@9.2:") + depends_on("seacas@2021-05-12:2022-10-14", when="@9.1") + # vtk@9.2: need Ioss::Utils::get_debug_stream() which only 2022-10-14 provides, + # and to be safe against other issues, make them build with this version only: + depends_on("seacas@2022-10-14", when="@9.2:9.3") + depends_on("seacas@2024-06-27", when="@9.4:") + depends_on("nlohmann-json", when="@9.2:") # For finding Fujitsu-MPI wrapper commands @@ -240,6 +239,27 @@ class Vtk(CMakePackage): when="@9.1:9.2 %gcc@13:", ) + # SEACAS >= 2024-06-27 needs c++17 which is already required in VTK master. + patch( + "https://gitlab.kitware.com/vtk/vtk/-/commit/00afe3ae0def6c2d0a6f7cb497c8d55874127820.diff", + sha256="1e5fb55b14ba6455a1891d27aa4a0506f47e3155014af06f97633ae1ef6e9cc2", + when="@9.4:", + ) + + # Needed to build VTK with external SEACAS. + patch( + "https://gitlab.kitware.com/vtk/vtk/-/commit/e98526813691e527fff7d5df6a1641ae36c0cf4f.diff", + sha256="174930dde06828ead84c68b1a192202766f6297a60f0c54eef6cab2605a466ef", + when="@9.4:", + ) + + # Needed to build VTK with external SEACAS >= 2022-10-14 + @when("@9.4:") + def patch(self): + filter_file( + "^.*USE_VARIABLES SEACASIoss_INCLUDE_DIRS.*$", "", "ThirdParty/ioss/CMakeLists.txt" + ) + @when("@9.2:") def patch(self): # provide definition for Ioss::Init::Initializer::Initializer(), diff --git a/var/spack/repos/builtin/packages/vtk/vtk-bogus-compiler-check.patch b/var/spack/repos/builtin/packages/vtk/vtk-bogus-compiler-check.patch new file mode 100644 index 00000000000000..c4b8c82b6b9b9f --- /dev/null +++ b/var/spack/repos/builtin/packages/vtk/vtk-bogus-compiler-check.patch @@ -0,0 +1,28 @@ +From a444764fa92b8c4d5b49914ad9c8d8a9a4efafec Mon Sep 17 00:00:00 2001 +From: Harmen Stoppels +Date: Mon, 27 Jan 2025 19:10:22 +0100 +Subject: [PATCH] VTKGenerateExportHeader.cmake: remove faulty compiler version + check + +--- + CMake/VTKGenerateExportHeader.cmake | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/CMake/VTKGenerateExportHeader.cmake b/CMake/VTKGenerateExportHeader.cmake +index 9a7a76386e..59d0bf7ebf 100644 +--- a/CMake/VTKGenerateExportHeader.cmake ++++ b/CMake/VTKGenerateExportHeader.cmake +@@ -204,9 +204,7 @@ macro(_vtk_test_compiler_hidden_visibility) + # Exclude XL here because it misinterprets -fvisibility=hidden even though + # the check_cxx_compiler_flag passes + # http://www.cdash.org/CDash/testDetails.php?test=109109951&build=1419259 +- if(NOT GCC_TOO_OLD +- AND NOT _INTEL_TOO_OLD +- AND NOT WIN32 ++ if(NOT WIN32 + AND NOT CYGWIN + AND NOT CMAKE_CXX_COMPILER_ID MATCHES "XL" + AND NOT CMAKE_CXX_COMPILER_ID MATCHES "PGI" +-- +2.43.0 + diff --git a/var/spack/repos/builtin/packages/wannier90/package.py b/var/spack/repos/builtin/packages/wannier90/package.py index ab268635ccb411..47874c433a861d 100644 --- a/var/spack/repos/builtin/packages/wannier90/package.py +++ b/var/spack/repos/builtin/packages/wannier90/package.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os.path +import os from spack.package import * diff --git a/var/spack/repos/builtin/packages/warpx/package.py b/var/spack/repos/builtin/packages/warpx/package.py index 0fac6808fe5b76..575700dfb6aaec 100644 --- a/var/spack/repos/builtin/packages/warpx/package.py +++ b/var/spack/repos/builtin/packages/warpx/package.py @@ -25,7 +25,12 @@ class Warpx(CMakePackage, PythonExtension): # NOTE: if you update the versions here, also see py-warpx version("develop", branch="development") - version("24.10", sha256="1fe3a86bf820a2ecef853cdcd9427fba4e0cb1efb05326da7dc9dbf94551202f") + version("25.02", sha256="c65385a3598bf43278c0b1c10ae2a5a07c1a46f6fa98deded385ecca2021a1a2") + version( + "24.10", + sha256="1fe3a86bf820a2ecef853cdcd9427fba4e0cb1efb05326da7dc9dbf94551202f", + deprecated=True, + ) version( "24.08", sha256="8da1f2967f613a65a295260260aa4f081ac1d1b7c1d6987d294e02b86099df08", @@ -245,7 +250,7 @@ class Warpx(CMakePackage, PythonExtension): depends_on("c", type="build") depends_on("cxx", type="build") - for v in ["24.10", "24.08", "develop"]: + for v in ["25.02", "24.10", "24.08", "develop"]: depends_on( f"amrex@{v} build_system=cmake +linear_solvers +pic +particles +shared +tiny_profile", when=f"@{v}", @@ -277,6 +282,8 @@ class Warpx(CMakePackage, PythonExtension): depends_on("amrex dimensions=3") with when("+eb"): depends_on("amrex +eb") + with when("+fft"): + depends_on("amrex +fft", when="@24.11:") depends_on("mpi", when="+mpi") with when("+mpi"): depends_on("amrex +mpi") @@ -321,6 +328,7 @@ class Warpx(CMakePackage, PythonExtension): depends_on("openpmd-api@0.13.1:") depends_on("openpmd-api@0.14.2:", when="@21.09:") depends_on("openpmd-api@0.15.1:", when="@23.05:") + depends_on("openpmd-api@0.16.1:", when="@25.02:") depends_on("openpmd-api ~mpi", when="~mpi") depends_on("openpmd-api +mpi", when="+mpi") @@ -334,7 +342,8 @@ class Warpx(CMakePackage, PythonExtension): depends_on("py-periodictable@1.5:1", type=("build", "run")) depends_on("py-picmistandard@0.28.0", type=("build", "run"), when="@23.11:24.07") depends_on("py-picmistandard@0.29.0", type=("build", "run"), when="@24.08") - depends_on("py-picmistandard@0.30.0", type=("build", "run"), when="@24.09:") + depends_on("py-picmistandard@0.30.0", type=("build", "run"), when="@24.09:24.12") + depends_on("py-picmistandard@0.33.0", type=("build", "run"), when="@25.01:") depends_on("py-pip@23:", type="build") depends_on("py-setuptools@42:", type="build") depends_on("py-pybind11@2.12.0:", type=("build", "link")) diff --git a/var/spack/repos/builtin/packages/wayland-protocols/package.py b/var/spack/repos/builtin/packages/wayland-protocols/package.py index dc29760647c741..2fba6d38c3aef4 100644 --- a/var/spack/repos/builtin/packages/wayland-protocols/package.py +++ b/var/spack/repos/builtin/packages/wayland-protocols/package.py @@ -28,6 +28,7 @@ class WaylandProtocols(MesonPackage, AutotoolsPackage): license("MIT") + version("1.40", sha256="0d783e6c1fff096d37c4e0fd1f3f14f63c4fdc5c1cf8ec07db2a349ffd56a1d3") version("1.39", sha256="42c16435dfc83f320ff727b6d446bb0d4feb361dc11796a2c5d3c0fb6532a517") version("1.38", sha256="a6069948458a1d86cea2b33a9735e67d7524118c32c388d75efb881a9e9d2cd9") version("1.37", sha256="c3b215084eb4cf318415533554c2c2714e58ed75847d7c3a8e50923215ffbbf3") diff --git a/var/spack/repos/builtin/packages/wgl/package.py b/var/spack/repos/builtin/packages/wgl/package.py index 98671349e4c3f3..7e603b03a500b7 100644 --- a/var/spack/repos/builtin/packages/wgl/package.py +++ b/var/spack/repos/builtin/packages/wgl/package.py @@ -61,8 +61,7 @@ class Wgl(Package): depends_on("win-sdk@10.0.14393", when="@10.0.14393") # WGL has no meaning on other platforms, should not be able to spec - for plat in ["linux", "darwin"]: - conflicts("platform=%s" % plat) + requires("platform=windows") @classmethod def determine_version(cls, lib): diff --git a/var/spack/repos/builtin/packages/wgrib2/package.py b/var/spack/repos/builtin/packages/wgrib2/package.py index b728bb4945e41a..6087c9885607bc 100644 --- a/var/spack/repos/builtin/packages/wgrib2/package.py +++ b/var/spack/repos/builtin/packages/wgrib2/package.py @@ -2,20 +2,65 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import os import re +import spack.build_systems.cmake +import spack.build_systems.makefile from spack.package import * - -class Wgrib2(MakefilePackage): +variant_map_common = { + "netcdf3": "USE_NETCDF3", + "netcdf4": "USE_NETCDF4", + "mysql": "USE_MYSQL", + "udf": "USE_UDF", + "regex": "USE_REGEX", + "tigge": "USE_TIGGE", + "proj4": "USE_PROJ4", + "aec": "USE_AEC", + "g2c": "USE_G2CLIB", + "png": "USE_PNG", + "jasper": "USE_JASPER", + "openmp": "USE_OPENMP", + "wmo_validation": "USE_WMO_VALIDATION", + "ipolates": "USE_IPOLATES", + "disable_alarm": "DISABLE_ALARM", + "fortran_api": "MAKE_FTN_API", + "disable_stat": "DISABLE_STAT", + "openjpeg": "USE_OPENJPEG", +} + +variant_map_makefile = {"spectral": "USE_SPECTRAL"} + +variant_map_cmake = { + "netcdf": "USE_NETCDF", + "disable_timezone": "DISABLE_TIMEZONE", + "enable_docs": "ENABLE_DOCS", +} + +variant_map_makefile.update(variant_map_common) +variant_map_cmake.update(variant_map_common) + + +class Wgrib2(MakefilePackage, CMakePackage): """Utility for interacting with GRIB2 files""" homepage = "https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2" - url = "https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz.v2.0.8" + url = "https://github.com/NOAA-EMC/wgrib2/archive/refs/tags/v3.5.0.tar.gz" + git = "https://github.com/NOAA-EMC/wgrib2.git" - maintainers("t-brown", "AlexanderRichert-NOAA", "Hang-Lei-NOAA", "edwardhartnett") + maintainers( + "AlysonStahl-NOAA", "t-brown", "AlexanderRichert-NOAA", "Hang-Lei-NOAA", "edwardhartnett" + ) + build_system( + conditional("cmake", when="@3.2:"), conditional("makefile", when="@:3.1"), default="cmake" + ) + + version("develop", branch="develop") + version("3.5.0", sha256="b27b48228442a08bddc3d511d0c6335afca47252ae9f0e41ef6948f804afa3a1") + version("3.4.0", sha256="ecbce2209c09bd63f1bca824f58a60aa89db6762603bda7d7d3fa2148b4a0536") + version("3.3.0", sha256="010827fba9c31f05807e02375240950927e9e51379e1444388153284f08f58e2") + version("3.2.0", sha256="ac3ace77a32c2809cbc4538608ad64aabda2c9c1e44e7851da79764a6eb3c369") version( "3.1.1", sha256="9236f6afddad76d868c2cfdf5c4227f5bdda5e85ae40c18bafb37218e49bc04a", @@ -37,27 +82,51 @@ class Wgrib2(MakefilePackage): extension="tar.gz", ) - depends_on("c", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("fortran", type="build") + + def url_for_version(self, version): + if version >= Version("3.2.0"): + url_fmt = "https://github.com/NOAA-EMC/wgrib2/archive/refs/tags/v{0}.tar.gz" + else: + url_fmt = "https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz.v{0}" + return url_fmt.format(version) - variant("netcdf3", default=True, description="Link in netcdf3 library to write netcdf3 files") variant( - "netcdf4", default=False, description="Link in netcdf4 library to write netcdf3/4 files" + "netcdf3", + default=True, + description="Link in netcdf3 library to write netcdf3 files", + when="@:3.1", ) variant( - "ipolates", - default="3", - description="Use to interpolate to new grids (0 = OFF, 1 = ip, 3 = ip2)", - values=("0", "1", "3"), + "netcdf4", + default=False, + description="Link in netcdf4 library to write netcdf3/4 files", + when="@:3.3", ) - variant("spectral", default=False, description="Spectral interpolation in -new_grid") + variant( + "netcdf", + default=False, + description="Link in netcdf4 library to write netcdf3/4 files", + when="@3.4:", + ) + variant("ipolates", default=False, description="Use to interpolate to new grids") + variant( + "spectral", default=False, description="Spectral interpolation in -new_grid", when="@:3.1" + ) + # Not currently working for @3.2: variant( "fortran_api", default=True, description="Make wgrib2api which allows fortran code to read/write grib2", ) + # Not currently working for @3.2: + # variant("lib", default=True, description="Build library", when="@3.2:") variant( - "mysql", default=False, description="Link in interface to MySQL to write to mysql database" + "mysql", + default=False, + description="Link in interface to MySQL to write to mysql database", + when="@:3.1", ) variant( "udf", @@ -66,11 +135,21 @@ class Wgrib2(MakefilePackage): ) variant("regex", default=True, description="Use regular expression library (POSIX-2)") variant("tigge", default=True, description="Ability for TIGGE-like variable names") - variant("proj4", default=False, description="The proj4 library is used to verify gctpc.") + variant( + "proj4", + default=False, + description="The proj4 library is used to verify gctpc.", + when="@:3.1", + ) variant( "aec", default=True, description="Use the libaec library for packing with GRIB2 template" ) - variant("g2c", default=False, description="Include NCEP g2clib (mainly for testing purposes)") + variant( + "g2c", + default=False, + description="Include NCEP g2clib (mainly for testing purposes)", + when="@:3.1", + ) variant( "disable_timezone", default=False, description="Some machines do not support timezones" ) @@ -83,46 +162,42 @@ class Wgrib2(MakefilePackage): variant("jasper", default=True, description="JPEG compression using Jasper") variant("openmp", default=True, description="OpenMP parallelization") variant("wmo_validation", default=False, description="WMO validation") + # variant("shared", default=False, description="Enable shared library", when="+lib") + variant("disable_stat", default=False, description="Disable POSIX feature", when="@:3.1") + variant("openjpeg", default=False, description="Enable OpenJPEG") + variant( + "enable_docs", default=False, description="Build doxygen documentation", when="@3.4.0:" + ) conflicts("+netcdf3", when="+netcdf4") + conflicts("+netcdf3", when="+netcdf") conflicts("+openmp", when="%apple-clang") - depends_on("wget", type=("build"), when="+netcdf4") - - variant_map = { - "netcdf3": "USE_NETCDF3", - "netcdf4": "USE_NETCDF4", - "spectral": "USE_SPECTRAL", - "mysql": "USE_MYSQL", - "udf": "USE_UDF", - "regex": "USE_REGEX", - "tigge": "USE_TIGGE", - "proj4": "USE_PROJ4", - "aec": "USE_AEC", - "g2c": "USE_G2CLIB", - "png": "USE_PNG", - "jasper": "USE_JASPER", - "openmp": "USE_OPENMP", - "wmo_validation": "USE_WMO_VALIDATION", - "ipolates": "USE_IPOLATES", - "disable_timezone": "DISABLE_TIMEZONE", - "disable_alarm": "DISABLE_ALARM", - "fortran_api": "MAKE_FTN_API", - } - - # Disable parallel build - parallel = False + depends_on("ip@5.1:", when="@3.5: +ipolates") + depends_on("lapack", when="@3.5: +ipolates") + depends_on("libaec@1.0.6:", when="@3.2: +aec") + depends_on("netcdf-c", when="@3.2: +netcdf4") + depends_on("jasper@:2", when="@3.2:3.4 +jasper") + depends_on("g2c", when="@3.5: +jasper") + depends_on("zlib-api", when="@3.2: +png") + depends_on("libpng", when="@3.2: +png") + depends_on("openjpeg", when="@3.2:3.4 +openjpeg") + depends_on("g2c +openjpeg", when="@3.5: +openjpeg") + requires("^g2c@1.9:", when="@3.5: ^g2c") + + @when("@:2 ^gmake@4.2:") + def patch(self): + filter_file(r"\\#define", "#define", "makefile") # Use Spack compiler wrapper flags def inject_flags(self, name, flags): - spec = self.spec if name == "cflags": - if spec.satisfies("%apple-clang"): + if self.spec.compiler.name == "apple-clang": flags.append("-Wno-error=implicit-function-declaration") # When mixing Clang/gfortran need to link to -lgfortran # Find this by searching for gfortran/../lib - if spec.satisfies("%apple-clang") or spec.satisfies("%clang"): + if self.spec.compiler.name in ["apple-clang", "clang"]: if "gfortran" in self.compiler.fc: output = Executable(self.compiler.fc)("-###", output=str, error=str) libdir = re.search("--libdir=(.+?) ", output).group(1) @@ -130,13 +205,30 @@ def inject_flags(self, name, flags): return (flags, None, None) + +class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): + # Disable parallel build + parallel = False + + def cmake_args(self): + args = [self.define_from_variant(variant_map_cmake[k], k) for k in variant_map_cmake] + # args.append(self.define_from_variant("BUILD_LIB", "lib")) + # args.append(self.define_from_variant("BUILD_SHARED_LIB", "shared")) + + return args + + +class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder): + # Disable parallel build + parallel = False + flag_handler = inject_flags def url_for_version(self, version): url = "https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz.v{}" return url.format(version) - def edit(self, spec, prefix): + def edit(self, pkg, spec, prefix): makefile = FileFilter("makefile") # ifort no longer accepts -openmp @@ -148,31 +240,20 @@ def edit(self, spec, prefix): if spec.satisfies("%clang") or spec.satisfies("%apple-clang"): makefile.filter(r"--fast-math", "-ffast-math") - for variant_name, makefile_option in self.variant_map.items(): + for variant_name, makefile_option in variant_map_makefile.items(): value = int(spec.variants[variant_name].value) makefile.filter(r"^%s=.*" % makefile_option, "{}={}".format(makefile_option, value)) def setup_build_environment(self, env): - spec = self.spec - if spec.satisfies("%oneapi") or spec.satisfies("%intel"): + if self.spec.compiler.name in ["oneapi", "intel"]: comp_sys = "intel_linux" - elif spec.satisfies("%gcc") or spec.satisfies("%clang") or spec.satisfies("%apple-clang"): + elif self.spec.compiler.name in ["gcc", "clang", "apple-clang"]: comp_sys = "gnu_linux" env.set("COMP_SYS", comp_sys) - def build(self, spec, prefix): - # Get source files for netCDF4 builds - if self.spec.satisfies("+netcdf4"): - with working_dir(self.build_directory): - os.system( - "wget https://downloads.unidata.ucar.edu/netcdf-c/4.8.1/netcdf-c-4.8.1.tar.gz" - ) - os.system( - "wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/src/hdf5-1.12.1.tar.gz" - ) - - make() + def build(self, pkg, spec, prefix): + make("-j1") # Move wgrib2 executable to a tempoary directory mkdir("install") @@ -187,7 +268,7 @@ def build(self, spec, prefix): makefile = FileFilter("makefile") # Disable all options - for variant_name, makefile_option in self.variant_map.items(): + for variant_name, makefile_option in variant_map_makefile.items(): value = 0 makefile.filter( r"^%s=.*" % makefile_option, "{}={}".format(makefile_option, value) @@ -196,7 +277,7 @@ def build(self, spec, prefix): # Need USE_REGEX in addition to MAKE_FTN_API to build lib makefile.filter(r"^MAKE_FTN_API=.*", "MAKE_FTN_API=1") makefile.filter(r"^USE_REGEX=.*", "USE_REGEX=1") - make("lib") + make("lib", "-j1") mkdir(join_path("install", "lib")) mkdir(join_path("install", "include")) @@ -204,5 +285,5 @@ def build(self, spec, prefix): move(join_path("lib", "wgrib2api.mod"), join_path("install", "include")) move(join_path("lib", "wgrib2lowapi.mod"), join_path("install", "include")) - def install(self, spec, prefix): + def install(self, pkg, spec, prefix): install_tree("install/", prefix) diff --git a/var/spack/repos/builtin/packages/wrf/package.py b/var/spack/repos/builtin/packages/wrf/package.py index 5b3d034f8a6eda..4fb5cd3727c53d 100644 --- a/var/spack/repos/builtin/packages/wrf/package.py +++ b/var/spack/repos/builtin/packages/wrf/package.py @@ -10,8 +10,6 @@ from pathlib import Path from subprocess import PIPE, Popen -from llnl.util import tty - from spack.package import * if sys.platform != "win32": diff --git a/var/spack/repos/builtin/packages/wxwidgets/package.py b/var/spack/repos/builtin/packages/wxwidgets/package.py index 665fb3d788f2f8..dc44a63478dd2a 100644 --- a/var/spack/repos/builtin/packages/wxwidgets/package.py +++ b/var/spack/repos/builtin/packages/wxwidgets/package.py @@ -22,6 +22,7 @@ class Wxwidgets(AutotoolsPackage): git = "https://github.com/wxWidgets/wxWidgets.git" version("develop", branch="master") + version("3.2.6", sha256="939e5b77ddc5b6092d1d7d29491fe67010a2433cf9b9c0d841ee4d04acb9dce7") version("3.2.5", sha256="0ad86a3ad3e2e519b6a705248fc9226e3a09bbf069c6c692a02acf7c2d1c6b51") version("3.2.4", sha256="0640e1ab716db5af2ecb7389dbef6138d7679261fbff730d23845ba838ca133e") version("3.2.2.1", sha256="dffcb6be71296fff4b7f8840eb1b510178f57aa2eb236b20da41182009242c02") diff --git a/var/spack/repos/builtin/packages/xcb-util-cursor/package.py b/var/spack/repos/builtin/packages/xcb-util-cursor/package.py index 9e5f6de0020be5..0e12845818cb58 100644 --- a/var/spack/repos/builtin/packages/xcb-util-cursor/package.py +++ b/var/spack/repos/builtin/packages/xcb-util-cursor/package.py @@ -18,6 +18,9 @@ class XcbUtilCursor(AutotoolsPackage, XorgPackage): license("MIT") + maintainers("wdconinc") + + version("0.1.5", sha256="0caf99b0d60970f81ce41c7ba694e5eaaf833227bb2cbcdb2f6dc9666a663c57") version("0.1.4", sha256="28dcfe90bcab7b3561abe0dd58eb6832aa9cc77cfe42fcdfa4ebe20d605231fb") version( "0.1.3", diff --git a/var/spack/repos/builtin/packages/xios/earcut_missing_include_2.6.patch b/var/spack/repos/builtin/packages/xios/earcut_missing_include_2.6.patch new file mode 100644 index 00000000000000..766c38c2c6917b --- /dev/null +++ b/var/spack/repos/builtin/packages/xios/earcut_missing_include_2.6.patch @@ -0,0 +1,11 @@ +--- a/extern/remap/src/earcut.hpp 2025-01-22 11:42:31.097755822 -0500 ++++ b/extern/remap/src/earcut.hpp 2025-01-22 11:44:00.022637783 -0500 +@@ -7,7 +7,7 @@ + #include + #include + //#include +-//#include ++#include + //#include + + namespace mapbox { diff --git a/var/spack/repos/builtin/packages/xios/package.py b/var/spack/repos/builtin/packages/xios/package.py index f9683d8bfb28a0..1fb036e5d7bce6 100644 --- a/var/spack/repos/builtin/packages/xios/package.py +++ b/var/spack/repos/builtin/packages/xios/package.py @@ -12,16 +12,28 @@ class Xios(Package): """XML-IO-SERVER library for IO management of climate models.""" homepage = "https://forge.ipsl.jussieu.fr/ioserver/wiki" - - version("develop", svn="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk") version( - "2.5", revision=1860, svn="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5" + "2.6", + revision=2714, + svn="https://forge.ipsl.jussieu.fr/ioserver/svn/XIOS2/branches/xios-2.6", + ) + version( + "2.5", + revision=1860, + svn="https://forge.ipsl.jussieu.fr/ioserver/svn/XIOS2/branches/xios-2.5", + deprecated=True, ) version( - "2.0", revision=1627, svn="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.0" + "2.0", + revision=1627, + svn="https://forge.ipsl.jussieu.fr/ioserver/svn/XIOS2/branches/xios-2.0", + deprecated=True, ) version( - "1.0", revision=910, svn="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-1.0" + "1.0", + revision=910, + svn="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-1.0", + deprecated=True, ) variant( @@ -37,10 +49,14 @@ class Xios(Package): patch("bld_extern_1.0.patch", when="@:1.0") # Workaround bug #17782 in llvm, where reading a double - # followed by a character is broken (e.g. duration '1d'): + # followed by a character is broken (e.g. duration '1d') + # https://bugs.llvm.org/show_bug.cgi?id=17782 + # Verified and still needed 2025-02-18 patch("llvm_bug_17782.patch", when="@1.1: %apple-clang") patch("llvm_bug_17782.patch", when="@1.1: %clang") + patch("earcut_missing_include_2.6.patch", when="@2.6:") + depends_on("netcdf-c+mpi") depends_on("netcdf-fortran") depends_on("hdf5+mpi") @@ -131,7 +147,7 @@ def xios_fcm(self): %FCOMPILER {MPIFC} %LINKER {MPIFC} -%BASE_CFLAGS -ansi -w -D_GLIBCXX_USE_CXX11_ABI=0 \ +%BASE_CFLAGS -std=c++11 -w -D_GLIBCXX_USE_CXX11_ABI=0 \ -I{BOOST_INC_DIR} -I{BLITZ_INC_DIR} %PROD_CFLAGS -O3 -DBOOST_DISABLE_ASSERTS %DEV_CFLAGS -g -O2 @@ -202,6 +218,8 @@ def install(self, spec, prefix): "--%s" % spec.variants["mode"].value, "--arch", "SPACK", + "--use_extern_boost", + "--use_extern_blitz", "--netcdf_lib", "netcdf4_par", "--job", diff --git a/var/spack/repos/builtin/packages/xnedit/package.py b/var/spack/repos/builtin/packages/xnedit/package.py new file mode 100644 index 00000000000000..e66c68405f4718 --- /dev/null +++ b/var/spack/repos/builtin/packages/xnedit/package.py @@ -0,0 +1,55 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Xnedit(MakefilePackage): + """XNEdit is a multi-purpose text editor for the X Window System, which combines a standard, + easy to use, graphical user interface with the thorough functionality and stability.""" + + license("GPL-2.0-or-later") + + homepage = "https://www.unixwork.de/xnedit/" + url = "https://github.com/unixwork/xnedit/archive/refs/tags/v1.6.1.tar.gz" + git = "https://github.com/unixwork/xnedit.git" + + maintainers("davekeeshan") + + version("1.6.2", sha256="0ee832ad186b81b8ba8df43352d86e35997cea9708ff7ddad15e9d91fe81b6cb") + version("1.6.1", sha256="46489fa3017f5e40da810170b33c681affd3cd4dff1dbd0f8a4c51f8285ca5c4") + version("1.6.0", sha256="197e635fc1aa8e4ff2dcd2375efac597975f04170c3eace3280c4054bbbc57ac") + version("1.5.3", sha256="89421abbcb91f27e122b874769ca60021802735ea527fc6ae5b3d50061f81120") + version("1.5.2", sha256="2f9710b661f8ec5d371a3385fa480c7424e2f863938a8e2ae71cb17397be3f91") + version("1.5.1", sha256="c871589e912ed9f9a02cc57932f5bb9694ec91cc5487be0cd55e7d3aade372d6") + version("1.5.0", sha256="054f0805405bfc0304e5d27aaac7f4d89b9f028b9e408bf8c079669ddb89df00") + version("1.4.1", sha256="6f6ef827b0f6efe481333fe81ec30e2ab133b24cbc9bab224c02e1f69474bade") + version("1.4.0", sha256="91c88689c853a6f16f22c109a7283ae552a7079829a25dfa6db192b3d6c6cb60") + version("1.3.3", sha256="388765726bca2887eca4a95e1253214ee7209075b0bdd4a143ad870ccc04703f") + version("1.3.2", sha256="20f816dba7c3aa59504d1a1360a731854581801c3031012a6b8fef55d437bd04") + version("1.3.1", sha256="e1551983cb4e6ee8c9dcb35a628fdcf12dd191bab9321c98c77c22456688e81a") + version("1.3.0", sha256="5b1fccbaee007dceca37b24d248e27818c30eb0a87b79317f51ba731da3b8a03") + version("1.2.2", sha256="9d0434fb47a306f8665bcf4f9bf3f41173c31010cdfd767a0622ae8b9be10ac1") + version("1.2.1", sha256="e0c0147c7f81ccac1c40acb5636b375ef76678a7a84ec592d509461af00983c5") + version("1.2.0", sha256="8a6a1252b36be8be5c20aafe5989ad3158cd66449632bf1014ad10cf85a6ea16") + version("1.1.1", sha256="9958cc58f9834e3ccfa1d094e942f1ff5bc8b0464ae8e6d259cbb9e71bfb1ebd") + version("1.1.0", sha256="c335c3a5beb2263d5a9974931dbdd1f2e5cf77fd0eafd4026ee2b7ca0aad2fe7") + version("1.0.1", sha256="3efa26d180696ea7b24c3efd2599c52183b6851fc1bc87ce9a4f85d465962a8c") + version("1.0.0", sha256="f58dcbd268f226192584f56dd1a897290a66176d91a90d715a40d63578a84b72") + + depends_on("automake", type="build") + depends_on("libx11") + depends_on("libxt") + depends_on("libxpm") + depends_on("motif") + depends_on("pcre") + + def setup_build_environment(self, env): + env.prepend_path("LDFLAGS", "-Wl,--copy-dt-needed-entries") + + def build(self, spec, prefix): + make("linux") + + def install(self, spec, prefix): + make("install", f"PREFIX={prefix}") diff --git a/var/spack/repos/builtin/packages/xrootd/package.py b/var/spack/repos/builtin/packages/xrootd/package.py index f7fcbbe7bef37e..e7aba78f31e9e2 100644 --- a/var/spack/repos/builtin/packages/xrootd/package.py +++ b/var/spack/repos/builtin/packages/xrootd/package.py @@ -260,7 +260,7 @@ def setup_build_environment(self, env): else: # The user has selected a (new?) legal value that we've # forgotten to deal with here. - tty.die( + raise InstallError( "INTERNAL ERROR: cannot accommodate unexpected variant ", "cxxstd={0}".format(self.spec.variants["cxxstd"].value), ) diff --git a/var/spack/repos/builtin/packages/xz/nvhpc.patch b/var/spack/repos/builtin/packages/xz/nvhpc.patch new file mode 100644 index 00000000000000..62ca2c6c8549a7 --- /dev/null +++ b/var/spack/repos/builtin/packages/xz/nvhpc.patch @@ -0,0 +1,12 @@ +diff -Naru xz.pristine/src/liblzma/common/common.h xz.new/src/liblzma/common/common.h +--- xz.pristine/src/liblzma/common/common.h 2025-02-11 21:03:10.322612833 +0000 ++++ xz.new/src/liblzma/common/common.h 2025-02-11 21:02:56.135613226 +0000 +@@ -93,7 +93,7 @@ + LZMA_API(type) intname + # else + # define LZMA_SYMVER_API(extnamever, type, intname) \ +- __asm__(".symver " #intname "," extnamever); \ ++ __asm__(".symver " #intname "," extnamever "\n"); \ + extern LZMA_API(type) intname + # endif + #endif diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index f4428539f603eb..a11b890b5b6cc1 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -61,6 +61,12 @@ class Xz(MSBuildPackage, AutotoolsPackage, SourceforgePackage): # prior to 5.2.3, build system is for MinGW only, not currently supported by Spack conflicts("platform=windows", when="@:5.2.3") + patch( + "nvhpc.patch", + when="@5.2.10: %nvhpc", + sha256="32228638c462651ec7dedab706d05aa352995f064ace2dee915f31c75cc995c0", + ) + build_system(conditional("msbuild", when="platform=windows"), "autotools", default="autotools") def flag_handler(self, name, flags): diff --git a/var/spack/repos/builtin/packages/yafyaml/package.py b/var/spack/repos/builtin/packages/yafyaml/package.py index 68dfd90c6f6bec..f1e4f699fee12e 100644 --- a/var/spack/repos/builtin/packages/yafyaml/package.py +++ b/var/spack/repos/builtin/packages/yafyaml/package.py @@ -31,6 +31,7 @@ class Yafyaml(CMakePackage): version("main", branch="main") + version("1.5.1", sha256="c9e7f873fdcb579fca53196f3a1ad68149dc6e980e6533e1119687f5a7463cc1") version("1.4.0", sha256="2a415087eb26d291ff40da4430d668c702d22601ed52a72d001140d97372bc7d") version("1.3.0", sha256="a3882210b2620485471e3337d995edc1e653b49d9caaa902a43293826a61a635") version("1.2.0", sha256="912a4248bbf2e2e84cf3e36f2ae8483bee6b32d2eaa4406dd2100ad660c9bfc6") diff --git a/var/spack/repos/builtin/packages/yosys/package.py b/var/spack/repos/builtin/packages/yosys/package.py index 5e5c8618b9f16e..8fd88a0172f1a6 100644 --- a/var/spack/repos/builtin/packages/yosys/package.py +++ b/var/spack/repos/builtin/packages/yosys/package.py @@ -28,6 +28,8 @@ class Yosys(MakefilePackage): version("master", branch="master") + version("0.50", commit="b5170e1394f602c607e75bdbb1a2b637118f2086", submodules=True) + version("0.49", commit="427b5a251bfb511528a177bfa92567b4b3ada3dd", submodules=True) version("0.48", commit="aaa5347494801e9e3870b31387da59da24233f76", submodules=True) version("0.47", commit="647d61dd9212365a3cd44db219660b8f90b95cbd", submodules=True) version("0.46", commit="e97731b9dda91fa5fa53ed87df7c34163ba59a41", submodules=True) diff --git a/var/spack/repos/builtin/packages/yq/package.py b/var/spack/repos/builtin/packages/yq/package.py index 938c0e7f998397..af065fbd16142b 100644 --- a/var/spack/repos/builtin/packages/yq/package.py +++ b/var/spack/repos/builtin/packages/yq/package.py @@ -10,12 +10,15 @@ class Yq(GoPackage): This is different from the py-yq package that is a wrapper around jq.""" homepage = "https://mikefarah.gitbook.io/yq" - url = "https://github.com/mikefarah/yq/archive/refs/tags/v4.43.1.tar.gz" + url = "https://github.com/mikefarah/yq/archive/refs/tags/v4.45.1.tar.gz" maintainers("teaguesterling") license("MIT", checked_by="teaguesterling") + version("4.45.1", sha256="074a21a002c32a1db3850064ad1fc420083d037951c8102adecfea6c5fd96427") + version("4.44.6", sha256="c0acef928168e5fdb26cd7e8320eddde822f30cf1942817f3f6b854dd721653f") + version("4.44.5", sha256="1505367f4a6c0c4f3b91c6197ffed4112d29ef97c48d0b5e66530cfa851d3f0e") version("4.44.3", sha256="ea950f5622480fc0ff3708c52589426a737cd4ec887a52922a74efa1be8f2fbf") version("4.43.1", sha256="e5581d28bae2bcdf70501dfd251233c592eb3e39a210956ee74965b784435d63") version("4.41.1", sha256="25d61e72887f57510f88d1a30d515c7e2d79e7c6dce5c96aea7c069fcbc089e7") diff --git a/var/spack/repos/builtin/packages/zfp/package.py b/var/spack/repos/builtin/packages/zfp/package.py index 8cb7c06267fa56..8c13ad703df22b 100644 --- a/var/spack/repos/builtin/packages/zfp/package.py +++ b/var/spack/repos/builtin/packages/zfp/package.py @@ -162,3 +162,42 @@ def cmake_args(self): args.append("-DCMAKE_CUDA_FLAGS=-arch sm_{0}".format(cuda_arch[0])) return args + + def test_smoke_test(self, source_dir=None): + """Build and run ctests""" + if source_dir is None: + source_dir = self.test_suite.current_test_cache_dir + spec = self.spec + with working_dir(source_dir): + with open("CMakeLists.txt", "w") as f: + f.write( + """ + cmake_minimum_required(VERSION 3.12 FATAL_ERROR) + project(ZfpSmokeTest CXX) + include(CTest) + find_package(ZFP REQUIRED) + add_executable(smoke_test tests/testzfp.cpp) + target_link_libraries(smoke_test zfp::zfp) + add_test(NAME SmokeTest COMMAND ${CMAKE_BINARY_DIR}/smoke_test) + """ + ) + + cmake = Executable(spec["cmake"].prefix.bin.cmake) + ctest = Executable(spec["cmake"].prefix.bin.ctest) + + cmake(*([".", "-DZFP_ROOT=" + spec["zfp"].prefix])) + cmake(*(["--build", "."])) + ctest(*(["--verbose"])) + + @run_after("install") + def copy_test_files(self): + cache_extra_test_sources(self, "tests/testzfp.cpp") + + @run_after("install") + @on_package_attributes(run_tests=True) + def build_tests(self): + testdir = join_path(self.stage.path, "smoke_test_dir") + mkdirp(testdir) + with working_dir(testdir): + install_tree(join_path(self.stage.source_path, "tests"), "tests") + self.test_smoke_test(testdir) diff --git a/var/spack/repos/builtin/packages/ziatest/package.py b/var/spack/repos/builtin/packages/ziatest/package.py new file mode 100644 index 00000000000000..b9d0f120106fb7 --- /dev/null +++ b/var/spack/repos/builtin/packages/ziatest/package.py @@ -0,0 +1,31 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.package import * + + +class Ziatest(MakefilePackage): + """Realistic assessment of both launch and wireup requirements of MPI applications""" + + homepage = "https://gitlab.com/NERSC/N10-benchmarks/ziatest" + git = "https://gitlab.com/NERSC/N10-benchmarks/ziatest" + maintainers("giordano") + + license("custom") + + executables = ["^ziatest$", "^ziaprobe$"] + + version("main", branch="main") + + depends_on("c", type="build") + depends_on("mpi") + + @property + def build_targets(self): + spec = self.spec + return [f"MPICC={spec['mpi'].mpicc}"] + + def install(self, spec, prefix): + mkdir(prefix.bin) + install("ziatest", prefix.bin) + install("ziaprobe", prefix.bin) diff --git a/var/spack/repos/builtin/packages/zlib/package.py b/var/spack/repos/builtin/packages/zlib/package.py index d3b4ffcffdf4e1..33e6650ec0e5ae 100644 --- a/var/spack/repos/builtin/packages/zlib/package.py +++ b/var/spack/repos/builtin/packages/zlib/package.py @@ -84,7 +84,12 @@ def determine_version(cls, lib): @property def libs(self): shared = "+shared" in self.spec - return find_libraries(["libz"], root=self.prefix, recursive=True, shared=shared) + libnames = ["libz"] + if self.spec.satisfies("platform=windows"): + libnames.append("zdll" if shared else "zlib") + return find_libraries( + libnames, root=self.prefix, recursive=True, shared=shared, runtime=False + ) class SetupEnvironment: diff --git a/var/spack/repos/builtin/packages/zpp/package.py b/var/spack/repos/builtin/packages/zpp/package.py new file mode 100644 index 00000000000000..f829a87f576799 --- /dev/null +++ b/var/spack/repos/builtin/packages/zpp/package.py @@ -0,0 +1,38 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * +from spack.package import * + + +class Zpp(PythonPackage): + """ZPP, the Z Pre-Processor. ZPP transforms bash in a pre-processor for F90 + source files. It offers a set of functions specifically tailored to build + clean Fortran90 interfaces by generating code for all types, kinds, and + array ranks supported by a given compiler.""" + + homepage = "https://github.com/jbigot/zpp" + pypi = "zpp/zpp-1.0.16.tar.gz" + + license("BSD-3-Clause") + + maintainers("jbigot") + + version("1.1.0", sha256="4cd07ef18df5d44798e213aaaf17af78449739b01c0bf41e046c95b8a1aad6bd") + version("1.0.16", sha256="3238d27b4158edabb09ee6d82ba6331540950cb4dcdcf4978f19370b4e384241") + version("1.0.15", sha256="33d49280ca0d8e5221faa4c694949647146d15f16dacc09c36f20e7c34831135") + version("1.0.14", sha256="c52962a9d9c3aa28d513090ef327e05eccc7923473415d9dcbdacf22911d6c9f") + version("1.0.13", sha256="c76985c172491667677eba01072656eb04a59791d8b6a4e396721eddb570c548") + version("1.0.12", sha256="1fcc206096a144d24dd8cc7d2278d1eb4d0b4a5e2e3aa4936e7de30fe2d435ce") + version("1.0.11", sha256="e6a3e98b6be5ae7853fd0f66f58e9607cecaa66caefc57418d3163df695a2a90") + version("1.0.10", sha256="b0bb95303fe2f09918f1ce833027fda429746c3e51a859f7e051f9deb360c4d5") + version( + "1.0.9-fixed", sha256="6aa5f4a42b8ba7c000e7b186d5ef2be99fd0f8f47e1d360c42c1b371d0bacf23" + ) + version( + "1.0.8-fixed", sha256="dc5f423f019f1af92ff020372b458ab539890d2de2133bb9602cce419486faea" + ) + + depends_on("python@3:", type=("build", "run")) + depends_on("py-setuptools", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/zuo/package.py b/var/spack/repos/builtin/packages/zuo/package.py new file mode 100644 index 00000000000000..9092b4020c3428 --- /dev/null +++ b/var/spack/repos/builtin/packages/zuo/package.py @@ -0,0 +1,27 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Zuo(AutotoolsPackage): + """A tiny Racket for scripting.""" + + homepage = "https://github.com/racket/zuo" + url = "https://github.com/racket/zuo/archive/refs/tags/v1.11.tar.gz" + + license("Apache-2.0 AND MIT", checked_by="Buldram") + maintainers("Buldram") + + version("1.11", sha256="8404bea8ecae4576f44dece7efcab69d94c8a30ec10ea186f86823d37e74694b") + + variant("big", default=False, description="Enable hygienic macro support") + + depends_on("c", type="build") + + def setup_build_environment(self, env): + env.set("ZUO_JOBS", make_jobs) + + def configure_args(self): + return [*self.enable_or_disable("big")]