NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.84k stars 13.92k forks source link

Pulp node package breaks with error about asyncWrite. #40406

Open seanparsons opened 6 years ago

seanparsons commented 6 years ago

Issue description

When trying to invoke pulp init with the version supplied in nixpkgs it breaks with the following error:

/nix/store/qmms9252s15znp1wj7c8n71q3vsysbnh-node-pulp-12.0.1/lib/node_modules/pulp/node_modules/readable-stream/lib/_stream_writable.js:470
      asyncWrite(afterWrite, stream, state, finished, cb);
      ^

TypeError: asyncWrite is not a function
    at onwrite (/nix/store/qmms9252s15znp1wj7c8n71q3vsysbnh-node-pulp-12.0.1/lib/node_modules/pulp/node_modules/readable-stream/lib/_stream_writable.js:470:7)
    at WritableState.onwrite (/nix/store/qmms9252s15znp1wj7c8n71q3vsysbnh-node-pulp-12.0.1/lib/node_modules/pulp/node_modules/readable-stream/lib/_stream_writable.js:180:5)
    at ConcatStream._write (/nix/store/qmms9252s15znp1wj7c8n71q3vsysbnh-node-pulp-12.0.1/lib/node_modules/pulp/node_modules/concat-stream/index.js:46:3)
    at doWrite (/nix/store/qmms9252s15znp1wj7c8n71q3vsysbnh-node-pulp-12.0.1/lib/node_modules/pulp/node_modules/readable-stream/lib/_stream_writable.js:418:64)
    at writeOrBuffer (/nix/store/qmms9252s15znp1wj7c8n71q3vsysbnh-node-pulp-12.0.1/lib/node_modules/pulp/node_modules/readable-stream/lib/_stream_writable.js:407:5)
    at ConcatStream.Writable.write (/nix/store/qmms9252s15znp1wj7c8n71q3vsysbnh-node-pulp-12.0.1/lib/node_modules/pulp/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Socket.ondata (_stream_readable.js:555:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)

Steps to reproduce

Note: If successful this will start creating a project in the current directory.

nix-shell -p node8Packages.pulp -p haskellPackages.purescript --command "pulp init"

Technical details

 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.37, NixOS, 18.03.132304.45cd6090d9a (Impala)`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.0.1`
 - channels(root): `"nixos-18.03.132304.45cd6090d9a"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`
seanparsons commented 6 years ago

@svanderburg I tried to create a derivation for this manually with node2nix and got the same issue, so it might be a node2nix issue under the hood, maybe?

svanderburg commented 6 years ago

@seanparsons Just checked it myself, and I'm having the same error. I guess the "flattening algorithm" is the culprit -- when I use the development version of node2nix with the --no-flatten parameter, it seems to work.

I guess the wrong (outdated) version of the readable-stream package is used for some reason. I need to investigate this.

jacereda commented 6 years ago

Same for me on Darwin.

svanderburg commented 6 years ago

Hi, can you make an issue for this on the node2nix github page? http://github.com/svanderburg/node2nix ?

I recently discovered a bug in the generator. I am still testing it, but maybe the development version already solves it.

Op di 5 jun. 2018 22:04 schreef jacereda notifications@github.com:

Same for me on Darwin.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NixOS/nixpkgs/issues/40406#issuecomment-394842143, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGY9_6hBzuOnw69EQqboRdYDl3u4IWHks5t5uRfgaJpZM4T8dC9 .

svanderburg commented 6 years ago

I just checked the development version, and it seems to properly deploy without showing the error. I'll try to speed up the upcoming release to get this problem fixed.

On Tue, Jun 5, 2018 at 10:54 PM Sander van der Burg svanderburg@gmail.com wrote:

Hi, can you make an issue for this on the node2nix github page? http://github.com/svanderburg/node2nix ?

I recently discovered a bug in the generator. I am still testing it, but maybe the development version already solves it.

Op di 5 jun. 2018 22:04 schreef jacereda notifications@github.com:

Same for me on Darwin.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NixOS/nixpkgs/issues/40406#issuecomment-394842143, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGY9_6hBzuOnw69EQqboRdYDl3u4IWHks5t5uRfgaJpZM4T8dC9 .

jacereda commented 6 years ago

Nice. With "development version", are you referring to pulp or node2nix?

svanderburg commented 6 years ago

@jacereda The development version of node2nix

Ekleog commented 6 years ago

(triage) if I understand correctly this issue is solved in the latest version of node2nix? If so, this issue could be closed.

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.