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(yarnpkg-pnp): make yarn 2 run on node 13 #550

Merged
merged 2 commits into from Oct 28, 2019
Merged

fix(yarnpkg-pnp): make yarn 2 run on node 13 #550

merged 2 commits into from Oct 28, 2019

Conversation

sverweij
Copy link
Contributor

@sverweij sverweij commented Oct 27, 2019

What's the problem this PR addresses?

yarn v2 did not run on node 13 because of a problem with pnp - see yarnpkg/yarn#7642 and PR yarnpkg/yarn#7650.

How did you fix it?

  • made the redefinition of Module._findPath in applyPatch.ts take into account that the paths parameter can be null
  • adapted the type definition of that redefinition and of the function signature to take this into account
  • added node 13 to the build matrix so we can see the fix works (or doesn't)
  • ran a ./scripts/run-yarn.js build:cli+hook to rebuild the cli & pnp hook code
  • ran a ./scripts/run-yarn.js so the .pnp.js has the fix as well

Notes

It seems the windows builds get tripped up by the set -e in workflows/integration-workflow. In windows shell set -e has a different meaning, apparently, and it might be that in the latest images of windows the check on the missing parameter got a bit more strict:

Set-Variable : Missing an argument for parameter 'Exclude'. Specify a parameter of type
'System.String[]' and try again.

PR #549 (typo fix) doesn't green because of this either...

@arcanis
Copy link
Member

arcanis commented Oct 27, 2019

I remember reading that the default shell for GitHub Actions running on Windows would change - it's probably because of this. I think replacing run with bash should work 🤔

@@ -2,8 +2,8 @@
"name": "@yarnpkg/pnp",
"version": "2.0.0-rc.6",
"nextVersion": {
"semver": "2.0.0-rc.7",
"nonce": "7116580554445175"
"semver": "2.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

There's a problem here - you scheduled a major (instead of just prerelease) 🙂

Suggested change
"semver": "2.0.0",
"semver": "2.0.0-rc.7",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dang - ran yarn version patch on each of them instead of that nice version check -i Sorry! 😊 . Fix coming up ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -2,8 +2,8 @@
"name": "@yarnpkg/pnpify",
"version": "2.0.0-rc.7",
"nextVersion": {
"semver": "2.0.0-rc.8",
"nonce": "8206665822561467"
"semver": "2.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"semver": "2.0.0",
"semver": "2.0.0-rc.8",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@sverweij
Copy link
Contributor Author

sverweij commented Oct 27, 2019

I remember reading that the default shell for GitHub Actions running on Windows would change - it's probably because of this. I think replacing run with bash should work 🤔

I've tried it (over here in a demo repo) - but it makes the gh-actions config invalid, so the ci script doesn't get executed (error message: every step must define a uses or run key).

So there's two possible courses of action (there might be more, but this is what I currently see):

  • remove the set -e for now
    I've tested it in that same demo repo and with or without set -e, the behaviour is the same - immediate bailout on a failing command. This is because the gh-action is executed with shell: /bin/bash -e {0} on linux anyway - and presumably it's the default behaviour of powershell anyway.
  • set up a separate workflow for windows

For now I've taken the liberty to remove the set -e. If you want a separate wf for windows - let me know.

@sverweij sverweij requested a review from arcanis October 27, 2019 22:50
@arcanis
Copy link
Member

arcanis commented Oct 28, 2019

Perfect, thanks! I've merged #551 to always force the tests to run with Bash - I prefer our runner to be consistent if possible. Good to go 👍

@arcanis arcanis merged commit 0eb802a into yarnpkg:master Oct 28, 2019
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.

None yet

2 participants