diff --git a/outputs/package-py-files/1.package.py b/outputs/package-py-files/1.package.py deleted file mode 100644 index 331772fd26..0000000000 --- a/outputs/package-py-files/1.package.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack_repo.builtin.build_systems.autotools import AutotoolsPackage -from spack.package import * - - -class TutorialMpileaks(AutotoolsPackage): - """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" - - maintainers("adamjstewart") - - license("BSD", checked_by="adamjstewart") - - version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") - - depends_on("c", type="build") - depends_on("cxx", type="build") - depends_on("fortran", type="build") - - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - - # FIXME: Add additional dependencies if required. - # depends_on("foo") - - def autoreconf(self, spec, prefix): - # FIXME: Modify the autoreconf method as necessary - autoreconf("--install", "--verbose", "--force") - - def configure_args(self): - # FIXME: Add arguments other than --prefix - # FIXME: If not needed delete this function - args = [] - return args diff --git a/outputs/package-py-files/3.package.py b/outputs/package-py-files/3.package.py deleted file mode 100644 index 42ae505a6b..0000000000 --- a/outputs/package-py-files/3.package.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack_repo.builtin.build_systems.autotools import AutotoolsPackage -from spack.package import * - - -class TutorialMpileaks(AutotoolsPackage): - """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" - - maintainers("adamjstewart") - - license("BSD", checked_by="adamjstewart") - - version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") - - depends_on("c", type="build") - depends_on("cxx", type="build") - depends_on("fortran", type="build") - - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - - depends_on("mpi") - depends_on("adept-utils") - depends_on("callpath") - - def autoreconf(self, spec, prefix): - autoreconf("--install", "--verbose", "--force") - - def configure_args(self): - args = [ - f"--with-adept-utils={self.spec['adept-utils'].prefix}", - f"--with-callpath={self.spec['callpath'].prefix}", - ] - - return args diff --git a/outputs/package-py-files/4.package.py b/outputs/package-py-files/4.package.py deleted file mode 100644 index d61abe0cd3..0000000000 --- a/outputs/package-py-files/4.package.py +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack_repo.builtin.build_systems.autotools import AutotoolsPackage -from spack.package import * - - -class TutorialMpileaks(AutotoolsPackage): - """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" - - maintainers("adamjstewart") - - license("BSD", checked_by="adamjstewart") - - version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") - - variant( - "stackstart", - values=int, - default="0", - description="Specify the number of stack frames to truncate", - ) - - depends_on("c", type="build") - depends_on("cxx", type="build") - depends_on("fortran", type="build") - - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - - depends_on("mpi") - depends_on("adept-utils") - depends_on("callpath") - - def autoreconf(self, spec, prefix): - autoreconf("--install", "--verbose", "--force") - - def configure_args(self): - args = [ - f"--with-adept-utils={self.spec['adept-utils'].prefix}", - f"--with-callpath={self.spec['callpath'].prefix}", - ] - - stackstart = int(self.spec.variants["stackstart"].value) - if stackstart: - args.extend( - [f"--with-stack-start-c={stackstart}", f"--with-stack-start-fortran={stackstart}"] - ) - - return args diff --git a/outputs/package-py-files/5.package.py b/outputs/package-py-files/5.package.py deleted file mode 100644 index 50df94c6fc..0000000000 --- a/outputs/package-py-files/5.package.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack_repo.builtin.build_systems.autotools import AutotoolsPackage -from spack.package import * - - -class TutorialMpileaks(AutotoolsPackage): - """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" - - maintainers("adamjstewart") - - sanity_check_is_dir = ["bin", "lib", "shar"] - - license("BSD", checked_by="adamjstewart") - - version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") - - variant( - "stackstart", - values=int, - default="0", - description="Specify the number of stack frames to truncate", - ) - - depends_on("c", type="build") - depends_on("cxx", type="build") - depends_on("fortran", type="build") - - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - - depends_on("mpi") - depends_on("adept-utils") - depends_on("callpath") - - def autoreconf(self, spec, prefix): - autoreconf("--install", "--verbose", "--force") - - def configure_args(self): - args = [ - f"--with-adept-utils={self.spec['adept-utils'].prefix}", - f"--with-callpath={self.spec['callpath'].prefix}", - ] - - stackstart = int(self.spec.variants["stackstart"].value) - if stackstart: - args.extend( - [f"--with-stack-start-c={stackstart}", f"--with-stack-start-fortran={stackstart}"] - ) - - return args diff --git a/outputs/package-py-files/6.package.py b/outputs/package-py-files/6.package.py deleted file mode 100644 index c4c9cfbdc6..0000000000 --- a/outputs/package-py-files/6.package.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -from spack_repo.builtin.build_systems.autotools import AutotoolsPackage -from spack.package import * - - -class TutorialMpileaks(AutotoolsPackage): - """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" - - maintainers("adamjstewart") - - sanity_check_is_dir = ["bin", "lib", "share"] - - license("BSD", checked_by="adamjstewart") - - version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") - - variant( - "stackstart", - values=int, - default="0", - description="Specify the number of stack frames to truncate", - ) - - depends_on("c", type="build") - depends_on("cxx", type="build") - depends_on("fortran", type="build") - - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - - depends_on("mpi") - depends_on("adept-utils") - depends_on("callpath") - - def autoreconf(self, spec, prefix): - autoreconf("--install", "--verbose", "--force") - - def configure_args(self): - args = [ - f"--with-adept-utils={self.spec['adept-utils'].prefix}", - f"--with-callpath={self.spec['callpath'].prefix}", - ] - - stackstart = int(self.spec.variants["stackstart"].value) - if stackstart: - args.extend( - [f"--with-stack-start-c={stackstart}", f"--with-stack-start-fortran={stackstart}"] - ) - - return args diff --git a/outputs/packaging.sh b/outputs/packaging.sh index c2941bad30..461b3d7e77 100755 --- a/outputs/packaging.sh +++ b/outputs/packaging.sh @@ -36,11 +36,11 @@ example packaging/checksum-mpileaks-1 "spack checksum tutorial-mpileaks 1.0" example --tee --expect-error packaging/install-mpileaks-1 "spack install tutorial-mpileaks" # add documentation -cp "$PROJECT/package-py-files/1.package.py" "$mpileaks_package_py" +cp "$PROJECT/packaging/examples/1.package.py" "$mpileaks_package_py" example packaging/info-mpileaks "spack info --phases tutorial-mpileaks" # add dependencies -cp "$PROJECT/package-py-files/2.package.py" "$mpileaks_package_py" +cp "$PROJECT/packaging/examples/2.package.py" "$mpileaks_package_py" example --tee --expect-error packaging/install-mpileaks-2 "spack install tutorial-mpileaks" stage_dir="$(spack location -s tutorial-mpileaks)" @@ -67,20 +67,20 @@ example packaging/build-output "cat $stage_dir/spack-build-out.txt" #run_configure # configure arguments -cp "$PROJECT/package-py-files/3.package.py" "$mpileaks_package_py" +cp "$PROJECT/packaging/examples/3.package.py" "$mpileaks_package_py" example --tee packaging/install-mpileaks-3 "spack install tutorial-mpileaks" # variants -cp "$PROJECT/package-py-files/4.package.py" "$mpileaks_package_py" +cp "$PROJECT/packaging/examples/4.package.py" "$mpileaks_package_py" example --tee packaging/install-mpileaks-4 "spack install --verbose tutorial-mpileaks stackstart=4" # TODO: Re-enable once https://github.com/spack/spack/issues/52573 is resolved. # tests #example --tee packaging/install-mpileaks-5 "spack uninstall -ay tutorial-mpileaks" -#cp "$PROJECT/package-py-files/5.package.py" "$mpileaks_package_py" +#cp "$PROJECT/packaging/examples/5.package.py" "$mpileaks_package_py" #example --tee --expect-error packaging/install-mpileaks-5 "spack install --test=root tutorial-mpileaks" # -#cp "$PROJECT/package-py-files/6.package.py" "$mpileaks_package_py" +#cp "$PROJECT/packaging/examples/6.package.py" "$mpileaks_package_py" #example --tee packaging/install-mpileaks-6 "spack install --test=root tutorial-mpileaks" # cleanup diff --git a/outputs/package-py-files/0.package.py b/outputs/packaging/examples/0.package.py similarity index 84% rename from outputs/package-py-files/0.package.py rename to outputs/packaging/examples/0.package.py index 0dfd438f32..15b9f85e58 100644 --- a/outputs/package-py-files/0.package.py +++ b/outputs/packaging/examples/0.package.py @@ -20,6 +20,7 @@ # ---------------------------------------------------------------------------- from spack_repo.builtin.build_systems.autotools import AutotoolsPackage + from spack.package import * @@ -28,7 +29,11 @@ class TutorialMpileaks(AutotoolsPackage): # FIXME: Add a proper url for your package's homepage here. homepage = "https://www.example.com" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" + url = "https://github.com/llnl/mpileaks/archive/refs/tags/v1.0.tar.gz" + + # FIXME: Uncomment and add the upstream supplier (organization or author). + # If unknown or inapplicable, remove this entire block. + # supplier = organization_or_author # FIXME: Add a list of GitHub accounts to # notify when the package is updated. @@ -45,10 +50,11 @@ class TutorialMpileaks(AutotoolsPackage): depends_on("cxx", type="build") depends_on("fortran", type="build") - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") + with default_args(type="build"): + depends_on("autoconf") + depends_on("automake") + depends_on("libtool") + depends_on("m4") # FIXME: Add additional dependencies if required. # depends_on("foo") diff --git a/tutorial/examples/packaging/1.package.py b/outputs/packaging/examples/1.package.py similarity index 72% rename from tutorial/examples/packaging/1.package.py rename to outputs/packaging/examples/1.package.py index 331772fd26..02eb03da99 100644 --- a/tutorial/examples/packaging/1.package.py +++ b/outputs/packaging/examples/1.package.py @@ -3,18 +3,21 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.autotools import AutotoolsPackage + from spack.package import * class TutorialMpileaks(AutotoolsPackage): """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" + homepage = "https://github.com/llnl/mpileaks" + url = "https://github.com/llnl/mpileaks/archive/refs/tags/v1.0.tar.gz" + + supplier = "Organization: LLNL" - maintainers("adamjstewart") + maintainers("cmelone") - license("BSD", checked_by="adamjstewart") + license("BSD", checked_by="cmelone") version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") @@ -22,10 +25,11 @@ class TutorialMpileaks(AutotoolsPackage): depends_on("cxx", type="build") depends_on("fortran", type="build") - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") + with default_args(type="build"): + depends_on("autoconf") + depends_on("automake") + depends_on("libtool") + depends_on("m4") # FIXME: Add additional dependencies if required. # depends_on("foo") diff --git a/outputs/package-py-files/2.package.py b/outputs/packaging/examples/2.package.py similarity index 72% rename from outputs/package-py-files/2.package.py rename to outputs/packaging/examples/2.package.py index 77ff263c57..4570028e60 100644 --- a/outputs/package-py-files/2.package.py +++ b/outputs/packaging/examples/2.package.py @@ -3,18 +3,21 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.autotools import AutotoolsPackage + from spack.package import * class TutorialMpileaks(AutotoolsPackage): """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" + homepage = "https://github.com/llnl/mpileaks" + url = "https://github.com/llnl/mpileaks/archive/refs/tags/v1.0.tar.gz" + + supplier = "Organization: LLNL" - maintainers("adamjstewart") + maintainers("cmelone") - license("BSD", checked_by="adamjstewart") + license("BSD", checked_by="cmelone") version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") @@ -22,10 +25,11 @@ class TutorialMpileaks(AutotoolsPackage): depends_on("cxx", type="build") depends_on("fortran", type="build") - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") + with default_args(type="build"): + depends_on("autoconf") + depends_on("automake") + depends_on("libtool") + depends_on("m4") depends_on("mpi") depends_on("adept-utils") diff --git a/tutorial/examples/packaging/3.package.py b/outputs/packaging/examples/3.package.py similarity index 72% rename from tutorial/examples/packaging/3.package.py rename to outputs/packaging/examples/3.package.py index 42ae505a6b..6c2be17628 100644 --- a/tutorial/examples/packaging/3.package.py +++ b/outputs/packaging/examples/3.package.py @@ -3,18 +3,21 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.autotools import AutotoolsPackage + from spack.package import * class TutorialMpileaks(AutotoolsPackage): """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" + homepage = "https://github.com/llnl/mpileaks" + url = "https://github.com/llnl/mpileaks/archive/refs/tags/v1.0.tar.gz" + + supplier = "Organization: LLNL" - maintainers("adamjstewart") + maintainers("cmelone") - license("BSD", checked_by="adamjstewart") + license("BSD", checked_by="cmelone") version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") @@ -22,10 +25,11 @@ class TutorialMpileaks(AutotoolsPackage): depends_on("cxx", type="build") depends_on("fortran", type="build") - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") + with default_args(type="build"): + depends_on("autoconf") + depends_on("automake") + depends_on("libtool") + depends_on("m4") depends_on("mpi") depends_on("adept-utils") diff --git a/tutorial/examples/packaging/4.package.py b/outputs/packaging/examples/4.package.py similarity index 78% rename from tutorial/examples/packaging/4.package.py rename to outputs/packaging/examples/4.package.py index 23bcd8e6d8..01035bf6d1 100644 --- a/tutorial/examples/packaging/4.package.py +++ b/outputs/packaging/examples/4.package.py @@ -3,18 +3,21 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.autotools import AutotoolsPackage + from spack.package import * class TutorialMpileaks(AutotoolsPackage): """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" + homepage = "https://github.com/llnl/mpileaks" + url = "https://github.com/llnl/mpileaks/archive/refs/tags/v1.0.tar.gz" + + supplier = "Organization: LLNL" - maintainers("adamjstewart") + maintainers("cmelone") - license("BSD", checked_by="adamjstewart") + license("BSD", checked_by="cmelone") version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") @@ -29,10 +32,11 @@ class TutorialMpileaks(AutotoolsPackage): depends_on("cxx", type="build") depends_on("fortran", type="build") - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") + with default_args(type="build"): + depends_on("autoconf") + depends_on("automake") + depends_on("libtool") + depends_on("m4") depends_on("mpi") depends_on("adept-utils") diff --git a/tutorial/examples/packaging/5.package.py b/outputs/packaging/examples/5.package.py similarity index 79% rename from tutorial/examples/packaging/5.package.py rename to outputs/packaging/examples/5.package.py index 427862d2e0..f9f37fa6a0 100644 --- a/tutorial/examples/packaging/5.package.py +++ b/outputs/packaging/examples/5.package.py @@ -3,18 +3,21 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.autotools import AutotoolsPackage + from spack.package import * class TutorialMpileaks(AutotoolsPackage): """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" + homepage = "https://github.com/llnl/mpileaks" + url = "https://github.com/llnl/mpileaks/archive/refs/tags/v1.0.tar.gz" + + supplier = "Organization: LLNL" - maintainers("adamjstewart") + maintainers("cmelone") - license("BSD", checked_by="adamjstewart") + license("BSD", checked_by="cmelone") sanity_check_is_dir = ["bin", "lib", "shar"] @@ -31,10 +34,11 @@ class TutorialMpileaks(AutotoolsPackage): depends_on("cxx", type="build") depends_on("fortran", type="build") - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") + with default_args(type="build"): + depends_on("autoconf") + depends_on("automake") + depends_on("libtool") + depends_on("m4") depends_on("mpi") depends_on("adept-utils") diff --git a/tutorial/examples/packaging/6.package.py b/outputs/packaging/examples/6.package.py similarity index 79% rename from tutorial/examples/packaging/6.package.py rename to outputs/packaging/examples/6.package.py index 9c51a30353..378d15ab53 100644 --- a/tutorial/examples/packaging/6.package.py +++ b/outputs/packaging/examples/6.package.py @@ -3,18 +3,21 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack_repo.builtin.build_systems.autotools import AutotoolsPackage + from spack.package import * class TutorialMpileaks(AutotoolsPackage): """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" + homepage = "https://github.com/llnl/mpileaks" + url = "https://github.com/llnl/mpileaks/archive/refs/tags/v1.0.tar.gz" + + supplier = "Organization: LLNL" - maintainers("adamjstewart") + maintainers("cmelone") - license("BSD", checked_by="adamjstewart") + license("BSD", checked_by="cmelone") sanity_check_is_dir = ["bin", "lib", "share"] @@ -31,10 +34,11 @@ class TutorialMpileaks(AutotoolsPackage): depends_on("cxx", type="build") depends_on("fortran", type="build") - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") + with default_args(type="build"): + depends_on("autoconf") + depends_on("automake") + depends_on("libtool") + depends_on("m4") depends_on("mpi") depends_on("adept-utils") diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000000..71de868235 --- /dev/null +++ b/ruff.toml @@ -0,0 +1 @@ +line-length = 100 diff --git a/tutorial/examples/packaging/0.package.py b/tutorial/examples/packaging/0.package.py deleted file mode 100644 index 0dfd438f32..0000000000 --- a/tutorial/examples/packaging/0.package.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install tutorial-mpileaks -# -# You can edit this file again by typing: -# -# spack edit tutorial-mpileaks -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -from spack_repo.builtin.build_systems.autotools import AutotoolsPackage -from spack.package import * - - -class TutorialMpileaks(AutotoolsPackage): - """FIXME: Put a proper description of your package here.""" - - # FIXME: Add a proper url for your package's homepage here. - homepage = "https://www.example.com" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" - - # FIXME: Add a list of GitHub accounts to - # notify when the package is updated. - # maintainers("github_user1", "github_user2") - - # FIXME: Add the SPDX identifier of the project's license below. - # See https://spdx.org/licenses/ for a list. Upon manually verifying - # the license, set checked_by to your Github username. - license("UNKNOWN", checked_by="github_user1") - - version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") - - depends_on("c", type="build") - depends_on("cxx", type="build") - depends_on("fortran", type="build") - - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - - # FIXME: Add additional dependencies if required. - # depends_on("foo") - - def autoreconf(self, spec, prefix): - # FIXME: Modify the autoreconf method as necessary - autoreconf("--install", "--verbose", "--force") - - def configure_args(self): - # FIXME: Add arguments other than --prefix - # FIXME: If not needed delete this function - args = [] - return args diff --git a/tutorial/examples/packaging/2.package.py b/tutorial/examples/packaging/2.package.py deleted file mode 100644 index 77ff263c57..0000000000 --- a/tutorial/examples/packaging/2.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_repo.builtin.build_systems.autotools import AutotoolsPackage -from spack.package import * - - -class TutorialMpileaks(AutotoolsPackage): - """Tool to detect and report leaked MPI objects like MPI_Requests and MPI_Datatypes.""" - - homepage = "https://github.com/LLNL/mpileaks" - url = "https://github.com/LLNL/mpileaks/archive/refs/tags/v1.0.tar.gz" - - maintainers("adamjstewart") - - license("BSD", checked_by="adamjstewart") - - version("1.0", sha256="24c706591bdcd84541e19389a9314813ce848035ee877e213d528b184f4b43f9") - - depends_on("c", type="build") - depends_on("cxx", type="build") - depends_on("fortran", type="build") - - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - - depends_on("mpi") - depends_on("adept-utils") - depends_on("callpath") - - def autoreconf(self, spec, prefix): - # FIXME: Modify the autoreconf method as necessary - autoreconf("--install", "--verbose", "--force") - - def configure_args(self): - # FIXME: Add arguments other than --prefix - # FIXME: If not needed delete this function - args = [] - return args diff --git a/tutorial_packaging.rst b/tutorial_packaging.rst index eb72e72b36..a9c51712a6 100644 --- a/tutorial_packaging.rst +++ b/tutorial_packaging.rst @@ -12,7 +12,7 @@ Package Creation Tutorial This tutorial walks you through the steps for creating and debugging a simple Spack package. We will develop and debug a package using an iterative approach to gain more experience with additional Spack commands. -For consistency, we will create a package for ``mpileaks`` (https://github.com/LLNL/mpileaks), an MPI debugging tool. +For consistency, we will create a package for ``mpileaks`` (https://github.com/llnl/mpileaks), an MPI debugging tool. ------------------------ What is a Spack Package? @@ -80,7 +80,7 @@ Spack's *create* command builds a new package from a template by taking the loca * create a package skeleton; and * open the file in your `editor of choice `_. -The ``mpileaks`` source code is available in a tarball in the software's repository (https://github.com/LLNL/mpileaks). +The ``mpileaks`` source code is available in a tarball in the software's repository (https://github.com/llnl/mpileaks). Spack will look at the contents of the tarball and generate a package when we run ``spack create`` with the URL: .. literalinclude:: outputs/packaging/create.out @@ -99,6 +99,7 @@ As we can see from the skeleton contents, the Spack template: * imports and inherits from the inferred `build system package `_; * provides a docstring template; * provides an example homepage URL; +* provides a placeholder for the upstream ``supplier``; * shows how to specify a list of package `maintainers `_; * provides a template for the `license `_; * specifies the `version directive `_ with the `checksum `_; @@ -107,6 +108,13 @@ As we can see from the skeleton contents, the Spack template: * provides a preliminary implementation of the `autoreconf `_ method; and * provides a skeleton `configure_args `_ method. +.. note:: + + The ``supplier`` field identifies the organization, project, or individual responsible for distributing the software, rather than the Spack package maintainer. + Spack uses this metadata in the `Software Bill of Materials (SBOM) `_ generated for each installation. + For ``mpileaks``, we use ``supplier = "Organization: LLNL"``. + If the supplier is unknown or inapplicable, remove the field and its placeholder comments. + .. note:: The `maintainers directive `_ holds a comma-separated list of GitHub user names for those accounts willing to be notified when a change is made to the package. @@ -115,16 +123,16 @@ As we can see from the skeleton contents, the Spack template: The areas we need to modify are highlighted in the figure below. -.. literalinclude:: tutorial/examples/packaging/0.package.py - :caption: tutorial-mpileaks/package.py (from tutorial/examples/packaging/0.package.py) +.. literalinclude:: outputs/packaging/examples/0.package.py + :caption: tutorial-mpileaks/package.py (from outputs/packaging/examples/0.package.py) :language: python - :emphasize-lines: 5-20,27,29-30,33-35,37-40,53-54,57,61-64 + :emphasize-lines: 5-20,28,30-31,34-36,38-40,42-45,59-60,63,67-70 .. tip:: We generally recommend you use the project-prepared archive url, when available, instead of the ``GitHub``-generated ``Source code (tar.gz)`` since those tend to be less volatile in the face of ``GitHub`` shasum algorithm changes. - In this case, that would mean copying the url labeled ``mpileaks-1.0.tar.gz`` under the ``v1.0`` release assets, or simply ``https://github.com/LLNL/mpileaks/releases/download/v1.0/mpileaks-1.0.tar.gz``. + In this case, that would mean copying the url labeled ``mpileaks-1.0.tar.gz`` under the ``v1.0`` release assets, or simply ``https://github.com/llnl/mpileaks/releases/download/v1.0/mpileaks-1.0.tar.gz``. The ``sha256`` is different since the file has build customizations. A key difference is the presence of ``autogen.sh``, which is a convenience script Autotools projects can create to customize their reconfiguration process. If you choose to use that URL, you should replace the more general call to ``autoreconf()`` with an invocation of the ``autogen.sh`` script. @@ -169,12 +177,13 @@ Let's make the following changes: * remove the boilerplate comments between and including the dashed lines at the top; * replace the first ``FIXME`` comment with a description of ``mpileaks`` in the docstring; * replace the ``homepage`` property with the correct link; +* uncomment the ``supplier`` field and set it to ``"Organization: LLNL"``; * uncomment the ``maintainers`` directive and replace the placeholder with your GitHub user name; and * replace the ``license`` of the project with the correct name and the placeholder with your GitHub user name. .. tip:: - It helps to have the `mpileaks `_ repository up in your browser since you can copy-and-paste some of the values from it. + It helps to have the `mpileaks `_ repository up in your browser since you can copy-and-paste some of the values from it. .. note:: @@ -184,11 +193,11 @@ Now make the changes and additions to your ``package.py`` file. The resulting package should contain the following information, omitting the copyright and license: -.. literalinclude:: tutorial/examples/packaging/1.package.py - :caption: tutorial-mpileaks/package.py (from tutorial/examples/packaging/1.package.py) +.. literalinclude:: outputs/packaging/examples/1.package.py + :caption: tutorial-mpileaks/package.py (from outputs/packaging/examples/1.package.py) :lines: 5- :language: python - :emphasize-lines: 6,8,11,13 + :emphasize-lines: 7,9,12,14,16 At this point we've only updated key documentation within the package. It won't help us build the software; however, the information is now available for review. @@ -230,7 +239,7 @@ Now we're ready to start filling in the build recipe. Adding Dependencies ------------------- -First we'll add the dependencies determined by reviewing documentation in the software's repository (https://github.com/LLNL/mpileaks). +First we'll add the dependencies determined by reviewing documentation in the software's repository (https://github.com/llnl/mpileaks). We can see from the ``README`` file's instructions, ``mpileaks`` software relies on three third-party libraries: * ``mpi``, @@ -249,11 +258,11 @@ Bring ``tutorial-mpileaks``' ``package.py`` file back up with the ``spack edit`` and add the dependencies by specifying them using the ``depends_on`` directive as shown below: -.. literalinclude:: tutorial/examples/packaging/2.package.py - :caption: tutorial-mpileaks/package.py (from tutorial/examples/packaging/2.package.py) +.. literalinclude:: outputs/packaging/examples/2.package.py + :caption: tutorial-mpileaks/package.py (from outputs/packaging/examples/2.package.py) :lines: 5- :language: python - :emphasize-lines: 26-28 + :emphasize-lines: 30-32 Adding dependencies tells Spack that it must ensure those packages are installed *before* it can build our package. @@ -399,11 +408,11 @@ Bring ``tutorial-mpileaks``' ``package.py`` file back up with the ``spack edit`` and add the ``--with-adept-utils`` and ``--with-callpath`` arguments in the ``configure_args`` method as follows: -.. literalinclude:: tutorial/examples/packaging/3.package.py - :caption: tutorial-mpileaks/package.py (from tutorial/examples/packaging/3.package.py) +.. literalinclude:: outputs/packaging/examples/3.package.py + :caption: tutorial-mpileaks/package.py (from outputs/packaging/examples/3.package.py) :lines: 5- :language: python - :emphasize-lines: 34-37 + :emphasize-lines: 38-41 Since this is an ``AutotoolsPackage``, the arguments returned from the method will automatically get passed to ``configure`` during the build. @@ -432,7 +441,7 @@ Two stand out for tutorial purposes because they both take integers, as opposed :language: console :emphasize-lines: 18-23 -According to the software's documentation (https://github.com/LLNL/mpileaks), the integer values for the ``--with-stack-start-*`` options represent the numbers of calls to shave off of the top of the stack traces for each language, effectively reducing the noise of internal mpileaks library function calls in generated traces. +According to the software's documentation (https://github.com/llnl/mpileaks), the integer values for the ``--with-stack-start-*`` options represent the numbers of calls to shave off of the top of the stack traces for each language, effectively reducing the noise of internal mpileaks library function calls in generated traces. For simplicity, we'll use one variant to supply the value for both arguments. @@ -453,11 +462,11 @@ Bring ``tutorial-mpileaks``' ``package.py`` file back up with the ``spack edit`` and add the ``variant`` directive and associated arguments as follows: -.. literalinclude:: tutorial/examples/packaging/4.package.py - :caption: tutorial-mpileaks/package.py (from tutorial/examples/packaging/4.package.py) +.. literalinclude:: outputs/packaging/examples/4.package.py + :caption: tutorial-mpileaks/package.py (from outputs/packaging/examples/4.package.py) :lines: 5- :language: python - :emphasize-lines: 17-22,46-53 + :emphasize-lines: 20-25,50-57 Notice that the ``variant`` directive is translated into a ``variants`` dictionary in ``self.spec``. Also note that the value provided by the user is accessed by the entry's ``value`` property.