You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this will then create a 1:1 directory structure and nixify all crates.io JSON files.
@@ -24,13 +27,41 @@ you need rustc nightly from most recent nipxkgs master!
24
27
25
28
example targets:
26
29
30
+
nix-build default.nix -A nixcrates
27
31
nix-build default.nix -A allTargets
28
-
nix-build default.nix -A allCrates.rusqlite
29
32
30
33
warning: there are horrible hack in this project just to make this minimal set of packages work. we were under a lot of time-pressure and low in funding. on judgement day, hopefully god didn't see it!
31
34
32
35
# todos
33
36
34
37
* write better documentation
35
-
* make these work:
36
-
*`rusqlite` (ATM it think it does cross-compiles)
38
+
39
+
40
+
# how it works
41
+
We are parsing the json files of the crates.io repository and translating them into nix files. Considering dependencies we are currently only supporting versening via `~` and `^` as well as single versions. If anything else is used we are switching to the newest version. In case of `^` and `~` we are using the highest allowed version.
42
+
43
+
## how do versions look like in the created
44
+
`{package_name}` is pointing on the newest version.
45
+
`all__{package_name}` contains a set of all versions.
46
+
47
+
There are also several shortcuts to address the newest subversion. For every missing semver version number simply the newest is assumed.
48
+
For example `all__{package_name}.{package_name}_0_1` points the the version of `{package_name}` with `0.1.X` where `X` is the highest number found.
49
+
50
+
## what failes and why?
51
+
52
+
### Missing dependencies
53
+
For some reason sometimes the crates.io json file is not listing all the dependencies. If this occours the missing dependencie has to be added by hand. However eddeting an autogenerated file is a pain.
54
+
Therefore this can be done in the `all_carg-packages.nix` file. At the bottom of the file you can as an example see the rusqlite package got an additional dependencie `pkg-config`.
55
+
56
+
### Resolving dependencies
57
+
Currently we are resolving semver only by choosing the highest allowed version out of the cartes.io repository. This works in most cases.
58
+
However here is a constructed case that would fail:
59
+
60
+
For example your project has 2 dependencies {dep_a} and {dep_b}.
61
+
Lets assume:
62
+
63
+
* `{dep_a}` depends on `{dep_c}` with 0.1.1 <= version <= 0.2.0
64
+
* `{dep_b}` depends on `{dep_c}` with 0.0.1 <= version <= 0.1.2
65
+
66
+
Now our repo would compile `dep_a` with `dep_c_0_2_0` and `dep_b` with `dep_c_0_1_2`. This is a problem as soon as `{dep_a}` as well as `{dep_b}` are exposing types from `{dep_c}` in their interfaces.
0 commit comments