cargo: avoid need to use super().build_args with std_build_args (#49071)
* cargo: avoid need to use super().build_args with std_build_args * cargo: fix style * jujutsu: avoid need for super().build_args
This commit is contained in:
parent
75c3d0a053
commit
f9e4d3898a
@ -70,10 +70,16 @@ def build_directory(self):
|
|||||||
"""Return the directory containing the main Cargo.toml."""
|
"""Return the directory containing the main Cargo.toml."""
|
||||||
return self.pkg.stage.source_path
|
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
|
@property
|
||||||
def build_args(self):
|
def build_args(self):
|
||||||
"""Arguments for ``cargo build``."""
|
"""Arguments for ``cargo build``."""
|
||||||
return ["-j", str(self.pkg.module.make_jobs)]
|
return []
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def check_args(self):
|
def check_args(self):
|
||||||
@ -88,7 +94,9 @@ def build(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""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):
|
||||||
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(
|
def install(
|
||||||
self, pkg: CargoPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix
|
self, pkg: CargoPackage, spec: spack.spec.Spec, prefix: spack.util.prefix.Prefix
|
||||||
|
@ -32,4 +32,4 @@ def build_directory(self):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def build_args(self):
|
def build_args(self):
|
||||||
return super().build_args + ["--bin", "jj", "jj-cli"]
|
return ["--bin", "jj", "jj-cli"]
|
||||||
|
Loading…
Reference in New Issue
Block a user