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

Rustdoc migrate to table so the gui can handle >2k constants #88816

Merged
merged 3 commits into from
Oct 5, 2021

Conversation

dns2utf8
Copy link
Contributor

@dns2utf8 dns2utf8 commented Sep 10, 2021

Closes #88545.

This PR adds a test for overlapping entries in the item-table #88545
It currently includes the commit with the workaround from #88776

@rust-highfive
Copy link
Collaborator

r? @ollie27

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 10, 2021
@dns2utf8
Copy link
Contributor Author

r? @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

Might be worth it to add a check on test and/or rustdoc hash version to check if we need to rebuild docs or not, even more with this change...

Or maybe we could just create this file once and for all. Not sure what's the best solution here. An opinion @Mark-Simulacrum ?

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Sep 10, 2021
@GuillaumeGomez
Copy link
Member

I marked this PR as blocked until #88776 is merged.

@dns2utf8
Copy link
Contributor Author

dns2utf8 commented Sep 11, 2021

Might be worth it to add a check on test and/or rustdoc hash version to check if we need to rebuild docs or not, even more with this change...

Do you mean that we only run the tests that have failed or are new? Or about (re-)generating the HTML and such?

Or maybe we could just create this file once and for all. Not sure what's the best solution here. An opinion @Mark-Simulacrum ?

We can store the generated file too, sure

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@dns2utf8 dns2utf8 changed the title Rustdoc test gui 2k constants Rustdoc migrate to table so the gui can handle <2k constants Sep 11, 2021
@dns2utf8 dns2utf8 changed the title Rustdoc migrate to table so the gui can handle <2k constants Rustdoc migrate to table so the gui can handle >2k constants Sep 11, 2021
@dns2utf8
Copy link
Contributor Author

I implemented both layouts with a table like structure but using <div>s and classes.
The file sizes of the index.html documents have increased by ~10% with this change, so maybe there is some potential there.

@GuillaumeGomez
Copy link
Member

Oh wow, that's awesome! So just remains to generate a 2000 line file with the constants I guess for the GUI test? :)

Once done, let's merge it, great work, thanks!

@Mark-Simulacrum
Copy link
Member

Please don't check in a 2000-line generated file, we can generate it at test runtime quickly enough that it shouldn't be necessary to pregenerate and bloat everyone's repository unnecessarily.

the grid-2 spec talks about -10k to +10k cells, it is currently a blink-engine thing to clamp at 1k. In some of their examples I saw them using 1.5k lines so I guessed 2k.

I'd be interested in hearing more about our motivation for adding this test, though. Based on what's been said so far, it sounds like the test is intended to avoid us regressing back to using grids specifically for this feature -- but that seems like the wrong thing to target. In practice, if grids are problematic with large tables -- whether the clamp is at 1000 or 10,000 doesn't seem like it matters that much in practice - then it seems like the better approach is to add a tidy lint preventing their usage in our css files. Obviously, if we know ahead of time that the lint doesn't apply to some statically known small-size user, then we can avoid it in that case. But this would both save on the generation of a 2k line file and the related annoyances (e.g., test run time, etc.) and target the problem more holistically, right?

@GuillaumeGomez
Copy link
Member

@Mark-Simulacrum Then we need to improve how we run GUI tests because currently we regenerate test docs every time whether or not something was changed. I can do that in a follow-up PR.

Also, @dns2utf8 removed the grid and replaced it with something else, completely fixing the issue.

@Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Then we need to improve how we run GUI tests because currently we regenerate test docs every time whether or not something was changed. I can do that in a follow-up PR.

This seems to have nothing to do with my request? I expect each test to either run from scratch or not at all. We can add some caching atop that similar to compiletest, though.

Also, @dns2utf8 removed the grid and replaced it with something else, completely fixing the issue.

Yes, I gathered that. What I'm saying is that testing that we can support 2,000 constants doesn't seem necessary, we can test directly for grid usage and lint against that.

@GuillaumeGomez
Copy link
Member

Yes, I gathered that. What I'm saying is that testing that we can support 2,000 constants doesn't seem necessary, we can test directly for grid usage and lint against that.

Then I don't understand what you mean.

@dns2utf8
Copy link
Contributor Author

Currently, there is no use of grid layouts in rustdoc and adding a lint that prevents their use could work too for now.

If we decide to use a grid in the future for something else (like switching the layout between super large desktops and 1080p-like desktops) then the check might get removed again. Adding a comment to the lint could reduce that risk again.

Wild idea (maybe a bad one): what if we move some of the tests into a separate folder that is only run at release?

@Mark-Simulacrum
Copy link
Member

No, we don't want a special category of tests, those just cause pain all around.

Yes, the lint would prevent usage of grids by accident; the reviewer/author could of course justify the usage in specific cases and silence the lint on that particular usage. Tidy lints don't just get dropped, so this would be a reliable way of ensuring we don't make this mistake in the future at very low overhead.

@GuillaumeGomez
Copy link
Member

I'm very curious on how you want to write such a lint considering all the debate around #86178 (which is still open)...

@GuillaumeGomez
Copy link
Member

Oh right, I had in mind potential adds through inline CSS (very unlikely) and through JS. Wel, if we don't consider those two, it should be easy enough.

@dns2utf8
Copy link
Contributor Author

A CSS lint seems reasonable.

If we want to keep the long check: what if we reexport some huge module (like one with the arm platform constants) in the test docs and use that for checking?
Or would you just remove this test for now because the table style is very stable I think?

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Oct 3, 2021
@JohnCSimon
Copy link
Member

Triage:
@GuillaumeGomez

I marked this PR as blocked until #88776 is merged.

this has been merged

@GuillaumeGomez
Copy link
Member

Let's merge this for now then!

Thanks @dns2utf8 !

@bors: r+

@bors
Copy link
Contributor

bors commented Oct 3, 2021

📌 Commit bca503f0687ea9f5aa0c8e6839963ea8947068f6 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 3, 2021
@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Oct 3, 2021

@bors r=GuillaumeGomez

Squashed the commits down a little.

@bors
Copy link
Contributor

bors commented Oct 3, 2021

📌 Commit e599e2d has been approved by GuillaumeGomez

@dns2utf8
Copy link
Contributor Author

dns2utf8 commented Oct 4, 2021

Thank you @Mark-Simulacrum for rebasing it! 😊

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 5, 2021
…nts, r=GuillaumeGomez

Rustdoc migrate to table so the gui can handle >2k constants

Closes rust-lang#88545.

This PR adds a test for overlapping entries in the `item-table` rust-lang#88545
It currently includes the commit with the workaround from rust-lang#88776
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2021
…arth

Rollup of 12 pull requests

Successful merges:

 - rust-lang#87631 (os current_exe using same approach as linux to get always the full ab…)
 - rust-lang#88234 (rustdoc-json: Don't ignore impls for primitive types)
 - rust-lang#88651 (Use the 64b inner:monotonize() implementation not the 128b one for aarch64)
 - rust-lang#88816 (Rustdoc migrate to table so the gui can handle >2k constants)
 - rust-lang#89244 (refactor: VecDeques PairSlices fields to private)
 - rust-lang#89364 (rustdoc-json: Encode json files with UTF-8)
 - rust-lang#89423 (Fix ICE caused by non_exaustive_omitted_patterns struct lint)
 - rust-lang#89426 (bootstrap: add config option for nix patching)
 - rust-lang#89462 (haiku thread affinity build fix)
 - rust-lang#89482 (Follow the diagnostic output style guide)
 - rust-lang#89504 (Don't suggest replacing region with 'static in NLL)
 - rust-lang#89535 (fix busted JavaScript in error index generator)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 52d3afa into rust-lang:master Oct 5, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 5, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 10, 2021
…st, r=Mark-Simulacrum

Don't rebuild GUI test crates every time you run test src/test/rustdoc-gui

This method has multiple advantages:

 * It'll completely remove the rustdoc-GUI test doc folder if rustdoc was updated
 * It'll rebuild GUI test crates only they have been updated

All in all, it's quite convenient! (even more with rust-lang#88816)

r? `@Mark-Simulacrum`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 10, 2021
…st, r=Mark-Simulacrum

Don't rebuild GUI test crates every time you run test src/test/rustdoc-gui

This method has multiple advantages:

 * It'll completely remove the rustdoc-GUI test doc folder if rustdoc was updated
 * It'll rebuild GUI test crates only they have been updated

All in all, it's quite convenient! (even more with rust-lang#88816)

r? ``@Mark-Simulacrum``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 10, 2021
…st, r=Mark-Simulacrum

Don't rebuild GUI test crates every time you run test src/test/rustdoc-gui

This method has multiple advantages:

 * It'll completely remove the rustdoc-GUI test doc folder if rustdoc was updated
 * It'll rebuild GUI test crates only they have been updated

All in all, it's quite convenient! (even more with rust-lang#88816)

r? ```@Mark-Simulacrum```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Generated docs on long pages render text on top of itself
9 participants