Skip to content

Commit 8438361

Browse files
committed
cli: Update default build policy from outdated to cascade
This should result in more reliable builds by default.
1 parent a7f4416 commit 8438361

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

cli/cloe_launch/exec.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,19 @@ def activate(
502502
print(f"source {self.runtime_dir / 'activate_all.sh'}")
503503
print(f"source {self.runtime_dir / 'prompt.sh'}")
504504

505-
def prepare(self, build_policy: str = "outdated") -> None:
505+
def _set_build_policy(self, build_policy: Optional[List[str]]):
506+
if build_policy is None:
507+
build_policy = ["outdated", "cascade"]
508+
for policy in build_policy:
509+
if policy == "":
510+
self.conan_args.append("--build")
511+
else:
512+
self.conan_args.append(f"--build={policy}")
513+
514+
def prepare(self, build_policy: Optional[List[str]] = None) -> None:
506515
"""Prepare (by downloading or building) dependencies for the profile."""
507516
self.capture_output = False
508-
if build_policy == "":
509-
self.conan_args.append("--build")
510-
else:
511-
self.conan_args.append(f"--build={build_policy}")
517+
self._set_build_policy(build_policy)
512518
self._prepare_runtime_env(use_cache=False)
513519

514520
def deploy(
@@ -517,14 +523,11 @@ def deploy(
517523
wrapper: Optional[Path] = None,
518524
wrapper_target: Optional[Path] = None,
519525
patch_rpath: bool = True,
520-
build_policy: str = "outdated",
526+
build_policy: Optional[List[str]] = None,
521527
) -> None:
522528
"""Deploy dependencies for the profile."""
523529
self.capture_output = False
524-
if build_policy == "":
525-
self.conan_args.append("--build")
526-
else:
527-
self.conan_args.append(f"--build={build_policy}")
530+
self._set_build_policy(build_policy)
528531
self._prepare_runtime_env(use_cache=False, with_json=True)
529532

530533
# Ensure destination exists:
@@ -561,9 +564,9 @@ def copy_tree(src, dest, ignore):
561564

562565
for dep in build_data["dependencies"]:
563566
for src in dep["bin_paths"]:
564-
copy_tree(src, dest/"bin", ignore=["bzip2"])
567+
copy_tree(src, dest / "bin", ignore=["bzip2"])
565568
for src in dep["lib_paths"]:
566-
copy_tree(src, dest/"lib", ignore=["cmake", "*.a"])
569+
copy_tree(src, dest / "lib", ignore=["cmake", "*.a"])
567570

568571
# Patching RPATH of all the binaries lets everything run
569572
# fine without any extra steps, like setting LD_LIBRARY_PATH.

0 commit comments

Comments
 (0)