Fix fetch-changed prefix, use rustinstall.sh for img

This commit is contained in:
Wildan M 2026-07-14 20:50:10 +07:00
parent a309abb16b
commit 45b03a18aa
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
5 changed files with 23 additions and 22 deletions

View File

@ -29,21 +29,25 @@ fetch-changed:
image: "redoxos/redox-base-x86_64" image: "redoxos/redox-base-x86_64"
stage: test stage: test
script: script:
- echo 'progress = bar:force:noscroll' > /etc/wgetrc
- curl "https://sh.rustup.rs" -sSf | sh -s -- -y --default-toolchain stable --profile minimal
- export PATH="$HOME/.cargo/bin:$PATH" PODMAN_BUILD=0 SKIP_CHECK_TOOLS=1
- make prefix/x86_64-unknown-redox/gcc-install
- ln -s gcc-install prefix/x86_64-unknown-redox/sysroot
- | - |
export PATH="$HOME/.cargo/bin:$PATH" && (cd prefix/x86_64-unknown-redox/sysroot &&
(curl "https://sh.rustup.rs" -sSf | sh -s -- -y --default-toolchain stable --profile minimal ) && sed "s|/usr/share|$(pwd)/share|g" "bin/libtoolize.orig" > "bin/libtoolize")
cargo install cbindgen && - ./scripts/fetch-changed.sh
env PODMAN_BUILD=0 SKIP_CHECK_TOOLS=1 ./scripts/fetch-changed.sh
img: img:
image: "redoxos/redox-base-x86_64" image: "redoxos/redox-base-x86_64"
stage: test stage: test
script: script:
- | - echo 'progress = bar:force:noscroll' > /etc/wgetrc
export PATH="$HOME/.cargo/bin:$PATH" && - export PATH="$HOME/.cargo/bin:$PATH"
(curl "https://sh.rustup.rs" -sSf | sh -s -- -y --default-toolchain stable --profile minimal ) && - export PODMAN_BUILD=0 SKIP_CHECK_TOOLS=1 REPO_BINARY=1 FSTOOLS_NO_MOUNT=1 COOKBOOK_VERBOSE=false
cargo install cbindgen && - ./podman/rustinstall.sh
PODMAN_BUILD=0 SKIP_CHECK_TOOLS=1 REPO_BINARY=1 FSTOOLS_NO_MOUNT=1 COOKBOOK_VERBOSE=false make ci-img IMG_TAG=$CI_COMMIT_REF_NAME - make ci-img IMG_TAG=$CI_COMMIT_REF_NAME
pkg: pkg:
image: "rust:trixie" image: "rust:trixie"

View File

@ -116,7 +116,7 @@
]; ];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
NIX_SHELL_BUILD = "1"; SKIP_CHECK_TOOLS = "1";
FSTOOLS_IN_PODMAN = "1"; FSTOOLS_IN_PODMAN = "1";
shellHook = '' shellHook = ''
# Install required configuration # Install required configuration

View File

@ -5,15 +5,11 @@ ifneq ($(PODMAN_BUILD),1)
# Don't check for dependencies if you will be using Hosted Redox # Don't check for dependencies if you will be using Hosted Redox
ifneq ($(HOSTED_REDOX),1) ifneq ($(HOSTED_REDOX),1)
# don't check for Rust and Cargo if building on a Nix system # don't check for compile tools, used when tools are managed externally, like in nix or CI
ifneq ($(NIX_SHELL_BUILD),1) ifneq ($(SKIP_CHECK_TOOLS),1)
ifeq ($(shell which rustup),) ifeq ($(shell which rustup),)
$(error rustup not found, install from "https://rustup.rs/") $(error rustup not found, install from "https://rustup.rs/")
endif endif
endif
# don't check for compile tools, used internally when installing fstools on host
ifneq ($(SKIP_CHECK_TOOLS),1)
ifeq ($(shell which cbindgen),) ifeq ($(shell which cbindgen),)
$(error cbindgen not found, install from crates.io or from your package manager) $(error cbindgen not found, install from crates.io or from your package manager)
endif endif

View File

@ -58,8 +58,9 @@ cookbook_configure
# monkey patching to make paths working in target system # monkey patching to make paths working in target system
if [ "$TARGET" != "$COOKBOOK_HOST_TARGET" ]; then if [ "$TARGET" != "$COOKBOOK_HOST_TARGET" ]; then
PYTHON_INIT PYTHON_INIT
sed -i "s/sccache //g" "$COOKBOOK_STAGE/usr/lib/$COOKBOOK_PYTHON_V/$_PYTHON_SYSCONFIGDATA_NAME.py" CONF="$COOKBOOK_STAGE/usr/lib/$COOKBOOK_PYTHON_V/$_PYTHON_SYSCONFIGDATA_NAME.py"
sed -i "s|${COOKBOOK_SYSROOT}|/usr|g" "$COOKBOOK_STAGE/usr/lib/$COOKBOOK_PYTHON_V/$_PYTHON_SYSCONFIGDATA_NAME.py" sed -i "s/sccache //g" "$CONF"
sed -i "s|${COOKBOOK_SYSROOT}|/usr|g" $CONF"
fi fi
""" """

View File

@ -657,7 +657,7 @@ pub(crate) fn fetch_cargo(
cargopath: Option<&String>, cargopath: Option<&String>,
logger: &PtyOut, logger: &PtyOut,
) -> Result<()> { ) -> Result<()> {
if !check_toolchain_available() { if !check_cargo_available() {
return Ok(()); return Ok(());
} }
@ -682,12 +682,12 @@ pub(crate) fn fetch_cargo(
Ok(()) Ok(())
} }
/// Check if "REDOXER_TOOLCHAIN" is available. /// Check if "$REDOXER_TOOLCHAIN/bin/cargo" is available.
fn check_toolchain_available() -> bool { fn check_cargo_available() -> bool {
let Ok(dir) = std::env::var("REDOXER_TOOLCHAIN") else { let Ok(dir) = std::env::var("REDOXER_TOOLCHAIN") else {
return false; return false;
}; };
PathBuf::from(dir).is_dir() PathBuf::from(dir).join("bin/cargo").is_file()
} }
pub fn fetch_remote( pub fn fetch_remote(