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

Check os and platform even when engines is not present in package.json #6976

Merged

Conversation

MichaReiser
Copy link
Contributor

Summary

This change ensures that the cpu and os requirements are checked if they are present in the package.json even when the package does not specify any engines requirements.

Fixes #6948

Test plan

package.json:

{
  "cpu": ["i32"],
  "os": ["win32"]
}

Running the following commands on a mac osx machine:

../bin/yarn
yarn install v1.15.0-0
warning package.json: No license field
warning No license field
[1/5] 🔍  Validating package.json...
warning No license field
error @: The platform "darwin" is incompatible with this module.
error @: The CPU architecture "x64" is incompatible with this module.
error Found incompatible module
../bin/yarn --ignore-platform
yarn install v1.15.0-0
warning package.json: No license field
warning No license field
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.22s.

@arcanis
Copy link
Member

arcanis commented Jan 29, 2019

Looks good! Can you run the linting and add an integration test to our new testsuite? This testsuite is located in packages/pkg-tests, and can be run through yarn && yarn jest :)

@MichaReiser MichaReiser force-pushed the fail-if-cpu-or-os-does-not-match branch from b26eb6a to 65def1c Compare January 30, 2019 09:16
@buildsize
Copy link

buildsize bot commented Jan 31, 2019

File name Previous Size New Size Change
yarn-[version].noarch.rpm 1.11 MB 1.11 MB 496 bytes (0%)
yarn-[version].js 4.47 MB 4.47 MB 1.19 KB (0%)
yarn-legacy-[version].js 4.66 MB 4.66 MB 1.19 KB (0%)
yarn-v[version].tar.gz 1.12 MB 1.12 MB 60 bytes (0%)
yarn_[version]all.deb 815.55 KB 815.45 KB -100 bytes (0%)

@arcanis arcanis merged commit 65e198d into yarnpkg:master Feb 1, 2019
@arcanis
Copy link
Member

arcanis commented Feb 1, 2019

🎉

@MichaReiser MichaReiser deleted the fail-if-cpu-or-os-does-not-match branch February 3, 2019 18:34
cacheflow added a commit to cacheflow/yarn that referenced this pull request Feb 14, 2019
* master: (67 commits)
  Include key info for "expected hoisted" invariant (yarnpkg#7009)
  refactor: remove unnecessary checks (yarnpkg#6955)
  fix: drive letter casing for win32 pnp (yarnpkg#7007)
  Don’t call `release` with an exit code (yarnpkg#6981)
  Check os and platform even when engines is not present in package.json (yarnpkg#6976)
  Fix handling of non-offline errors (yarnpkg#6968)
  Treat the ignore-scripts in yarnrc as a synonym to the cli arg (yarnpkg#6983)
  fix(pnp): make sure pnp module is again the first preloaded module. (yarnpkg#6951)
  refactor: remove unused imports (yarnpkg#6956)
  Add 1.14.0 to changelog (yarnpkg#6967)
  1.15.0-0
  v1.14.0
  Fix suggested command after unlinking a package (yarnpkg#6931)
  Update CHANGELOG.md
  fix(pnp): make sure pnp module is the first preloaded module. (yarnpkg#6942)
  fix(pnp): make sure that the package locator is fetched with a trailing slash (yarnpkg#6882)
  Improve rendering of Chocolatey package description (yarnpkg#6899)
  Fixing dynamic require missing from webpack (yarnpkg#6908)
  feat(policies): Use github access token when requesting releases (yarnpkg#6912)
  Fixes PnP detection across workspaces (yarnpkg#6878)
  ...
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.

2 participants