Skip to content
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 7 pull requests #126201

Closed
wants to merge 17 commits into from
Closed

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Jun 9, 2024

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

sunsided and others added 17 commits May 29, 2024 09:30
This is create symmetry between the already existing TAU constant (2pi)
and the newly-introduced FRAC_1_SQRT_2PI, keeping the more common
name while increasing visibility.
When things like our internal hashing or representations change,
it is inappropriate for these tests to suddenly fail for no reason.
The chance of error is reduced if we instead pattern-match.
These are the default package set required by opt-dist to correctly work,
hence for people wanting to build a production grade of rustc in a
sandboxed / air-gapped environment, these need to be vendored.

The size of `rustc-src-nightly.tar.xz` before and after this change:

* Before: 298M
* After: 323M (+8%)

These crates are the default set of packages required by opt-dist
to correctly work, hence for people wanting to build a production grade
of rustc in an sandboxed / air-gapped environment, these need to be vendored.

The size of `rustc-src-nightly.tar.xz` before and after this change:

* Before: 298M
* After: 323M (+8%)

Size change might or might not be a concern.
See the previous discussion: rust-lang#125166 (comment)

Previous efforts on making:

* rust-lang#125125
* rust-lang#125166

---

Note that extra works still need to be done to make it fully vendored.

* The current pinned rustc-perf uses `tempfile::Tempdir` as the working
  directory when collecting profiles from some of these packages.
  This "tmp" working directory usage make it impossible for Cargo to pick
  up the correct vendor sources setting in `.cargo/config.toml` bundled
  in the rustc-src tarball. [^1]
* opt-dist verifies the final built rustc against a subset of rustc test
  suite. However it rolls out its own `config.toml` without setting
  `vendor = true`, and that results in `./vendor/` directory removed.
  [^2]

[^1]: https://github.com/rust-lang/rustc-perf/blob/4f313add609f43e928e98132358e8426ed3969ae/collector/src/compile/benchmark/mod.rs#L164-L173
[^2]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
`ring` is included because it is an optional dependency of `hyper`,
which is a training data in rustc-pref for optimized build.
The license of it is generally `ISC AND MIT AND OpenSSL`,
though the `package.license` field is not set.

See briansmith/ring#902

`git+https://github.com/rust-lang/team` git source is from
`rust_team_data`, which is used by `site` in src/tools/rustc-perf.
This doesn't really a part of the compiler,
so doesn't really affect the bootstrapping process.

See rust-lang/rustc-perf#1914.
The type name ID map has underscores in its names, so the query
element should have them, too.
…=cjgillot

Enable GVN for `AggregateKind::RawPtr`

Looks like I was worried for nothing; this seems like it's much easier than I was originally thinking it would be.
r? `@cjgillot`

This should be useful for `x[..4]`-like things, should those start inlining enough to expose the lengths.
…=Mark-Simulacrum

Add `FRAC_1_SQRT_2PI` constant to f16/f32/f64/f128

This adds the `FRAC_1_SQRT_2PI` to the `f16`, `f32`, `f64` and `f128` as [`1/√(2π)`](https://www.wolframalpha.com/input?i=1%2Fsqrt%282*pi%29). The rationale is that while `FRAC_1_SQRT_PI` already exists, [Gaussian calculations](https://en.wikipedia.org/wiki/Gaussian_function) for random normal distributions require a `1/(σ√(2π))` term, which could then be directly expressed e.g. as `f32::FRAC_1_SQRT_2PI / sigma`.

The actual value is approximately `1/√(2π) = 0.3989422804014326779399460599343818684758586311649346576659258296…`. Truncated/rounded forms were used for the individual types.

---

~~I did not any of the `#[unstable]` attributes since I am not aware of their implications.~~

**Edit:** I applied the stability attributes from the surrounding types according to what seemed most likely correct. I believe the `more_float_constants` feature marker is incorrectly applied, but I wasn't sure how to proceed.
…Simulacrum

bootstrap: vendor crates required by opt-dist to collect profiles

These are the default package set required by opt-dist to correctly work,
hence for people wanting to build a production grade of rustc in a
sandboxed / air-gapped environment, these need to be vendored.

The size of `rustc-src-nightly.tar.xz` before and after this change:

* Before: 298M
* After: 323M (+8%)

Size change might or might not be a concern.
See the previous discussion: rust-lang#125166 (comment)

Previous efforts on making:

* rust-lang#125125
* rust-lang#125166

---

Note that extra works still need to be done to make it fully vendored.

* The current pinned rustc-perf uses `tempfile::Tempdir` as the working
  directory when collecting profiles from some of these packages.
  This "tmp" working directory usage make it impossible for Cargo to pick
  up the correct vendor sources setting in `.cargo/config.toml` bundled
  in the rustc-src tarball. [^1]
* opt-dist verifies the final built rustc against a subset of rustc test
  suite. However it rolls out its own `config.toml` without setting
  `vendor = true`, and that results in `./vendor/` directory removed.
  [^2]

[^1]: https://github.com/rust-lang/rustc-perf/blob/4f313add609f43e928e98132358e8426ed3969ae/collector/src/compile/benchmark/mod.rs#L164-L173
[^2]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
…mulacrum

Add release notes for 1.79.0

cc `@rust-lang/release`
r? `@Mark-Simulacrum`
…codegen-tests, r=Mark-Simulacrum

Remove hard-coded hashes from codegen tests

This removes hard-coded hashes from the codegen and assembly tests. These use FileCheck, which supports eliding part of the pattern being matched, including by capturing it as a pattern parameter for later matching-on. This is much more appropriate than asking contributors to engage with deliberately-opaque identifier schemes.

In order to reduce the likelihood of error, every hash-coded segment I've touched now expects a certain length. This correctly represents these cases, as our hash outputs have a predetermined amount of entropy attached to them.

This is not done for the UI test suite as those are comparatively easy to simply `--bless`, whereas that would be inappropriate for codegen tests. It is also not done for debuginfo tests as those tests do not support such elision in a correct and useful way.
…normalize, r=fmease

rustdoc-search: use lowercase, non-normalized name for type search

The type name ID map has underscores in its names, so the query element should have them, too.

Fixes rust-lang#125993
…youxu

Fix documentation for `impl_common_helpers` in `run-make-support`

Forgot to do this in rust-lang#126121.

`@bors` rollup

r? `@jieyouxu`
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 9, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Jun 9, 2024

@bors r+ rollup=never p=5

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check-tidy failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Getting action download info
Download action repository 'msys2/[email protected]' (SHA:cc11e9188b693c2b100158c3322424c4cc1dadea)
Download action repository 'actions/checkout@v4' (SHA:a5ac7e51b41094c92402da3b24376905380afc29)
Download action repository 'actions/upload-artifact@v4' (SHA:65462800fd760344b1a7b4382951275a0abb4808)
Complete job name: PR - mingw-check-tidy
git config --global core.autocrlf false
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
---
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt \
    && pip3 install virtualenv
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

# NOTE: intentionally uses python2 for x.py so we can test it still works.
# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
           --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
---

#12 [5/8] COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
#12 DONE 0.0s

#13 [6/8] RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt     && pip3 install virtualenv
#13 0.414   Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB)
#13 0.428 Collecting boolean-py==4.0
#13 0.432   Downloading boolean.py-4.0-py3-none-any.whl (25 kB)
#13 0.444 Collecting chardet==5.1.0
---
#13 4.418 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#13 4.930 Collecting virtualenv
#13 4.966   Downloading virtualenv-20.26.2-py3-none-any.whl (3.9 MB)
#13 5.025      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 69.3 MB/s eta 0:00:00
#13 5.073 Collecting platformdirs<5,>=3.9.1
#13 5.076   Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 5.092 Collecting distlib<1,>=0.3.7
#13 5.096   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 5.133 Collecting filelock<4,>=3.12.2
#13 5.136   Downloading filelock-3.14.0-py3-none-any.whl (12 kB)
#13 5.136   Downloading filelock-3.14.0-py3-none-any.whl (12 kB)
#13 5.222 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 5.384 Successfully installed distlib-0.3.8 filelock-3.14.0 platformdirs-4.2.2 virtualenv-20.26.2
#13 DONE 5.5s

#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k:      212928 kB
DirectMap2M:     7127040 kB
DirectMap1G:    11534336 kB
##[endgroup]
Executing TIDY_PRINT_DIFF=1 python2.7 ../x.py test            --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
+ TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
    Finished `dev` profile [unoptimized] target(s) in 0.03s
##[endgroup]
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/7bb0ef4902e43f338aa73c3ff728bea3cb9ecf6a/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-7bb0ef4902e43f338aa73c3ff728bea3cb9ecf6a-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
   Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
    Finished `release` profile [optimized] target(s) in 26.55s
##[endgroup]
fmt check
##[error]Diff in /checkout/tests/rustdoc-js/underscoredtype.rs at line 1:
 pub mod unix {
- #[allow(non_camel_case_types)]
- pub type pid_t = i32;
- pub fn get_pid() -> pid_t { 0 }
- pub fn set_pid(_: pid_t) {}
+    pub type pid_t = i32;
+    pub type pid_t = i32;
+    pub fn get_pid() -> pid_t {
+    }
+    }
+    pub fn set_pid(_: pid_t) {}
 
 
fmt error: Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/tests/rustdoc-js/assoc-type-backtrack.rs" "/checkout/tests/rustdoc-js/search-method-disambiguate.rs" "/checkout/tests/rustdoc-js/macro-search.rs" "/checkout/tests/rustdoc-js/doc-alias-whitespace.rs" "/checkout/tests/rustdoc-js/search-bag-semantics.rs" "/checkout/tests/rustdoc-js/raw-pointer.rs" "/checkout/tests/rustdoc-js/search-short-types.rs" "/checkout/tests/rustdoc-js/auxiliary/interner.rs" "/checkout/tests/rustdoc-js/auxiliary/macro-in-module.rs" "/checkout/tests/rustdoc-js/auxiliary/equivalent.rs" "/checkout/tests/rustdoc-js/looks-like-rustc-interner.rs" "/checkout/tests/rustdoc-js/underscoredtype.rs" "/checkout/tests/rustdoc-js/generics-trait.rs" "/checkout/tests/rustdoc-js/doc-alias-filter-out.rs" "/checkout/tests/rustdoc-js/reexport-dedup.rs" "/checkout/tests/rustdoc-js/full-path-function.rs" "/checkout/tests/rustdoc-js/foreign-type-path.rs" "/checkout/tests/rustdoc-js/reference.rs" "/checkout/tests/rustdoc-js/generics-match-ambiguity.rs" "/checkout/tests/rustdoc-js/non-english-identifier.rs" "/checkout/tests/coverage/async.rs" "/checkout/tests/coverage/sort_groups.rs" "/checkout/tests/coverage/uses_inline_crate.rs" "/checkout/tests/coverage/assert.rs" "/checkout/tests/coverage/simple_match.rs" "/checkout/tests/coverage/inline.rs" "/checkout/tests/coverage/conditions.rs" "/checkout/tests/coverage/macro_in_closure.rs" "/checkout/tests/coverage/lazy_boolean.rs" "/checkout/tests/coverage/async2.rs" "/checkout/tests/coverage/if.rs" "/checkout/tests/coverage/try_error_result.rs" "/checkout/tests/coverage/overflow.rs" "/checkout/tests/coverage/if_not.rs" "/checkout/tests/coverage/inner_items.rs" "/checkout/tests/coverage/ignore_map.rs" "/checkout/tests/coverage/partial_eq.rs" "/checkout/tests/coverage/condition/conditions.rs" "/checkout/tests/coverage/coroutine.rs" "/checkout/tests/coverage/let_else_loop.rs" "/checkout/tests/coverage/while.rs" "/checkout/tests/coverage/unicode.rs" "/checkout/tests/coverage/color.rs" "/checkout/tests/coverage/test_harness.rs" "/checkout/tests/coverage/if_else.rs" "/checkout/tests/coverage/closure_bug.rs" "/checkout/tests/coverage/mcdc/condition-limit.rs" "/checkout/tests/coverage/trivial.rs" "/checkout/tests/coverage/closure_unit_return.rs" "/checkout/tests/coverage/nested_loops.rs" "/checkout/tests/coverage/issue-83601.rs" "/checkout/tests/coverage/inline-dead.rs" "/checkout/tests/coverage/unused.rs" "/checkout/tests/coverage/ignore_run.rs" "/checkout/tests/coverage/loop_break_value.rs" "/checkout/tests/coverage/generics.rs" "/checkout/tests/coverage/abort.rs" "/checkout/tests/coverage/bad_counter_ids.rs" "/checkout/tests/coverage/long_and_wide.rs" "/checkout/tests/coverage/issue-85461.rs" "/checkout/tests/coverage/continue.rs" "/checkout/tests/coverage/thin-lto.rs" "/checkout/tests/coverage/panic_unwind.rs" "/checkout/tests/rustdoc-js/never-search.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
  local time: Sun Jun  9 18:10:57 UTC 2024
  network time: Sun, 09 Jun 2024 18:10:57 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@jieyouxu
Copy link
Member Author

jieyouxu commented Jun 9, 2024

@bors r- (fmt failure?)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 9, 2024
@jieyouxu jieyouxu closed this Jun 9, 2024
@jieyouxu jieyouxu deleted the rollup-oig66ap branch June 9, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.