mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 15:34:18 +08:00
Merge branch 'clean_sysroot' into 'master'
Fix sysroot rebuild for clean_target See merge request redox-os/redox!2093
This commit is contained in:
commit
e92839d2dd
@ -1,20 +1,14 @@
|
||||
use pkg::PackageError;
|
||||
use pkg::{Package, PackageName};
|
||||
use pkg::{Package, PackageError, PackageName};
|
||||
use pkgar::{PackageFile, Transaction};
|
||||
use pkgar_core::PackageSrc;
|
||||
use pkgar_keys::PublicKeyFile;
|
||||
|
||||
use crate::config::CookConfig;
|
||||
use crate::cook::fetch;
|
||||
use crate::cook::package::{package_source_paths, package_target};
|
||||
use crate::cook::pty::PtyOut;
|
||||
use crate::cook::{fs, script::*};
|
||||
use crate::recipe::Recipe;
|
||||
use crate::recipe::{AutoDeps, CookRecipe};
|
||||
use crate::recipe::{BuildKind, OptionalPackageRecipe};
|
||||
use std::collections::VecDeque;
|
||||
use crate::cook::{fetch, fs, pty::PtyOut, script::*};
|
||||
use crate::recipe::{AutoDeps, BuildKind, CookRecipe, OptionalPackageRecipe, Recipe};
|
||||
use std::{
|
||||
collections::BTreeSet,
|
||||
collections::{BTreeSet, VecDeque},
|
||||
path::{Path, PathBuf},
|
||||
process::Command,
|
||||
str,
|
||||
@ -267,17 +261,15 @@ pub fn build(
|
||||
return build_remote(stage_dirs, stage_pkgars, recipe, target_dir, logger);
|
||||
}
|
||||
|
||||
let deps_sysroot = if name.is_host() {
|
||||
&dep_host_pkgars
|
||||
} else {
|
||||
&dep_pkgars
|
||||
};
|
||||
let have_toolchain = !name.is_host() && dep_host_pkgars.len() > 0;
|
||||
let (sysroot_cached, toolchain_cached) = (
|
||||
build_deps_dir(
|
||||
logger,
|
||||
&sysroot_dir,
|
||||
if name.is_host() {
|
||||
&dep_host_pkgars
|
||||
} else {
|
||||
&dep_pkgars
|
||||
},
|
||||
)?,
|
||||
if !name.is_host() && dep_host_pkgars.len() > 0 {
|
||||
build_deps_dir(logger, &sysroot_dir, deps_sysroot)?,
|
||||
if have_toolchain {
|
||||
build_deps_dir(logger, &toolchain_dir, &dep_host_pkgars)?
|
||||
} else {
|
||||
true
|
||||
@ -300,6 +292,17 @@ pub fn build(
|
||||
for stage_dir in &stage_dirs {
|
||||
remove_stage_dir(stage_dir)?;
|
||||
}
|
||||
if cook_config.clean_target {
|
||||
// no matter what, these two caches are invalid
|
||||
if sysroot_cached {
|
||||
fs::remove_all(&sysroot_dir)?;
|
||||
build_deps_dir(logger, &sysroot_dir, deps_sysroot)?;
|
||||
}
|
||||
if toolchain_cached && have_toolchain {
|
||||
fs::remove_all(&toolchain_dir)?;
|
||||
build_deps_dir(logger, &toolchain_dir, &dep_host_pkgars)?;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log_to_pty!(logger, "DEBUG: using cached build");
|
||||
// stop early otherwise we'll end up rebuilding
|
||||
|
||||
@ -1,32 +1,28 @@
|
||||
use crate::Error;
|
||||
use crate::Result;
|
||||
use crate::bail_other_err;
|
||||
use crate::config::translate_mirror;
|
||||
use crate::cook::cook_build;
|
||||
use crate::cook::fetch_repo;
|
||||
use crate::cook::fetch_repo::PlainPtyCallback;
|
||||
use crate::cook::fs::*;
|
||||
use crate::cook::package::get_package_name;
|
||||
use crate::cook::package::package_source_paths;
|
||||
use crate::cook::pty::PtyOut;
|
||||
use crate::cook::script::*;
|
||||
use crate::is_redox;
|
||||
use crate::log_to_pty;
|
||||
use crate::recipe::BuildKind;
|
||||
use crate::recipe::CookRecipe;
|
||||
use crate::recipe::SourceRecipe;
|
||||
use crate::wrap_io_err;
|
||||
use crate::wrap_other_err;
|
||||
use pkg::SourceIdentifier;
|
||||
use pkg::net_backend::DownloadBackendWriter;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::BTreeMap;
|
||||
use std::fs;
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
use std::rc::Rc;
|
||||
use crate::cook::{
|
||||
cook_build,
|
||||
fetch_repo::{self, PlainPtyCallback},
|
||||
fs::*,
|
||||
package::{get_package_name, package_source_paths},
|
||||
pty::PtyOut,
|
||||
script::*,
|
||||
};
|
||||
use crate::{
|
||||
Error, Result, bail_other_err,
|
||||
config::translate_mirror,
|
||||
is_redox, log_to_pty,
|
||||
recipe::{BuildKind, CookRecipe, SourceRecipe},
|
||||
wrap_io_err, wrap_other_err,
|
||||
};
|
||||
use pkg::{SourceIdentifier, net_backend::DownloadBackendWriter};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
collections::BTreeMap,
|
||||
fs::{self, File},
|
||||
io::Read,
|
||||
path::{Path, PathBuf},
|
||||
process::Command,
|
||||
rc::Rc,
|
||||
};
|
||||
|
||||
pub struct FetchResult {
|
||||
pub source_dir: PathBuf,
|
||||
|
||||
@ -1,18 +1,9 @@
|
||||
use libc::{self, winsize};
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Write};
|
||||
use std::io::{self, PipeReader, PipeWriter, Read, Write};
|
||||
use std::os::fd::FromRawFd;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::os::unix::process::CommandExt;
|
||||
use std::process::Child;
|
||||
use std::time::Duration;
|
||||
use std::{io, mem, ptr};
|
||||
use std::{
|
||||
io::{PipeReader, PipeWriter},
|
||||
process::Command,
|
||||
};
|
||||
|
||||
pub use std::os::unix::io::RawFd;
|
||||
use std::os::unix::{io::AsRawFd, io::RawFd, process::CommandExt};
|
||||
use std::process::{Child, Command};
|
||||
use std::{fs::File, mem, ptr, time::Duration};
|
||||
|
||||
use crate::{Error, Result, wrap_io_err};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use pkg::{Package, PackageName};
|
||||
use std::fmt::Write as _;
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
fmt::Write as _,
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user