Re: [Nix-dev] npm prepublish hook

2013-12-10 Thread Mathijs Kwik
On Tue, Dec 10, 2013 at 3:23 PM, Shea Levy  wrote:
> Hmm, that first one could be fixed by running the npm install in $out since
> we've already set up the deps there.

Well there's another issue: that package does not depend on testjs, so
using $out won't help in this case unless we forcefully add an extra
dependency. In the end, I think this is just the packager's fault, but
I'm afraid there will be many more like that, so an in-nix solution is
preferrable instead of contacting all packagers and waiting for them
to fix stuff.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] npm prepublish hook

2013-12-10 Thread Shea Levy
Heh, OK. I will make an issue to track/fix this.

On 12/10/2013 09:34 AM, Mathijs Kwik wrote:
> I'm not gonna push broken stuff :)
>
> On Tue, Dec 10, 2013 at 3:23 PM, Shea Levy  wrote:
>> On 12/10/2013 09:16 AM, Mathijs Kwik wrote:
>>> On Tue, Dec 10, 2013 at 3:01 PM, Shea Levy  wrote:
 maintaining a manual list, as unfortunate as that sounds. Hopefully this
 will be fixed soon in most packages.

 For packages that are installed from a tarball (which is most), issues
 with
 read-only paths shouldn't come up. If there's a common set of utilities
 always expected in $PATH we may as well resign ourselves to adding those
 to
 buildInputs unconditionally.
>>> The 2 cases I found are:
>>> bytebuffer-2.1.0:
>>> bug in the package itself, wants to run hardcoded path
>>> ./node_modules/testjs/bin/testjs
>>> but of course this path is not available in the (extracted) tarball.
>>> protobufjs:
>>> runs tests like "test1 > tests/test1.out", which will fail because
>>> tests is not writable, so the issue _does_ come up.
>> Hmm, that first one could be fixed by running the npm install in $out since
>> we've already set up the deps there. Not sure about the second one, I can't
>> seem to find it in nixpkgs?

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] npm prepublish hook

2013-12-10 Thread Mathijs Kwik
I'm not gonna push broken stuff :)

On Tue, Dec 10, 2013 at 3:23 PM, Shea Levy  wrote:
> On 12/10/2013 09:16 AM, Mathijs Kwik wrote:
>>
>> On Tue, Dec 10, 2013 at 3:01 PM, Shea Levy  wrote:
>>>
>>> maintaining a manual list, as unfortunate as that sounds. Hopefully this
>>> will be fixed soon in most packages.
>>>
>>> For packages that are installed from a tarball (which is most), issues
>>> with
>>> read-only paths shouldn't come up. If there's a common set of utilities
>>> always expected in $PATH we may as well resign ourselves to adding those
>>> to
>>> buildInputs unconditionally.
>>
>> The 2 cases I found are:
>> bytebuffer-2.1.0:
>>bug in the package itself, wants to run hardcoded path
>> ./node_modules/testjs/bin/testjs
>>but of course this path is not available in the (extracted) tarball.
>> protobufjs:
>>runs tests like "test1 > tests/test1.out", which will fail because
>> tests is not writable, so the issue _does_ come up.
>
> Hmm, that first one could be fixed by running the npm install in $out since
> we've already set up the deps there. Not sure about the second one, I can't
> seem to find it in nixpkgs?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] npm prepublish hook

2013-12-10 Thread Shea Levy
On 12/10/2013 09:16 AM, Mathijs Kwik wrote:
> On Tue, Dec 10, 2013 at 3:01 PM, Shea Levy  wrote:
>> maintaining a manual list, as unfortunate as that sounds. Hopefully this
>> will be fixed soon in most packages.
>>
>> For packages that are installed from a tarball (which is most), issues with
>> read-only paths shouldn't come up. If there's a common set of utilities
>> always expected in $PATH we may as well resign ourselves to adding those to
>> buildInputs unconditionally.
> The 2 cases I found are:
> bytebuffer-2.1.0:
>bug in the package itself, wants to run hardcoded path
> ./node_modules/testjs/bin/testjs
>but of course this path is not available in the (extracted) tarball.
> protobufjs:
>runs tests like "test1 > tests/test1.out", which will fail because
> tests is not writable, so the issue _does_ come up.
Hmm, that first one could be fixed by running the npm install in $out 
since we've already set up the deps there. Not sure about the second 
one, I can't seem to find it in nixpkgs?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] npm prepublish hook

2013-12-10 Thread Mathijs Kwik
On Tue, Dec 10, 2013 at 3:01 PM, Shea Levy  wrote:
> maintaining a manual list, as unfortunate as that sounds. Hopefully this
> will be fixed soon in most packages.
>
> For packages that are installed from a tarball (which is most), issues with
> read-only paths shouldn't come up. If there's a common set of utilities
> always expected in $PATH we may as well resign ourselves to adding those to
> buildInputs unconditionally.

The 2 cases I found are:
bytebuffer-2.1.0:
  bug in the package itself, wants to run hardcoded path
./node_modules/testjs/bin/testjs
  but of course this path is not available in the (extracted) tarball.
protobufjs:
  runs tests like "test1 > tests/test1.out", which will fail because
tests is not writable, so the issue _does_ come up.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] npm prepublish hook

2013-12-10 Thread Shea Levy
Hi Mathijs (nix-dev cc'd),

Thanks for pointing this out! This does seem very stupid, but isaacs 
seems committed to the change so we'll have to live with it. 
Unfortunately some packages will *depend* on the new behavior now, so I 
think the best case is maintaining a manual list, as unfortunate as that 
sounds. Hopefully this will be fixed soon in most packages.

For packages that are installed from a tarball (which is most), issues 
with read-only paths shouldn't come up. If there's a common set of 
utilities always expected in $PATH we may as well resign ourselves to 
adding those to buildInputs unconditionally.

Any idea of a better way to do this?

Thanks,
Shea

On 12/10/2013 08:24 AM, Mathijs Kwik wrote:
> Hi Shea,
>
> I noticed a few npms that started running tests during their installation.
> For example "bytebuffer" and "protobufjs".
> It turns out npm decided to run prepublish hooks on install now.
> https://github.com/isaacs/npm/issues/3059
> There is some discussion about it because it sounds like a stupid idea
> (or a stupid hook name), but nixos is bitten by this more than others.
> The prepublish hook for many packages runs tests, and tests expect the
> source dir to be writable or certain things to be available in the
> path.
> I would not expect all packages to better themselves in the short term.
>
> The easiest "fix" is to either remove tests or prepublish from
> package.json as an additional patch in patchSource. However, I think
> we should not hack packages that just work. And because most packages
> get generated, we should keep some "noTests" list externally same as
> with nativeDeps. But that all becomes quite messy and fragile imo.
>
> What do you think?
>
> Regards,
> Mathijs

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev