Stop trying to compile detector and verifier on CE (#5857)

This commit is contained in:
Artur Pata 2025-11-03 11:22:55 +02:00 committed by GitHub
parent 0405055f95
commit a204c89066
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 4 deletions

View File

@ -35,6 +35,12 @@ const ALL_VARIANTS = variantsFile.legacyVariants.concat(
variantsFile.manualVariants
)
function shouldCompileVariant(variant) {
const IS_CE = ['ce', 'ce_test', 'ce_dev'].includes(process.env.MIX_ENV)
const shouldCompileVariant = IS_CE && variant.ee_only ? false : true
return shouldCompileVariant
}
export async function compileAll(options = {}) {
if (process.env.NODE_ENV === 'dev' && canSkipCompile()) {
console.info(
@ -46,16 +52,17 @@ export async function compileAll(options = {}) {
const bundledCode = await bundleCode()
const startTime = Date.now()
console.log(`Starting compilation of ${ALL_VARIANTS.length} variants...`)
const variantsToCompile = ALL_VARIANTS.filter(shouldCompileVariant)
console.log(`Starting compilation of ${variantsToCompile.length} variants...`)
const bar = new progress.SingleBar(
{ clearOnComplete: true },
progress.Presets.shades_classic
)
bar.start(ALL_VARIANTS.length, 0)
bar.start(variantsToCompile.length, 0)
const workerPool = Pool(() => spawn(new Worker('./worker-thread.js')))
ALL_VARIANTS.forEach((variant) => {
variantsToCompile.forEach((variant) => {
workerPool.queue(async (worker) => {
await worker.compileFile(variant, { ...options, bundledCode })
bar.increment()
@ -67,7 +74,7 @@ export async function compileAll(options = {}) {
bar.stop()
console.log(
`Completed compilation of ${ALL_VARIANTS.length} variants in ${((Date.now() - startTime) / 1000).toFixed(2)}s`
`Completed compilation of ${variantsToCompile.length} variants in ${((Date.now() - startTime) / 1000).toFixed(2)}s`
)
}

View File

@ -32,12 +32,14 @@
"npm_package": "esm"
},
{
"ee_only": true,
"name": "detector.js",
"entry_point": "installation_support/detector.js",
"output_path": "priv/tracker/installation_support/detector.js",
"globals": {}
},
{
"ee_only": true,
"name": "verifier.js",
"entry_point": "installation_support/verifier.js",
"output_path": "priv/tracker/installation_support/verifier.js",