Review remarks
This commit is contained in:
parent
ca6e367e19
commit
b92b35204b
3 changed files with 23 additions and 26 deletions
|
|
@ -1606,7 +1606,7 @@ impl Step for GccCodegenBackend {
|
|||
let _guard = builder.msg_rustc_tool(
|
||||
Kind::Build,
|
||||
build_compiler.stage,
|
||||
format_args!("codegen backend gcc"),
|
||||
"codegen backend gcc",
|
||||
build_compiler.host,
|
||||
target,
|
||||
);
|
||||
|
|
@ -1690,7 +1690,7 @@ impl Step for CraneliftCodegenBackend {
|
|||
let _guard = builder.msg_rustc_tool(
|
||||
Kind::Build,
|
||||
build_compiler.stage,
|
||||
format_args!("codegen backend cranelift"),
|
||||
"codegen backend cranelift",
|
||||
build_compiler.host,
|
||||
target,
|
||||
);
|
||||
|
|
@ -1712,32 +1712,28 @@ fn write_codegen_backend_stamp(
|
|||
files: Vec<PathBuf>,
|
||||
dry_run: bool,
|
||||
) -> BuildStamp {
|
||||
if !dry_run {
|
||||
let mut files = files.into_iter().filter(|f| {
|
||||
let filename = f.file_name().unwrap().to_str().unwrap();
|
||||
is_dylib(f) && filename.contains("rustc_codegen_")
|
||||
});
|
||||
let codegen_backend = match files.next() {
|
||||
Some(f) => f,
|
||||
None => panic!("no dylibs built for codegen backend?"),
|
||||
};
|
||||
if let Some(f) = files.next() {
|
||||
panic!(
|
||||
"codegen backend built two dylibs:\n{}\n{}",
|
||||
codegen_backend.display(),
|
||||
f.display()
|
||||
);
|
||||
}
|
||||
|
||||
let codegen_backend = codegen_backend.to_str().unwrap();
|
||||
stamp = stamp.add_stamp(codegen_backend);
|
||||
t!(stamp.write());
|
||||
if dry_run {
|
||||
return stamp;
|
||||
}
|
||||
|
||||
let mut files = files.into_iter().filter(|f| {
|
||||
let filename = f.file_name().unwrap().to_str().unwrap();
|
||||
is_dylib(f) && filename.contains("rustc_codegen_")
|
||||
});
|
||||
let codegen_backend = match files.next() {
|
||||
Some(f) => f,
|
||||
None => panic!("no dylibs built for codegen backend?"),
|
||||
};
|
||||
if let Some(f) = files.next() {
|
||||
panic!("codegen backend built two dylibs:\n{}\n{}", codegen_backend.display(), f.display());
|
||||
}
|
||||
|
||||
let codegen_backend = codegen_backend.to_str().unwrap();
|
||||
stamp = stamp.add_stamp(codegen_backend);
|
||||
t!(stamp.write());
|
||||
stamp
|
||||
}
|
||||
|
||||
pub(crate) const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_";
|
||||
|
||||
/// Creates the `codegen-backends` folder for a compiler that's about to be
|
||||
/// assembled as a complete compiler.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1401,7 +1401,7 @@ impl Step for CraneliftCodegenBackend {
|
|||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||
// We only want to build the cranelift backend in `x dist` if the backend was enabled
|
||||
// in rust.codegen-backends.
|
||||
// Sadly, we don't have access to the actual for which we're disting clif here..
|
||||
// Sadly, we don't have access to the actual target for which we're disting clif here..
|
||||
// So we just use the host target.
|
||||
let clif_enabled_by_default = run
|
||||
.builder
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
use crate::core::build_steps::compile::CODEGEN_BACKEND_PREFIX;
|
||||
use crate::core::config::toml::TomlConfig;
|
||||
use crate::core::config::{DebuginfoLevel, Merge, ReplaceOpt, StringOrBool};
|
||||
use crate::{BTreeSet, CodegenBackendKind, HashSet, PathBuf, TargetSelection, define_config, exit};
|
||||
|
|
@ -391,6 +390,8 @@ pub(crate) fn parse_codegen_backends(
|
|||
backends: Vec<String>,
|
||||
section: &str,
|
||||
) -> Vec<CodegenBackendKind> {
|
||||
const CODEGEN_BACKEND_PREFIX: &str = "rustc_codegen_";
|
||||
|
||||
let mut found_backends = vec![];
|
||||
for backend in &backends {
|
||||
if let Some(stripped) = backend.strip_prefix(CODEGEN_BACKEND_PREFIX) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue