A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/npm/cli/commit/6673c77bc4222d0f1719449fe903b7461b3e6907 below:

add `--libc` option to override platform specific install (#6914) · npm/cli@6673c77 · GitHub

File tree Expand file treeCollapse file tree 10 files changed

+81

-26

lines changed

Filter options

Expand file treeCollapse file tree 10 files changed

+81

-26

lines changed Original file line number Diff line number Diff line change

@@ -37,6 +37,7 @@ class Install extends ArboristWorkspaceCmd {

37 37

'dry-run',

38 38

'cpu',

39 39

'os',

40 +

'libc',

40 41

...super.params,

41 42

]

42 43 Original file line number Diff line number Diff line change

@@ -35,6 +35,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna

35 35

"commit-hooks": true,

36 36

"cpu": null,

37 37

"os": null,

38 +

"libc": null,

38 39

"depth": null,

39 40

"description": true,

40 41

"dev": false,

@@ -245,6 +246,7 @@ json = false

245 246

key = null

246 247

legacy-bundling = false

247 248

legacy-peer-deps = false

249 +

libc = null

248 250

link = false

249 251

local-address = null

250 252

location = "user"

Original file line number Diff line number Diff line change

@@ -903,6 +903,16 @@ Use of \`legacy-peer-deps\` is not recommended, as it will not enforce the

903 903 904 904 905 905 906 +

#### \`libc\`

907 + 908 +

* Default: null

909 +

* Type: null or String

910 + 911 +

Override libc of native modules to install. Acceptable values are same as

912 +

\`libc\` field of package.json

913 + 914 + 915 + 906 916

#### \`link\`

907 917 908 918

* Default: false

@@ -2049,6 +2059,7 @@ Array [

2049 2059

"commit-hooks",

2050 2060

"cpu",

2051 2061

"os",

2062 +

"libc",

2052 2063

"depth",

2053 2064

"description",

2054 2065

"dev",

@@ -2206,6 +2217,7 @@ Array [

2206 2217

"commit-hooks",

2207 2218

"cpu",

2208 2219

"os",

2220 +

"libc",

2209 2221

"depth",

2210 2222

"description",

2211 2223

"dev",

@@ -2395,6 +2407,7 @@ Object {

2395 2407

"json": false,

2396 2408

"key": null,

2397 2409

"legacyPeerDeps": false,

2410 +

"libc": null,

2398 2411

"localAddress": null,

2399 2412

"location": "user",

2400 2413

"lockfileVersion": null,

@@ -3240,7 +3253,7 @@ Options:

3240 3253

[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]

3241 3254

[--strict-peer-deps] [--prefer-dedupe] [--no-package-lock] [--package-lock-only]

3242 3255

[--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links]

3243 -

[--no-fund] [--dry-run] [--cpu <cpu>] [--os <os>]

3256 +

[--no-fund] [--dry-run] [--cpu <cpu>] [--os <os>] [--libc <libc>]

3244 3257

[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]

3245 3258

[-ws|--workspaces] [--include-workspace-root] [--install-links]

3246 3259

@@ -3274,6 +3287,7 @@ aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall

3274 3287

#### \`dry-run\`

3275 3288

#### \`cpu\`

3276 3289

#### \`os\`

3290 +

#### \`libc\`

3277 3291

#### \`workspace\`

3278 3292

#### \`workspaces\`

3279 3293

#### \`include-workspace-root\`

@@ -3337,7 +3351,7 @@ Options:

3337 3351

[--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]

3338 3352

[--strict-peer-deps] [--prefer-dedupe] [--no-package-lock] [--package-lock-only]

3339 3353

[--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links]

3340 -

[--no-fund] [--dry-run] [--cpu <cpu>] [--os <os>]

3354 +

[--no-fund] [--dry-run] [--cpu <cpu>] [--os <os>] [--libc <libc>]

3341 3355

[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]

3342 3356

[-ws|--workspaces] [--include-workspace-root] [--install-links]

3343 3357

@@ -3371,6 +3385,7 @@ alias: it

3371 3385

#### \`dry-run\`

3372 3386

#### \`cpu\`

3373 3387

#### \`os\`

3388 +

#### \`libc\`

3374 3389

#### \`workspace\`

3375 3390

#### \`workspaces\`

3376 3391

#### \`include-workspace-root\`

Original file line number Diff line number Diff line change

@@ -628,7 +628,7 @@ module.exports = cls => class Reifier extends cls {

628 628

process.emit('time', timer)

629 629

this.addTracker('reify', node.name, node.location)

630 630 631 -

const { npmVersion, nodeVersion, cpu, os } = this.options

631 +

const { npmVersion, nodeVersion, cpu, os, libc } = this.options

632 632

const p = Promise.resolve().then(async () => {

633 633

// when we reify an optional node, check the engine and platform

634 634

// first. be sure to ignore the --force and --engine-strict flags,

@@ -638,7 +638,7 @@ module.exports = cls => class Reifier extends cls {

638 638

// eslint-disable-next-line promise/always-return

639 639

if (node.optional) {

640 640

checkEngine(node.package, npmVersion, nodeVersion, false)

641 -

checkPlatform(node.package, false, { cpu, os })

641 +

checkPlatform(node.package, false, { cpu, os, libc })

642 642

}

643 643

await this[_checkBins](node)

644 644

await this[_extractOrLink](node)

Original file line number Diff line number Diff line change

@@ -3295,7 +3295,7 @@ ArboristNode {

3295 3295

}

3296 3296

`

3297 3297 3298 -

exports[`test/arborist/reify.js TAP fail to install optional deps with matched os and mismatched cpu with os and cpu options > expect resolving Promise 1`] = `

3298 +

exports[`test/arborist/reify.js TAP fail to install optional deps with matched os and matched cpu and mismatched libc with os and cpu and libc options > expect resolving Promise 1`] = `

3299 3299

ArboristNode {

3300 3300

"edgesOut": Map {

3301 3301

"platform-specifying-test-package" => EdgeOut {

@@ -3307,14 +3307,14 @@ ArboristNode {

3307 3307

},

3308 3308

"isProjectRoot": true,

3309 3309

"location": "",

3310 -

"name": "tap-testdir-reify-fail-to-install-optional-deps-with-matched-os-and-mismatched-cpu-with-os-and-cpu-options",

3310 +

"name": "tap-testdir-reify-fail-to-install-optional-deps-with-matched-os-and-matched-cpu-and-mismatched-libc-with-os-and-cpu-and-libc-options",

3311 3311

"packageName": "platform-test",

3312 -

"path": "{CWD}/test/arborist/tap-testdir-reify-fail-to-install-optional-deps-with-matched-os-and-mismatched-cpu-with-os-and-cpu-options",

3312 +

"path": "{CWD}/test/arborist/tap-testdir-reify-fail-to-install-optional-deps-with-matched-os-and-matched-cpu-and-mismatched-libc-with-os-and-cpu-and-libc-options",

3313 3313

"version": "1.0.0",

3314 3314

}

3315 3315

`

3316 3316 3317 -

exports[`test/arborist/reify.js TAP fail to install optional deps with mismatched os and matched cpu with os and cpu options > expect resolving Promise 1`] = `

3317 +

exports[`test/arborist/reify.js TAP fail to install optional deps with matched os and mismatched cpu with os and cpu and libc options > expect resolving Promise 1`] = `

3318 3318

ArboristNode {

3319 3319

"edgesOut": Map {

3320 3320

"platform-specifying-test-package" => EdgeOut {

@@ -3326,9 +3326,28 @@ ArboristNode {

3326 3326

},

3327 3327

"isProjectRoot": true,

3328 3328

"location": "",

3329 -

"name": "tap-testdir-reify-fail-to-install-optional-deps-with-mismatched-os-and-matched-cpu-with-os-and-cpu-options",

3329 +

"name": "tap-testdir-reify-fail-to-install-optional-deps-with-matched-os-and-mismatched-cpu-with-os-and-cpu-and-libc-options",

3330 3330

"packageName": "platform-test",

3331 -

"path": "{CWD}/test/arborist/tap-testdir-reify-fail-to-install-optional-deps-with-mismatched-os-and-matched-cpu-with-os-and-cpu-options",

3331 +

"path": "{CWD}/test/arborist/tap-testdir-reify-fail-to-install-optional-deps-with-matched-os-and-mismatched-cpu-with-os-and-cpu-and-libc-options",

3332 +

"version": "1.0.0",

3333 +

}

3334 +

`

3335 + 3336 +

exports[`test/arborist/reify.js TAP fail to install optional deps with mismatched os and matched cpu with os and cpu and libc options > expect resolving Promise 1`] = `

3337 +

ArboristNode {

3338 +

"edgesOut": Map {

3339 +

"platform-specifying-test-package" => EdgeOut {

3340 +

"name": "platform-specifying-test-package",

3341 +

"spec": "1.0.0",

3342 +

"to": null,

3343 +

"type": "optional",

3344 +

},

3345 +

},

3346 +

"isProjectRoot": true,

3347 +

"location": "",

3348 +

"name": "tap-testdir-reify-fail-to-install-optional-deps-with-mismatched-os-and-matched-cpu-with-os-and-cpu-and-libc-options",

3349 +

"packageName": "platform-test",

3350 +

"path": "{CWD}/test/arborist/tap-testdir-reify-fail-to-install-optional-deps-with-mismatched-os-and-matched-cpu-with-os-and-cpu-and-libc-options",

3332 3351

"version": "1.0.0",

3333 3352

}

3334 3353

`

@@ -33165,7 +33184,7 @@ exports[`test/arborist/reify.js TAP store files with a custom indenting > must m

33165 33184 33166 33185

`

33167 33186 33168 -

exports[`test/arborist/reify.js TAP success to install optional deps with matched platform specifications with os and cpu options > expect resolving Promise 1`] = `

33187 +

exports[`test/arborist/reify.js TAP success to install optional deps with matched platform specifications with os and cpu and libc options > expect resolving Promise 1`] = `

33169 33188

ArboristNode {

33170 33189

"children": Map {

33171 33190

"platform-specifying-test-package" => ArboristNode {

@@ -33180,7 +33199,7 @@ ArboristNode {

33180 33199

"location": "node_modules/platform-specifying-test-package",

33181 33200

"name": "platform-specifying-test-package",

33182 33201

"optional": true,

33183 -

"path": "{CWD}/test/arborist/tap-testdir-reify-success-to-install-optional-deps-with-matched-platform-specifications-with-os-and-cpu-options/node_modules/platform-specifying-test-package",

33202 +

"path": "{CWD}/test/arborist/tap-testdir-reify-success-to-install-optional-deps-with-matched-platform-specifications-with-os-and-cpu-and-libc-options/node_modules/platform-specifying-test-package",

33184 33203

"resolved": "https://registry.npmjs.org/platform-specifying-test-package/-/platform-specifying-test-package-1.0.0.tgz",

33185 33204

"version": "1.0.0",

33186 33205

},

@@ -33195,9 +33214,9 @@ ArboristNode {

33195 33214

},

33196 33215

"isProjectRoot": true,

33197 33216

"location": "",

33198 -

"name": "tap-testdir-reify-success-to-install-optional-deps-with-matched-platform-specifications-with-os-and-cpu-options",

33217 +

"name": "tap-testdir-reify-success-to-install-optional-deps-with-matched-platform-specifications-with-os-and-cpu-and-libc-options",

33199 33218

"packageName": "platform-test",

33200 -

"path": "{CWD}/test/arborist/tap-testdir-reify-success-to-install-optional-deps-with-matched-platform-specifications-with-os-and-cpu-options",

33219 +

"path": "{CWD}/test/arborist/tap-testdir-reify-success-to-install-optional-deps-with-matched-platform-specifications-with-os-and-cpu-and-libc-options",

33201 33220

"version": "1.0.0",

33202 33221

}

33203 33222

`

Original file line number Diff line number Diff line change

@@ -470,17 +470,21 @@ t.test('still do not install optional deps with mismatched platform specificatio

470 470

t.test('fail to install deps with mismatched platform specifications', t =>

471 471

t.rejects(printReified(fixture(t, 'platform-specification')), { code: 'EBADPLATFORM' }))

472 472 473 -

t.test('success to install optional deps with matched platform specifications with os and cpu options', t =>

473 +

t.test('success to install optional deps with matched platform specifications with os and cpu and libc options', t =>

474 474

t.resolveMatchSnapshot(printReified(

475 -

fixture(t, 'optional-platform-specification'), { os: 'not-your-os', cpu: 'not-your-cpu' })))

475 +

fixture(t, 'optional-platform-specification'), { os: 'not-your-os', cpu: 'not-your-cpu', libc: 'not-your-libc' })))

476 476 477 -

t.test('fail to install optional deps with matched os and mismatched cpu with os and cpu options', t =>

477 +

t.test('fail to install optional deps with matched os and mismatched cpu with os and cpu and libc options', t =>

478 478

t.resolveMatchSnapshot(printReified(

479 -

fixture(t, 'optional-platform-specification'), { os: 'not-your-os', cpu: 'another-cpu' })))

479 +

fixture(t, 'optional-platform-specification'), { os: 'not-your-os', cpu: 'another-cpu', libc: 'not-your-libc' })))

480 480 481 -

t.test('fail to install optional deps with mismatched os and matched cpu with os and cpu options', t =>

481 +

t.test('fail to install optional deps with mismatched os and matched cpu with os and cpu and libc options', t =>

482 482

t.resolveMatchSnapshot(printReified(

483 -

fixture(t, 'optional-platform-specification'), { os: 'another-os', cpu: 'not-your-cpu' })))

483 +

fixture(t, 'optional-platform-specification'), { os: 'another-os', cpu: 'not-your-cpu', libc: 'not-your-libc' })))

484 + 485 +

t.test('fail to install optional deps with matched os and matched cpu and mismatched libc with os and cpu and libc options', t =>

486 +

t.resolveMatchSnapshot(printReified(

487 +

fixture(t, 'optional-platform-specification'), { os: 'another-os', cpu: 'not-your-cpu', libc: 'not-your-libc' })))

484 488 485 489

t.test('dry run, do not get anything wet', async t => {

486 490

const cases = [

Original file line number Diff line number Diff line change

@@ -24,6 +24,9 @@

24 24

"cpu": [

25 25

"not-your-cpu"

26 26

],

27 +

"libc": [

28 +

"not-your-libc"

29 +

],

27 30

"_id": "platform-specifying-test-package@1.0.0",

28 31

"_nodeVersion": "12.18.4",

29 32

"_npmVersion": "6.14.6",

Original file line number Diff line number Diff line change

@@ -13,12 +13,9 @@

13 13

"unpackedSize": 3481,

14 14

"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbRvlCRA9TVsSAnZWagAAIQMP/jgNB73uGp5pHvkumGq7\nyA6DC6pqL3vU7Pwctr7QzYi+1jHcWwHtNHHTYwrZZru04xLpiQk8BohAfmOt\nEXstFVfMR/C/Y1pAxi3ITPj79zTmgixUVaor9knGWov8gHyFgQsg+2Jf/90E\nv0fOnAKe4+tb1xZNtKiG+Jc2KBIBhVG3g+YjYc8xYz8FaS4Gj9GPwozhE/kl\nHOu+cAXI/CM2nu1U0Q9Jgxna3i/uzXs8exZVzErgHs6sQPKxBpRwItcl4bOi\nkvUJA+QKmiUNHJauJc/1/vK4O8TD35+kiFSrg82MHnrYuDSzfpRhnjWFKlSb\nfcdLICfV0PhR/6KX4ct+uepUAHHJXBpOe48X5zXjMtFcl1MkImzNzXLbuOZ+\nXo+8LCCc7K5AuBx4HDkAHU0hjdG7k6FLf+fjIdeDbFy/bjPHzb6ecyKf73hX\n+Fh1szs37uwsT2M500qgYgfsLl2GuguBEz2IrFaA7ZGmzXZSF34lsH1dXDgY\nl/CFekaEvA4QaIvGL8BM8CdWkFA2VN8xTuZ9+gC9vsLOSnmaM8Qp1iS+mfr9\nVC5FhANvIi8Ckx0iNJQZ0pC8hMdrT5ox8/oSA42l8XZn4PWQWUco3RA6ksig\n2tcUTuRUDeb40SZV3i1l2xS76YBT4ROeYGyXoiPHBECIo4ps0mGmSd1v3Jdk\nk1n3\r\n=gZQk\r\n-----END PGP SIGNATURE-----\r\n"

15 15

},

16 -

"os": [

17 -

"not-your-os"

18 -

],

19 -

"cpu": [

20 -

"not-your-cpu"

21 -

]

16 +

"os": ["not-your-os"],

17 +

"cpu": ["not-your-cpu"],

18 +

"libc": ["not-your-libc"]

22 19

}

23 20

},

24 21

"modified": "2020-09-24T22:21:27.433Z"

Original file line number Diff line number Diff line change

@@ -494,6 +494,16 @@ define('os', {

494 494

flatten,

495 495

})

496 496 497 +

define('libc', {

498 +

default: null,

499 +

type: [null, String],

500 +

description: `

501 +

Override libc of native modules to install.

502 +

Acceptable values are same as \`libc\` field of package.json

503 +

`,

504 +

flatten,

505 +

})

506 + 497 507

define('depth', {

498 508

default: null,

499 509

defaultDescription: `

Original file line number Diff line number Diff line change

@@ -267,6 +267,10 @@ Object {

267 267

"legacy-peer-deps": Array [

268 268

"boolean value (true or false)",

269 269

],

270 +

"libc": Array [

271 +

null,

272 +

Function String(),

273 +

],

270 274

"link": Array [

271 275

"boolean value (true or false)",

272 276

],

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4