diff --git a/pycheribuild/boot_cheribsd/__init__.py b/pycheribuild/boot_cheribsd/__init__.py index 47df03f7e..ecf45ec60 100755 --- a/pycheribuild/boot_cheribsd/__init__.py +++ b/pycheribuild/boot_cheribsd/__init__.py @@ -72,7 +72,10 @@ CompilationTargets.CHERIBSD_MORELLO_PURECAP, )} -AUTOBOOT_PROMPT = re.compile(r"(H|, h)it \[Enter] to boot ") +# boot loader without lua: "Hit [Enter] to boot " +# menu.lua before Sep 2019: ", hit [Enter] to boot " +# menu.lua: "[Space] to pause" +AUTOBOOT_PROMPT = re.compile(r"((H|, h)it \[Enter] to boot |\[Space] to pause)") BOOT_LOADER_PROMPT = "OK " STARTING_INIT = "start_init: trying /sbin/init" @@ -845,6 +848,7 @@ def boot_and_login(child: CheriBSDSpawnMixin, *, starttime, kernel_init_only=Fal loader_boot_prompt_messages = [*boot_messages, BOOT_LOADER_PROMPT] loader_boot_messages = [*loader_boot_prompt_messages, AUTOBOOT_PROMPT] i = child.expect(loader_boot_messages, timeout=20 * 60, timeout_msg="timeout before loader or kernel") + ran_manual_boot = False if i >= len(boot_messages): # Skip 10s wait from loader(8) if we see the autoboot message if i == loader_boot_messages.index(AUTOBOOT_PROMPT): # Hit Enter @@ -855,7 +859,7 @@ def boot_and_login(child: CheriBSDSpawnMixin, *, starttime, kernel_init_only=Fal i = child.expect(loader_boot_prompt_messages, timeout=60, timeout_msg="timeout before loader prompt") if i != loader_boot_prompt_messages.index(BOOT_LOADER_PROMPT): - failure("failed to enter boot loader prompt", exit=True) + failure("failed to enter boot loader prompt after stopping autoboot", exit=True) # Fall through to BOOT_LOADER_PROMPT else: child.sendline("\r") @@ -863,7 +867,10 @@ def boot_and_login(child: CheriBSDSpawnMixin, *, starttime, kernel_init_only=Fal success("===> loader(8) waiting boot commands") # Just boot the default kernel if no alternate kernel directory is given child.sendline("boot {}".format(boot_alternate_kernel_dir or "")) + ran_manual_boot = True i = child.expect(boot_messages, timeout=5 * 60, timeout_msg="timeout before kernel") + if boot_alternate_kernel_dir and not ran_manual_boot: + failure("failed to enter boot loader prompt", exit=True) if i == boot_messages.index(TRYING_TO_MOUNT_ROOT): success("===> mounting rootfs") if bootverbose: diff --git a/pycheribuild/projects/cross/benchmarks.py b/pycheribuild/projects/cross/benchmarks.py index 29d771e45..058db9767 100644 --- a/pycheribuild/projects/cross/benchmarks.py +++ b/pycheribuild/projects/cross/benchmarks.py @@ -483,8 +483,7 @@ def run_tests(self): self.fatal("running x86 tests is not implemented yet") return # testing, not benchmarking -> run only once - test_command = "cd '/build/{dirname}' && ./run_jenkins-bluehive.sh -d0 -r1 -s".format( - dirname=self.bundle_dir.name) + test_command = f"cd '/build/{self.bundle_dir.name}' && ./run_jenkins-bluehive.sh -d0 -r1 -s" self.target_info.run_cheribsd_test_script("run_simple_tests.py", "--test-command", test_command, "--test-timeout", str(120 * 60), mount_builddir=True) diff --git a/pycheribuild/projects/cross/libcxx.py b/pycheribuild/projects/cross/libcxx.py index b579a0999..79de531c7 100644 --- a/pycheribuild/projects/cross/libcxx.py +++ b/pycheribuild/projects/cross/libcxx.py @@ -330,16 +330,13 @@ def add_cross_flags(self): elif self.nfs_mounted_path: self.libcxx_lit_jobs = " -j1" # We can only run one job here since we are using scp self.fatal("nfs_mounted_path not portend to new libc++ test infrastructure yet") - executor = "SSHExecutorWithNFSMount(\\\"{host}\\\", nfs_dir=\\\"{nfs_dir}\\\"," \ - "path_in_target=\\\"{nfs_in_target}\\\", config=self, username=\\\"{user}\\\"," \ - " port={port})".format(host=self.qemu_host, user=self.qemu_user, port=self.qemu_port, - nfs_dir=self.nfs_mounted_path, nfs_in_target=self.nfs_path_in_qemu) + executor = f"SSHExecutorWithNFSMount(\\\"{self.qemu_host}\\\", nfs_dir=\\\"{self.nfs_mounted_path}\\\"," \ + f"path_in_target=\\\"{self.nfs_path_in_qemu}\\\", config=self," \ + f"username=\\\"{self.qemu_user}\\\", port={self.qemu_port})" else: self.libcxx_lit_jobs = " -j1" # We can only run one job here since we are using scp executor = self.commandline_to_str([self.source_dir / "utils/ssh.py", - "--host", "{user}@{host}:{port}".format(host=self.qemu_host, - user=self.qemu_user, - port=self.qemu_port)]) + "--host", f"{self.qemu_user}@{self.qemu_host}:{self.qemu_port}"]) if self.target_info.is_baremetal(): target_info = "libcxx.test.target_info.BaremetalNewlibTI" else: diff --git a/pycheribuild/projects/repository.py b/pycheribuild/projects/repository.py index a73487b71..f0851c12a 100644 --- a/pycheribuild/projects/repository.py +++ b/pycheribuild/projects/repository.py @@ -263,8 +263,7 @@ def ensure_cloned(self, current_project: "Project", *, src_dir: Path, base_proje default_clone_branch = self.get_default_branch(current_project, include_per_target=False) assert target_override is not None, "Default src != base src -> must have a per-target override" assert target_override.branch != default_clone_branch, \ - "Cannot create worktree with same branch as base repo: {} vs {}".format(target_override.branch, - default_clone_branch) + f"Cannot create worktree with same branch as base repo: {target_override.branch} vs {default_clone_branch}" if (src_dir / ".git").exists(): return current_project.info("Creating git-worktree checkout of", base_project_source_dir, "with branch", diff --git a/test-scripts/run_libcxx_tests.py b/test-scripts/run_libcxx_tests.py index 087b74bcb..382590170 100755 --- a/test-scripts/run_libcxx_tests.py +++ b/test-scripts/run_libcxx_tests.py @@ -314,8 +314,7 @@ def run_parallel_impl(args: argparse.Namespace, processes: "list[LitShardProcess if len(not_booted_processes) == 0: boot_cheribsd.success("All shards have booted succesfully. Releasing barrier (num_waiting = ", mp_barrier.n_waiting, ")") - assert mp_barrier.n_waiting == len(processes), "{} != {}".format(mp_barrier.n_waiting, - len(processes)) + assert mp_barrier.n_waiting == len(processes), f"{mp_barrier.n_waiting} != {len(processes)}" mp_barrier.wait(timeout=10) boot_cheribsd.success("Barrier has been released, tests should run now.") # assert target_process.stage < shard_result[2], "STAGE WENT BACKWARDS?"