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

Support Windows paths for pnp. #6447

Merged
merged 5 commits into from Oct 2, 2018
Merged

Support Windows paths for pnp. #6447

merged 5 commits into from Oct 2, 2018

Conversation

jdalton
Copy link
Contributor

@jdalton jdalton commented Sep 27, 2018

This PR is a start to resolve #6402 (Plug'n'Play doesn't support Windows paths).

@jdalton jdalton changed the title Support Windows paths. Support Windows paths for pnp. Sep 27, 2018
@buildsize
Copy link

buildsize bot commented Sep 27, 2018

File name Previous Size New Size Change
yarn-[version].noarch.rpm 1.07 MB 1.07 MB 81 bytes (0%)
yarn-[version].js 4.2 MB 4.2 MB 753 bytes (0%)
yarn-legacy-[version].js 4.37 MB 4.37 MB 743 bytes (0%)
yarn-v[version].tar.gz 1.08 MB 1.08 MB 967 bytes (0%)
yarn_[version]all.deb 791.67 KB 791.51 KB -172 bytes (0%)

Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

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

One note regarding the warning, but looks good apart from that! 👍

src/config.js Outdated
@@ -395,14 +395,6 @@ export default class Config {
this.plugnplayEnabled = false;
}

if (process.platform === 'win32') {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the warning should be kept if cacheFolder is detected to be on a different drive than lockfileFolder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay, I'll noodle on that today.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arcanis Thanks for pushing more patches to the PR!

if (cacheRootFolderDrive !== lockfileFolderDrive) {
if (this.plugnplayEnabled) {
this.reporter.warn(this.reporter.lang('plugnplayWindowsSupport'));
}
Copy link
Contributor Author

@jdalton jdalton Oct 1, 2018

Choose a reason for hiding this comment

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

Now may be a good time to think on other platform specific path things that might make relative paths less portable from platform to platform. Off the top of my head there is also long paths (namespaced paths) in Windows.

Update:

I think the root check above may already handle namespaced paths.

Copy link
Member

Choose a reason for hiding this comment

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

I guess if the need arise we could just have a plugnplay-use-absolute settings that would use absolute paths for everything outside of __dirname. Since getPackageInformation already returns absolute paths no matter what, it should be backward compatible.

@arcanis
Copy link
Member

arcanis commented Oct 2, 2018

Next step: port the pkg-tests to be executed on Windows. Maybe we could try the Azure pipeline? We were interested to give it a try, it would be a good test subject since the pkg-tests testsuite is quite well contained.

@arcanis arcanis merged commit 9028f9a into yarnpkg:master Oct 2, 2018
@jdalton jdalton deleted the pnp-win branch October 2, 2018 15:07
@jdalton
Copy link
Contributor Author

jdalton commented Oct 2, 2018

I'll ping some Azure dev advocates 🥑 to see if they have any guidance, tips, or can pitch in.

@btholt
Copy link

btholt commented Oct 4, 2018

@arcanis I'm happy to be your point-of-contact for Azure Pipelines and pitch in where helpful.

@edmorley
Copy link
Contributor

edmorley commented Oct 4, 2018

I ran into an issue with yarn run - opened #6493.

@arcanis
Copy link
Member

arcanis commented Oct 4, 2018

Thanks @btholt! I just opened #6495 to play a bit with the pipeline 😃

const cacheRootFolderDrive = path.parse(this._cacheRootFolder).root;
const lockfileFolderDrive = path.parse(this.lockfileFolder).root;

if (cacheRootFolderDrive !== lockfileFolderDrive) {
Copy link
Contributor

@vkrol vkrol Oct 8, 2018

Choose a reason for hiding this comment

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

There should be a case-insensitive check.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense! Can you open a PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like both cacheRootFolder and lockfileFolder can be user customized. Would it make more sense for user-provided values to be normalized at time of ingestion to avoid these kinds of one-off normalizations in other places in the code as well?

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 22, 2018
Changelog tracks back up to 1.12.0 only.

## 1.12.3

**Important:** This release contains a cache bump. It will cause the very first install following the upgrade to take slightly more time, especially if you don't use the [Offline Mirror](https://yarnpkg.com/blog/2016/11/24/offline-mirror/) feature. After that everything will be back to normal.

- Fixes an issue with `yarn audit` when using workspaces

  [6625](yarnpkg/yarn#6639) - [**Jeff Valore**](https://twitter.com/codingwithspike)

- Uses `NODE_OPTIONS` to instruct Node to load the PnP hook, instead of raw CLI arguments

  **Caveat:** This change might cause issues for PnP users having a space inside their cwd (cf [nodejs/node24065](nodejs/node#24065))

  [6479](yarnpkg/yarn#6629) - [**Maël Nison**](https://twitter.com/arcanis)

- Fixes Gulp when used with Plug'n'Play

  [6623](yarnpkg/yarn#6623) - [**Maël Nison**](https://twitter.com/arcanis)

- Fixes an issue with `yarn audit` when the root package was missing a name

  [6611](yarnpkg/yarn#6611) - [**Jack Zhao**](https://github.com/bugzpodder)

- Fixes an issue with `yarn audit` when a package was depending on an empty range

  [6611](yarnpkg/yarn#6611) - [**Jack Zhao**](https://github.com/bugzpodder)

- Fixes an issue with how symlinks are setup into the cache on Windows

  [6621](yarnpkg/yarn#6621) - [**Yoad Snapir**](https://github.com/yoadsn)

- Upgrades `inquirer`, fixing `upgrade-interactive` for users using both Node 10 and Windows

  [6635](yarnpkg/yarn#6635) - [**Philipp Feigl**](https://github.com/pfeigl)

- Exposes the path to the PnP file using `require.resolve('pnpapi')`

  [6643](yarnpkg/yarn#6643) - [**Maël Nison**](https://twitter.com/arcanis)

## 1.12.2

This release doesn't actually exists and was caused by a quirk in our systems.

## 1.12.1

- Ensures the engine check is ran before showing the UI for `upgrade-interactive`

  [6536](yarnpkg/yarn#6536) - [**Orta Therox**](https://github.com/orta)

- Restores Node v4 support by downgrading `cli-table3`

  [6535](yarnpkg/yarn#6535) - [**Mark Stacey**](https://github.com/Gudahtt)

- Prevents infinite loop when parsing corrupted lockfiles with unterminated strings

  [4965](yarnpkg/yarn#4965) - [**Ryan Hendrickson**](https://github.com/rhendric)

- Environment variables now have to **start** with `YARN_` (instead of just contain it) to be considered

  [6518](yarnpkg/yarn#6518) - [**Michael Gmelin**](https://blog.grem.de)

- Fixes the `extensions` option when used by `resolveRequest`

  [6479](yarnpkg/yarn#6479) - [**Maël Nison**](https://twitter.com/arcanis)

- Fixes handling of empty string entries for `bin` in package.json

  [6515](yarnpkg/yarn#6515) - [**Ryan Burrows**](https://github.com/rhburrows)

- Adds support for basic auth for registries with paths, such as artifactory

  [5322](yarnpkg/yarn#5322) - [**Karolis Narkevicius**](https://twitter.com/KidkArolis)

- Adds 2FA (Two Factor Authentication) support to publish & alike

  [6555](yarnpkg/yarn#6555) - [**Krzysztof Zbudniewek**](https://github.com/neonowy)

- Fixes how the `files` property is interpreted to bring it in line with npm

  [6562](yarnpkg/yarn#6562) - [**Bertrand Marron**](https://github.com/tusbar)

- Fixes Yarn invocations on Darwin when the `yarn` binary was symlinked

  [6568](yarnpkg/yarn#6568) - [**Hidde Boomsma**](https://github.com/hboomsma)

- Fixes `require.resolve` when used together with the `paths` option

  [6565](yarnpkg/yarn#6565) - [**Maël Nison**](https://twitter.com/arcanis)

## 1.12.0

- Adds initial support for PnP on Windows

  [6447](yarnpkg/yarn#6447) - [**John-David Dalton**](https://twitter.com/jdalton)

- Adds `yarn audit` (and the `--audit` flag for all installs)

  [6409](yarnpkg/yarn#6409) - [**Jeff Valore**](https://github.com/rally25rs)

- Adds a special logic to PnP for ESLint compatibility (temporary, until [eslint/eslint10125](eslint/eslint#10125) is fixed)

  [6449](yarnpkg/yarn#6449) - [**Maël Nison**](https://twitter.com/arcanis)

- Makes the PnP hook inject a `process.versions.pnp` variable when setup (equals to `VERSIONS.std`)

  [6464](yarnpkg/yarn#6464) - [**Maël Nison**](https://twitter.com/arcanis)

- Disables by default (configurable) the automatic migration of the `integrity` field. **It will be re-enabled in 2.0.**

  [6465](yarnpkg/yarn#6465) - [**Maël Nison**](https://twitter.com/arcanis)

- Fixes the display name of the faulty package when the NPM registry returns corrupted data

  [6455](yarnpkg/yarn#6455) - [**Grey Baker**](https://github.com/greysteil)

- Prevents crashes when running `yarn outdated` and the NPM registry forgets to return the `latest` tag

  [6454](yarnpkg/yarn#6454) - [**mad-mike**](https://github.com/mad-mike)

- Fixes `yarn run` when used together with workspaces and PnP

  [6444](yarnpkg/yarn#6444) - [**Maël Nison**](https://twitter.com/arcanis)

- Fixes an edge case when peer dependencies were resolved multiple levels deep (`webpack-dev-server`)

  [6443](yarnpkg/yarn#6443) - [**Maël Nison**](https://twitter.com/arcanis)
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.

Plug'n'Play doesn't support Windows paths
5 participants