-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Fix JS search scripts path #145650
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
Fix JS search scripts path #145650
Conversation
|
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
d15d582
to
e1045c2
Compare
Locally, if we're dealing with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I've manually gone through all references of ROOT_PATH
and "DocSearch#rootPath
" (set to ROOT_PATH
in the ctor) and all other sites seem to append path segments correctly (i.e., without an extra slash).
@bors r+ rollup |
…ts-path, r=fmease Fix JS search scripts path `rootPath` always end with a `/` so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/). Follow-up of rust-lang#144476. Fixes rust-lang#145646. cc `@notriddle` r? `@fmease`
I've taken the liberty of rolling this up (despite the backlog) because I think it's worthwhile to get doc search working again ASAP. |
Rollup of 5 pull requests Successful merges: - #144915 (Defer tail call ret ty equality to check_tail_calls) - #145256 (Add new `--test-codegen-backend` bootstrap option) - #145415 (std_detect: RISC-V: implement implication to "C") - #145647 (miri subtree update) - #145650 (Fix JS search scripts path) r? `@ghost` `@rustbot` modify labels: rollup
most http servers also deduplicate consecutive slashes, but apparently not the one that rust documentation is hosted on. |
It also affected docs.rs, so Axum doesn't deduplicate slashes it seems. |
That just means that rustdoc can't assume that consecutive slashes get normalized away by whomever ends up interpreting the path. |
Is there a way we can modify the gui testing framework to error if there are ever duplicated slashes in the URL path? that seems desirable to stop this from happening again. |
CC https://en.wikipedia.org/wiki/URI_normalization which classifies "slash collapsing" to not necessarily be semantics-preserving. |
Yes. I'll have a PR open that tests this in a few minutes. |
…ts-path, r=fmease Fix JS search scripts path `rootPath` always end with a `/` so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/). Follow-up of rust-lang#144476. Fixes rust-lang#145646. cc `@notriddle` r? `@fmease`
Rollup of 12 pull requests Successful merges: - #143383 (stabilize `const_array_each_ref`) - #144443 (Make target pointer width in target json an integer) - #144758 ([Doc] Add links to the various collections) - #144915 (Defer tail call ret ty equality to check_tail_calls) - #145256 (Add new `--test-codegen-backend` bootstrap option) - #145415 (std_detect: RISC-V: implement implication to "C") - #145573 (Add an experimental unsafe(force_target_feature) attribute.) - #145642 (Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause) - #145650 (Fix JS search scripts path) - #145654 (Download CI GCC into the correct directory) - #145662 (Enforce correct number of arguments for `"x86-interrupt"` functions) - #145674 (Enable triagebot `[review-changes-since]` feature) Failed merges: - #145647 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
…ts-path, r=fmease Fix JS search scripts path `rootPath` always end with a `/` so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/). Follow-up of rust-lang#144476. Fixes rust-lang#145646. cc ``@notriddle`` r? ``@fmease``
Rollup of 14 pull requests Successful merges: - #143383 (stabilize `const_array_each_ref`) - #144443 (Make target pointer width in target json an integer) - #144758 ([Doc] Add links to the various collections) - #144915 (Defer tail call ret ty equality to check_tail_calls) - #145137 (Consolidate panicking functions in `slice/index.rs`) - #145256 (Add new `--test-codegen-backend` bootstrap option) - #145297 (fix(debuginfo): handle false positives in overflow check) - #145415 (std_detect: RISC-V: implement implication to "C") - #145642 (Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause) - #145650 (Fix JS search scripts path) - #145654 (Download CI GCC into the correct directory) - #145662 (Enforce correct number of arguments for `"x86-interrupt"` functions) - #145674 (Enable triagebot `[review-changes-since]` feature) - #145678 (Fix typo in docstring) r? `@ghost` `@rustbot` modify labels: rollup
…ts-path, r=fmease Fix JS search scripts path `rootPath` always end with a `/` so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/). Follow-up of rust-lang#144476. Fixes rust-lang#145646. cc ```@notriddle``` r? ```@fmease```
Rollup of 15 pull requests Successful merges: - #143383 (stabilize `const_array_each_ref`) - #144758 ([Doc] Add links to the various collections) - #144915 (Defer tail call ret ty equality to check_tail_calls) - #145137 (Consolidate panicking functions in `slice/index.rs`) - #145256 (Add new `--test-codegen-backend` bootstrap option) - #145297 (fix(debuginfo): handle false positives in overflow check) - #145415 (std_detect: RISC-V: implement implication to "C") - #145590 (Prevent impossible combinations in `ast::ModKind`.) - #145621 (Fix some doc typos) - #145642 (Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause) - #145650 (Fix JS search scripts path) - #145654 (Download CI GCC into the correct directory) - #145662 (Enforce correct number of arguments for `"x86-interrupt"` functions) - #145674 (Enable triagebot `[review-changes-since]` feature) - #145678 (Fix typo in docstring) r? `@ghost` `@rustbot` modify labels: rollup
…ts-path, r=fmease Fix JS search scripts path `rootPath` always end with a `/` so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/). Follow-up of rust-lang#144476. Fixes rust-lang#145646. cc ````@notriddle```` r? ````@fmease````
Rollup of 19 pull requests Successful merges: - #143383 (stabilize `const_array_each_ref`) - #144758 ([Doc] Add links to the various collections) - #144915 (Defer tail call ret ty equality to check_tail_calls) - #145256 (Add new `--test-codegen-backend` bootstrap option) - #145297 (fix(debuginfo): handle false positives in overflow check) - #145390 (Shorten some dependency chains in the compiler) - #145415 (std_detect: RISC-V: implement implication to "C") - #145525 (stdlib: Replace typedef -> type alias in doc comment) - #145590 (Prevent impossible combinations in `ast::ModKind`.) - #145593 (UnsafePinned::raw_get: sync signature with get) - #145621 (Fix some doc typos) - #145627 (Unconditionally-const supertraits are considered not dyn compatible) - #145642 (Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause) - #145650 (Fix JS search scripts path) - #145654 (Download CI GCC into the correct directory) - #145662 (Enforce correct number of arguments for `"x86-interrupt"` functions) - #145673 (Add flock support for cygwin) - #145674 (Enable triagebot `[review-changes-since]` feature) - #145678 (Fix typo in docstring) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145650 - GuillaumeGomez:fix-js-search-scripts-path, r=fmease Fix JS search scripts path `rootPath` always end with a `/` so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/). Follow-up of #144476. Fixes #145646. cc `````@notriddle````` r? `````@fmease`````
A safer way to construct paths needs to be used in my humble opinion, so this doesn't keep happening. That crates.io issue was Rust code which should have just used |
Thank you unknown person from the internet. I'm sure you commented with good intentions but sadly, there are some issues with your comment:
This PR fixes the issue and and most importantly: a follow-up (#145669) will add a regression test to ensure it doesn't happen again. So now comes the "wise man talk": comments are very welcome, but considering how stressful this has been for the people involved, if you just come in saying "why are you so bad at doing this thing?", it's just annoying and counter-productive. However if you came with a useful information like "you could use this vanilla JS method to handle paths", then we'd be very happy. |
I don't do JS, so I assumed people familiar with it would know better. Having said that, this seems to work. (I wrote a silly and technically wrong comment earlier which I promptly deleted.) |
I think it would make more sense to use the URL interface from the DOM. The Rustdoc frontend has no build step, and I'd prefer not to add one. |
…ath, r=GuillaumeGomez rustdoc-search: GUI tests check for `//` in URL Follow up rust-lang#145650 When this fails, you get output that looks like: /home/user/rust/tests/rustdoc-gui/search-result-impl-disambiguation.goml search-result-impl-disambiguation... FAILED [ERROR] `tests/rustdoc-gui/utils.goml` around line 49 from `tests/rustdoc-gui/search-result-impl-disambiguation.goml` line 25: JS errors occurred: Event: Event Making the error message more informative requires patching browser-ui-test.
…ath, r=GuillaumeGomez rustdoc-search: GUI tests check for `//` in URL Follow up rust-lang#145650 When this fails, you get output that looks like: /home/user/rust/tests/rustdoc-gui/search-result-impl-disambiguation.goml search-result-impl-disambiguation... FAILED [ERROR] `tests/rustdoc-gui/utils.goml` around line 49 from `tests/rustdoc-gui/search-result-impl-disambiguation.goml` line 25: JS errors occurred: Event: Event Making the error message more informative requires patching browser-ui-test.
Rollup merge of #145669 - notriddle:test-js-search-scripts-path, r=GuillaumeGomez rustdoc-search: GUI tests check for `//` in URL Follow up #145650 When this fails, you get output that looks like: /home/user/rust/tests/rustdoc-gui/search-result-impl-disambiguation.goml search-result-impl-disambiguation... FAILED [ERROR] `tests/rustdoc-gui/utils.goml` around line 49 from `tests/rustdoc-gui/search-result-impl-disambiguation.goml` line 25: JS errors occurred: Event: Event Making the error message more informative requires patching browser-ui-test.
…illaumeGomez rustdoc-search: GUI tests check for `//` in URL Follow up rust-lang/rust#145650 When this fails, you get output that looks like: /home/user/rust/tests/rustdoc-gui/search-result-impl-disambiguation.goml search-result-impl-disambiguation... FAILED [ERROR] `tests/rustdoc-gui/utils.goml` around line 49 from `tests/rustdoc-gui/search-result-impl-disambiguation.goml` line 25: JS errors occurred: Event: Event Making the error message more informative requires patching browser-ui-test.
rootPath
always end with a/
so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/).Follow-up of #144476.
Fixes #145646.
cc @notriddle
r? @fmease