diff --git a/lib/spack/spack/build_systems/cargo.py b/lib/spack/spack/build_systems/cargo.py index 7a549bd56a0..2e5c6e4ffc0 100644 --- a/lib/spack/spack/build_systems/cargo.py +++ b/lib/spack/spack/build_systems/cargo.py @@ -71,13 +71,16 @@ def build_directory(self): @property def build_args(self): """Arguments for ``cargo build``.""" - return [] + return ["-j", str(self.pkg.module.make_jobs)] @property def check_args(self): """Argument for ``cargo test`` during check phase""" return [] + def setup_build_environment(self, env): + env.set("CARGO_HOME", self.stage.path) + def build(self, pkg, spec, prefix): """Runs ``cargo install`` in the source directory""" with fs.working_dir(self.build_directory): diff --git a/var/spack/repos/builtin/packages/py-py-spy/package.py b/var/spack/repos/builtin/packages/py-py-spy/package.py index 438c8d44e68..aa194efa37b 100644 --- a/var/spack/repos/builtin/packages/py-py-spy/package.py +++ b/var/spack/repos/builtin/packages/py-py-spy/package.py @@ -5,26 +5,20 @@ from spack.package import * -class PyPySpy(Package): +class PyPySpy(CargoPackage): """A Sampling Profiler for Python.""" homepage = "https://github.com/benfred/py-spy" url = "https://github.com/benfred/py-spy/archive/v0.3.8.tar.gz" - license("MIT") + license("MIT", checked_by="lgarrison") + version("0.4.0", sha256="13a5c4b949947425670eedac05b6dd27edbc736b75f1587899efca1a7ef79ac3") version("0.3.8", sha256="9dbfd0ea79ef31a2966891e86cf6238ed3831938cf562e71848e07b7009cf57d") version("0.3.3", sha256="41454d3d9132da45c72f7574faaff65f40c757720293a277ffa5ec5a4b44f902") - depends_on("c", type="build") # generated - # TODO: uses cargo to download and build dozens of dependencies. # Need to figure out how to manage these with Spack once we have a # CargoPackage base class. - depends_on("rust", type="build") depends_on("unwind") depends_on("libunwind components=ptrace", when="^[virtuals=unwind] libunwind") - - def install(self, spec, prefix): - cargo = which("cargo") - cargo("install", "--root", prefix, "--path", ".") diff --git a/var/spack/repos/builtin/packages/rust/package.py b/var/spack/repos/builtin/packages/rust/package.py index 8f2246550a5..75458e71ad2 100644 --- a/var/spack/repos/builtin/packages/rust/package.py +++ b/var/spack/repos/builtin/packages/rust/package.py @@ -206,10 +206,10 @@ def configure(self, spec, prefix): configure(*flags) def build(self, spec, prefix): - python("./x.py", "build") + python("./x.py", "build", "-j", str(make_jobs)) def install(self, spec, prefix): - python("./x.py", "install") + python("./x.py", "install", "-j", str(make_jobs)) # known issue: https://github.com/rust-lang/rust/issues/132604 unresolved_libraries = ["libz.so.*"]