Skip to content

Rollup of 9 pull requests #125533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e7772f2
use posix_memalign on most Unix targets
RalfJung May 19, 2024
3c2d9c2
fix typo
RalfJung May 19, 2024
dc8d1bc
Add more tests
oli-obk May 23, 2024
29a630e
When checking whether an impl applies, constrain hidden types of opaq…
oli-obk Apr 17, 2024
7f292f4
Allow defining opaque types during trait object upcasting.
oli-obk Apr 17, 2024
4387eea
Support constraining opaque types while trait upcasting with binders
oli-obk Apr 17, 2024
09c8e39
A small diagnostic improvement for dropping_copy_types
surechen May 22, 2024
3fe3157
Stop using the avx512er and avx512pf x86 target features
zmodem May 24, 2024
ebd9f35
remove proof tree formatter, make em shallow
lcnr May 24, 2024
1af490d
Better ICE message for unresolved upvars
compiler-errors May 24, 2024
9185ddb
bootstrap: support target specific config overrides
weihanglo May 24, 2024
d1f0bc7
bootstrap: test target specific config overrides
weihanglo May 24, 2024
61aac55
Structurally resolve before builtin_index in EUV
compiler-errors May 24, 2024
f4b9ac6
Add manual Sync impl for ReentrantLockGuard
programmerjake May 24, 2024
045f448
Don't eagerly monomorphize drop for types that are impossible to inst…
compiler-errors May 24, 2024
8f00197
Rollup merge of #124080 - oli-obk:define_opaque_types10, r=compiler-e…
workingjubilee May 25, 2024
508d5e4
Rollup merge of #125271 - RalfJung:posix_memalign, r=workingjubilee
workingjubilee May 25, 2024
05fefb5
Rollup merge of #125433 - surechen:fix_125189, r=Urgau
workingjubilee May 25, 2024
5edded5
Rollup merge of #125498 - zmodem:avx512er, r=workingjubilee
workingjubilee May 25, 2024
f528aab
Rollup merge of #125510 - lcnr:change-proof-trees-to-be-shallow, r=co…
workingjubilee May 25, 2024
a570549
Rollup merge of #125513 - compiler-errors:impossible-drop, r=jackh726
workingjubilee May 25, 2024
12e92c4
Rollup merge of #125514 - compiler-errors:builtin-index, r=lcnr
workingjubilee May 25, 2024
836487b
Rollup merge of #125515 - weihanglo:target-toml-override, r=onur-ozkan
workingjubilee May 25, 2024
f8346f0
Rollup merge of #125527 - programmerjake:patch-2, r=workingjubilee
workingjubilee May 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub enum RustfmtState {
LazyEvaluated,
}

#[derive(Debug, Default, Clone, Copy, PartialEq)]
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub enum LlvmLibunwind {
#[default]
No,
Expand All @@ -381,7 +381,7 @@ impl FromStr for LlvmLibunwind {
}
}

#[derive(Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum SplitDebuginfo {
Packed,
Unpacked,
Expand Down Expand Up @@ -542,7 +542,7 @@ impl PartialEq<&str> for TargetSelection {
}

/// Per-target configuration stored in the global configuration structure.
#[derive(Default, Clone)]
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct Target {
/// Some(path to llvm-config) if using an external LLVM.
pub llvm_config: Option<PathBuf>,
Expand Down Expand Up @@ -644,7 +644,20 @@ impl Merge for TomlConfig {
do_merge(&mut self.llvm, llvm, replace);
do_merge(&mut self.rust, rust, replace);
do_merge(&mut self.dist, dist, replace);
assert!(target.is_none(), "merging target-specific config is not currently supported");

match (self.target.as_mut(), target) {
(_, None) => {}
(None, Some(target)) => self.target = Some(target),
(Some(original_target), Some(new_target)) => {
for (triple, new) in new_target {
if let Some(original) = original_target.get_mut(&triple) {
original.merge(new, replace);
} else {
original_target.insert(triple, new);
}
}
}
}
}
}

Expand Down Expand Up @@ -899,7 +912,7 @@ define_config! {
}
}

#[derive(Clone, Debug, Deserialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
#[serde(untagged)]
pub enum StringOrBool {
String(String),
Expand Down
41 changes: 41 additions & 0 deletions src/bootstrap/src/core/config/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use super::{flags::Flags, ChangeIdWrapper, Config};
use crate::core::build_steps::clippy::get_clippy_rules_in_order;
use crate::core::config::Target;
use crate::core::config::TargetSelection;
use crate::core::config::{LldMode, TomlConfig};

use clap::CommandFactory;
Expand Down Expand Up @@ -124,6 +126,10 @@ fn override_toml() {
"--set=build.gdb=\"bar\"".to_owned(),
"--set=build.tools=[\"cargo\"]".to_owned(),
"--set=llvm.build-config={\"foo\" = \"bar\"}".to_owned(),
"--set=target.x86_64-unknown-linux-gnu.runner=bar".to_owned(),
"--set=target.x86_64-unknown-linux-gnu.rpath=false".to_owned(),
"--set=target.aarch64-unknown-linux-gnu.sanitizers=false".to_owned(),
"--set=target.aarch64-apple-darwin.runner=apple".to_owned(),
],
|&_| {
toml::from_str(
Expand All @@ -140,6 +146,17 @@ tools = []
[llvm]
download-ci-llvm = false
build-config = {}

[target.aarch64-unknown-linux-gnu]
sanitizers = true
rpath = true
runner = "aarch64-runner"

[target.x86_64-unknown-linux-gnu]
sanitizers = true
rpath = true
runner = "x86_64-runner"

"#,
)
.unwrap()
Expand All @@ -163,6 +180,30 @@ build-config = {}
[("foo".to_string(), "bar".to_string())].into_iter().collect(),
"setting dictionary value"
);

let x86_64 = TargetSelection::from_user("x86_64-unknown-linux-gnu");
let x86_64_values = Target {
sanitizers: Some(true),
rpath: Some(false),
runner: Some("bar".into()),
..Default::default()
};
let aarch64 = TargetSelection::from_user("aarch64-unknown-linux-gnu");
let aarch64_values = Target {
sanitizers: Some(false),
rpath: Some(true),
runner: Some("aarch64-runner".into()),
..Default::default()
};
let darwin = TargetSelection::from_user("aarch64-apple-darwin");
let darwin_values = Target { runner: Some("apple".into()), ..Default::default() };
assert_eq!(
config.target_config,
[(x86_64, x86_64_values), (aarch64, aarch64_values), (darwin, darwin_values)]
.into_iter()
.collect(),
"setting dictionary value"
);
}

#[test]
Expand Down