{"record":{"id":"ca6f4d279a08dbf0","repo":"Morganamilo/paru","slug":"can-not-use-chroot-builds-devtools-is-not-installed","errorCode":null,"errorMessage":"can not use chroot builds: devtools is not installed","messagePattern":"can not use chroot builds: devtools is not installed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib.rs","lineNumber":206,"sourceCode":"        git_flags: config.git_flags.clone(),\n        clone_dir: config.build_dir.clone(),\n        diff_dir: config.cache_dir.join(\"diff\"),\n        aur_url,\n    };\n\n    let mut fetch = config.fetch.clone();\n    fetch.clone_dir = config.build_dir.join(\"repo\");\n    fetch.diff_dir = config.cache_dir.join(\"diff/repo\");\n    config.pkgbuild_repos.fetch = fetch;\n\n    log::debug!(\"{:#?}\", config);\n\n    handle_cmd(config).await\n}\n\nasync fn handle_cmd(config: &mut Config) -> Result<i32> {\n    if (config.op == Op::ChrootCtl || config.chroot) && !has_command(\"arch-nspawn\") {\n        bail!(tr!(\"can not use chroot builds: devtools is not installed\"));\n    }\n\n    let ret = match config.op {\n        Op::Database | Op::Files => exec::pacman(config, &config.args)?.code(),\n        Op::Upgrade => handle_upgrade(config).await?,\n        Op::Build => handle_build(config).await?,\n        Op::Query => handle_query(config).await?,\n        Op::Sync => handle_sync(config).await?,\n        Op::Remove => handle_remove(config)?,\n        Op::DepTest => handle_test(config).await?,\n        Op::GetPkgBuild => handle_get_pkg_build(config).await?,\n        Op::Show => handle_show(config).await?,\n        Op::Default => handle_default(config).await?,\n        Op::RepoCtl => handle_repo(config)?,\n        Op::ChrootCtl => handle_chroot(config)?,\n        // _ => bail!(\"unknown op '{}'\", config.op),\n    };\n","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/lib.rs#L188-L224","documentation":"handle_cmd checks at startup that chroot-based builds are possible: if the operation is ChrootCtl or the --chroot flag is set, the arch-nspawn command (from the devtools package) must exist on PATH. If not, paru bails because chroot builds simply cannot proceed without devtools.","triggerScenarios":"Running `paru --chroot ...` / `paru -S <pkg> --chroot` or a chrootctl operation when has_command(\"arch-nspawn\") returns false — i.e. devtools is not installed or arch-nspawn is not on PATH.","commonSituations":"Users enabling --chroot on a fresh Arch install without devtools; minimal containers; devtools installed but PATH broken (e.g. /usr/bin missing from PATH in weird environments); forgetting that chroot builds require the extra package.","solutions":["Install devtools: `sudo pacman -S devtools`","Verify: `command -v arch-nspawn` should print a path","Drop the --chroot flag / chroot config option if you don't need isolated builds","Set `Chroot`/chroot options off in paru.conf if it's enabled there unintentionally"],"exampleFix":"// before\n$ paru -S foo --chroot\ncan not use chroot builds: devtools is not installed\n// after\n$ sudo pacman -S devtools\n$ paru -S foo --chroot","handlingStrategy":"validation","validationCode":"if using_chroot() && which(\"arch-nspawn\").is_err() {\n    eprintln!(\"install devtools before using --chroot\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install devtools (`pacman -S devtools`) on hosts where chroot builds are used","Disable Chroot in paru.conf if you don't need it","Verify arch-nspawn is on PATH in minimal images"],"tags":["chroot","devtools","missing-dependency","arch"],"backgroundTag":"missing-dependency","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}