Change:
Since bumped the bootstrap compiler, stage0 libstd fails to build when jemalloc is disabled: I believe it needs to restore the logic removed here: I tried to add this to : Then stage0 passed, but stage1 std failed like:
cc
We should probably add a builder for this...
or just get on with evicting jemalloc...
is not the right way to fix this - I that so I could build rust with a local rust that does not have jemalloc i.e. unless the following two conditions are true: you're using a local rust (as opposed to the automatic stage0 download) and your local rust does not have jemalloc (you compiled the whole thing yourself with ) it's irrelevant. Edit: to be clear, by "not the right way to fix this" I mean "it worked fine before I that flag, so its removal is probably not the root cause". That's doesn't exclude the possibility that we could perform some incantations with this flag and fix the issue. Edit2: sorry, I thought you were exclusively referring to rather than all the logic. I read and thought this issue was about the same thing.
Generally, the two conditions you list are actually true for me. I build Fedora's rustc without jemalloc, and I use that as the local stage0 to build the next release. And i think the force flag does come into play too, because if we need to rebuild the current release then the local rust gets treated as a stage1. But right now it's more direct. I am using the downloaded stage0, which wants to default to jemalloc. Since I'm disabling that for my build, stage0 can't find it.
Interesting, I kinda figured I was the only one! Rereading , I see I'm wrong about my two conditions above - it actually applies when trying to build something without jemalloc, from something that defaults to it. Anyway, it should all be fixed soonish...

Discussion:
use rustc::hir::def_id::{DefId, CrateNum, LOCAL_CRATE, INVALID_CRATE, CRATE_DEF_INDEX}; use rustc::session::config; use rustc::ty::TyCtxt; <ins> use rustc_allocator::ALLOCATOR_METHODS; </ins> use syntax::attr; /// The SymbolExportLevel of a symbols specifies from which kinds of crates

SymbolExportLevel::C)); } <ins> if tcx.sess.allocator_kind.get().is_some() { for method in ALLOCATOR_METHODS { local_crate.push((format!("__rust_{}", method.name), INVALID_DEF_ID, SymbolExportLevel::Rust)); } } </ins> if let Some(id) = tcx.sess.derive_registrar_fn.get() { let def_id = tcx.hir.local_def_id(id); let idx = def_id.index;

#![default_lib_allocator] <ins> // Always use alloc_system during stage0 since we don't know if the alloc_* // crate the stage0 compiler will pick by default is enabled (e.g. // if the user has disabled jemalloc in `./configure`). // `force_alloc_system` is *only* intended as a workaround for local rebuilds // with a rustc without jemalloc. // The not(stage0+msvc) gates will only last until the next stage0 bump #![cfg_attr(all( not(all(stage0, target_env = "msvc")), any(stage0, feature = "force_alloc_system")), feature(global_allocator))] #[cfg(all( not(all(stage0, target_env = "msvc")), any(stage0, feature = "force_alloc_system")))] #[global_allocator] static ALLOC: alloc_system::System = alloc_system::System; </ins> // Explicitly import the prelude. The compiler uses this same unstable attribute // to import the prelude implicitly when building crates that depend on std. #[prelude_import]

"src/libstd/path.rs", "src/libstd/f32.rs", "src/libstd/f64.rs", <ins> "src/libstd/lib.rs", // Until next stage0 snapshot bump </ins> "src/libstd/sys_common/mod.rs", "src/libstd/sys_common/net.rs", "src/libterm", // Not sure how to make this crate portable, but test needs it