rvl / bower2nix

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

bower2nix includes ~ in generated versions #3

Closed Baughn closed 7 years ago

Baughn commented 8 years ago

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.

rvl commented 8 years ago

It is indeed the hash which is throwing it off. I'm not even sure what #~1.2 is supposed to mean. In this case I suggest tweaking the generated nix until a solution can be found.

Baughn commented 8 years ago

It seems to mean.. "Look for GitHub releases matching this version, approximately; install that."

johbo commented 7 years ago

It seems to work if we use the source specifier and the resolved version, e.g. components/bootstrap#3.3. Without the source specifier (e.g. just 3.3) I ran into trouble because it looked in the wrong place.

johbo commented 7 years ago

I've added my workaround in https://github.com/rvl/bower2nix/pull/6

rvl commented 7 years ago

Thanks @johbo, workarounds are good. I will check & merge later.

rvl commented 7 years ago

Fixed by 16521d4f502145f6bcaaff992aa13e251f39a930, sorry for the delay.