Skip to content

Commit a204c89

Browse files
authored
Stop trying to compile detector and verifier on CE (#5857)
1 parent 0405055 commit a204c89

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

tracker/compiler/index.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ const ALL_VARIANTS = variantsFile.legacyVariants.concat(
3535
variantsFile.manualVariants
3636
)
3737

38+
function shouldCompileVariant(variant) {
39+
const IS_CE = ['ce', 'ce_test', 'ce_dev'].includes(process.env.MIX_ENV)
40+
const shouldCompileVariant = IS_CE && variant.ee_only ? false : true
41+
return shouldCompileVariant
42+
}
43+
3844
export async function compileAll(options = {}) {
3945
if (process.env.NODE_ENV === 'dev' && canSkipCompile()) {
4046
console.info(
@@ -46,16 +52,17 @@ export async function compileAll(options = {}) {
4652
const bundledCode = await bundleCode()
4753

4854
const startTime = Date.now()
49-
console.log(`Starting compilation of ${ALL_VARIANTS.length} variants...`)
55+
const variantsToCompile = ALL_VARIANTS.filter(shouldCompileVariant)
56+
console.log(`Starting compilation of ${variantsToCompile.length} variants...`)
5057

5158
const bar = new progress.SingleBar(
5259
{ clearOnComplete: true },
5360
progress.Presets.shades_classic
5461
)
55-
bar.start(ALL_VARIANTS.length, 0)
62+
bar.start(variantsToCompile.length, 0)
5663

5764
const workerPool = Pool(() => spawn(new Worker('./worker-thread.js')))
58-
ALL_VARIANTS.forEach((variant) => {
65+
variantsToCompile.forEach((variant) => {
5966
workerPool.queue(async (worker) => {
6067
await worker.compileFile(variant, { ...options, bundledCode })
6168
bar.increment()
@@ -67,7 +74,7 @@ export async function compileAll(options = {}) {
6774
bar.stop()
6875

6976
console.log(
70-
`Completed compilation of ${ALL_VARIANTS.length} variants in ${((Date.now() - startTime) / 1000).toFixed(2)}s`
77+
`Completed compilation of ${variantsToCompile.length} variants in ${((Date.now() - startTime) / 1000).toFixed(2)}s`
7178
)
7279
}
7380

tracker/compiler/variants.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@
3232
"npm_package": "esm"
3333
},
3434
{
35+
"ee_only": true,
3536
"name": "detector.js",
3637
"entry_point": "installation_support/detector.js",
3738
"output_path": "priv/tracker/installation_support/detector.js",
3839
"globals": {}
3940
},
4041
{
42+
"ee_only": true,
4143
"name": "verifier.js",
4244
"entry_point": "installation_support/verifier.js",
4345
"output_path": "priv/tracker/installation_support/verifier.js",

0 commit comments

Comments
 (0)