clan-cli: Fix garbled clan vms run output. docs: Improve debugging guide

This commit is contained in:
Qubasa
2025-02-13 16:17:46 +07:00
parent bf492d4deb
commit de3153259d
3 changed files with 16 additions and 12 deletions

View File

@@ -73,17 +73,6 @@ def get_clan_nix_attrset(clan_dir: Flake | None = None) -> ClanExports:
log.debug(f"Evaluating flake {clan_dir} for Clan attrsets")
# from clan_cli.nix import nix_metadata
# from urllib.parse import urlencode
# myurl = f"path://{clan_dir}"
# metadata = nix_metadata(myurl)["locked"]
# query_params = {
# "lastModified": metadata["lastModified"],
# "narHash": metadata["narHash"]
# }
# url = f"{myurl}?{urlencode(query_params)}"
# Nix evaluation script to compute find inputs that have a "clan" attribute
eval_script = f"""
let

View File

@@ -129,6 +129,7 @@ def start_vm(
env.update(extra_env)
cmd = nix_shell(packages, args)
machine.debug(f"Starting VM with command: {cmd}")
with subprocess.Popen(
cmd, env=env, stdout=stdout, stderr=stderr, stdin=stdin
) as process:
@@ -354,7 +355,7 @@ def run_vm(
stdout=sys.stdout.buffer,
stderr=sys.stderr.buffer,
input_bytes=None,
log=Log.BOTH,
log=Log.NONE,
)
args: list[str] = vm.process.args # type: ignore[assignment]