pnpm / supi

Fast, disk space efficient installation engine. Used by pnpm
MIT License
24 stars 5 forks source link

mkdirp never resolves/rejects #5

Open Akkuma opened 7 years ago

Akkuma commented 7 years ago

pnpm version:

0.2.13

Code to reproduce the issue:

https://github.com/virtru/voltron/blob/19463b64c920aff9d0c24449630463cb009b23ec/lib/voltron.js#L46

Expected behavior:

https://github.com/pnpm/supi/blob/5e774263696d68bd839bce24abef79bcf3bf6f06/src/api/lock.ts#L59 should resolve

Actual behavior:

mkdirp creates the directory, but never resolves or rejects

Additional information:

I manually put in console.log to find out what was stuck when installPkgs was called and found that mkdirp appears to be the culprit for me.

zkochan commented 7 years ago

weird. As a temporary solution you can pass lock: false to installPkgs.

Also, I see the comment in voltron:

//@NOTE: pnpm at one point had issues installing in parallel,
// so we instead resort to sequential installs of extensions

This is something I'd like to support out of the box, passing an array of projects for which pnpm could install simultaneously. It would be a great feature for monorepos

Akkuma commented 7 years ago

So setting it to lock: false didn't help, because I then ran into: https://github.com/pnpm/supi/blob/5e774263696d68bd839bce24abef79bcf3bf6f06/src/api/getContext.ts#L80 another use of mkdirp that seems to not resolve, despite the directory existing. I then run into another never resolving/rejecting scenario within installMultiple

The package.json being transformed into the installables for supi is:

  "devDependencies": {
    "ajv": "^4.11.2",
    "ava": "^0.16.0",
    "ava-spec": "^1.0.0",
    "babel-eslint": "^6.1.2",
    "babel-plugin-istanbul": "^2.0.3",
    "babel-plugin-rewire": "^1.0.0",
    "babel-plugin-syntax-async-functions": "^6.13.0",
    "babel-plugin-transform-async-to-generator": "^6.16.0",
    "babel-preset-es2015-node4": "^2.1.0",
    "babel-preset-stage-2": "^6.17.0",
    "babel-register": "^6.18.0",
    "binary": "git+ssh://git@github.com:virtru/binary.js.git#v1.0.2",
    "browser-env": "^2.0.9",
    "buble": "^0.15.2",
    "buble-loader": "^0.4.0",
    "coffee-script": "^1.12.3",
    "css-loader": "^0.23.1",
    "eslint": "^2.13.1",
    "eslint-config-lint-trap": "github:virtru/lint-trap",
    "eslint-plugin-virtru-lint": "git+ssh://git@github.com/virtru/eslint-plugin-virtru-lint.git",
    "extract-text-webpack-plugin": "^2.1.2",
    "file-loader": "^0.9.0",
    "fly": "1.3.2",
    "html-loader": "^0.3.0",
    "istanbul": "^0.4.5",
    "json-loader": "^0.5.4",
    "node-hook-filename": "^0.3.2",
    "node-sass": "^4.5.3",
    "nodent": "^2.5.4",
    "nodent-loader": "^1.2.4",
    "nyc": "^8.3.1",
    "pug": "^2.0.0-rc.2",
    "pug-loader": "^2.2.1",
    "pug-walk": "0.0.3",
    "raw-loader": "^0.5.1",
    "sass-loader": "^4.0.0",
    "string-replace-loader": "github:Akkuma/string-replace-loader",
    "uglifyjs-webpack-plugin": "^1.0.0-beta.2",
    "url-loader": "^0.5.9",
    "webpack": "^2.7.0"
  },

If I update the list to just webpack, I get farther into the process, but it then stalls on the calculatingIntegrity await, https://github.com/pnpm/supi/blob/5e774263696d68bd839bce24abef79bcf3bf6f06/src/api/install.ts#L558

zkochan commented 7 years ago

I tried to reproduce it with your package.json but could not.

Here's the code I used: https://github.com/zkochan/supi-issue-5

Just install the deps with pnpm and run node index.js