rvl / bower2nix Goto Github PK
View Code? Open in Web Editor NEWGenerate nix expressions to fetch bower dependencies.
License: Other
Generate nix expressions to fetch bower dependencies.
License: Other
using bower2nix 3.2.0
with https://github.com/xwiki-labs/cryptpad/blob/38a1e5e39fb854cdbad8896333901beb85ee6510/bower.json results in this error:
bower2nix bower.json bower-generated.nix
(node:26837) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Invalid endpoint: #^1.6.0
it seems this is a feature which is not supported in bower2nix
.
if this patch is applied, it is working:
"html2canvas": "^0.4.1",
"croppie": "^2.5.0",
- "sortablejs": "#^1.6.0",
+ "sortablejs": "^1.6.0",
"saferphore": "^0.0.1"
- },
bower.json
:
{
"name": "nextcloud-calendar",
"dependencies": {
"angular": "1.6.4",
"angular-bootstrap": "2.5.0",
"jquery-timepicker": "883bb2cd94",
"jstzdetect": "https://github.com/georgehrke/jstimezonedetect.git",
"ical.js": "1.2.2",
"fullcalendar": "3.4.0",
"hsl_rgb_converter": "https://github.com/kayellpeee/hsl_rgb_converter.git"
},
"devDependencies": {
"angular-mocks": "1.6.4"
}
}
bower-generated.nix
generated by bower2nix
:
# Generated by bower2nix v3.2.0 (https://github.com/rvl/bower2nix)
{ fetchbower, buildEnv }:
buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
(fetchbower "angular" "1.6.4" "1.6.4" "0d2rfw9763qsggwp72i29n7dllk539y9djzy7jpwxzg7a03kq0xj")
(fetchbower "angular-bootstrap" "2.5.0" "2.5.0" "1hgycif9w3zc2j6ig7wi9hyfxvm8is8h74zpkrrsrfsaabx28b1y")
(fetchbower "jquery-timepicker" "883bb2cd94" "883bb2cd94" "1qbb3zvs26j0c5fjwjv5jfgba7z4nsjly37g89nqm60j5x44f853")
(fetchbower "jstzdetect" "https://github.com/georgehrke/jstimezonedetect.git" "https://github.com/georgehrke/jstimezonedetect.git" "1a81hxn7xz0w0w2av7y4zc2jq99m6gjc8v738x3ncwwd2xiy2sg6")
(fetchbower "ical.js" "1.2.2" "1.2.2" "1liq4nqx5hf313i0fjf35qh77psh4a0dyg6gkwcraia8dn15cc08")
(fetchbower "fullcalendar" "3.4.0" "3.4.0" "1xdqd2r6jngh5afjgw3p9bhbrxbjryvy25igppyh0rvgbaxhgm1b")
(fetchbower "hsl_rgb_converter" "https://github.com/kayellpeee/hsl_rgb_converter.git" "https://github.com/kayellpeee/hsl_rgb_converter.git" "1n0mrjp6gcqr65vbqnkj0y9kc3hs4ymklyiyqvw0rpqpgrg1jkb1")
(fetchbower "angular-mocks" "1.6.4" "1.6.4" "0w4nch7zws18ggxgrgsg2i5p1kxp5gpm0352pjr2a7rjd4l3w8ll")
(fetchbower "jquery" "3.2.1" "2 - 3" "1wfj9lm5qpdqamnwzj6pg56s0vrs162p2faiydvklcd4q1mq04jk")
(fetchbower "moment" "2.19.1" "^2.9.0" "1gj5npzb23pr9sk37vpklbarnpqrh3xb6chnjdnnrnskc8dqr4a6")
]; }
In default.nix
, I use:
bowerComponents = pkgs.buildBowerComponents {
name = "nextcloud-calendar-bower";
generated = ./js/bower-generated.nix;
src = ./js;
};
But I get an error when launching nix-shell
:
error: invalid character ‘:’ in name ‘jstzdetect-https://github.com/georgehrke/jstimezonedetect.git’
Am I doing something wrong or any ideas what is the issue? Should I write those GitHub URLs differently?
For example if bower.json
contains:
...
"purescript-avm-bridge": "../web-bridge",
...
Then building results into:
error: invalid character ‘/’ in name ‘purescript-avm-bridge-../web-bridge’
cc @rvl
E.g. for a bower.json such as this:
{
"name": "jupyter-notebook-deps",
"version": "0.0.1",
"dependencies": {
"backbone": "components/backbone#~1.2",
"bootstrap": "components/bootstrap#~3.3",
(snip)
}
}
...the generated .nix file will include ~ in the version number:
(fetchbower "backbone" "components/backbone#~1.2" "components/backbone#~1.2" "1arcv99907bzr84lfrm9qyv0l8al653p6m4ih188n2dz8dd7n6ls")
(fetchbower "bootstrap" "components/bootstrap#~3.3" "components/bootstrap#~3.3" "1vf8wylj51dh3gkjasnifpycvsfaxjci9hj4vd5q028ck7fprk8g")
Not only does this break bowerVersion, but it would also make the fetch non-fixed in the event that bowerVersion were fixed.
You do handle ~-ranges correctly in other cases; at the moment, I suspect it's the hash that's throwing it off.
seeing as this repo hasn't seen updates in a while, it would seem like it could use more maintainers.
would it perhaps be an idea to have the repo moved to the nix-community
org such that people could more easily contribute to it?
Hi!
I'm trying to test your updated version of bower2nix (version 3.0.1) on my NixOS machine, and while it builds via default.nix, I cannot get it to run after installing the derivation. I get the following error when running bower2nix -v
:
nix/store/ay1al3j3gvjfqdqp58kbn285qblcalir-nodejs-bower2nix-3.0.0/lib/node_modules/bower2nix/dist/bower2nix.js:26
let temp = require('promised-temp').track();
^^^
SyntaxError: Unexpected strict mode reserved word
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/nix/store/ay1al3j3gvjfqdqp58kbn285qblcalir-nodejs-bower2nix-3.0.0/lib/node_modules/bower2nix/bin/bower2nix:3:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
I am not very familiar with TypeScript (or JS for that part), so I think I need some help with debugging this. Any pointers? And thank you for your efforts to make bower2nix a useful tool with decent documentation!
bower2nix
generates following line for a git repository:
(fetchbower "purescript-prim" "hdgarrood/purescript-prim" "hdgarrood/purescript-prim" "0434lf7pkmpyb9pn3yjppmj9mqnx064xaqmjlrcq1vkbwn69n50c")
And then when building the bower project, Nix fails with:
error: invalid character ‘/’ in name ‘purescript-prim-hdgarrood/purescript-prim’
Sounds like an easy fix, but haven't looked into it yet.
Later versions of https://github.com/sensu/uchiwa use angular-tools/ng-jsoneditor
and while bower2nix
will process bower.json
, nix will subsequently fail with:
error: invalid character ‘/’ in name ‘angular-tools/ng-jsoneditor-ea138469f157d8f2b54ec5b8dcf4b08a55b61459
bower-packages.json:
(fetchbower "angular-tools/ng-jsoneditor" "ea138469f157d8f2b54ec5b8dcf4b08a55b61459" "ea138469f157d8f2b54ec5b8dcf4b08a55b61459" "1rr7xf3a2l15g2nmd9svq8ijy1v0igc5jdpwp21kna1kzc65jg3m")
Related to #7?
After using bower2nix
to generate bower-generated.nix, I get the following error when running a nix-build on my expression:
output path ‘/nix/store/lbn3c6i5v62xqi8mk2dfy54vi8mgzkli-angular-block-ui-0.2.2’ has r:sha256 hash ‘09sccghl6mbn32bai6bsa47mw3vibkdnzginc4y62hkx5wks42rk’ when ‘0nzqan0mqj47qic7m74d2rwp178n2wgjw523hw9x2mfnrcicsyvp’ was expected
and the hash is different time I run nix-build!
The problem is easily reproducible.
1- I have the followingbower-generated.nix
:
{ fetchbower, buildEnv }:
buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
(fetchbower "angular-sweetalert" "1.1.0" "1.1.0" "060wmhivpb257xxa4lg9jznnqn9w7rfk5cvx5513pzfmm5clqw4z")
(fetchbower "satellizer" "0.14.1" "0.14.1" "00m566lq6ajknxfvlnz65b4wqr4j6cc6vvsym3jbbf8rnss35yha")
(fetchbower "angular-block-ui" "0.2.2" "0.2.2" "0nzqan0mqj47qic7m74d2rwp178n2wgjw523hw9x2mfnrcicsyvp")
(fetchbower "angular-moment" "1.0.0-beta.6" "1.0.0-beta.6" "1xzx4z35cmaajwrc7vvyg8n7kkpn03p6yg0q54kldrfkc3r19icz")
(fetchbower "ngstorage" "0.3.6" "0.3.6" "06y7y0j6igp6w42kh8msbjfnqs1555jxnw4kq6hcl9s8145a0864")
(fetchbower "angular-smart-table" "2.1.8" "2.1.8" "0yjld9sinx1hxgc28qs8q0dc6xfvf14bdm88zzrwmcdyaggjwf0a")
(fetchbower "ngSticky" "1.8.11" "1.8.11" "1vwsj1dlnl6462ynn6ji4hff7mzf4p7l6lqzv9b7kb8g1w70lkq4")
(fetchbower "angular-bootstrap" "1.3.2" "1.3.2" "0b9kr2926643ryfkmhn0hiv78a82q12qgwyadw2la5ajdkv80pvj")
(fetchbower "angular-ui-router" "0.2.18" "0.2.18" "02xvdn93wfzya6fb6srnk2175hgdkpdwxpnybrsl1yz0j05vphs0")
(fetchbower "angular-google-chart" "0.1.0" "0.1.0" "16gyw7ww5v2ks43gixg7vfynjgm8xar9h77dkvd1ml2r0z2brc73")
(fetchbower "jquery" "2.2.4" "2.2.4" "0jir5x9xgkkpql5kwfclg9j4lpysg9dbkq8qbp5j0384kn23d9x8")
(fetchbower "angular" "1.5.3" "1.5.3" "010fhrgfh8ykwfkyxpndadkpzl72dgy3yr4j83jp3nwpjismnbmg")
(fetchbower "angular-ui-bootstrap" "1.3.2" "1.3.2" "06rfib7mlgbnlaniyb76w1gqzg5s1hccpzv5hbqwhvvk38fyqkgw")
(fetchbower "moment" "2.14.1" "2.14.1" "191x42jhgww1bk2h1zmh08h79fz5g5hps5w874rbj8sc7siabkza")
];
}
2- And this default.nix
:
{ pkgs ? import <nixpkgs> {}
, mySource ? ./.
, system ? builtins.currentSystem
}:
with import <nixpkgs> { inherit system; };
let
bowerPackages = import ./bower-generated.nix { inherit (pkgs) fetchbower buildEnv; };
in
{
bowerComponents = pkgs.stdenv.mkDerivation {
name = "bower_components";
inherit bowerPackages;
src = mySource;
buildPhase = ''
cp -RL --reflink=auto ${bowerPackages} bc
chmod -R u+w bc
HOME=$PWD bower \
--config.storage.packages=bc/packages \
--config.storage.registry=bc/registry \
--offline install
'';
installPhase = "mv bower_components $out";
buildInputs = [ pkgs.git bowerPackages pkgs.nodePackages.bower ];
};
}
3- Command that is run:
$ nix-build
OSX El Capitan v 10.11.5
(Nix) 1.11.2
16.03.1011.6317da4
Latest available release which is also what we have in nixpkgs is 3.1.1 while 3.3 exists upstream.
For example pkgs.stdenv.mkDerivation
in README needs to be pkgs.buildBowerComponents
.
As such:
$ git clone https://github.com/rvl/bower2nix
$ nix-build bower2nix
( snip )
$ result/bin/bower2nix
module.js:327
throw err;
^
Error: Cannot find module '/nix/store/w3fary8sywpl8ad6p1dkwf5a5yw3rbaq-nodejs-bower2nix-3.0.1/lib/node_modules/bower2nix/bin/../dist/bower2nix'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/nix/store/w3fary8sywpl8ad6p1dkwf5a5yw3rbaq-nodejs-bower2nix-3.0.1/lib/node_modules/bower2nix/bin/bower2nix:3:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
I'm not able to generate a nix expression that would work with nix-rebuild
so I thought I'd ask here if I'm doing something wrong or if there's something wrong in bower2nix.
The original bower.json
file looks like:
{
"name": "nextcloud-calendar",
"dependencies": {
"angular": "1.6.4",
"angular-bootstrap": "2.5.0",
"jquery-timepicker": "883bb2cd94",
"jstzdetect": "https://github.com/georgehrke/jstimezonedetect.git",
"ical.js": "1.2.2",
"fullcalendar": "3.4.0",
"hsl_rgb_converter": "https://github.com/kayellpeee/hsl_rgb_converter.git"
},
"devDependencies": {
"angular-mocks": "1.6.4"
}
}
The result of bower2nix
:
# Generated by bower2nix v3.2.0 (https://github.com/rvl/bower2nix)
{ fetchbower, buildEnv }:
buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
(fetchbower "angular" "1.6.4" "1.6.4" "0d2rfw9763qsggwp72i29n7dllk539y9djzy7jpwxzg7a03kq0xj")
(fetchbower "angular-bootstrap" "2.5.0" "2.5.0" "1hgycif9w3zc2j6ig7wi9hyfxvm8is8h74zpkrrsrfsaabx28b1y")
(fetchbower "jquery-timepicker" "883bb2cd94" "883bb2cd94" "1qbb3zvs26j0c5fjwjv5jfgba7z4nsjly37g89nqm60j5x44f853")
(fetchbower "jstzdetect" "https://github.com/georgehrke/jstimezonedetect.git" "https://github.com/georgehrke/jstimezonedetect.git" "1a81hxn7xz0w0w2av7y4zc2jq99m6gjc8v738x3ncwwd2xiy2sg6")
(fetchbower "ical.js" "1.2.2" "1.2.2" "1liq4nqx5hf313i0fjf35qh77psh4a0dyg6gkwcraia8dn15cc08")
(fetchbower "fullcalendar" "3.4.0" "3.4.0" "1xdqd2r6jngh5afjgw3p9bhbrxbjryvy25igppyh0rvgbaxhgm1b")
(fetchbower "hsl_rgb_converter" "https://github.com/kayellpeee/hsl_rgb_converter.git" "https://github.com/kayellpeee/hsl_rgb_converter.git" "1n0mrjp6gcqr65vbqnkj0y9kc3hs4ymklyiyqvw0rpqpgrg1jkb1")
(fetchbower "angular-mocks" "1.6.4" "1.6.4" "0w4nch7zws18ggxgrgsg2i5p1kxp5gpm0352pjr2a7rjd4l3w8ll")
(fetchbower "jquery" "3.2.1" "2 - 3" "1wfj9lm5qpdqamnwzj6pg56s0vrs162p2faiydvklcd4q1mq04jk")
(fetchbower "moment" "2.19.1" "^2.9.0" "1gj5npzb23pr9sk37vpklbarnpqrh3xb6chnjdnnrnskc8dqr4a6")
]; }
Using with nix-rebuild raises this error:
error: invalid character ‘:’ in name ‘jstzdetect-https://github.com/georgehrke/jstimezonedetect.git’
Based on this comment: #9 (comment) , I thought I need to clean the GitHub URLs. So I tried that:
bower.json
:
{
"name": "nextcloud-calendar",
"dependencies": {
"angular": "1.6.4",
"angular-bootstrap": "2.5.0",
"jquery-timepicker": "883bb2cd94",
"jstzdetect": "georgehrke/jstimezonedetect#d90d861a98a30a802cb1f4c7864854fe3a583134",
"ical.js": "1.2.2",
"fullcalendar": "3.4.0",
"hsl_rgb_converter": "kayellpeee/hsl_rgb_converter#3936a3896dd2f45a5c66317aab6f9175c9fde9fb"
},
"devDependencies": {
"angular-mocks": "1.6.4"
}
}
bower2nix
:
# Generated by bower2nix v3.2.0 (https://github.com/rvl/bower2nix)
{ fetchbower, buildEnv }:
buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
(fetchbower "angular" "1.6.4" "1.6.4" "0d2rfw9763qsggwp72i29n7dllk539y9djzy7jpwxzg7a03kq0xj")
(fetchbower "angular-bootstrap" "2.5.0" "2.5.0" "1hgycif9w3zc2j6ig7wi9hyfxvm8is8h74zpkrrsrfsaabx28b1y")
(fetchbower "jquery-timepicker" "883bb2cd94" "883bb2cd94" "1qbb3zvs26j0c5fjwjv5jfgba7z4nsjly37g89nqm60j5x44f853")
(fetchbower "jstzdetect" "georgehrke/jstimezonedetect#d90d861a98a30a802cb1f4c7864854fe3a583134" "georgehrke/jstimezonedetect#d90d861a98a30a802cb1f4c7864854fe3a583134" "1x19wgbwqa6cj8136hbz95n8jg6jchncnqpf6y66jfwnsay835fy")
(fetchbower "ical.js" "1.2.2" "1.2.2" "1liq4nqx5hf313i0fjf35qh77psh4a0dyg6gkwcraia8dn15cc08")
(fetchbower "fullcalendar" "3.4.0" "3.4.0" "1xdqd2r6jngh5afjgw3p9bhbrxbjryvy25igppyh0rvgbaxhgm1b")
(fetchbower "hsl_rgb_converter" "kayellpeee/hsl_rgb_converter#3936a3896dd2f45a5c66317aab6f9175c9fde9fb" "kayellpeee/hsl_rgb_converter#3936a3896dd2f45a5c66317aab6f9175c9fde9fb" "1jq1h2vv5n6h9v8gp5mqp2rsif65vlz7djnkbp9cgmz3wx8w4gmr")
(fetchbower "angular-mocks" "1.6.4" "1.6.4" "0w4nch7zws18ggxgrgsg2i5p1kxp5gpm0352pjr2a7rjd4l3w8ll")
(fetchbower "jquery" "3.2.1" "2 - 3" "1wfj9lm5qpdqamnwzj6pg56s0vrs162p2faiydvklcd4q1mq04jk")
(fetchbower "moment" "2.19.1" "^2.9.0" "1gj5npzb23pr9sk37vpklbarnpqrh3xb6chnjdnnrnskc8dqr4a6")
]; }
nix-rebuild
:
building path(s) ‘/nix/store/aj83x360cca5n3amrr97nkrwpg2qc8an-bower_components-bower-components’
created 33813 symlinks in user environment
bower angular-mocks#1.6.4 cached https://github.com/angular/bower-angular-mocks.git#1.6.4
bower angular#1.6.4 cached https://github.com/angular/bower-angular.git#1.6.4
bower angular-bootstrap#2.5.0 cached https://github.com/angular-ui/bootstrap-bower.git#2.5.0
bower ical.js#1.2.2 cached https://github.com/mozilla-comm/ical.js.git#1.2.2
bower fullcalendar#3.4.0 cached https://github.com/fullcalendar/fullcalendar.git#3.4.0
bower jquery-timepicker#883bb2cd94 cached https://github.com/fgelinas/timepicker.git#883bb2cd94
bower hsl_rgb_converter#* ENOCACHE No cached version for https://github.com/kayellpeee/hsl_rgb_converter.git#*
builder for ‘/nix/store/9qxnnx3shvxjgj8500n54mk1acwkjm47-bower_components-bower-components.drv’ failed with exit code 1
Now I tried adding [email protected]:
prefix and .git
suffix to repo id.
bower.json
:
{
"name": "nextcloud-calendar",
"dependencies": {
"angular": "1.6.4",
"angular-bootstrap": "2.5.0",
"jquery-timepicker": "883bb2cd94",
"jstzdetect": "[email protected]:georgehrke/jstimezonedetect.git#d90d861a98a30a802cb1f4c7864854fe3a583134",
"ical.js": "1.2.2",
"fullcalendar": "3.4.0",
"hsl_rgb_converter": "[email protected]:kayellpeee/hsl_rgb_converter.git#3936a3896dd2f45a5c66317aab6f9175c9fde9fb"
},
"devDependencies": {
"angular-mocks": "1.6.4"
}
}
bower2nix
:
# Generated by bower2nix v3.2.0 (https://github.com/rvl/bower2nix)
{ fetchbower, buildEnv }:
buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
(fetchbower "angular" "1.6.4" "1.6.4" "0d2rfw9763qsggwp72i29n7dllk539y9djzy7jpwxzg7a03kq0xj")
(fetchbower "angular-bootstrap" "2.5.0" "2.5.0" "1hgycif9w3zc2j6ig7wi9hyfxvm8is8h74zpkrrsrfsaabx28b1y")
(fetchbower "jquery-timepicker" "883bb2cd94" "883bb2cd94" "1qbb3zvs26j0c5fjwjv5jfgba7z4nsjly37g89nqm60j5x44f853")
(fetchbower "jstzdetect" "[email protected]:georgehrke/jstimezonedetect.git#d90d861a98a30a802cb1f4c7864854fe3a583134" "[email protected]:georgehrke/jstimezonedetect.git#d90d861a98a30a802cb1f4c7864854fe3a583134" "0lj5lg9dyq3nn44i2fqh92iv45khb6159p0kfcb5fb856yg441iy")
(fetchbower "ical.js" "1.2.2" "1.2.2" "1liq4nqx5hf313i0fjf35qh77psh4a0dyg6gkwcraia8dn15cc08")
(fetchbower "fullcalendar" "3.4.0" "3.4.0" "1xdqd2r6jngh5afjgw3p9bhbrxbjryvy25igppyh0rvgbaxhgm1b")
(fetchbower "hsl_rgb_converter" "[email protected]:kayellpeee/hsl_rgb_converter.git#3936a3896dd2f45a5c66317aab6f9175c9fde9fb" "[email protected]:kayellpeee/hsl_rgb_converter.git#3936a3896dd2f45a5c66317aab6f9175c9fde9fb" "0nk3279aj2zzmsg7l2j1ja0722p0hifcw8fc31623ccfk6l6a6rd")
(fetchbower "angular-mocks" "1.6.4" "1.6.4" "0w4nch7zws18ggxgrgsg2i5p1kxp5gpm0352pjr2a7rjd4l3w8ll")
(fetchbower "jquery" "3.2.1" "2 - 3" "1wfj9lm5qpdqamnwzj6pg56s0vrs162p2faiydvklcd4q1mq04jk")
(fetchbower "moment" "2.19.1" "^2.9.0" "1gj5npzb23pr9sk37vpklbarnpqrh3xb6chnjdnnrnskc8dqr4a6")
]; }
nix-rebuild
:
building path(s) ‘/nix/store/mb82ayriqz93jw5lqk13paskdf4v7n9x-bower-env’
created 33813 symlinks in user environment
created 18 symlinks in user environment
building path(s) ‘/nix/store/2kjp1w15prskv2fixf5vh66wzfyjr57p-bower_components-bower-components’
bower angular-bootstrap#2.5.0 cached https://github.com/angular-ui/bootstrap-bower.git#2.5.0
bower fullcalendar#3.4.0 cached https://github.com/fullcalendar/fullcalendar.git#3.4.0
bower angular#1.6.4 cached https://github.com/angular/bower-angular.git#1.6.4
bower angular-mocks#1.6.4 cached https://github.com/angular/bower-angular-mocks.git#1.6.4
bower jquery-timepicker#883bb2cd94 cached https://github.com/fgelinas/timepicker.git#883bb2cd94
bower ical.js#1.2.2 cached https://github.com/mozilla-comm/ical.js.git#1.2.2
bower jstzdetect#* ENOCACHE No cached version for https://github.com/georgehrke/jstimezonedetect.git#*
builder for ‘/nix/store/ishg4f5n91rhs8qa0n0xhvq2jxgmjbkl-bower_components-bower-components.drv’ failed with exit code 1
I'm out of ideas and very lost here. Any ideas what I'm doing wrong?
Building fetchbower
for package bootstrap-tour
is non-deterministic (and thus build fails).
To reproduce this run
nix-build -E 'let pkgs = import <nixpkgs> {}; in (pkgs.fetchbower "bootstrap-tour" "0.11.0" "0.11.0" "0sfacwp1awvk93s6a5al1385dixblyizgp8dymnwzkac5mg1x01x")'
And observe the output. There is a hash mismatch. Now run it again, resulting hash will be yet another value.
I ran nix-build
with -K
and analysed resulting dirs. Here is the culprit part of the diff
--- a/nix-build-bootstrap-tour-0.11.0.drv-0/out/registry/bower.herokuapp.com/lookup/bootstrap-tour_62fe9
+++ b/nix-build-bootstrap-tour-0.11.0.drv-1/out/registry/bower.herokuapp.com/lookup/bootstrap-tour_62fe9
@@ -1 +1 @@
-{"expires":1484645523867,"value":{"type":"alias","url":"https://github.com/sorich87/bootstrap-tour.git"}}
\ No newline at end of file
+{"expires":1484645546121,"value":{"type":"alias","url":"https://github.com/sorich87/bootstrap-tour.git"}}
\ No newline at end of file
andraz@amaterasu /tmp
Value for expires
is different. I found this bit of fetchbower that is supposed to set it to 0 but apparently it doesn't work in this case (it does work for all other packages I have).
This is as far as I got. I can probably invest some more time into fixing this in the near future if need be.
I don't really know a lot about nodejs but the error seems to be because of an old fs-extra version.
Full message:
$ bower2nix
# Generated by bower2nix v3.2.0 (https://github.com/rvl/bower2nix)
{ fetchbower, buildEnv }:
buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
Parsing /path/to/src/bower.json failed: ReferenceError: primordials is not defined
Coming back to our friend uchiwa
, there are still issues. When running bower2nix, I get hash mismatches when trying to build the package:
output path ‘/nix/store/yyvvlc769izfa0ssdal2g4n0aksmcvdc-uchiwa-web-0.26.1’ has
r:sha256 hash ‘1n4a7inanshh5bxz1c5lwddqyky4innzifzyxvvyjygawg93vi8m’ when
‘13zglwrlba538iqlxmyhfcq51y8xd6d7clnixxqk0zg53ns36cp6’ was expected
The easiest way to try it out is to:
pkgs/servers/monitoring/uchiwa/update.sh
nix-build -A uchiwa $(pwd)
Bower supports resolutions if two packages
are declared with different versions. bower2nix fails to account for that.
A http://sscce.org/: https://gist.github.com/domenkozar/c1a3dbc9ab86c867aa356ea6218533e0
Note that you have to use bower2nix
from master:
git clone https://gist.github.com/c1a3dbc9ab86c867aa356ea6218533e0.git
cd c1a3*
bower2nix > bower-generated.nix && nix-build bower.nix
If you remove the last commit, you'll see that it also doesn't work without resolutions
I tried using bower2nix
as follows in a directory containing bower.json
:
nix-shell --pure -p nodePackages.bower2nix
bower2nix > bower-generated.nix
The content of bower-generated.nix
:
# Generated by bower2nix v3.2.0 (https://github.com/rvl/bower2nix)
{ fetchbower, buildEnv }:
buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [
# failed to fetch "angular": nix-hash failed to exec with error Error: spawn nix-hash ENOENT
# failed to fetch "angular-bootstrap": nix-hash failed to exec with error Error: spawn nix-hash ENOENT
# failed to fetch "jquery-timepicker": nix-hash failed to exec with error Error: spawn nix-hash ENOENT
# failed to fetch "jstzdetect": nix-hash failed to exec with error Error: spawn nix-hash ENOENT
# failed to fetch "ical.js": nix-hash failed to exec with error Error: spawn nix-hash ENOENT
# failed to fetch "fullcalendar": nix-hash failed to exec with error Error: spawn nix-hash ENOENT
# failed to fetch "hsl_rgb_converter": nix-hash failed to exec with error Error: spawn nix-hash ENOENT
# failed to fetch "angular-mocks": nix-hash failed to exec with error Error: spawn nix-hash ENOENT
]; }
Any ideas what's wrong?
{
"name": "my-web-app",
"dependencies": {
"angular": "~1.5.0",
"bootstrap": "~3.3.6"
}
}
What could be the cause?
It would be nice to get a new release that includes package-lock.json
so bower2nix can be packaged using buildNpmPackage
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.