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

Canonicalize path when displaying a FileName::Real #83345

Closed

Conversation

basavesh
Copy link
Contributor

Addresses #51349 (?)
Follow-up #68654

Currently, I see two rustdoc tests failing. Not sure If I should add test cases or modify something else.

r? @estebank

Errors
---- [rustdoc] rustdoc/test_option_check/test.rs stdout ----

error: No test has been found... {"src/test/rustdoc/test_option_check/test.rs": [8, 15], "src/test/rustdoc/test_option_check/bar.rs": [6]}

---- [rustdoc] rustdoc/test_option_check/bar.rs stdout ----

error: No test has been found... {"src/test/rustdoc/test_option_check/bar.rs": [6]}
status: exit code: 0

failures:
[rustdoc] rustdoc/test_option_check/bar.rs
[rustdoc] rustdoc/test_option_check/test.rs

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 21, 2021
@rust-log-analyzer

This comment has been minimized.

@basavesh
Copy link
Contributor Author

The issue seems to be
f.rs:9:5 v/s /checkout/src/test/run-make-fulldeps/libtest-json/f.rs:9:5

{"type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:9:5\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\n" }
3248
3249
{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', /checkout/src/test/run-make-fulldeps/libtest-json/f.rs:9:5\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\n" }

@basavesh basavesh force-pushed the canonicalize_path_in_error branch from 46886d1 to b8737b4 Compare March 21, 2021 23:00
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-9 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 9300/11706
.................................................................................................... 9400/11706
.................................................................................................... 9500/11706
...............................................i......i............................................. 9600/11706
.............................................................................................iiiiiii 9700/11706
..iiiiii.i.......................................................................................... 9800/11706
.................................................................................................... 10000/11706
.................................................................................................... 10100/11706
.................................................................................................... 10200/11706
.................................................................................................... 10300/11706
---
Suite("src/test/assembly") not skipped for "bootstrap::test::Assembly" -- not in ["src/tools/tidy"]
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 31 tests
iiiiiiiiiiiiiiiiiiiiiiiiiiiii..

 finished in 0.116 seconds
Suite("src/test/incremental") not skipped for "bootstrap::test::Incremental" -- not in ["src/tools/tidy"]
Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
Suite("src/test/debuginfo") not skipped for "bootstrap::test::Debuginfo" -- not in ["src/tools/tidy"]
Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 116 tests
iiiiiiiiii.i.i..i..i..ii....i.i....ii..........iiii.........i.....i...i.......ii.i.ii.....iiii.....i 100/116
test result: ok. 78 passed; 0 failed; 38 ignored; 0 measured; 0 filtered out; finished in 2.33s

 finished in 2.406 seconds
Suite("src/test/ui-fulldeps") not skipped for "bootstrap::test::UiFullDeps" -- not in ["src/tools/tidy"]
---
Suite("src/test/run-make") not skipped for "bootstrap::test::RunMake" -- not in ["src/tools/tidy"]
Check compiletest suite=run-make mode=run-make (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 22 tests
Some tests failed in compiletest suite=run-make mode=run-make host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
iiiiiiiiiiii.F........

---- [run-make] run-make/const_fn_mir stdout ----

error: make failed
error: make failed
status: exit code: 2
command: "make"
stdout:
------------------------------------------
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/const_fn_mir/const_fn_mir:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/const_fn_mir/const_fn_mir -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/const_fn_mir/const_fn_mir  main.rs --emit=mir -o "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/const_fn_mir/const_fn_mir"/dump.mir
diff -u --strip-trailing-cr dump.mir "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/const_fn_mir/const_fn_mir"/dump.mir
--- dump.mir 2021-03-21 23:01:13.940226871 +0000
+++ /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/const_fn_mir/const_fn_mir/dump.mir 2021-03-21 23:34:25.387132655 +0000
@@ -1,42 +1,42 @@
 // WARNING: This output format is intended for human consumers only
 // and is subject to change without notice. Knock yourself out.
 fn main() -> () {
-    let mut _0: ();                      // return place in scope 0 at main.rs:8:11: 8:11
-    let _1: i32;                         // in scope 0 at main.rs:9:5: 9:10
+    let mut _0: ();                      // return place in scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:8:11: 8:11
+    let _1: i32;                         // in scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:9:5: 9:10
     bb0: {
     bb0: {
-        _1 = foo() -> bb1;               // scope 0 at main.rs:9:5: 9:10
+        _1 = foo() -> bb1;               // scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:9:5: 9:10
                                          // mir::Constant
-                                         // + span: main.rs:9:5: 9:8
+                                         // + span: /checkout/src/test/run-make/const_fn_mir/main.rs:9:5: 9:8
                                          // + literal: Const { ty: fn() -> i32 {foo}, val: Value(Scalar(<ZST>)) }
 
     bb1: {
     bb1: {
-        return;                          // scope 0 at main.rs:10:2: 10:2
+        return;                          // scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:10:2: 10:2
 }
 
 fn foo() -> i32 {
 fn foo() -> i32 {
-    let mut _0: i32;                     // return place in scope 0 at main.rs:4:19: 4:22
+    let mut _0: i32;                     // return place in scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:4:19: 4:22
     bb0: {
     bb0: {
-        _0 = const 11_i32;               // scope 0 at main.rs:5:5: 5:10
-        return;                          // scope 0 at main.rs:6:2: 6:2
+        _0 = const 11_i32;               // scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:5:5: 5:10
+        return;                          // scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:6:2: 6:2
 }
 
 
 // MIR FOR CTFE
 fn foo() -> i32 {
-    let mut _0: i32;                     // return place in scope 0 at main.rs:4:19: 4:22
-    let mut _1: (i32, bool);             // in scope 0 at main.rs:5:5: 5:10
+    let mut _0: i32;                     // return place in scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:4:19: 4:22
+    let mut _1: (i32, bool);             // in scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:5:5: 5:10
     bb0: {
     bb0: {
-        _1 = CheckedAdd(const 5_i32, const 6_i32); // scope 0 at main.rs:5:5: 5:10
-        assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> bb1; // scope 0 at main.rs:5:5: 5:10
+        _1 = CheckedAdd(const 5_i32, const 6_i32); // scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:5:5: 5:10
+        assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> bb1; // scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:5:5: 5:10
 
     bb1: {
     bb1: {
-        _0 = move (_1.0: i32);           // scope 0 at main.rs:5:5: 5:10
-        return;                          // scope 0 at main.rs:6:2: 6:2
+        _0 = move (_1.0: i32);           // scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:5:5: 5:10
+        return;                          // scope 0 at /checkout/src/test/run-make/const_fn_mir/main.rs:6:2: 6:2
 }
Makefile:4: recipe for target 'all' failed

------------------------------------------
------------------------------------------
stderr:
------------------------------------------
warning: ignoring --out-dir flag due to -o flag

warning: 1 warning emitted

make: *** [all] Error 1
------------------------------------------




failures:
    [run-make] run-make/const_fn_mir

test result: FAILED. 9 passed; 1 failed; 12 ignored; 0 measured; 0 filtered out; finished in 0.55s



command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/run-make" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "run-make" "--mode" "run-make" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-9/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--llvm-bin-dir" "/usr/lib/llvm-9/bin" "--cc" "cc" "--cxx" "c++" "--cflags" "-ffunction-sections -fdata-sections -fPIC -m64" "--ar" "ar" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test --exclude src/tools/tidy
Build completed unsuccessfully in 0:30:39

@basavesh
Copy link
Contributor Author

@estebank Do you think it is worth fixing this?

@estebank
Copy link
Contributor

It would be worth fixing this and adding tests specifically for the case being addressed. The tests failing now are because we now output the full path for files instead of the relative path. I think we would want the current behavior to remain and for the case of extract/tests/query/../helper.rs the output should be extract/tests/helper.rs instead of /full/path/to/extract/tests/helper.rs, which might not be a trivial thing to do.

@basavesh
Copy link
Contributor Author

Closing this pull request for now.

@basavesh basavesh closed this Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants