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(gatsby): PnP fixes #35194

Merged
merged 6 commits into from
Mar 22, 2022
Merged

fix(gatsby): PnP fixes #35194

merged 6 commits into from
Mar 22, 2022

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Mar 22, 2022

Description

Couple of fixes here that seems to impact yarn@2+:

  1. Resolve gatsby-parcel-config from gatsby context and not site context
  2. gatsby-worker should await for worker process to be ready before trying to send task to it (we saw in CI at least tests being stuck on "validating engines", which is just first thing we use any worker process for, also yarn run gatsby build stalles in run queries in workers #35192 looks like has similar problem just in different spot, due to repro site not using engines, so we don't try to validate them and first worker usage is actually query running)

Related Issues

Fixes #35140
Fixes #35192

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 22, 2022
@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 22, 2022
Comment on lines -353 to -355
- run: # TODO: remove pinned version
command: yarn set version 3.1.1
working_directory: /tmp/e2e-tests/gatsby-pnp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unpin yarn version in tests, so we start using latest again

defaultConfig: require.resolve(`gatsby-parcel-config`, {
paths: [siteRoot],
}),
defaultConfig: require.resolve(`gatsby-parcel-config`),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gatsby-parcel-config is dependency of gatsby not site, so we shouldn't try to resolve it from site context

Comment on lines +106 to +107

ensuredSendToMain([WORKER_READY])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't have init messaging and seems like in some cases initial messages (before child set on('message') handler) are lost. The change here is that child sends "ready" message once it's initialized and workerpool waits for it before sending task to process

@pieh pieh marked this pull request as ready for review March 22, 2022 12:18
@pieh pieh merged commit 79c5598 into master Mar 22, 2022
@pieh pieh deleted the fix/pnp-parcel branch March 22, 2022 14:50
pieh added a commit that referenced this pull request Mar 22, 2022
(cherry picked from commit 79c5598)
pieh added a commit that referenced this pull request Mar 22, 2022
(cherry picked from commit 79c5598)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
@pieh
Copy link
Contributor Author

pieh commented Mar 22, 2022

Published in gatsby@4.10.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yarn run gatsby build stalles in run queries in workers Yarn 3 dev commands fails with missing deps
2 participants