Skip to content

Rewrite .gitattributes CRLF ui tests into run-make tests #142925

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Oneirical
Copy link
Contributor

@Oneirical Oneirical commented Jun 23, 2025

These tests are difficult to edit. Even adding a newline to the original UI test breaks it, as all newlines in it are supposed to be \r\n.

In the run-make suite, the test is instead automatically generated with \r\n clearly visible, making fixes easier.

Closes #140033
Closes #139968

r? @jieyouxu

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 23, 2025

jieyouxu is not on the review rotation at the moment.
They may take a while to respond.

@Oneirical Oneirical force-pushed the unattentive-immobility branch 2 times, most recently from 4b34c01 to 1475a51 Compare June 23, 2025 19:25
@rust-log-analyzer

This comment has been minimized.

@Oneirical Oneirical force-pushed the unattentive-immobility branch from 1475a51 to 580b27c Compare June 23, 2025 22:14
@Oneirical Oneirical marked this pull request as ready for review June 23, 2025 22:16
@rustbot
Copy link
Collaborator

rustbot commented Jun 23, 2025

This PR modifies run-make tests.

cc @jieyouxu

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 23, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/json-bom-plus-crlf stdout ----

error: run-make test failed: could not build `rmake.rs` recipe
status: exit status: 1
command: RUSTC_BOOTSTRAP="-1" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/rustc" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/run-make/json-bom-plus-crlf/rmake" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release/deps" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/release/deps" "--extern" "run_make_support=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release/librun_make_support.rlib" "--edition=2021" "/checkout/tests/run-make/json-bom-plus-crlf/rmake.rs" "-Cprefer-dynamic" "-Dunused_must_use"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `run_make_support::tmp_dir`
##[error] --> /checkout/tests/run-make/json-bom-plus-crlf/rmake.rs:4:42
  |
4 | use run_make_support::{diff, rfs, rustc, tmp_dir};
  |                                          ^^^^^^^ no `tmp_dir` in the root

error[E0599]: no method named `unwrap` found for unit type `()` in the current scope
##[error]  --> /checkout/tests/run-make/json-bom-plus-crlf/rmake.rs:23:42
   |
23 |     rfs::write(&main_path, main_content).unwrap();
   |                                          ^^^^^^ method not found in `()`

error[E0599]: no method named `unwrap` found for struct `Vec<u8>` in the current scope
##[error]  --> /checkout/tests/run-make/json-bom-plus-crlf/rmake.rs:25:44
   |
25 |     let main_bytes = rfs::read(&main_path).unwrap();
   |                                            ^^^^^^
   |
help: there is a method `swap` with a similar name, but with different arguments
  --> /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/slice/mod.rs:896:5

---
---- [run-make] tests/run-make/json-bom-plus-crlf-multifile stdout ----

error: run-make test failed: could not build `rmake.rs` recipe
status: exit status: 1
command: RUSTC_BOOTSTRAP="-1" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/rustc" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/run-make/json-bom-plus-crlf-multifile/rmake" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release/deps" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/release/deps" "--extern" "run_make_support=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release/librun_make_support.rlib" "--edition=2021" "/checkout/tests/run-make/json-bom-plus-crlf-multifile/rmake.rs" "-Cprefer-dynamic" "-Dunused_must_use"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `run_make_support::tmp_dir`
##[error] --> /checkout/tests/run-make/json-bom-plus-crlf-multifile/rmake.rs:4:36
  |
---

error[E0599]: no method named `unwrap` found for unit type `()` in the current scope
##[error]  --> /checkout/tests/run-make/json-bom-plus-crlf-multifile/rmake.rs:22:84
   |
22 |     rfs::write(tmp_dir().join("json-bom-plus-crlf-multifile-aux.rs"), aux_content).unwrap();
   |                                                                                    ^^^^^^ method not found in `()`

error[E0599]: no method named `unwrap` found for struct `Vec<u8>` in the current scope
##[error]  --> /checkout/tests/run-make/json-bom-plus-crlf-multifile/rmake.rs:24:86
   |
24 |     let aux_bytes = rfs::read(tmp_dir().join("json-bom-plus-crlf-multifile-aux.rs")).unwrap();
   |                                                                                      ^^^^^^
   |
help: there is a method `swap` with a similar name, but with different arguments
  --> /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/slice/mod.rs:896:5

error[E0599]: no method named `unwrap` found for unit type `()` in the current scope
##[error]  --> /checkout/tests/run-make/json-bom-plus-crlf-multifile/rmake.rs:36:81
   |
36 |     rfs::write(tmp_dir().join("json-bom-plus-crlf-multifile.rs"), main_content).unwrap();
   |                                                                                 ^^^^^^ method not found in `()`

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0425, E0432, E0599.
For more information about an error, try `rustc --explain E0425`.
------------------------------------------


---- [run-make] tests/run-make/lexer-crlf-line-endings-string-literal-doc-comment stdout ----

error: run-make test failed: could not build `rmake.rs` recipe
status: exit status: 1
command: RUSTC_BOOTSTRAP="-1" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/rustc" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/run-make/lexer-crlf-line-endings-string-literal-doc-comment/rmake" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release/deps" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/release/deps" "--extern" "run_make_support=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release/librun_make_support.rlib" "--edition=2021" "/checkout/tests/run-make/lexer-crlf-line-endings-string-literal-doc-comment/rmake.rs" "-Cprefer-dynamic" "-Dunused_must_use"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `run_make_support::tmp_dir`
##[error] --> /checkout/tests/run-make/lexer-crlf-line-endings-string-literal-doc-comment/rmake.rs:3:41
  |
---

error[E0599]: no method named `unwrap` found for unit type `()` in the current scope
##[error]  --> /checkout/tests/run-make/lexer-crlf-line-endings-string-literal-doc-comment/rmake.rs:33:42
   |
33 |     rfs::write(&test_path, test_content).unwrap();
   |                                          ^^^^^^ method not found in `()`

error[E0599]: no method named `unwrap` found for struct `Vec<u8>` in the current scope
##[error]  --> /checkout/tests/run-make/lexer-crlf-line-endings-string-literal-doc-comment/rmake.rs:35:44
   |
35 |     let test_bytes = rfs::read(&test_path).unwrap();
   |                                            ^^^^^^
   |
help: there is a method `swap` with a similar name, but with different arguments
  --> /rustc/95597e848d27a82b8864c677ab807e9f0be1f68c/library/core/src/slice/mod.rs:896:5

---
---- [run-make] tests/run-make/trailing-carriage-return-in-string stdout ----

error: run-make test failed: could not build `rmake.rs` recipe
status: exit status: 1
command: RUSTC_BOOTSTRAP="-1" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/rustc" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/run-make/trailing-carriage-return-in-string/rmake" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release/deps" "-Ldependency=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/release/deps" "--extern" "run_make_support=/checkout/obj/build/aarch64-unknown-linux-gnu/bootstrap-tools/aarch64-unknown-linux-gnu/release/librun_make_support.rlib" "--edition=2021" "/checkout/tests/run-make/trailing-carriage-return-in-string/rmake.rs" "-Cprefer-dynamic" "-Dunused_must_use"
stdout: none
--- stderr -------------------------------
error[E0432]: unresolved import `run_make_support::tmp_dir`
##[error] --> /checkout/tests/run-make/trailing-carriage-return-in-string/rmake.rs:1:42
  |
1 | use run_make_support::{diff, rfs, rustc, tmp_dir};
  |                                          ^^^^^^^ no `tmp_dir` in the root

error[E0599]: no method named `unwrap` found for unit type `()` in the current scope
##[error]  --> /checkout/tests/run-make/trailing-carriage-return-in-string/rmake.rs:14:42
   |
14 |     rfs::write(&test_path, test_content).unwrap();
   |                                          ^^^^^^ method not found in `()`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.

@jieyouxu
Copy link
Member

@rustbot author

@rustbot rustbot 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 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 24, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
4 participants