Optimize language build order

This commit is contained in:
Radon Rosborough 2021-01-17 15:18:41 -08:00
parent ce72de4f6f
commit bb924ca926
1 changed files with 70 additions and 62 deletions

View File

@ -92,7 +92,8 @@ async function planDebianPackages(opts) {
(await getLangs()).map(async (id) => [id, await readLangConfig(id)])
)
);
return await Promise.all(
return _.sortBy(
await Promise.all(
packages.map(async ({ lang, type, name, buildScriptPath, debPath }) => {
const desired = crypto
.createHash("sha1")
@ -155,8 +156,15 @@ async function planDebianPackages(opts) {
}
await runCommand(`make upload L=${lang} T=${type}`);
},
type,
};
})
),
({ type, desired, local, remote }) => {
// If *not* a shared package, and all we have to do is download
// it, then sort to the end.
return type !== "shared" && local !== desired && remote === desired;
}
);
}