-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
fetch-bower fails fetching components when run under nix-build #18454
Comments
Sorry for the delay @abuibrahim, I will test and merge today. |
Hello @abuibrahim, thanks for your detailed report. I am getting slightly different results to you, so more investigation will be necessary.
In my environment (NixOS 16.09 channel), there was no hash mismatch.
Possibly something caused git to fail to download the jquery package. If it silently fails producing an incorrect result, then that is a bug in bower2nix which could be reported at https://github.com/rvl/bower2nix/issues. |
I am not sure this due to bower2nix. Fetch-bower is calling git and should handle the error's accordingly, no? |
It consistently fails for me both on the latest unstable and 16.09 channels. Can you try updating your channels? My suspect was commit 457eddd but I wasn't able to revert it cleanly to try it out. |
By You are definitely right,
I'm an avid subscriber to 16.09 and especially nixos-unstable, so have tested on those. Obviously it would be easier to fix the error handling if I can make |
I don't have any proxy settings. Is it possible GitHub is rate limiting requests from bower? I found this thread interesting componentjs/component#546 And yes I am running nix-store --delete before trying nix-build. |
Hi @rvl, are there any additional details I can provide? I am not that familiar with typescript or javascript, but I could try to narrow the issue down with some help. |
How to reproduce:
Expected output: bower package info json. |
bower2nix and fetch-bower need git in the PATH to operate. This wrapping got lost with the nodePackages updates. (Fixes NixOS#18454)
Good catch, I think I've seen the same issue as well, but didn't bother (lack of time). Could be a different cause, but we have to start somewhere :) |
Running nix-shell --pure -p nodePackages.bower2nix --command "fetch-bower -o out jquery" produces correct result while let
pkgs = import <nixpkgs> {};
in
pkgs.stdenv.mkDerivation {
name = "jq";
buildInputs = with pkgs; [ nodePackages.bower2nix ];
buildCommand = ''
fetch-bower -o $out jquery
'';
} produces an output without jquery (just meta data) |
Figured it out. Git doesn't see SSL certificates. I made it run with this expression let
pkgs = import <nixpkgs> {};
in
pkgs.stdenv.mkDerivation {
name = "jq";
src = ./.;
buildInputs = with pkgs; [ nodePackages.bower2nix ];
buildCommand = ''
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
fetch-bower --out $out jquery
'';
} I'll try to open a PR to fix this in nixpkgs. I'll also try to open a PR to bower2nix because there is a bug in it - missing SSL cert should not result in exit code 0. |
bower2nix and fetch-bower need git in the PATH to operate. This wrapping got lost with the nodePackages updates. (Fixes NixOS#18454) (cherry picked from commit 952c477)
Issue description
fetch-bower produces truncated nix-store entry when run under nix-build:
Looking into the retrieved jquery in the nix store you can see jquery is actually missing:
It works fine when trying to manually run it as a regular user:
Steps to reproduce
bower.json:
bower-packages.nix generated by
bower2nix bower.json bower-packages.nix
:default.nix:
run nix-build
Technical details
The text was updated successfully, but these errors were encountered: