-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Rollup of 9 pull requests #148337
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
Rollup of 9 pull requests #148337
Conversation
Targets theoretically possible, but not provided yet: - 32-bit arm See also notes in the PR, I was unable to run anything non-trivial on ARM HelenOS, there are issues with the linker/loader, incomplete support of atomics, and overall a lot of confusion about the precise version of ARM architecture that the HelenOS builds target. - riscv, mips (These targets currently don't run HelenOS at all. HelenOS says it should work, but the builds are broken for quite some time now.)
Signed-off-by: tison <wander4096@gmail.com>
Instead of `include_str!()`ing `range_search.rs`, just make it a normal module under `core::unicode`. This means the same source code doesn't have to be checked in twice, and it plays nicer with IDEs. Also rename it to `rt` since it includes functions for searching the bitsets and case conversion tables as well as the range represesentation.
Remove `#[rustfmt::skip]` from all the generated modules in `unicode_data.rs`. This means we won't have to worry so much about getting indetation and formatting right when generating code. Exempted for now some tables which would be too big when formatted by `rustfmt`.
This check was made redundant (it will always be true) when we removed all ASCII characters from the tables (rust-lang@a8c6694).
To make the final output code easier to see: * Get rid of the unnecessary line-noise of `.unwrap()`ing calls to `write!()` by moving the `.unwrap()` into a macro. * Join consecutive `write!()` calls using a single multiline format string. * Replace `.push()` and `.push_str(format!())` with `write!()`. * If after doing all of the above, there is only a single `write!()` call in the function, just construct the string directly with `format!()`.
Instead of generating a standalone executable to test `unicode_data`, generate normal tests in `coretests`. This ensures tests are always generated, and will be run as part of the normal testsuite. Also change the generated tests to loop over lookup tables, rather than generating a separate `assert_eq!()` statement for every codepoint. The old approach produced a massive (20,000 lines plus) file which took minutes to compile!
…wiser add first HelenOS compilation targets I'm working on adding a HelenOS compilation target for Rust as my bachelor thesis. I understood that the policy for tier 3 targets is quite liberal, so here's my attempt at upstreaming the initial support. I'm quite new to Rust internals, so thanks in advance for all assistance with my stupid questions :) libstd support is coming, but I understood compiler support must come first before libc bindings can get merged (rust-lang/libc#4355 (comment)) Locally, I also needed to update `cc-rs`, to do two things: - add [here](https://github.com/rust-lang/cc-rs/blob/59578addda0233c8e9a0b399769cedb538ac8052/src/lib.rs#L3397) the binutils prefixes (`x86_64-unknown-helenos` -> `amd64-helenos` - add the targets to `generated.rs` From the "Adding tier 3 target" guide it sound like the latter will happen automatically, the first I need to do manually? I'm not sure if the test suite will pass or fail without it. I'm also quite unsure about all the target spec configuration flags. I copied the specs from other small OSs with some tweaks and things seems to work now, but I have no idea how to better judge if it's correct. Finally, I'm also working on support for arm (32-bit and 64), but there I'm currently running into some issues with linking, so I'll send that later, if I figure it out. --- <details> <summary>Tier 3 policy "form"</summary> > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) That would be me, I suppose. I agree. > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. I'm using the standard Rust conventions. > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. > - The target must not introduce license incompatibilities. > - Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). I am not aware of any legal issues. HelenOS itself is open-source under BSD license. All code contributed in this PR (and later for libstd) is either fully my own or an adaptation of existing code from this repo (some PAL pieces). > - The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. I am not adding any new dependencies. > - Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. The HelenOS build tools consist of open-source patches to GCC and binutils, so I suppose we're fine. > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. Understood. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. The libstd PR will fully support core+alloc, and enough of std to run interesting programs (stdio, argv and fs) - so we can run tools like [imagecli](https://github.com/theotherphil/imagecli). But yes, major parts of std are missing - pipe, process and net are currently forwarded to `unsupported()`. Some barebones `net` should be possible, but e.g. cloning of the descriptor is unheard of in HelenOS, so it won't be as straightforward as the rest. Also, some places of the `fs` and `thread` module are also quite stubby (but part of it is just because HelenOS has no file permissions, for example). HelenOS is a small, experimental OS, so its own libc is stubbed out as well in some places. I hope this state is acceptable? > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. I hope the guide in doc is sufficient. > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via ```@)``` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. Understood. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. Understood. > Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.) Umm, I think this is satisfied? Code generation works with the default LLVM backend, even though it has no idea about HelenOS. And our GCC patch is then used only for linking. </details>
…thin, r=joboet implement VecDeque extend_from_within and prepend_from_within Tracking issue: rust-lang#146975
… r=joboet `unicode_data` refactors Minor refactors to `unicode_data` that occured to me while trying to reduce the size of the tables. Splitting into a separate PR. NFC
…oboet Implement VecDeque::extract_if This refers to rust-lang#147750.
…rgau Enable regression labeling aliases Enabling label aliases when regressions bleed into the next release channel (nightly -> beta, beta -> stable). This configuration enables these two aliases: - ```@rustbot`` label to-beta` (switch regression label <anything> -> beta) - ```@rustbot`` label to-stable` (switch regression label <anything> -> beta) Pending merge of [triagebot#2172](rust-lang/triagebot#2172)
…=joboet Use fstatat() in DirEntry::metadata on Apple platforms Apple supports `fstatat` on macOS >=10.10 ([source](https://gitlab.gnome.org/GNOME/glib/-/issues/2203)), and according to [Platform Support](https://doc.rust-lang.org/beta/rustc/platform-support.html) the oldest supported version is 10.12. Google says iOS >=10 supports `fstatat` but doesn't provide a source. [*-apple-ios](https://doc.rust-lang.org/beta/rustc/platform-support/apple-ios.html#os-version) says the minimum supported iOS version is 10.0. Unsure about tvOS, watchOS and visionOS, hoping CI can confirm this. I am testing with [fastdu](https://github.com/jesseschalken/fastdu) which is effectively a stress test for `DirEntry::metadata`. In one test this provides a **1.13x** speedup. ``` $ hyperfine --warmup 1 'target/release/fastdu testdir' 'fastdu testdir' Benchmark 1: target/release/fastdu testdir Time (mean ± σ): 154.6 ms ± 17.4 ms [User: 31.7 ms, System: 187.6 ms] Range (min … max): 148.4 ms … 225.5 ms 19 runs Benchmark 2: fastdu testdir Time (mean ± σ): 175.3 ms ± 15.8 ms [User: 50.0 ms, System: 196.2 ms] Range (min … max): 165.4 ms … 211.7 ms 17 runs Summary target/release/fastdu testdir ran 1.13 ± 0.16 times faster than fastdu testdir ``` You can also reproduce a speedup with a program like this (providing a directory with many entries): ```rust fn main() { let args: Vec<_> = std::env::args_os().collect(); let dir: PathBuf = args[1].clone().into(); for entry in dir.read_dir().as_mut().unwrap() { let entry = entry.as_ref().unwrap(); let metadata = entry.metadata(); let metadata = metadata.as_ref().unwrap(); println!("{} {}", metadata.len(), entry.file_name().display()); } } ``` ``` $ hyperfine './target/release/main testdir' './main testdir' Benchmark 1: ./target/release/main testdir Time (mean ± σ): 148.3 ms ± 5.2 ms [User: 23.1 ms, System: 122.9 ms] Range (min … max): 145.2 ms … 167.2 ms 19 runs Benchmark 2: ./main testdir Time (mean ± σ): 164.4 ms ± 9.5 ms [User: 32.6 ms, System: 128.8 ms] Range (min … max): 158.5 ms … 199.5 ms 17 runs Summary ./target/release/main testdir ran 1.11 ± 0.07 times faster than ./main testdir ```
cg_llvm: Pass `debuginfo_compression` through FFI as an enum There are only three possible values, making an enum more appropriate. This avoids string allocation on the Rust side, and avoids ad-hoc `!strcmp` to convert back to an enum on the C++ side.
…ocs, r=Amanieu docs: Fix argument names for `carrying_mul_add` Fixes rust-lang#148312
…ChrisDenton Enable file locking support in illumos rust-lang#132977 introduced an allow-list of targets supporting file locking, but forgot to add illumos to it (which introduced support for it in ~2015). `File::lock` and friends are now stable, and the ecosystem is slowly replacing custom libc calls with the standard library. Crucially, in 1.91 both Cargo and bootstrap switched to `File::lock`, both breaking build directory locking. This PR enables file locking on illumos. Fixes rust-lang#146312.
Rollup of 9 pull requests Successful merges: - #139310 (add first HelenOS compilation targets) - #147161 (implement VecDeque extend_from_within and prepend_from_within) - #147622 (`unicode_data` refactors) - #147780 (Implement VecDeque::extract_if) - #147942 (Enable regression labeling aliases) - #147986 (Use fstatat() in DirEntry::metadata on Apple platforms) - #148103 (cg_llvm: Pass `debuginfo_compression` through FFI as an enum) - #148319 (docs: Fix argument names for `carrying_mul_add`) - #148322 (Enable file locking support in illumos) r? `@ghost` `@rustbot` modify labels: rollup
|
💥 Test timed out |
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
@bors retry |
|
☀️ Test successful - checks-actions |
|
📌 Perf builds for each rolled up PR:
previous master: 17e7324d44 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 17e7324 (parent) -> d85276b (this PR) Test differencesShow 357 test diffsStage 0
Stage 1
Stage 2
Additionally, 274 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard d85276b256a8ab18e03b6394b4f7a7b246176db7 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (d85276b): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.4%, secondary 3.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 3.4%, secondary -3.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 475.117s -> 476.797s (0.35%) |
|
@rust-timer build d6b0e6e |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (d6b0e6e): comparison URL. Overall result: no relevant changes - no action neededInstruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 0.6%, secondary 3.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 475.117s -> 476.653s (0.32%) |
|
@rust-timer build f29ba69 |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (f29ba69): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowInstruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.1%, secondary 3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -3.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 475.117s -> 475.015s (-0.02%) |
Successful merges:
unicode_datarefactors #147622 (unicode_datarefactors)debuginfo_compressionthrough FFI as an enum #148103 (cg_llvm: Passdebuginfo_compressionthrough FFI as an enum)carrying_mul_add#148319 (docs: Fix argument names forcarrying_mul_add)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup