Skip to content

Rollup of 10 pull requests #138006

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 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2c752bc
Undeprecate env::home_dir
arlosi Feb 20, 2025
b340545
[illumos] attempt to use posix_spawn to spawn processes
sunshowers Feb 11, 2025
78615ff
Stablize `string_extend_from_within`
aDotInTheVoid Feb 24, 2025
0ca1c9c
Count char width at most once in Formatter::pad
thaliaarchi Feb 6, 2025
4c45285
Add `dist:Gcc` build step
Kobzol Feb 26, 2025
e4bfad2
Build GCC on the Linux x64 dist runner
Kobzol Feb 28, 2025
6563437
Create the `OptimizedDist` tool with a macro
Kobzol Feb 21, 2025
96a9197
Allow specifying that tools build a library, not a binary
Kobzol Feb 21, 2025
807f6ff
Implement `RunMakeSupport` tool using the `bootstrap_tool!` macro
Kobzol Feb 21, 2025
4af94f8
Implement `RunMake` test suite using the `test!` macro
Kobzol Feb 21, 2025
86aae8e
uefi: Add Service Binding Protocol abstraction
Ayush1325 Feb 23, 2025
0034d6c
Compile run-make recipes using the stage0 compiler
Kobzol Feb 24, 2025
9d6ca5f
Ignore a-b-a-linker-guard during cross-compilation
Kobzol Feb 25, 2025
a0ed304
float: Update some constants to `pub(crate)`
tgross35 Dec 9, 2024
5a2da96
dec2flt: Update documentation of existing methods
tgross35 Dec 9, 2024
49a2d4c
dec2flt: Rename `Decimal` to `DecimalSeq`
tgross35 Dec 9, 2024
626d2c5
dec2flt: Rename `Number` to `Decimal`
tgross35 Dec 9, 2024
6c34daf
dec2flt: Rename fields to be consistent with documented notation
tgross35 Dec 9, 2024
19a909a
dec2flt: Refactor float traits
tgross35 Dec 9, 2024
37e223c
dec2flt: Refactor the fast path
tgross35 Dec 9, 2024
6324b39
promote ohos targets to tier to with host tools
LuuuXXX Feb 12, 2025
7279acf
use measureme-12.0.1
LuuuXXX Feb 15, 2025
6efacfb
add fix for full tools and sanitizer
LuuuXXX Feb 24, 2025
4dab55b
Revert "add fix for full tools and sanitizer"
LuuuXXX Mar 4, 2025
3eb04fd
add support for extend rust tools and sanitizer
LuuuXXX Mar 4, 2025
6463590
Postprocess test suite metrics into GitHub summary
Kobzol Feb 15, 2025
2e5ab4e
Store bootstrap command-line into metrics
Kobzol Feb 19, 2025
ead58ea
Move `BuildStep` and metric logging into `build_helper`
Kobzol Mar 4, 2025
7b53ac7
Record bootstrap step durations into GitHub summary in citool
Kobzol Mar 2, 2025
f331260
add note for miri
LuuuXXX Mar 4, 2025
0ea5a73
Rollup merge of #134063 - tgross35:dec2flt-refactoring, r=Noratrieb
jieyouxu Mar 4, 2025
588aa63
Rollup merge of #136662 - thaliaarchi:formatter-pad-char-count, r=m-o…
jieyouxu Mar 4, 2025
6930886
Rollup merge of #137011 - LuuuXXX:promote-ohos-with-host-tools, r=Ama…
jieyouxu Mar 4, 2025
5813a6e
Rollup merge of #137077 - Kobzol:citool-test-metrics, r=marcoieni
jieyouxu Mar 4, 2025
10faff4
Rollup merge of #137327 - arlosi:home-dir, r=Mark-Simulacrum
jieyouxu Mar 4, 2025
85ebc01
Rollup merge of #137373 - Kobzol:tool-stage0-improve, r=jieyouxu
jieyouxu Mar 4, 2025
b00b604
Rollup merge of #137463 - sunshowers:illumos-posix-spawn, r=Mark-Simu…
jieyouxu Mar 4, 2025
da862b1
Rollup merge of #137477 - Ayush1325:uefi-service-binding, r=Noratrieb
jieyouxu Mar 4, 2025
038edab
Rollup merge of #137569 - aDotInTheVoid:for-iurii, r=ibraheemdev
jieyouxu Mar 4, 2025
41b6c76
Rollup merge of #137667 - Kobzol:gcc-dist-build, r=onur-ozkan
jieyouxu Mar 4, 2025
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
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ jobs:
- name: show the current environment
run: src/ci/scripts/dump-environment.sh

# Pre-build citool before the following step uninstalls rustup
# Build is into the build directory, to avoid modifying sources
- name: build citool
run: |
cd src/ci/citool
CARGO_TARGET_DIR=../../../build/citool cargo build

- name: run the build
# Redirect stderr to stdout to avoid reordering the two streams in the GHA logs.
run: src/ci/scripts/run-build-from-ci.sh 2>&1
Expand Down Expand Up @@ -218,6 +225,16 @@ jobs:
# erroring about invalid credentials instead.
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'

- name: postprocess metrics into the summary
run: |
if [ -f build/metrics.json ]; then
./build/citool/debug/citool postprocess-metrics build/metrics.json ${GITHUB_STEP_SUMMARY}
elif [ -f obj/build/metrics.json ]; then
./build/citool/debug/citool postprocess-metrics obj/build/metrics.json ${GITHUB_STEP_SUMMARY}
else
echo "No metrics.json found"
fi

- name: upload job metrics to DataDog
if: needs.calculate_matrix.outputs.run_type != 'pr'
env:
Expand Down
23 changes: 18 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2178,6 +2178,20 @@ dependencies = [
"smallvec",
]

[[package]]
name = "measureme"
version = "12.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "570a507d8948a66a97f42cbbaf8a6bb9516a51017d4ee949502ad7a10a864395"
dependencies = [
"log",
"memmap2",
"parking_lot",
"perf-event-open-sys",
"rustc-hash 1.1.0",
"smallvec",
]

[[package]]
name = "memchr"
version = "2.7.4"
Expand Down Expand Up @@ -2261,7 +2275,7 @@ dependencies = [
"libc",
"libffi",
"libloading",
"measureme",
"measureme 11.0.1",
"rand 0.9.0",
"regex",
"rustc_version",
Expand Down Expand Up @@ -3365,7 +3379,7 @@ dependencies = [
"gimli 0.30.0",
"itertools",
"libc",
"measureme",
"measureme 12.0.1",
"object 0.36.7",
"rustc-demangle",
"rustc_abi",
Expand Down Expand Up @@ -3483,7 +3497,7 @@ dependencies = [
"indexmap",
"jobserver",
"libc",
"measureme",
"measureme 12.0.1",
"memmap2",
"parking_lot",
"portable-atomic",
Expand Down Expand Up @@ -4249,8 +4263,7 @@ dependencies = [
name = "rustc_query_impl"
version = "0.0.0"
dependencies = [
"measureme",
"rustc_attr_data_structures",
"measureme 12.0.1",
"rustc_data_structures",
"rustc_errors",
"rustc_hashes",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bitflags = "2.4.1"
gimli = "0.30"
itertools = "0.12"
libc = "0.2"
measureme = "11"
measureme = "12.0.1"
object = { version = "0.36.3", default-features = false, features = ["std", "read"] }
rustc-demangle = "0.1.21"
rustc_abi = { path = "../rustc_abi" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ elsa = "1.11.0"
ena = "0.14.3"
indexmap = "2.4.0"
jobserver_crate = { version = "0.1.28", package = "jobserver" }
measureme = "11"
measureme = "12.0.1"
rustc-hash = "2.0.0"
rustc-rayon = { version = "0.5.1", features = ["indexmap"] }
rustc-stable-hash = { version = "0.1.0", features = ["nightly"] }
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ fn main() {
println!("cargo:rustc-link-lib=kstat");
}

if (target.starts_with("arm") && !target.contains("freebsd"))
if (target.starts_with("arm") && !target.contains("freebsd")) && !target.contains("ohos")
|| target.starts_with("mips-")
|| target.starts_with("mipsel-")
|| target.starts_with("powerpc-")
Expand Down Expand Up @@ -371,6 +371,7 @@ fn main() {
|| target.contains("freebsd")
|| target.contains("windows-gnullvm")
|| target.contains("aix")
|| target.contains("ohos")
{
"c++"
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_query_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ edition = "2024"

[dependencies]
# tidy-alphabetical-start
measureme = "11"
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
measureme = "12.0.1"
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_hashes = { path = "../rustc_hashes" }
Expand Down
4 changes: 2 additions & 2 deletions library/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ dependencies = [

[[package]]
name = "libc"
version = "0.2.169"
version = "0.2.170"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down
3 changes: 1 addition & 2 deletions library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,6 @@ impl String {
/// # Examples
///
/// ```
/// #![feature(string_extend_from_within)]
/// let mut string = String::from("abcde");
///
/// string.extend_from_within(2..);
Expand All @@ -1147,7 +1146,7 @@ impl String {
/// assert_eq!(string, "abcdecdeabecde");
/// ```
#[cfg(not(no_global_oom_handling))]
#[unstable(feature = "string_extend_from_within", issue = "103806")]
#[stable(feature = "string_extend_from_within", since = "CURRENT_RUSTC_VERSION")]
pub fn extend_from_within<R>(&mut self, src: R)
where
R: RangeBounds<usize>,
Expand Down
66 changes: 29 additions & 37 deletions library/core/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1693,49 +1693,41 @@ impl<'a> Formatter<'a> {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn pad(&mut self, s: &str) -> Result {
// Make sure there's a fast path up front
// Make sure there's a fast path up front.
if self.options.width.is_none() && self.options.precision.is_none() {
return self.buf.write_str(s);
}
// The `precision` field can be interpreted as a `max-width` for the

// The `precision` field can be interpreted as a maximum width for the
// string being formatted.
let s = if let Some(max) = self.options.precision {
// If our string is longer that the precision, then we must have
// truncation. However other flags like `fill`, `width` and `align`
// must act as always.
if let Some((i, _)) = s.char_indices().nth(max) {
// LLVM here can't prove that `..i` won't panic `&s[..i]`, but
// we know that it can't panic. Use `get` + `unwrap_or` to avoid
// `unsafe` and otherwise don't emit any panic-related code
// here.
s.get(..i).unwrap_or(s)
} else {
&s
}
let (s, char_count) = if let Some(max_char_count) = self.options.precision {
let mut iter = s.char_indices();
let remaining = match iter.advance_by(max_char_count) {
Ok(()) => 0,
Err(remaining) => remaining.get(),
};
// SAFETY: The offset of `.char_indices()` is guaranteed to be
// in-bounds and between character boundaries.
let truncated = unsafe { s.get_unchecked(..iter.offset()) };
(truncated, max_char_count - remaining)
} else {
&s
// Use the optimized char counting algorithm for the full string.
(s, s.chars().count())
};
// The `width` field is more of a `min-width` parameter at this point.
match self.options.width {
// If we're under the maximum length, and there's no minimum length
// requirements, then we can just emit the string
None => self.buf.write_str(s),
Some(width) => {
let chars_count = s.chars().count();
// If we're under the maximum width, check if we're over the minimum
// width, if so it's as easy as just emitting the string.
if chars_count >= width {
self.buf.write_str(s)
}
// If we're under both the maximum and the minimum width, then fill
// up the minimum width with the specified string + some alignment.
else {
let align = Alignment::Left;
let post_padding = self.padding(width - chars_count, align)?;
self.buf.write_str(s)?;
post_padding.write(self)
}
}

// The `width` field is more of a minimum width parameter at this point.
if let Some(width) = self.options.width
&& char_count < width
{
// If we're under the minimum width, then fill up the minimum width
// with the specified string + some alignment.
let post_padding = self.padding(width - char_count, Alignment::Left)?;
self.buf.write_str(s)?;
post_padding.write(self)
} else {
// If we're over the minimum width or there is no minimum width, we
// can just emit the string.
self.buf.write_str(s)
}
}

Expand Down
27 changes: 15 additions & 12 deletions library/core/src/num/dec2flt/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ pub(crate) trait ByteSlice {
/// Writes a 64-bit integer as 8 bytes in little-endian order.
fn write_u64(&mut self, value: u64);

/// Calculate the offset of a slice from another.
/// Calculate the difference in length between two slices.
fn offset_from(&self, other: &Self) -> isize;

/// Iteratively parse and consume digits from bytes.
/// Returns the same bytes with consumed digits being
/// elided.
///
/// Returns the same bytes with consumed digits being elided. Breaks on invalid digits.
fn parse_digits(&self, func: impl FnMut(u8)) -> &Self;
}

Expand All @@ -39,11 +39,11 @@ impl ByteSlice for [u8] {
fn parse_digits(&self, mut func: impl FnMut(u8)) -> &Self {
let mut s = self;

while let Some((c, s_next)) = s.split_first() {
while let Some((c, rest)) = s.split_first() {
let c = c.wrapping_sub(b'0');
if c < 10 {
func(c);
s = s_next;
s = rest;
} else {
break;
}
Expand All @@ -53,27 +53,30 @@ impl ByteSlice for [u8] {
}
}

/// Determine if 8 bytes are all decimal digits.
/// Determine if all characters in an 8-byte byte string (represented as a `u64`) are all decimal
/// digits.
///
/// This does not care about the order in which the bytes were loaded.
pub(crate) fn is_8digits(v: u64) -> bool {
let a = v.wrapping_add(0x4646_4646_4646_4646);
let b = v.wrapping_sub(0x3030_3030_3030_3030);
(a | b) & 0x8080_8080_8080_8080 == 0
}

/// A custom 64-bit floating point type, representing `f * 2^e`.
/// e is biased, so it be directly shifted into the exponent bits.
/// A custom 64-bit floating point type, representing `m * 2^p`.
/// p is biased, so it be directly shifted into the exponent bits.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
pub struct BiasedFp {
/// The significant digits.
pub f: u64,
pub m: u64,
/// The biased, binary exponent.
pub e: i32,
pub p_biased: i32,
}

impl BiasedFp {
/// Represent `0 ^ p`
#[inline]
pub const fn zero_pow2(e: i32) -> Self {
Self { f: 0, e }
pub const fn zero_pow2(p_biased: i32) -> Self {
Self { m: 0, p_biased }
}
}
Loading
Loading