rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
93.58k stars 12.05k forks source link

Migrate `run-make/rustdoc-error-lines` to new `rmake.rs` #124753

Closed GuillaumeGomez closed 1 week ago

GuillaumeGomez commented 1 week ago

Part of https://github.com/rust-lang/rust/issues/121876.

There was a weird naming inconsistency with input/output. A few tests write .arg("-o").arg(path) and the output method was actually the command output. So instead, I renamed the original output into command_output so that I could create the output method with the expected effect (and updated the tests to use it too).

EDIT: The first two commits come from https://github.com/rust-lang/rust/pull/124711. Some weird things happened recently pparently. ^^'

r? @jieyouxu

rustbot commented 1 week ago

The run-make-support library was changed

cc @jieyouxu

Some changes occurred in run-make tests.

cc @jieyouxu

rust-log-analyzer commented 1 week ago

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) ```plain Getting action download info Download action repository 'msys2/setup-msys2@v2.22.0' (SHA:cc11e9188b693c2b100158c3322424c4cc1dadea) Download action repository 'actions/checkout@v4' (SHA:0ad4b8fadaa221de15dcec353f45205ec38ea70b) 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.435 Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB) #13 0.453 Collecting boolean-py==4.0 #13 0.461 Downloading boolean.py-4.0-py3-none-any.whl (25 kB) #13 0.478 Collecting chardet==5.1.0 --- #13 3.589 Building wheels for collected packages: reuse #13 3.589 Building wheel for reuse (pyproject.toml): started #13 3.910 Building wheel for reuse (pyproject.toml): finished with status 'done' #13 3.910 Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269 #13 3.911 Stored in directory: /tmp/pip-ephem-wheel-cache-halq9s3j/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d #13 3.913 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet #13 3.935 Attempting uninstall: setuptools #13 3.935 Found existing installation: setuptools 59.6.0 #13 3.937 Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr #13 3.937 Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr #13 3.937 Can't uninstall 'setuptools'. No files were found to uninstall. #13 4.607 Successfully installed binaryornot-0.4.4 boolean-py-4.0 chardet-5.1.0 jinja2-3.1.2 license-expression-30.0.0 markupsafe-2.1.1 python-debian-0.1.49 reuse-1.1.0 setuptools-66.0.0 #13 4.607 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 5.116 Collecting virtualenv #13 5.168 Downloading virtualenv-20.26.1-py3-none-any.whl (3.9 MB) #13 5.308 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 28.7 MB/s eta 0:00:00 #13 5.360 Collecting platformdirs<5,>=3.9.1 #13 5.367 Downloading platformdirs-4.2.1-py3-none-any.whl (17 kB) #13 5.402 Collecting filelock<4,>=3.12.2 #13 5.409 Downloading filelock-3.14.0-py3-none-any.whl (12 kB) #13 5.438 Collecting distlib<1,>=0.3.7 #13 5.445 Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB) #13 5.456 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 52.6 MB/s eta 0:00:00 #13 5.542 Installing collected packages: distlib, platformdirs, filelock, virtualenv #13 5.701 Successfully installed distlib-0.3.8 filelock-3.14.0 platformdirs-4.2.1 virtualenv-20.26.1 #13 DONE 5.8s #14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/ #14 DONE 0.0s --- DirectMap4k: 194496 kB DirectMap2M: 7145472 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/06e88c306a180067b6798901c26828d8ed7b0963/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz extracting /checkout/obj/build/cache/llvm-06e88c306a180067b6798901c26828d8ed7b0963-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm --- Finished `release` profile [optimized] target(s) in 25.45s ##[endgroup] fmt check tidy check tidy error: Makefile `/checkout/tests/run-make/rustdoc-error-lines/Makefile` no longer exists and should be removed from the exclusions in `src/tools/tidy/src/allowed_run_make_makefiles.txt`, you can run --bless to update the allow list tidy: Skipping binary file check, read-only filesystem ##[error]tidy error: /checkout/tests/run-make/rustdoc-error-lines/rmake.rs:7: line longer than 100 chars removing old virtual environment creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' Requirement already satisfied: pip in ./build/venv/lib/python3.10/site-packages (24.0) Collecting black==23.3.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 7)) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 16.5 MB/s eta 0:00:00 Collecting click==8.1.3 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 34)) Downloading click-8.1.3-py3-none-any.whl (96 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 31.4 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 31.4 MB/s eta 0:00:00 Collecting importlib-metadata==6.7.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 38)) Downloading importlib_metadata-6.7.0-py3-none-any.whl (22 kB) Collecting mypy-extensions==1.0.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 42)) Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB) Collecting packaging==23.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 46)) Downloading packaging-23.1-py3-none-any.whl (48 kB) Collecting pathspec==0.11.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 50)) Downloading pathspec-0.11.1-py3-none-any.whl (29 kB) Collecting platformdirs==3.6.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 54)) Downloading platformdirs-3.6.0-py3-none-any.whl (16 kB) Downloading platformdirs-3.6.0-py3-none-any.whl (16 kB) Collecting ruff==0.0.272 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 58)) Downloading ruff-0.0.272-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB) Collecting tomli==2.0.1 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 77)) Downloading tomli-2.0.1-py3-none-any.whl (12 kB) Collecting typed-ast==1.5.4 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 81)) Downloading typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (877 kB) Downloading typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (877 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 877.7/877.7 kB 71.8 MB/s eta 0:00:00 Collecting typing-extensions==4.6.3 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 107)) Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB) Collecting zipp==3.15.0 (from -r /checkout/src/tools/tidy/config/requirements.txt (line 114)) Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB) Installing collected packages: zipp, typing-extensions, typed-ast, tomli, ruff, platformdirs, pathspec, packaging, mypy-extensions, click, importlib-metadata, black Successfully installed black-23.3.0 click-8.1.3 importlib-metadata-6.7.0 mypy-extensions-1.0.0 packaging-23.1 pathspec-0.11.1 platformdirs-3.6.0 ruff-0.0.272 tomli-2.0.1 typed-ast-1.5.4 typing-extensions-4.6.3 zipp-3.15.0 some tidy checks failed Build completed unsuccessfully in 0:00:59 local time: Sun May 5 15:13:42 UTC 2024 network time: Sun, 05 May 2024 15:13:42 GMT ```
rust-log-analyzer commented 1 week ago

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) ```plain Getting action download info Download action repository 'msys2/setup-msys2@v2.22.0' (SHA:cc11e9188b693c2b100158c3322424c4cc1dadea) Download action repository 'actions/checkout@v4' (SHA:0ad4b8fadaa221de15dcec353f45205ec38ea70b) 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.420 Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB) #13 0.432 Collecting boolean-py==4.0 #13 0.437 Downloading boolean.py-4.0-py3-none-any.whl (25 kB) #13 0.450 Collecting chardet==5.1.0 --- #13 3.432 Building wheels for collected packages: reuse #13 3.433 Building wheel for reuse (pyproject.toml): started #13 3.752 Building wheel for reuse (pyproject.toml): finished with status 'done' #13 3.752 Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269 #13 3.753 Stored in directory: /tmp/pip-ephem-wheel-cache-gz7q2dx0/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d #13 3.755 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet #13 3.777 Attempting uninstall: setuptools #13 3.778 Found existing installation: setuptools 59.6.0 #13 3.779 Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr #13 3.779 Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr #13 3.779 Can't uninstall 'setuptools'. No files were found to uninstall. #13 4.449 Successfully installed binaryornot-0.4.4 boolean-py-4.0 chardet-5.1.0 jinja2-3.1.2 license-expression-30.0.0 markupsafe-2.1.1 python-debian-0.1.49 reuse-1.1.0 setuptools-66.0.0 #13 4.449 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.951 Collecting virtualenv #13 5.000 Downloading virtualenv-20.26.1-py3-none-any.whl (3.9 MB) #13 5.058 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 69.6 MB/s eta 0:00:00 #13 5.094 Collecting distlib<1,>=0.3.7 #13 5.100 Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB) #13 5.106 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 121.7 MB/s eta 0:00:00 #13 5.133 Collecting platformdirs<5,>=3.9.1 #13 5.137 Downloading platformdirs-4.2.1-py3-none-any.whl (17 kB) #13 5.169 Collecting filelock<4,>=3.12.2 #13 5.173 Downloading filelock-3.14.0-py3-none-any.whl (12 kB) #13 5.259 Installing collected packages: distlib, platformdirs, filelock, virtualenv #13 5.425 Successfully installed distlib-0.3.8 filelock-3.14.0 platformdirs-4.2.1 virtualenv-20.26.1 #13 DONE 5.5s #14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/ #14 DONE 0.0s --- DirectMap4k: 176064 kB DirectMap2M: 9261056 kB DirectMap1G: 9437184 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/06e88c306a180067b6798901c26828d8ed7b0963/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz extracting /checkout/obj/build/cache/llvm-06e88c306a180067b6798901c26828d8ed7b0963-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 24.75s ##[endgroup] fmt check ##[error]Diff in /checkout/tests/run-make/rustdoc-error-lines/rmake.rs at line 4: use run_make_support::rustdoc; fn main() { fn main() { - let output = String::from_utf8(rustdoc().input("input.rs").arg("--test").command_output().stdout).unwrap(); + let output = + String::from_utf8(rustdoc().input("input.rs").arg("--test").command_output().stdout) let should_contains = &[ let should_contains = &[ "input.rs - foo (line 5)", Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/tests/run-make/print-native-static-libs/rmake.rs" "/checkout/tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs" "/checkout/tests/run-make/wasm-custom-section/rmake.rs" "/checkout/tests/run-make/rustdoc-error-lines/rmake.rs" "/checkout/tests/run-make/wasm-panic-small/rmake.rs" "/checkout/tests/run-make/no-input-file/rmake.rs" "/checkout/tests/run-make/issue-107495-archive-permissions/rmake.rs" "/checkout/tests/run-make/artifact-incr-cache-no-obj/rmake.rs" "/checkout/tests/run-make/non-unicode-in-incremental-dir/rmake.rs" "/checkout/tests/run-make/rustdoc-test-args/rmake.rs" "/checkout/tests/run-make/wasm-export-all-symbols/rmake.rs" "/checkout/tests/run-make/artifact-incr-cache/rmake.rs" "/checkout/tests/run-make/print-cfg/rmake.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 May 5 15:21:29 UTC 2024 network time: Sun, 05 May 2024 15:21:29 GMT ##[error]Process completed with exit code 1. Post job cleanup. ```
GuillaumeGomez commented 1 week ago

CI passed this time. :)

jieyouxu commented 1 week ago

Thanks!

@bors r+ rollup

bors commented 1 week ago

:pushpin: Commit bb474aa622098ca10792d0a8717d95dc0f3420fd has been approved by jieyouxu

It is now in the queue for this repository.

matthiaskrgr commented 1 week ago

@bors r- https://github.com/rust-lang/rust/pull/124776

GuillaumeGomez commented 1 week ago

Thanks for the notification, fixed it.

@bors r=jieyouxu rollup

bors commented 1 week ago

:pushpin: Commit 34fe2172b16fb9d80c76e51ab4703bd297d630fe has been approved by jieyouxu

It is now in the queue for this repository.

bors commented 1 week ago

:hourglass: Testing commit 34fe2172b16fb9d80c76e51ab4703bd297d630fe with merge 25e3949aa1b24b3f62a72c1f713830aa1d1efcd4...

bors commented 1 week ago

:sunny: Test successful - checks-actions Approved by: jieyouxu Pushing 25e3949aa1b24b3f62a72c1f713830aa1d1efcd4 to master...

rust-timer commented 1 week ago

Finished benchmarking commit (25e3949aa1b24b3f62a72c1f713830aa1d1efcd4): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment. | | mean | range | count | |:----------------------------------:|:----:|:------------:|:-----:| | Regressions ❌
(primary) | - | - | 0 | | Regressions ❌
(secondary) | 2.0% | [2.0%, 2.0%] | 1 | | Improvements ✅
(primary) | - | - | 0 | | Improvements ✅
(secondary) | - | - | 0 | | All ❌✅ (primary) | - | - | 0 |

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 676.654s -> 676.836s (0.03%) Artifact size: 315.91 MiB -> 315.81 MiB (-0.03%)