1
Fork 0
Empowering everyone to build reliable and efficient software. Gabriel's commits. https://www.rust-lang.org/
Find a file
bors 48b36c9d59 Auto merge of #128320 - saethlin:link-me-maybe, r=compiler-errors
Avoid no-op unlink+link dances in incr comp

Incremental compilation scales quite poorly with the number of CGUs. This PR improves one reason for that.

The incr comp process hard-links all the files from an old session into a new one, then it runs the backend, which may just hard-link the new session files into the output directory. Then codegen hard-links all the output files back to the new session directory.

This PR (perhaps unimaginatively) fixes the silliness that ensues in the last step. The old `link_or_copy` implementation would be passed pairs of paths which are already the same inode, then it would blindly delete the destination and re-create the hard-link that it just deleted. This PR lets us skip both those operations. We don't skip the other two hard-links.

`cargo +stage1 b && touch crates/core/main.rs && strace -cfw -elink,linkat,unlink,unlinkat cargo +stage1 b` before and then after on `ripgrep-13.0.0`:
```
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 52.56    0.024950          25       978       485 unlink
 34.38    0.016318          22       727           linkat
 13.06    0.006200          24       249           unlinkat
------ ----------- ----------- --------- --------- ----------------
100.00    0.047467          24      1954       485 total
```
```
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 42.83    0.014521          57       252           unlink
 38.41    0.013021          26       486           linkat
 18.77    0.006362          25       249           unlinkat
------ ----------- ----------- --------- --------- ----------------
100.00    0.033904          34       987           total
```

This reduces the number of hard-links that are causing perf troubles, noted in https://github.com/rust-lang/rust/issues/64291 and https://github.com/rust-lang/rust/issues/137560
2025-03-21 21:03:49 +00:00
.github Rollup merge of #138658 - marcoieni:mirror-alpine-and-centos, r=Kobzol 2025-03-19 08:17:16 +01:00
compiler Auto merge of #128320 - saethlin:link-me-maybe, r=compiler-errors 2025-03-21 21:03:49 +00:00
library Rollup merge of #138717 - jdonszelmann:pin-macro, r=WaffleLapkin 2025-03-21 15:48:57 +01:00
LICENSES
src Auto merge of #138791 - matthiaskrgr:rollup-ev46cqr, r=matthiaskrgr 2025-03-21 17:55:41 +00:00
tests Rollup merge of #138721 - jchecahi:tests-explicit-cpus, r=tgross35 2025-03-21 15:48:58 +01:00
.clang-format
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore change config.toml to bootstrap.toml for bootstrap module 2025-03-17 12:56:41 +05:30
.gitmodules
.ignore change config.toml to bootstrap.toml for bootstrap module 2025-03-17 12:56:41 +05:30
.mailmap
bootstrap.example.toml change config.toml to bootstrap.toml for bootstrap module 2025-03-17 12:56:41 +05:30
Cargo.lock Update Cargo.lock 2025-03-20 22:35:05 +01:00
Cargo.toml Alphabetize the root workspace members 2025-03-13 12:21:14 -07:00
CODE_OF_CONDUCT.md
configure
CONTRIBUTING.md
COPYRIGHT Update copyright year 2025-03-13 02:01:16 +05:00
INSTALL.md change config.toml to bootstrap.toml for bootstrap module 2025-03-17 12:56:41 +05:30
LICENSE-APACHE Update copyright year 2025-03-13 02:01:16 +05:00
license-metadata.json
LICENSE-MIT Update copyright year 2025-03-13 02:01:16 +05:00
README.md Update Rust Foundation links in Readme 2025-03-16 19:03:40 -07:00
RELEASES.md change config.toml to bootstrap.toml for bootstrap module 2025-03-17 12:56:41 +05:30
REUSE.toml change config.toml to bootstrap.toml for bootstrap module 2025-03-17 12:56:41 +05:30
rust-bors.toml
rustfmt.toml
triagebot.toml Remove llvm and llvms triagebot ping aliases for icebreakers-llvm 2025-03-20 12:37:24 +08:00
x
x.ps1
x.py

This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.

Why Rust?

  • Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrated with other languages.

  • Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.

  • Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).

Quick Start

Read "Installation" from The Book.

Installing from Source

If you really want to install from source (though this is not recommended), see INSTALL.md.

Getting Help

See https://www.rust-lang.org/community for a list of chat platforms and forums.

Contributing

See CONTRIBUTING.md.

License

Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.

Trademark

The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks").

If you want to use these names or brands, please read the Rust language trademark policy.

Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.