Skip to content

Commit

Permalink
Merge pull request #2911 from Shopify/fix-concurrent-function-builds
Browse files Browse the repository at this point in the history
Fix concurrent function builds
  • Loading branch information
gonzaloriestra authored Oct 5, 2023
2 parents 21b431f + de8104d commit 280b4f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-crews-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/app': patch
---

Fix concurrent function builds
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 280b4f7

Please sign in to comment.