Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix concurrent function builds #2911

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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})
gonzaloriestra marked this conversation as resolved.
Show resolved Hide resolved
}

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