Merge branch 'fix-ci' into 'master'

Fix CI by avoiding FUSE and host packages on full binary-only build

See merge request redox-os/redox!1769
This commit is contained in:
Jeremy Soller 2025-12-15 13:42:08 -07:00
commit a2ce30b797
3 changed files with 15 additions and 1 deletions

View File

@ -60,7 +60,7 @@ img:
- |
export PATH="$HOME/.cargo/bin:$PATH" &&
bash podman/rustinstall.sh &&
PODMAN_BUILD=0 REPO_BINARY=1 COOKBOOK_VERBOSE=false make ci-img IMG_TAG=$CI_COMMIT_REF_NAME &&
PODMAN_BUILD=0 REPO_BINARY=1 FSTOOLS_NO_MOUNT=1 COOKBOOK_VERBOSE=false make ci-img IMG_TAG=$CI_COMMIT_REF_NAME &&
([ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" ] && rm -rf build/img/* || true)
artifacts:
paths:

View File

@ -42,6 +42,8 @@ REDOXFS_MKFS_FLAGS?=
PODMAN_BUILD?=1
## Set to 1 to put filesystem tools inside podman, any other value will install it to host
FSTOOLS_IN_PODMAN?=0
## Set to 1 if FUSE is not available and we are running in a container
FSTOOLS_NO_MOUNT?=0
## Enable sccache to speed up cargo builds
## only do this by default if this is inside podman
SCCACHE_BUILD?=$(shell [ -f /run/.containerenv ] && echo 1 || echo 0)
@ -152,6 +154,9 @@ ifeq ($(REPO_BINARY),1)
INSTALLER_OPTS+=--repo-binary
COOKBOOK_OPTS+=--repo-binary
endif
ifeq ($(FSTOOLS_NO_MOUNT),1)
INSTALLER_OPTS+=--no-mount
endif
REPO_TAG=$(BUILD)/repo.tag
FSTOOLS_TAG=build/fstools.tag

View File

@ -504,6 +504,7 @@ fn parse_args(args: Vec<String>) -> anyhow::Result<(CliConfig, CliCommand, Vec<C
{
let repo_binary = conf.general.repo_binary == Some(true);
let mut last_rule = if repo_binary { "binary" } else { "source" };
let mut should_drop_host_packages = true;
// Use rev() so recipes that don't listed in config is inherited from parent
for recipe in recipes.iter_mut().rev() {
if let Some(conf) = conf.packages.get(recipe.name.as_str()) {
@ -516,12 +517,20 @@ fn parse_args(args: Vec<String>) -> anyhow::Result<(CliConfig, CliCommand, Vec<C
"source"
}
}
};
if should_drop_host_packages && (last_rule == "source" || last_rule == "local") {
should_drop_host_packages = false;
}
};
recipe
.apply_filesystem_config(last_rule)
.map_err(|e| anyhow!(e))?;
}
// If there's no building from source, drop all host toolchain
// TODO: This is more of a hack to make CI passing
if should_drop_host_packages && config.with_package_deps {
recipes = recipes.into_iter().filter(|p| !p.name.is_host()).collect();
}
}
if command.is_informational() {