From 67459f825b14b96e7aa972e1507a70cbac36078b Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Sun, 8 Sep 2024 15:34:12 +0200 Subject: [PATCH] Improve table --- src/web.rs | 1 + static/build.html | 7 +++++-- static/index.css | 13 +++++++++++++ static/index.html | 9 +++++++-- static/index.js | 49 ++++++++++++++++++++++++----------------------- 5 files changed, 51 insertions(+), 28 deletions(-) diff --git a/src/web.rs b/src/web.rs index 2fad208..8ad3180 100644 --- a/src/web.rs +++ b/src/web.rs @@ -54,6 +54,7 @@ async fn build(State(state): State, Query(query): Query) - .replace("{{nightly}}", &query.nightly) .replace("{{target}}", &query.target) .replace("{{stderr}}", &build.stderr) + .replace("{{mode}}", &build.mode.to_string()) .replace("{{version}}", crate::VERSION) .replace("{{status}}", &build.status.to_string()); diff --git a/static/build.html b/static/build.html index 8504e91..cfdfa64 100644 --- a/static/build.html +++ b/static/build.html @@ -12,8 +12,11 @@ -

Build results nightly-{{nightly}} target-{{target}}

-
{{status}}
+

Build results for nightly-{{nightly}} target-{{target}} {{mode}}

+ Back +
+ {{status}} +
 {{stderr}}
     
diff --git a/static/index.css b/static/index.css index 98a46fd..a4201f3 100644 --- a/static/index.css +++ b/static/index.css @@ -20,11 +20,24 @@ td { background-color: lightgray; } +.target-header { + writing-mode: sideways-lr; +} + .build-info-a { color: black; text-decoration: none; } +.build-cell { + padding-left: 5px; + padding-right: 5px; +} + +.target-name-col { + white-space: nowrap; +} + .footer { margin-top: 20px; display: flex; diff --git a/static/index.html b/static/index.html index 244dc5b..400a997 100644 --- a/static/index.html +++ b/static/index.html @@ -8,8 +8,13 @@

Does it build?

+

This website builds every rustc target on many nightlies to check which ones work and which ones do not.

+ -

Core Build

+

Core Build

Builds every target with:

cargo build --release -Zbuild-std=core

This checks that codegen/linking of core works, but does not check whether std builds.

@@ -25,7 +30,7 @@ -

Miri Std Build

+

Miri Std Build

Builds every target with:

cargo miri setup

This checks that std builds (on targets that have it) but does not check whether codegen/linking works.

diff --git a/static/index.js b/static/index.js index e26b452..140551c 100644 --- a/static/index.js +++ b/static/index.js @@ -28,7 +28,8 @@ class Table { const allTargets = new Set(); const allNightlies = new Set(); - const nightlyInfos = new Map(); + // The infos grouped by target. + const targetInfos = new Map(); // Targets that have, at some point, errored const targetsWithErrors = new Set(); @@ -62,10 +63,10 @@ class Table { } allTargets.add(info.target); - if (!nightlyInfos.has(info.nightly)) { - nightlyInfos.set(info.nightly, new Map()); + if (!targetInfos.has(info.target)) { + targetInfos.set(info.target, new Map()); } - nightlyInfos.get(info.nightly).set(info.target, info); + targetInfos.get(info.target).set(info.nightly, info); } const nightlies = Array.from(allNightlies); @@ -75,34 +76,33 @@ class Table { targets.sort(); const header = document.createElement("tr"); - const headerNightly = document.createElement("th"); - headerNightly.innerText = "nightly"; - header.appendChild(headerNightly); - targets.forEach((target) => { - if (this.filter.filterFailed && !targetsWithErrors.has(target)) { - return; - } + const headerTarget = document.createElement("th"); + headerTarget.innerText = "target"; + header.appendChild(headerTarget); + nightlies.forEach((target) => { const elem = document.createElement("th"); + elem.classList.add("target-header"); elem.innerText = target; header.appendChild(elem); }); - const rows = nightlies.map((nightly) => { + const rows = targets.flatMap((target) => { + if (this.filter.filterFailed && !targetsWithErrors.has(target)) { + return []; + } + const tr = document.createElement("tr"); - const nightlyCol = document.createElement("td"); - nightlyCol.innerText = nightly; - tr.appendChild(nightlyCol); + const targetCol = document.createElement("td"); + targetCol.innerText = target; + targetCol.classList.add("target-name-col"); + tr.appendChild(targetCol); - const info = nightlyInfos.get(nightly) ?? new Map(); - - for (const target of targets) { - if (this.filter.filterFailed && !targetsWithErrors.has(target)) { - continue; - } + const info = targetInfos.get(target) ?? new Map(); + for (const nightly of nightlies) { const td = document.createElement("td"); - const targetInfo = info.get(target); + const targetInfo = info.get(nightly); if (targetInfo) { const a = document.createElement("a"); @@ -112,8 +112,9 @@ class Table { )}&target=${encodeURIComponent(target)}&mode=${encodeURIComponent( targetInfo.mode )}`; - a.innerText = targetInfo.status; + a.innerText = targetInfo.status == "pass" ? "✅" : "❌"; td.appendChild(a); + td.classList.add("build-cell"); td.classList.add(targetInfo.status); } else { td.innerText = ""; @@ -122,7 +123,7 @@ class Table { tr.appendChild(td); } - return tr; + return [tr]; }); this.elem.replaceChildren(header, ...rows); }