Skip to content

Commit

Permalink
Merge pull request #2932 from Shopify/fix-concurrent-function-builds-…
Browse files Browse the repository at this point in the history
…main

[main] Fix concurrent function builds
  • Loading branch information
gonzaloriestra authored Oct 5, 2023
2 parents aa7a547 + 9f49b61 commit 686f77d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/app/src/cli/services/deploy/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {renderConcurrent} from '@shopify/cli-kit/node/ui'
import {AbortSignal} from '@shopify/cli-kit/node/abort'
import {inTemporaryDirectory, mkdirSync, touchFile} from '@shopify/cli-kit/node/fs'
import {joinPath} from '@shopify/cli-kit/node/path'
import {exec} from '@shopify/cli-kit/node/system'
import {Writable} from 'stream'

export interface BundleOptions {
Expand All @@ -19,6 +20,13 @@ export async function bundleAndBuildExtensions(options: BundleOptions) {
await mkdirSync(bundleDirectory)
await touchFile(joinPath(bundleDirectory, '.shopify'))

const javyRequired = options.app.allExtensions.some((ext) => ext.features.includes('function'))
if (javyRequired) {
// Force the download of the javy binary in advance to avoid later problems,
// as it might be done multiple times in parallel. https://github.com/Shopify/cli/issues/2877
await exec('npm', ['exec', '--', 'javy', '--version'], {cwd: options.app.directory})
}

await renderConcurrent({
processes: options.app.allExtensions.map((extension) => {
return {
Expand Down

0 comments on commit 686f77d

Please sign in to comment.