diff --git a/recipes/dev/cargo/recipe.toml b/recipes/dev/cargo/recipe.toml index 07acd357a..e07489624 100644 --- a/recipes/dev/cargo/recipe.toml +++ b/recipes/dev/cargo/recipe.toml @@ -1,7 +1,9 @@ [source] -git = "https://gitlab.redox-os.org/redox-os/cargo.git" -upstream = "https://github.com/rust-lang/cargo.git" -branch = "redox-2023-01-21" +git = "https://github.com/rust-lang/cargo.git" +rev = "d73d2caf9e41a39daf2a8d6ce60ec80bf354d2a7" # 0.86 +patches = [ + "redox.patch" +] [build] template = "custom" @@ -19,14 +21,13 @@ export LIBZ_SYS_STATIC=1 export DEP_NGHTTP2_ROOT="${COOKBOOK_SYSROOT}" export DEP_OPENSSL_ROOT="${COOKBOOK_SYSROOT}" export DEP_Z_ROOT="${COOKBOOK_SYSROOT}" -# Force linking system nghttp2 "${COOKBOOK_CARGO}" rustc \ --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \ --release \ --bin cargo \ -- \ -L "${COOKBOOK_SYSROOT}/lib" \ - -C link-arg="-lnghttp2" + -C link-arg=-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib mkdir -pv "${COOKBOOK_STAGE}/usr/bin" cp -v "target/${TARGET}/release/cargo" "${COOKBOOK_STAGE}/usr/bin/cargo" """ diff --git a/recipes/dev/cargo/redox.patch b/recipes/dev/cargo/redox.patch new file mode 100644 index 000000000..4a32bfe05 --- /dev/null +++ b/recipes/dev/cargo/redox.patch @@ -0,0 +1,37 @@ +diff --git a/crates/cargo-util/src/paths.rs b/crates/cargo-util/src/paths.rs +index 5d7e3c5a6..b7de5655f 100644 +--- a/crates/cargo-util/src/paths.rs ++++ b/crates/cargo-util/src/paths.rs +@@ -201,7 +201,7 @@ pub fn write_atomic, C: AsRef<[u8]>>(path: P, contents: C) -> Res + use std::os::unix::fs::PermissionsExt; + + // these constants are u16 on macOS +- let mask = u32::from(libc::S_IRWXU | libc::S_IRWXG | libc::S_IRWXO); ++ let mask = (libc::S_IRWXU | libc::S_IRWXG | libc::S_IRWXO) as u32; + let mode = meta.permissions().mode() & mask; + + std::fs::Permissions::from_mode(mode) +@@ -611,8 +611,6 @@ fn _link_or_copy(src: &Path, dst: &Path) -> Result<()> { + } + + let link_result = if src.is_dir() { +- #[cfg(target_os = "redox")] +- use std::os::redox::fs::symlink; + #[cfg(unix)] + use std::os::unix::fs::symlink; + #[cfg(windows)] +diff --git a/src/cargo/core/compiler/build_config.rs b/src/cargo/core/compiler/build_config.rs +index 80aa592dd..d40c2056b 100644 +--- a/src/cargo/core/compiler/build_config.rs ++++ b/src/cargo/core/compiler/build_config.rs +@@ -51,9 +51,7 @@ pub struct BuildConfig { + } + + fn default_parallelism() -> CargoResult { +- Ok(available_parallelism() +- .context("failed to determine the amount of parallelism available")? +- .get() as u32) ++ Ok(1) + } + + impl BuildConfig {