summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.rs12
-rw-r--r--src/pipeline/steps.rs3
-rw-r--r--src/shims/mod.rs2
3 files changed, 15 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs
index 7effa53..9226622 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -37,6 +37,13 @@ pub struct Config {
pub makechrootpkg_bin: String,
/// Path to mkarchroot.
pub mkarchroot_bin: String,
+ /// Package list handed to `mkarchroot` after the working directory, i.e.
+ /// what goes into the warm root. The default is the real devtools usage
+ /// (`mkarchroot <dir> base`); there is no `-N` flag on the real tool, so
+ /// hardcoding one would make the first real-chroot run fail on its first
+ /// step. Kept configurable because a site may want a smaller seed.
+ #[serde(default = "default_mkarchroot_args")]
+ pub mkarchroot_args: Vec<String>,
/// Path to repo-add.
pub repo_add_bin: String,
/// Path to gpg.
@@ -94,6 +101,7 @@ impl Default for Config {
makepkg_bin: "makepkg".into(),
makechrootpkg_bin: "makechrootpkg".into(),
mkarchroot_bin: "mkarchroot".into(),
+ mkarchroot_args: default_mkarchroot_args(),
repo_add_bin: "repo-add".into(),
gpg_bin: "gpg".into(),
build_user: String::new(),
@@ -250,6 +258,10 @@ impl Config {
}
/// Filesystem-safe slug for a URL, used in cache filenames.
+fn default_mkarchroot_args() -> Vec<String> {
+ vec!["base".to_string()]
+}
+
pub fn slug(url: &str) -> String {
url.chars()
.map(|c| {
diff --git a/src/pipeline/steps.rs b/src/pipeline/steps.rs
index db7032c..50e41d3 100644
--- a/src/pipeline/steps.rs
+++ b/src/pipeline/steps.rs
@@ -120,7 +120,8 @@ fn chroot(ctx: &Ctx) -> Result<StepResult> {
if !seed.exists() {
std::fs::create_dir_all(seed.parent().unwrap_or(&ctx.cfg.chroot_dir()))?;
let mut cmd = Command::new(&ctx.cfg.mkarchroot_bin);
- cmd.args(["-N", &seed.display().to_string()]);
+ // Real devtools usage: `mkarchroot [options] <working-dir> <packages...>`.
+ cmd.arg(&seed).args(&ctx.cfg.mkarchroot_args);
ctx.cfg.child_env(&mut cmd);
let out = cmd.output()?;
if !out.status.success() {
diff --git a/src/shims/mod.rs b/src/shims/mod.rs
index 46dd98f..5cf9ac7 100644
--- a/src/shims/mod.rs
+++ b/src/shims/mod.rs
@@ -307,7 +307,7 @@ fn plant_link_if_asked(startdir: &Path) {
#[cfg(unix)]
{
let _ = std::fs::remove_file(&link);
- if let Err(e) = std::fs::symlink(&target, &link) {
+ if let Err(e) = std::os::unix::fs::symlink(&target, &link) {
eprintln!("shim: could not plant {link:?} -> {target}: {e}");
}
}