rvl / bower2nix

Generate nix expressions to fetch bower dependencies.
Other
6 stars 10 forks source link

ENOCACHE No cached version for #18

Open jluttine opened 6 years ago

jluttine commented 6 years ago

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.

With original file

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’

Clean GitHub URLs

Based on this comment: https://github.com/rvl/bower2nix/issues/9#issuecomment-253807818 , 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

Add git prefix and suffix

Now I tried adding git@github.com: 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": "git@github.com:georgehrke/jstimezonedetect.git#d90d861a98a30a802cb1f4c7864854fe3a583134",
    "ical.js": "1.2.2",
    "fullcalendar": "3.4.0",
    "hsl_rgb_converter": "git@github.com: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" "git@github.com:georgehrke/jstimezonedetect.git#d90d861a98a30a802cb1f4c7864854fe3a583134" "git@github.com: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" "git@github.com:kayellpeee/hsl_rgb_converter.git#3936a3896dd2f45a5c66317aab6f9175c9fde9fb" "git@github.com: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

Conclusion

I'm out of ideas and very lost here. Any ideas what I'm doing wrong?

rvl commented 6 years ago

Hi @jluttine, thanks for the report! There are two issues.

  1. installing package from a github https URL without version. I will shortly push a fix for this so that you don't need to "clean" the version string.
  2. Fetch bower fails to get hsl_rgb_converter for some reason I haven't figured out yet.
rvl commented 6 years ago

Hi @jluttine Problem 1 is fixed in nixpkgs so might appear on the unstable channel some time. Problem 2 is not fixed yet, but maybe you should reformulate the dependency as kayellpeee/hsl_rgb_converter#3936a3896dd2f45a5c66317aab6f9175c9fde9fb. The advantage of this is that it works, and the version is locked (ensures future nix builds will work!).

jluttine commented 6 years ago

@rvl Thanks! I did try that reformulation you suggest. In my second attempt, I tried this 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"
  }
}

And it didn't work (then at least). Any other workaround ideas?