Improve table

This commit is contained in:
nora 2024-09-08 15:34:12 +02:00
parent ae1f0b96e3
commit 67459f825b
5 changed files with 51 additions and 28 deletions

View file

@ -54,6 +54,7 @@ async fn build(State(state): State<AppState>, Query(query): Query<BuildQuery>) -
.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());

View file

@ -12,8 +12,11 @@
</style>
</head>
<body>
<h1>Build results nightly-{{nightly}} target-{{target}}</h1>
<div class="{{status}} build-indicator-big">{{status}}</div>
<h1>Build results for nightly-{{nightly}} target-{{target}} {{mode}}</h1>
<a href="/">Back</a>
<div style="margin-top: 20px" class="{{status}} build-indicator-big">
{{status}}
</div>
<pre>
{{stderr}}
</pre>

View file

@ -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;

View file

@ -8,8 +8,13 @@
</head>
<body>
<h1>Does it build?</h1>
<p>This website builds every rustc target on many nightlies to check which ones work and which ones do not.</p>
<ul>
<li><a href="#core-build">Core build</a></li>
<li><a href="#miri-std-build">Std check build</a></li>
</ul>
<!--core-->
<h2>Core Build</h2>
<h2 id="core-build">Core Build</h2>
<p>Builds every target with:
<pre>cargo build --release -Zbuild-std=core</pre></p>
<p>This checks that codegen/linking of core works, but does not check whether std builds.</p>
@ -25,7 +30,7 @@
</table>
<!--std-->
<h2>Miri Std Build</h2>
<h2 id="miri-std-build">Miri Std Build</h2>
<p>Builds every target with:
<pre>cargo miri setup</pre></p>
<p>This checks that std builds (on targets that have it) but does not check whether codegen/linking works.</p>

View file

@ -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);
}