Skip to content

Rustdoc copy local img #68734

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

Closed

Conversation

GuillaumeGomez
Copy link
Member

Fixes #32104.

r? @kinnison

@JohnTitor JohnTitor added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 1, 2020
@kinnison
Copy link
Contributor

kinnison commented Feb 1, 2020

@GuillaumeGomez While the approach of hashing the URL is cheap, it's also a bit risky. Consider a library which has some image it uses from a lot of places to illustrate things. Those places may all have subtly different paths to the same object (different numbers of ..s for example) and so we may end up with the same potentially large resource repeated many times. It would be better to hash the content of the file instead -- is there a reason you chose not to?

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-02-01T17:42:32.2561421Z ========================== Starting Command Output ===========================
2020-02-01T17:42:32.2564885Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/9fa36c1f-a6ab-4c1c-b1e6-d18e8f4d6e43.sh
2020-02-01T17:42:32.2565144Z 
2020-02-01T17:42:32.2575388Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-01T17:42:32.2587373Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68734/merge to s
2020-02-01T17:42:32.2590384Z Task         : Get sources
2020-02-01T17:42:32.2590418Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-01T17:42:32.2590499Z Version      : 1.0.0
2020-02-01T17:42:32.2590531Z Author       : Microsoft
---
2020-02-01T17:42:33.3178028Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-01T17:42:33.3188880Z ##[command]git config gc.auto 0
2020-02-01T17:42:33.3191102Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-01T17:42:33.3193232Z ##[command]git config --get-all http.proxy
2020-02-01T17:42:33.3201420Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68734/merge:refs/remotes/pull/68734/merge
---
2020-02-01T18:40:30.1453362Z .................................................................................................... 1700/9561
2020-02-01T18:40:35.2617009Z .................................................................................................... 1800/9561
2020-02-01T18:40:48.2116936Z .........................i.......................................................................... 1900/9561
2020-02-01T18:40:55.3249740Z .................................................................................................... 2000/9561
2020-02-01T18:41:10.1823338Z ...............iiiii................................................................................ 2100/9561
2020-02-01T18:41:20.1880717Z .................................................................................................... 2300/9561
2020-02-01T18:41:22.6558052Z .................................................................................................... 2400/9561
2020-02-01T18:41:27.8450280Z .................................................................................................... 2500/9561
2020-02-01T18:41:49.4533916Z .................................................................................................... 2600/9561
---
2020-02-01T18:44:29.0990205Z .................................................................................................... 4800/9561
2020-02-01T18:44:34.5888206Z ..........................................................i...............i......................... 4900/9561
2020-02-01T18:44:42.6495407Z .................................................................................................... 5000/9561
2020-02-01T18:44:51.0492747Z .................................................................................................... 5100/9561
2020-02-01T18:44:56.0682177Z .i.................................................................................................. 5200/9561
2020-02-01T18:45:07.3206764Z ...........................................................................ii.ii........i...i....... 5300/9561
2020-02-01T18:45:16.0135357Z .............i...................................................................................... 5500/9561
2020-02-01T18:45:26.2151673Z .................................................................................................... 5600/9561
2020-02-01T18:45:32.8356966Z ..............................................................i..................................... 5700/9561
2020-02-01T18:45:40.2445735Z .................................................................................................... 5800/9561
2020-02-01T18:45:40.2445735Z .................................................................................................... 5800/9561
2020-02-01T18:45:48.2517752Z .................................................................................................... 5900/9561
2020-02-01T18:45:57.4389601Z .....................................................ii...i..ii...........i......................... 6000/9561
2020-02-01T18:46:19.6310295Z .................................................................................................... 6200/9561
2020-02-01T18:46:27.4215899Z .................................................................................................... 6300/9561
2020-02-01T18:46:27.4215899Z .................................................................................................... 6300/9561
2020-02-01T18:46:36.1598811Z .................................................................................i..ii.............. 6400/9561
2020-02-01T18:47:10.1876008Z .................................................................................................... 6600/9561
2020-02-01T18:47:15.8368112Z .........................................................i.......................................... 6700/9561
2020-02-01T18:47:18.0704215Z .................................................................................................... 6800/9561
2020-02-01T18:47:20.4473154Z ..........................................................i......................................... 6900/9561
---
2020-02-01T18:49:06.0561899Z .................................................................................................... 7600/9561
2020-02-01T18:49:11.6825144Z .................................................................................................... 7700/9561
2020-02-01T18:49:18.7399929Z .................................................................................................... 7800/9561
2020-02-01T18:49:30.0540919Z .................................................................................................... 7900/9561
2020-02-01T18:49:36.4295217Z ..............iiiiiii.i............................................................................. 8000/9561
2020-02-01T18:49:51.5142621Z .................................................................................................... 8200/9561
2020-02-01T18:50:02.2235548Z .................................................................................................... 8300/9561
2020-02-01T18:50:15.9894081Z .................................................................................................... 8400/9561
2020-02-01T18:50:23.1773884Z .................................................................................................... 8500/9561
---
2020-02-01T18:52:47.7014085Z  finished in 7.402
2020-02-01T18:52:47.7209024Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T18:52:47.8815223Z 
2020-02-01T18:52:47.8816595Z running 169 tests
2020-02-01T18:52:51.0016150Z iiii......i........ii..iiii...i....i...........i............i..i..................i....i............ 100/169
2020-02-01T18:52:53.2446601Z i.i.i...iii..iiiiiiiiii.......................iii............ii......
2020-02-01T18:52:53.2447820Z 
2020-02-01T18:52:53.2450373Z  finished in 5.524
2020-02-01T18:52:53.2666535Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T18:52:53.4236992Z 
---
2020-02-01T18:52:56.3207957Z  finished in 2.219
2020-02-01T18:52:56.3208254Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T18:52:56.3208316Z 
2020-02-01T18:52:56.3208359Z running 9 tests
2020-02-01T18:52:56.3208647Z iiiiiiiii
2020-02-01T18:52:56.3208967Z 
2020-02-01T18:52:56.3209008Z  finished in 0.158
2020-02-01T18:52:56.3209288Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T18:52:56.3209649Z 
---
2020-02-01T18:53:16.6416954Z  finished in 20.958
2020-02-01T18:53:16.6625072Z Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T18:53:16.8413097Z 
2020-02-01T18:53:16.8413818Z running 116 tests
2020-02-01T18:53:31.5232939Z iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii..........i.....i..i.......ii.i.ii. 100/116
2020-02-01T18:53:33.6550467Z ....iiii.....ii.
2020-02-01T18:53:33.6552290Z 
2020-02-01T18:53:33.6553164Z  finished in 16.992
2020-02-01T18:53:33.6558195Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T18:53:33.6558558Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2020-02-01T19:00:56.7872838Z ..................................................................................i................. 300/338
2020-02-01T19:01:19.4197075Z ......................................
2020-02-01T19:01:19.4198076Z failures:
2020-02-01T19:01:19.4200641Z 
2020-02-01T19:01:19.4201368Z ---- [rustdoc] rustdoc/copy-local-img.rs stdout ----
2020-02-01T19:01:19.4201745Z 
2020-02-01T19:01:19.4202008Z error: htmldocck failed!
2020-02-01T19:01:19.4202252Z status: exit code: 1
2020-02-01T19:01:19.4202945Z command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/copy-local-img" "/checkout/src/test/rustdoc/copy-local-img.rs"
2020-02-01T19:01:19.4203903Z ------------------------------------------
2020-02-01T19:01:19.4204196Z 
2020-02-01T19:01:19.4204676Z ------------------------------------------
2020-02-01T19:01:19.4205003Z stderr:
2020-02-01T19:01:19.4205003Z stderr:
2020-02-01T19:01:19.4205483Z ------------------------------------------
2020-02-01T19:01:19.4205797Z 3: @has check failed
2020-02-01T19:01:19.4206303Z  File does not exist 'static/d3212ae9b701da87'
2020-02-01T19:01:19.4206616Z  // @has static/d3212ae9b701da87
2020-02-01T19:01:19.4207103Z Encountered 1 errors
2020-02-01T19:01:19.4207326Z 
2020-02-01T19:01:19.4207817Z ------------------------------------------
2020-02-01T19:01:19.4208099Z 
2020-02-01T19:01:19.4208099Z 
2020-02-01T19:01:19.4208346Z 
2020-02-01T19:01:19.4208557Z 
2020-02-01T19:01:19.4208788Z failures:
2020-02-01T19:01:19.4209309Z     [rustdoc] rustdoc/copy-local-img.rs
2020-02-01T19:01:19.4212270Z test result: FAILED. 334 passed; 1 failed; 3 ignored; 0 measured; 0 filtered out
2020-02-01T19:01:19.4212683Z 
2020-02-01T19:01:19.4215145Z 
2020-02-01T19:01:19.4215458Z 
2020-02-01T19:01:19.4215458Z 
2020-02-01T19:01:19.4217520Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "/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/rustdoc" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/bin/FileCheck" "--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/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-02-01T19:01:19.4220790Z 
2020-02-01T19:01:19.4221031Z 
2020-02-01T19:01:19.4291727Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-02-01T19:01:19.4293900Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-02-01T19:01:19.4293900Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-02-01T19:01:19.4297477Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-02-01T19:01:19.4298851Z Build completed unsuccessfully in 1:12:55
2020-02-01T19:01:19.4301584Z == clock drift check ==
2020-02-01T19:01:19.4322630Z   local time: Sat Feb  1 19:01:19 UTC 2020
2020-02-01T19:01:19.7271584Z   network time: Sat, 01 Feb 2020 19:01:19 GMT
2020-02-01T19:01:19.7277193Z == end clock drift check ==
2020-02-01T19:01:20.8724113Z 
2020-02-01T19:01:20.8829788Z ##[error]Bash exited with code '1'.
2020-02-01T19:01:20.8842280Z ##[section]Finishing: Run build
2020-02-01T19:01:20.8878811Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68734/merge to s
2020-02-01T19:01:20.8880637Z Task         : Get sources
2020-02-01T19:01:20.8880685Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-01T19:01:20.8880731Z Version      : 1.0.0
2020-02-01T19:01:20.8880779Z Author       : Microsoft
2020-02-01T19:01:20.8880779Z Author       : Microsoft
2020-02-01T19:01:20.8880825Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-01T19:01:20.8880874Z ==============================================================================
2020-02-01T19:01:21.3762913Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-01T19:01:21.3816539Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68734/merge to s
2020-02-01T19:01:21.3943150Z Cleaning up task key
2020-02-01T19:01:21.3944084Z Start cleaning up orphan processes.
2020-02-01T19:01:21.4067234Z Terminate orphan process: pid (5114) (python)
2020-02-01T19:01:21.4311127Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@GuillaumeGomez
Copy link
Member Author

@kinnison This is a very good point. Maybe storing a checksum instead maybe and use it as name? What do you think?

@GuillaumeGomez
Copy link
Member Author

I realized that we could get the full path from a path and therefore generate a same hash every time.

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-02-01T21:03:00.3532154Z ========================== Starting Command Output ===========================
2020-02-01T21:03:00.3547405Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/01a434ac-001b-46a0-a933-82d5d52bd71e.sh
2020-02-01T21:03:00.7402184Z 
2020-02-01T21:03:00.7457401Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-01T21:03:00.7463231Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68734/merge to s
2020-02-01T21:03:00.7464648Z Task         : Get sources
2020-02-01T21:03:00.7464675Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-01T21:03:00.7464703Z Version      : 1.0.0
2020-02-01T21:03:00.7464767Z Author       : Microsoft
---
2020-02-01T21:03:05.5307889Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-01T21:03:05.5729523Z ##[command]git config gc.auto 0
2020-02-01T21:03:05.5804669Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-01T21:03:05.5847748Z ##[command]git config --get-all http.proxy
2020-02-01T21:03:05.5972250Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68734/merge:refs/remotes/pull/68734/merge
---
2020-02-01T21:51:43.5193125Z .................................................................................................... 1700/9561
2020-02-01T21:51:47.6611775Z .................................................................................................... 1800/9561
2020-02-01T21:51:58.3343541Z .........................i.......................................................................... 1900/9561
2020-02-01T21:52:04.1916424Z .................................................................................................... 2000/9561
2020-02-01T21:52:16.3982329Z ...............iiiii................................................................................ 2100/9561
2020-02-01T21:52:24.5505170Z .................................................................................................... 2300/9561
2020-02-01T21:52:26.5581619Z .................................................................................................... 2400/9561
2020-02-01T21:52:30.8161049Z .................................................................................................... 2500/9561
2020-02-01T21:52:48.3040577Z .................................................................................................... 2600/9561
---
2020-02-01T21:54:57.8053470Z .................................................................................................... 4800/9561
2020-02-01T21:55:02.0032084Z ..........................................................i...............i......................... 4900/9561
2020-02-01T21:55:08.7123093Z .................................................................................................... 5000/9561
2020-02-01T21:55:15.6480024Z .................................................................................................... 5100/9561
2020-02-01T21:55:20.0103514Z .i.................................................................................................. 5200/9561
2020-02-01T21:55:29.5867392Z ...........................................................................ii.ii........i...i....... 5300/9561
2020-02-01T21:55:37.0978936Z .............i...................................................................................... 5500/9561
2020-02-01T21:55:45.7430998Z .................................................................................................... 5600/9561
2020-02-01T21:55:51.3968749Z ..............................................................i..................................... 5700/9561
2020-02-01T21:55:57.8016658Z .................................................................................................... 5800/9561
2020-02-01T21:55:57.8016658Z .................................................................................................... 5800/9561
2020-02-01T21:56:04.6424475Z .................................................................................................... 5900/9561
2020-02-01T21:56:12.2899014Z .....................................................ii...i..ii...........i......................... 6000/9561
2020-02-01T21:56:31.3183515Z .................................................................................................... 6200/9561
2020-02-01T21:56:37.8079364Z .................................................................................................... 6300/9561
2020-02-01T21:56:37.8079364Z .................................................................................................... 6300/9561
2020-02-01T21:56:44.8460053Z .................................................................................i..ii.............. 6400/9561
2020-02-01T21:57:08.7426407Z .................................................................................................... 6600/9561
2020-02-01T21:57:13.2556988Z .........................................................i.......................................... 6700/9561
2020-02-01T21:57:15.0448142Z .................................................................................................... 6800/9561
2020-02-01T21:57:16.9248037Z ..........................................................i......................................... 6900/9561
---
2020-02-01T21:58:42.1908616Z .................................................................................................... 7600/9561
2020-02-01T21:58:46.7118430Z .................................................................................................... 7700/9561
2020-02-01T21:58:52.3727560Z .................................................................................................... 7800/9561
2020-02-01T21:59:01.2728156Z .................................................................................................... 7900/9561
2020-02-01T21:59:06.3597685Z ..............iiiiiii.i............................................................................. 8000/9561
2020-02-01T21:59:18.5933874Z .................................................................................................... 8200/9561
2020-02-01T21:59:27.1755370Z .................................................................................................... 8300/9561
2020-02-01T21:59:38.4691019Z .................................................................................................... 8400/9561
2020-02-01T21:59:44.4058682Z .................................................................................................... 8500/9561
---
2020-02-01T22:01:44.8722800Z  finished in 6.395
2020-02-01T22:01:44.8876580Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T22:01:45.0247645Z 
2020-02-01T22:01:45.0247989Z running 172 tests
2020-02-01T22:01:47.6364130Z iiii......i...........ii..iiii...i....i...........i............i..i..................i....i......... 100/172
2020-02-01T22:01:49.6312408Z ...i.i.i...iii..iiiiiiiiii.......................iii............ii......
2020-02-01T22:01:49.6315795Z 
2020-02-01T22:01:49.6322302Z  finished in 4.744
2020-02-01T22:01:49.6509316Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T22:01:49.7780248Z 
---
2020-02-01T22:01:51.4236635Z  finished in 1.772
2020-02-01T22:01:51.4381523Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T22:01:51.5793047Z 
2020-02-01T22:01:51.5793397Z running 9 tests
2020-02-01T22:01:51.5794207Z iiiiiiiii
2020-02-01T22:01:51.5794491Z 
2020-02-01T22:01:51.5794577Z  finished in 0.141
2020-02-01T22:01:51.5946081Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T22:01:51.7404319Z 
---
2020-02-01T22:02:08.5865712Z  finished in 16.992
2020-02-01T22:02:08.6029286Z Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T22:02:08.7300065Z 
2020-02-01T22:02:08.7300677Z running 116 tests
2020-02-01T22:02:20.2394175Z iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii..........i.....i..i.......ii.i.ii. 100/116
2020-02-01T22:02:21.8269549Z ....iiii.....ii.
2020-02-01T22:02:21.8269958Z 
2020-02-01T22:02:21.8270054Z  finished in 13.223
2020-02-01T22:02:21.8275702Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-02-01T22:02:21.8275965Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2020-02-01T22:08:28.9303062Z ..................................................................................i................. 300/338
2020-02-01T22:08:47.7910780Z ......................................
2020-02-01T22:08:47.7911482Z failures:
2020-02-01T22:08:47.7911616Z 
2020-02-01T22:08:47.7911991Z ---- [rustdoc] rustdoc/copy-local-img.rs stdout ----
2020-02-01T22:08:47.7912725Z 
2020-02-01T22:08:47.7912927Z error: htmldocck failed!
2020-02-01T22:08:47.7913067Z status: exit code: 1
2020-02-01T22:08:47.7913582Z command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/copy-local-img" "/checkout/src/test/rustdoc/copy-local-img.rs"
2020-02-01T22:08:47.7914065Z ------------------------------------------
2020-02-01T22:08:47.7914227Z 
2020-02-01T22:08:47.7914520Z ------------------------------------------
2020-02-01T22:08:47.7914670Z stderr:
2020-02-01T22:08:47.7914670Z stderr:
2020-02-01T22:08:47.7914981Z ------------------------------------------
2020-02-01T22:08:47.7915131Z 3: @has check failed
2020-02-01T22:08:47.7915435Z  File does not exist 'static/8a40d4987fbb905'
2020-02-01T22:08:47.7915617Z  // @has static/8a40d4987fbb905
2020-02-01T22:08:47.7915737Z 5: @has check failed
2020-02-01T22:08:47.7915897Z  `XPATH PATTERN` did not match
2020-02-01T22:08:47.7916207Z  // @has - '//img[@src="../static/8a40d4987fbb905"]' ''
2020-02-01T22:08:47.7916481Z Encountered 2 errors
2020-02-01T22:08:47.7916607Z 
2020-02-01T22:08:47.7916897Z ------------------------------------------
2020-02-01T22:08:47.7917030Z 
2020-02-01T22:08:47.7917030Z 
2020-02-01T22:08:47.7917153Z 
2020-02-01T22:08:47.7917254Z 
2020-02-01T22:08:47.7917370Z failures:
2020-02-01T22:08:47.7917655Z     [rustdoc] rustdoc/copy-local-img.rs
2020-02-01T22:08:47.7918145Z test result: FAILED. 334 passed; 1 failed; 3 ignored; 0 measured; 0 filtered out
2020-02-01T22:08:47.7918283Z 
2020-02-01T22:08:47.7918697Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-02-01T22:08:47.7919026Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-02-01T22:08:47.7919026Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-02-01T22:08:47.7924801Z 
2020-02-01T22:08:47.7925014Z 
2020-02-01T22:08:47.7926984Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "/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/rustdoc" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/bin/FileCheck" "--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/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-02-01T22:08:47.7927678Z 
2020-02-01T22:08:47.7927783Z 
2020-02-01T22:08:47.7933313Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-02-01T22:08:47.7933398Z Build completed unsuccessfully in 1:00:03
2020-02-01T22:08:47.7933398Z Build completed unsuccessfully in 1:00:03
2020-02-01T22:08:47.7988274Z == clock drift check ==
2020-02-01T22:08:47.8003007Z   local time: Sat Feb  1 22:08:47 UTC 2020
2020-02-01T22:08:48.8971977Z   network time: Sat, 01 Feb 2020 22:08:48 GMT
2020-02-01T22:08:48.8972830Z == end clock drift check ==
2020-02-01T22:08:49.6397327Z 
2020-02-01T22:08:49.6514352Z ##[error]Bash exited with code '1'.
2020-02-01T22:08:49.6529431Z ##[section]Finishing: Run build
2020-02-01T22:08:49.6548342Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68734/merge to s
2020-02-01T22:08:49.6550009Z Task         : Get sources
2020-02-01T22:08:49.6550052Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-01T22:08:49.6550090Z Version      : 1.0.0
2020-02-01T22:08:49.6550144Z Author       : Microsoft
2020-02-01T22:08:49.6550144Z Author       : Microsoft
2020-02-01T22:08:49.6550182Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-01T22:08:49.6550223Z ==============================================================================
2020-02-01T22:08:50.0460251Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-01T22:08:50.0501762Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68734/merge to s
2020-02-01T22:08:50.0608444Z Cleaning up task key
2020-02-01T22:08:50.0609337Z Start cleaning up orphan processes.
2020-02-01T22:08:50.1041591Z Terminate orphan process: pid (4666) (python)
2020-02-01T22:08:50.1067632Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kinnison
Copy link
Contributor

kinnison commented Feb 1, 2020

If you've resolved the filename to a canonical path before hashing then that sounds fine to me. It will make it harder to match exact hashes in your test though.

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with the approach, but I think the test will need rethinking.

Comment on lines +3 to +5
// @has static/8a40d4987fbb905
// @has foo/struct.Enum.html
// @has - '//img[@src="../static/8a40d4987fbb905"]' ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fear these hashes won't be consistent between systems now that the filename is canonicalised. Is there a cut-down test which will still work here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, didn't think about that, the hash will fail indeed. Great catch! I can add something to count files in the given folder and add a "start with" thing. Unless you have another idea?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One option could indeed be that. Another -- hash the file as part of the deduplication effort, but then simply number them as you add them to the static/ dir?

@kinnison kinnison 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 Feb 1, 2020
@ollie27
Copy link
Member

ollie27 commented Feb 2, 2020

There will need to be some way to explicitly opt-in to this feature. As it stands this could break the docs for people already using relative paths to images. Additionally missing files should be errors.

The main issue I see with this implementation is that it resolves paths to the images relative to rustdoc's current directory. Even if that were changed to be relative to the source file, it can't be rustdoc which actually loads the file because rustdoc doesn't have access to the source files of external crates so cross-crate inlining won't work.

I think this will have to be implemented similarly to #[doc(include)] where the file is loaded by rustc, something like #[doc(include_image = "../image.png")] perhaps.

@joelpalmer
Copy link

Triaged

@joelpalmer joelpalmer 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 23, 2020
@bors
Copy link
Collaborator

bors commented Mar 28, 2020

☔ The latest upstream changes (presumably #70499) made this pull request unmergeable. Please resolve the merge conflicts.

@joelpalmer joelpalmer 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 6, 2020
@joelpalmer joelpalmer 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 14, 2020
@crlf0710 crlf0710 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 24, 2020
@crlf0710 crlf0710 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 2, 2020
@joelpalmer joelpalmer 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 12, 2020
@Elinvynia Elinvynia 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 20, 2020
@Elinvynia Elinvynia 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 27, 2020
@Dylan-DPC-zz
Copy link

Closing this due to inactivity.

@Dylan-DPC-zz Dylan-DPC-zz added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 3, 2020
@GuillaumeGomez GuillaumeGomez deleted the rustdoc-copy-local-img branch February 2, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. 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.

Include images in rustdoc output
10 participants