Skip to content

Commit 9328174

Browse files
committed
merge
2 parents 14c5879 + beb9466 commit 9328174

File tree

7,072 files changed

+262120
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,072 files changed

+262120
-32
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,34 @@ a drop-in replacement for `cargo` which yet uses crates.io index.
33

44
**note:** this is an early draft don't expect much.
55

6-
**warning**: crates.io-index uses 'semantic versioning' (see http://semver.org/) and we don't support this here. 'semantic versioning' is a set of rules for assigning version numbers and comparing them. Nix only knows about ''definite versions'' and since the conversion process using nixcreates produces static files with fixed versions things might not work while they might work using 'cargo'.
6+
**warning**: crates.io-index uses 'semantic versioning' (see http://semver.org/) and we don't support this here. 'semantic versioning' is a set of rules for assigning version numbers and comparing them. Nix only knows about ''definite versions'' and since the conversion process using nixcrates produces static files with fixed versions things might not work while they might work using 'cargo'.
77
having only ''definite versions'' implies no dependency calculation, for instance by using SAT to solve them, has prooven to be a great relief in many situations. however, it would require a **cargo2nix** tool to have that.
88

99
# usage
1010

11+
creating a initial crates.io-index conversion:
12+
1113
nix-shell -p cargoc crates
1214
git clone https://github.com/rust-lang/crates.io-index
1315
cargo run ../crates.io-index/ ./nix-crates-index/
1416

1517
this will then create a 1:1 directory structure and nixify all crates.io JSON files.
1618

19+
warning: this repo contains a modified version of a converted crates.io-index
20+
1721
# build examples
1822

23+
you need rustc nightly from most recent nipxkgs master!
24+
1925
example targets:
2026

21-
nix-build default.nix -A getopts-example
22-
nix-build default.nix -A tar-example
23-
nix-build default.nix -A flate2-example
24-
25-
targets we are actually interested in:
27+
nix-build default.nix -A allTargets
28+
nix-build default.nix -A allCrates.rusqlite
29+
30+
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+
32+
# todos
2633

27-
nix-build default.nix -A allCrates.nom
28-
nix-build default.nix -A allCrates.rustfbp
29-
nix-build default.nix -A allCrates.capnp
30-
nix-build default.nix -A nix-crates
34+
* write better documentation
35+
* make these work:
36+
* `rusqlite` (ATM it think it does cross-compiles)

default.nix

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ let
1212
symlinkCalc = pkgs.lib.fold ( dep: str: "${str} ln -sf ${dep}/lib${normalizeName dep.name}.rlib mylibs/ \n") "mkdir mylibs\n ";
1313
in
1414

15-
{
16-
15+
rec {
1716
nix-crates = stdenv.mkDerivation rec {
1817
name = "nix-crates";
1918
src = ./src;
20-
2119

2220
deps = [ allCrates.walkdir allCrates.rustc-serialize allCrates.rustache ];
2321
crates = depsStringCalc deps;
@@ -46,7 +44,9 @@ in
4644
buildPhase = ''
4745
${rustc}/bin/rustc $src/main.rs ${depsString}
4846
./main
49-
exit 1
47+
'';
48+
installPhase=''
49+
mkdir $out
5050
'';
5151
};
5252

@@ -92,9 +92,23 @@ in
9292
else
9393
echo "FAIL: not working!"
9494
fi
95-
exit 1
95+
'';
96+
installPhase=''
97+
mkdir $out
9698
'';
9799
};
98100
# with this you can do: ix-build -A allCrates.getopts to compile single dependencies
99101
inherit allCrates;
102+
103+
allTargets = stdenv.mkDerivation rec {
104+
name="allTargets";
105+
version="1";
106+
buildInputs = with allCrates; [ nom capnp regex json tiny_http tar-example getopts-example rustfbp rusqlite ];
107+
src = ./.;
108+
buildPhase=''
109+
'';
110+
installPhase=''
111+
mkdir $out
112+
'';
113+
};
100114
}

nix-crates-index/1/a.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
a_0_0_1 = buildCratesLib {
5+
name = "a";
6+
version = "0.0.1";
7+
hash = "bae3d8de1b7fd1fef6c2da3130a7d06d32499fd5292a9c1309681ac79e98c643";
8+
deps = with allCrates; [ ];
9+
};}

nix-crates-index/1/c.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
c_0_0_1 = buildCratesLib {
5+
name = "c";
6+
version = "0.0.1";
7+
hash = "9262f44d4a8f5730bf63cf7bdc852240a8ed628e1b59178b721fd3a05e9942d7";
8+
deps = with allCrates; [ libc ];
9+
};
10+
c_1_0_0 = buildCratesLib {
11+
name = "c";
12+
version = "1.0.0";
13+
hash = "23394e1b334e168b5929379221e9613711e23417b9a90151c50c1abacaef1da8";
14+
deps = with allCrates; [ libc ];
15+
};}

nix-crates-index/1/j.nix

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
j_0_1_0 = buildCratesLib {
5+
name = "j";
6+
version = "0.1.0";
7+
hash = "5142ce974d7c7287641b6942c1e59eea3ab5de35bfe8c42bc7e450e8fdff72b4";
8+
deps = with allCrates; [ ];
9+
};
10+
j_0_1_1 = buildCratesLib {
11+
name = "j";
12+
version = "0.1.1";
13+
hash = "2b684a90df63b59132017b73ca869aea55ad9a7dc94575032509829a10530ee7";
14+
deps = with allCrates; [ brev ];
15+
};
16+
j_0_1_2 = buildCratesLib {
17+
name = "j";
18+
version = "0.1.2";
19+
hash = "4fc6e3ff567715863163313f1be2b69f50abe6d427aa58c0203276525fe386ef";
20+
deps = with allCrates; [ ];
21+
};
22+
j_0_1_3 = buildCratesLib {
23+
name = "j";
24+
version = "0.1.3";
25+
hash = "c0a2ce0a9f9776f4c4335cc281d9997576045c44fd154ab48b4052ba8d8530d3";
26+
deps = with allCrates; [ ];
27+
};
28+
j_0_1_4 = buildCratesLib {
29+
name = "j";
30+
version = "0.1.4";
31+
hash = "ca54ca9fc03bcacaa34a5c36ecb29a9e10ac8d1794fb7f88a2e552577045ebec";
32+
deps = with allCrates; [ ];
33+
};
34+
j_0_1_5 = buildCratesLib {
35+
name = "j";
36+
version = "0.1.5";
37+
hash = "fb65f21d5b4666adac084b3289d66b0d3a55968b0d8ea748af9f10a39fb7e44e";
38+
deps = with allCrates; [ ];
39+
};
40+
j_0_2_0 = buildCratesLib {
41+
name = "j";
42+
version = "0.2.0";
43+
hash = "2e95d29efff77a296e07388a38d35ffb9c1047ff9f1641b2312ef72ca6b3997a";
44+
deps = with allCrates; [ clap tempdir regex ];
45+
};
46+
j_0_2_1 = buildCratesLib {
47+
name = "j";
48+
version = "0.2.1";
49+
hash = "988188c9b2854e839a7b3a7cfd3c4a40a4fd1a285eb17195100005065666e70d";
50+
deps = with allCrates; [ clap lazy_static tempdir regex ];
51+
};
52+
j_0_2_2 = buildCratesLib {
53+
name = "j";
54+
version = "0.2.2";
55+
hash = "3bd08da3e53d0527d1cb3b154dd79405a81aa012f3ef329cf63639476140ea08";
56+
deps = with allCrates; [ clap lazy_static regex tempdir ];
57+
};
58+
j_0_2_3 = buildCratesLib {
59+
name = "j";
60+
version = "0.2.3";
61+
hash = "e0bfa64764b3f3559f1777e8d25c282bb6885f6a4919099ab298d7fd13d33413";
62+
deps = with allCrates; [ clap regex lazy_static tempdir ];
63+
};
64+
j_0_2_4 = buildCratesLib {
65+
name = "j";
66+
version = "0.2.4";
67+
hash = "b70ceff379eb876bdf90e70ebbaa038c776bb097ba5d9b12e9bfdf55f85ae1d8";
68+
deps = with allCrates; [ regex clap lazy_static tempdir ];
69+
};
70+
j_0_2_5 = buildCratesLib {
71+
name = "j";
72+
version = "0.2.5";
73+
hash = "4413826edee594dbe99b981dbe38729bece2b9fa2c575e351aa645e78514cdeb";
74+
deps = with allCrates; [ regex clap lazy_static tempdir brev ];
75+
};
76+
j_0_2_6 = buildCratesLib {
77+
name = "j";
78+
version = "0.2.6";
79+
hash = "aa2b59871bad2be41bebb97813b0a6d7f402b4f70f08f095c6d623ddd99e8a81";
80+
deps = with allCrates; [ lazy_static tempdir brev regex clap ];
81+
};
82+
j_0_2_7 = buildCratesLib {
83+
name = "j";
84+
version = "0.2.7";
85+
hash = "ea1b330c595c7139c316dd4c689e734aaf02e2774961c7be85285b304b6bd9f9";
86+
deps = with allCrates; [ lazy_static clap brev regex tempdir ];
87+
};
88+
j_0_2_8 = buildCratesLib {
89+
name = "j";
90+
version = "0.2.8";
91+
hash = "a739ba619a33e45adce054502019f21472564b436c9619f8ab1589b21431161d";
92+
deps = with allCrates; [ regex lazy_static brev clap tempdir ];
93+
};
94+
j_0_2_9 = buildCratesLib {
95+
name = "j";
96+
version = "0.2.9";
97+
hash = "896bf4bd189e76fa776f503f51b48fc5fa86ee68781fd4687c55a8d083a65974";
98+
deps = with allCrates; [ clap lazy_static brev itertools tempdir regex ];
99+
};
100+
j_0_2_10 = buildCratesLib {
101+
name = "j";
102+
version = "0.2.10";
103+
hash = "e942f3710954cd4e2882066b2b8801dd3b161975eaa885bd27c6e35506566be4";
104+
deps = with allCrates; [ lazy_static brev itertools regex clap tempdir ];
105+
};
106+
j_0_2_11 = buildCratesLib {
107+
name = "j";
108+
version = "0.2.11";
109+
hash = "892f4c0fc853a6b15f2a8b325ccac3f8fc5ae9c28459c4bfb791b40a98f8c744";
110+
deps = with allCrates; [ ];
111+
};}

nix-crates-index/1/m.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
m_0_1_0 = buildCratesLib {
5+
name = "m";
6+
version = "0.1.0";
7+
hash = "e8e24f3e3aa9d00b991b55b6b7989afb3225eb113eb632edc0f7bf73d43c5e89";
8+
deps = with allCrates; [ ];
9+
};
10+
m_0_1_1 = buildCratesLib {
11+
name = "m";
12+
version = "0.1.1";
13+
hash = "9199148efbf3463493dd58c03a921add4623147739b9acd15f339b1dc5bfd677";
14+
deps = with allCrates; [ ];
15+
};}

nix-crates-index/1/q.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
q_0_0_1 = buildCratesLib {
5+
name = "q";
6+
version = "0.0.1";
7+
hash = "d10daaba5144965afb3e6ee2c3847579294a7054ff96775e9d02374b8ace333d";
8+
deps = with allCrates; [ ];
9+
};}

nix-crates-index/1/r.nix

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
r_0_0_1 = buildCratesLib {
5+
name = "r";
6+
version = "0.0.1";
7+
hash = "8e7875ef0b519a92e8cc645940fd606579817627939c5e2d0c785fbba8ee53cd";
8+
deps = with allCrates; [ ];
9+
};
10+
r_0_0_2 = buildCratesLib {
11+
name = "r";
12+
version = "0.0.2";
13+
hash = "e375c7deee5a200051e9dcbc553f01b5f6af3daf3378ff0dda78f7b3e0ccfa74";
14+
deps = with allCrates; [ ];
15+
};
16+
r_0_0_3 = buildCratesLib {
17+
name = "r";
18+
version = "0.0.3";
19+
hash = "1125f3ab33fe862e9aa6e1a1a69272ebde8d88ec2fdbe73ebcb4ce3cebb8c6e6";
20+
deps = with allCrates; [ ];
21+
};
22+
r_0_0_4 = buildCratesLib {
23+
name = "r";
24+
version = "0.0.4";
25+
hash = "061ba5b11cfc0e506ae84e488559e882725b3f12cc6c8c30ba9f348f87b50934";
26+
deps = with allCrates; [ ];
27+
};
28+
r_0_0_5 = buildCratesLib {
29+
name = "r";
30+
version = "0.0.5";
31+
hash = "f0e4655c9bdf25b2789d6e537bb0d5c76a8d5cf1497de304619aa27e78064db8";
32+
deps = with allCrates; [ ];
33+
};
34+
r_0_0_6 = buildCratesLib {
35+
name = "r";
36+
version = "0.0.6";
37+
hash = "bfe3531d7cf8ac54012bdab630404bc34228dc59224483adc2f618f9198fae7f";
38+
deps = with allCrates; [ ];
39+
};
40+
r_0_0_7 = buildCratesLib {
41+
name = "r";
42+
version = "0.0.7";
43+
hash = "a37516ee1bbee94c9395092b51c98012d914839b0b7e3aa7de517d5e5fcf0e30";
44+
deps = with allCrates; [ rand ];
45+
};
46+
r_0_0_9 = buildCratesLib {
47+
name = "r";
48+
version = "0.0.9";
49+
hash = "80e936d744cbaa0564128675ed776ce70c6f4622dca3d101490afe18ddad199f";
50+
deps = with allCrates; [ rand ];
51+
};}

nix-crates-index/1/t.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
t_0_0_1 = buildCratesLib {
5+
name = "t";
6+
version = "0.0.1";
7+
hash = "bd131e4c8dd914a72a9c6575db8fbbe9522616d19fe40f9a9e1a3a6b129c783e";
8+
deps = with allCrates; [ time ];
9+
};}

nix-crates-index/1/x.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
x_0_0_0 = buildCratesLib {
5+
name = "x";
6+
version = "0.0.0";
7+
hash = "ed1c683c8bf5a9c931c1f23848b38595189694faab7cd47b17f62831d6e7741d";
8+
deps = with allCrates; [ ];
9+
};}

nix-crates-index/1/z.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
z_0_1_0 = buildCratesLib {
5+
name = "z";
6+
version = "0.1.0";
7+
hash = "1e273e0bece59b41b32f80f99f849f99d6f2b4d1ad489c524b0cf4e45e951afa";
8+
deps = with allCrates; [ thread-id time leb128 ];
9+
};
10+
z_0_2_0 = buildCratesLib {
11+
name = "z";
12+
version = "0.2.0";
13+
hash = "31322717738195790382a6b2d1431ee34a7995b7f46b4b2037d6c06997ee2414";
14+
deps = with allCrates; [ ];
15+
};}

nix-crates-index/2/an.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#DON'T EDIT. AUTOGENERATED FILE
2+
{buildCratesLib, allCrates}:
3+
{
4+
an_0_0_1 = buildCratesLib {
5+
name = "an";
6+
version = "0.0.1";
7+
hash = "97c9e07999d532286b81b7b03d28fb06e39b9d21428b0751f087184b54fb6b1c";
8+
deps = with allCrates; [ ];
9+
};
10+
an_0_0_2 = buildCratesLib {
11+
name = "an";
12+
version = "0.0.2";
13+
hash = "a492c18cfcd9eea594d08ba6f38690479b7a89f02886b1e95e5d8fb2b6d38654";
14+
deps = with allCrates; [ ];
15+
};}

0 commit comments

Comments
 (0)