py-py-spy: add 0.4.0, and make rust & CargoPackage
respect -j
(#47883)
* py-py-spy: add 0.4.0 * py-py-spy: port from Package to CargoPackage * CargoPackage: respect make_jobs * rust: respect make_jobs during build and install * spack style * CargoBuilder: fix make_jobs syntax * CargoBuilder: don't write to $HOME, use stage dir
This commit is contained in:
parent
85c125a0f5
commit
aa0ab3b38b
@ -71,13 +71,16 @@ def build_directory(self):
|
|||||||
@property
|
@property
|
||||||
def build_args(self):
|
def build_args(self):
|
||||||
"""Arguments for ``cargo build``."""
|
"""Arguments for ``cargo build``."""
|
||||||
return []
|
return ["-j", str(self.pkg.module.make_jobs)]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def check_args(self):
|
def check_args(self):
|
||||||
"""Argument for ``cargo test`` during check phase"""
|
"""Argument for ``cargo test`` during check phase"""
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
def setup_build_environment(self, env):
|
||||||
|
env.set("CARGO_HOME", self.stage.path)
|
||||||
|
|
||||||
def build(self, pkg, spec, prefix):
|
def build(self, pkg, spec, prefix):
|
||||||
"""Runs ``cargo install`` in the source directory"""
|
"""Runs ``cargo install`` in the source directory"""
|
||||||
with fs.working_dir(self.build_directory):
|
with fs.working_dir(self.build_directory):
|
||||||
|
@ -5,26 +5,20 @@
|
|||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
class PyPySpy(Package):
|
class PyPySpy(CargoPackage):
|
||||||
"""A Sampling Profiler for Python."""
|
"""A Sampling Profiler for Python."""
|
||||||
|
|
||||||
homepage = "https://github.com/benfred/py-spy"
|
homepage = "https://github.com/benfred/py-spy"
|
||||||
url = "https://github.com/benfred/py-spy/archive/v0.3.8.tar.gz"
|
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.8", sha256="9dbfd0ea79ef31a2966891e86cf6238ed3831938cf562e71848e07b7009cf57d")
|
||||||
version("0.3.3", sha256="41454d3d9132da45c72f7574faaff65f40c757720293a277ffa5ec5a4b44f902")
|
version("0.3.3", sha256="41454d3d9132da45c72f7574faaff65f40c757720293a277ffa5ec5a4b44f902")
|
||||||
|
|
||||||
depends_on("c", type="build") # generated
|
|
||||||
|
|
||||||
# TODO: uses cargo to download and build dozens of dependencies.
|
# TODO: uses cargo to download and build dozens of dependencies.
|
||||||
# Need to figure out how to manage these with Spack once we have a
|
# Need to figure out how to manage these with Spack once we have a
|
||||||
# CargoPackage base class.
|
# CargoPackage base class.
|
||||||
depends_on("rust", type="build")
|
|
||||||
depends_on("unwind")
|
depends_on("unwind")
|
||||||
depends_on("libunwind components=ptrace", when="^[virtuals=unwind] libunwind")
|
depends_on("libunwind components=ptrace", when="^[virtuals=unwind] libunwind")
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
|
||||||
cargo = which("cargo")
|
|
||||||
cargo("install", "--root", prefix, "--path", ".")
|
|
||||||
|
@ -206,10 +206,10 @@ def configure(self, spec, prefix):
|
|||||||
configure(*flags)
|
configure(*flags)
|
||||||
|
|
||||||
def build(self, spec, prefix):
|
def build(self, spec, prefix):
|
||||||
python("./x.py", "build")
|
python("./x.py", "build", "-j", str(make_jobs))
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
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
|
# known issue: https://github.com/rust-lang/rust/issues/132604
|
||||||
unresolved_libraries = ["libz.so.*"]
|
unresolved_libraries = ["libz.so.*"]
|
||||||
|
Loading…
Reference in New Issue
Block a user