1 |
commit: cff84737fa33c9186b8549c66ecda830382fba36 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Apr 25 03:35:51 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 25 06:05:51 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cff84737 |
7 |
|
8 |
dev-lang/rust: bump to 1.43.0 |
9 |
|
10 |
use system libgit2 |
11 |
initial src_test support (thanks smaeul) |
12 |
clean-up ebuild code a bit |
13 |
|
14 |
Closes: https://bugs.gentoo.org/707746 |
15 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
16 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
17 |
|
18 |
dev-lang/rust/Manifest | 15 + |
19 |
...12-Ignore-broken-and-non-applicable-tests.patch | 89 +++++ |
20 |
....0-llvm10-LLVMTimeTraceProfilerInitialize.patch | 26 ++ |
21 |
dev-lang/rust/files/1.43.0-llvm10.patch | 194 ++++++++++ |
22 |
dev-lang/rust/rust-1.43.0.ebuild | 413 +++++++++++++++++++++ |
23 |
5 files changed, 737 insertions(+) |
24 |
|
25 |
diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest |
26 |
index acba249de03..5f746fe3066 100644 |
27 |
--- a/dev-lang/rust/Manifest |
28 |
+++ b/dev-lang/rust/Manifest |
29 |
@@ -26,5 +26,20 @@ DIST rust-1.41.1-powerpc64le-unknown-linux-gnu.tar.xz 110594504 BLAKE2B eaf9c92e |
30 |
DIST rust-1.41.1-s390x-unknown-linux-gnu.tar.xz 114814112 BLAKE2B ef22c377e1d89ef4ebe78df19d91bcf042e2e1d8997be80d7d40998b18f6b44f8bb1232b1f72e42e3ffb6d1ff235f3cd2f04854e996bbf7be8f6d5d7299e8514 SHA512 f809adc626876df5c6e050362d59189ede5e3991ac41fd129922540abeb728f618e1a3f3925cee34895de5e037141aabb1f8c2b94d4069945d174e38446e8153 |
31 |
DIST rust-1.41.1-x86_64-unknown-linux-gnu.tar.xz 111202140 BLAKE2B 226c68b1e97cc9be82e81f6c9e065e08514166a65a57159c2f63527063ae5f514650afc2591e0c4854ecd0239dc82cbc9a97b99412608645aca879a71354d857 SHA512 c75d4a18cf9300c6ab480d34c5e4b41be971535931455239330cb2a0e927bcf9cf102498cad5dd1d5d802fd1d9c9d214b80e8ff15aa6be68d3e7f41420cad666 |
32 |
DIST rust-1.41.1-x86_64-unknown-linux-musl.tar.xz 96076684 BLAKE2B 3672e24a83c1e4c97a0844f9522a9fced19d5ef01c89d44e54bba8683514a86f7a14ea2e8c2f28d03c65b7e2e0358ff3cea2f85de1e69eb5334c55e18a8c8e4f SHA512 29e7b2aae35017d7f4313e0a482712390ffec752e62d8b1bda95d56a1f93ba882a8f610b469b5d2d7fa3d6d35c2cdc4e45d219ad85b8a3f71ba6ce04b1add48b |
33 |
+DIST rust-1.42.0-aarch64-unknown-linux-gnu.tar.xz 99903344 BLAKE2B 77e64c56c2f3ab505af9d9003d127b8beb3b2204344985faa6de92905c96d92342485e062e0ff1228baf51a67c8c2274078a60cc86e0c67ba99481a5c01d4d0d SHA512 691a11e279efdcafa6bdafacb7fb48ccf653e180e0e85909b6031105a297d47538efb36d63216f6185427f818483a51aa827f351ca2123840d72caf60079fe13 |
34 |
+DIST rust-1.42.0-arm-unknown-linux-gnueabi.tar.xz 102380528 BLAKE2B 5df9a33fa2b1414c9986f01d8dbd85fab2a705818336e1b2c94ca63136be7be63d25a2586efa956cf31aa604106b3c92857e2133169c7f3062da22006f1896bf SHA512 8e1b5351a3289441823ed0ce12f2fb0cedc267efe5c504966aefbc9a74f37ed11f4da1086295d7351c58c2d0bf59c4b7b54b23d5ec0dec4750bd7e38500afeb0 |
35 |
+DIST rust-1.42.0-arm-unknown-linux-gnueabihf.tar.xz 100300920 BLAKE2B eb90db613230e44f5002388d83460b635f33ceee349b094ca2472171d54ce3d459b6a2143a66705ef7ea89dcb0fc9b21e6d2f2f53479098ca8559f7c84ee0697 SHA512 d58c1820f39abfdf74569e26ba4f13347dde16632415d4ec0b54cc99c3b04563ed551ed1ba717b33e9b1a9b13e2502008203472f8ed712e302d1db66909e7ccf |
36 |
+DIST rust-1.42.0-armv7-unknown-linux-gnueabihf.tar.xz 105021972 BLAKE2B 5a04715582193138344ef05700af4ccc90074a1b7d6ed8109993b6c59315e6fd6bc947504fcde36b869da8db4b7b8d8240f908387c8b2d78e21e35f6c27fdef7 SHA512 26768ec530506e20fed8f9ef2c1ca85eec155fc90949f2063836b6109b296a976c8430a698971a8b1c11e8f6ad043d854a36e9f0e849417178411dc5cbd30e59 |
37 |
+DIST rust-1.42.0-i686-unknown-linux-gnu.tar.xz 124258356 BLAKE2B 3e2e0c11e792943be65c989d4b9ba98cc92b2a1dfec7b8506f00d20e439050faf744b991e7e4fa91f0c8a52f7a4e5fb8dc5d383fd0430fa46c4e35dfa5bb26e7 SHA512 7376be5abed573bbf68f73ed5609fa8e22dfa3ead19a3f3d78d553347e3ae01604ab9906f5317f1687a8ab3f9ad9c38cde44ef6f56d7da65a788a74aee9df057 |
38 |
+DIST rust-1.42.0-mips-unknown-linux-gnu.tar.xz 95265764 BLAKE2B b02a340c7689812f7e13286f3dcde893933869c9becb071e9b0455eb68130d74fd67babdf85859ff7b4ef449261be6e09f230a4cf6196041c199d717324c8b21 SHA512 cc19b383ac3dde62750cd247e7fdec9ca4b4ee16880b9b00c42e62c57b46c522950983b500bf8fc70b8198469a18ab92c1ca382e8a07abf8bc937d8f17208d5d |
39 |
+DIST rust-1.42.0-mips64-unknown-linux-gnuabi64.tar.xz 99814476 BLAKE2B 405fa7426a8d21648be97f6b93065b20878419a2c0aa5889ea6a66b9c0f5804d2673a23932a2462965f04e320c4e78f4c79d5b0a6f9877dfe9909d4b4b8864be SHA512 e8933af6290f2cb881fdfc7d2ba3da1c47ef67d847c8a3e659f8f626b7154f202f071ccd4e90555333a3f3dc2bf4101a645b5665dd00a6d72b5acacd6ad317a2 |
40 |
+DIST rust-1.42.0-mipsel-unknown-linux-gnu.tar.xz 95248132 BLAKE2B 875597ba699281d7160ba2f36fe03f3a234d19e5c6e91ce1291ab2369799349a42e1e7e6dcdf524980548a8c499693d6b48967913d4280776da7a921dfd18ab1 SHA512 733307eec1f938385a43b38aadcd84b7d4c1cfc084e070333d955d8b36f3192a7f7e6c05c5c07d782b945acbb261e48db94f2f9f7d3a09e8669055a577c90528 |
41 |
+DIST rust-1.42.0-powerpc-unknown-linux-gnu.tar.xz 100228400 BLAKE2B e05749ab974ffb0dbae332d4f59c8f71047f86c5e33a368555d996ccf14d229b0cda2cfbcf7f05902746fcf9b18a9a1ba4cd8d8cfeb51d3128f04914e8bc062d SHA512 ad2c9d3ebae5ccffd1f70d0a732a3e6cf793b203a8ab7bea3b90d45b63dac84cd513fcc494c7401a6dedcc1e4c3b6fa4ba95a4d3c10411dce5c2a06b84ef934a |
42 |
+DIST rust-1.42.0-powerpc64-unknown-linux-gnu.tar.xz 106116524 BLAKE2B bfa533d3fdeaba4c539f18f205ddaa99c6a6be8f4213cf2d02090cc576ee17c721295262c78d84ec01bc286b59f6a30bf32e7c44e435205908fec03de1a8d60a SHA512 668d1d353bdaf676043ab7f4baad464b202e8ae1be7713e3481b8e9fb5fabd1020e10e178d69d099541cb1b23362b50b826790740156f1c96efa3d2a7457e404 |
43 |
+DIST rust-1.42.0-powerpc64le-unknown-linux-gnu.tar.xz 109926880 BLAKE2B 92a9067ff95bf2293eb5dc3f055275646f9f9764a59ea5dc772b1d8da78c28acfbd93e7a9076dd7ddfb36255cecda0646a7e5cc4ef4767cdb320aaf046f77162 SHA512 e1db9bbef45e88e7d1d5b905379c04786a015c90d0d9de6a6c16276a3e91c342a8231dda7a4d46ecc7adc969d07fd7dd8595975647b9ab69f8997fee74401219 |
44 |
+DIST rust-1.42.0-s390x-unknown-linux-gnu.tar.xz 116937084 BLAKE2B 4d68801c7c40aa0aca24d19d25e80614b5b40aa2715aacddb6b9f5441b1c7e19e7b0d396caea860607df1dc580deadc43d9cd1f988cbe654b3132b665f9032af SHA512 85b1331a9a71cc43a2fa628b8510590ff072e409c2c38ebfd9089ab7a245182e23b52f6221b25c63f6048e1bf4ada0f561dd8f3f810680c9727040bc8a0d8d46 |
45 |
+DIST rust-1.42.0-x86_64-unknown-linux-gnu.tar.xz 110826392 BLAKE2B 8c90bacc9b350d64c4084edf104e9004461d681e19f8e8179ff6eb0b2bc50e25d95e3ed13c83f77224cc60f374f3961f0069dfe20512c844598b8eb2393300b0 SHA512 87c06d4503e7ba12bd3dfc8dd279a3bdf33a24d2c22eec1378b79b2c17ccdad9b4c8dbd0d4704eae1f3476aec5639d3ba143e8c74a296d631b17b57da7447e70 |
46 |
+DIST rust-1.42.0-x86_64-unknown-linux-musl.tar.xz 97471188 BLAKE2B 29e7089a33a20e5c57a68c171e6b049e5dbc97d4c940106bbf7116c970e7ddb2271b1cf33162b4141d89b0b59049e09ca49c848a326036eefbc03e369f3ab18e SHA512 d804a08e38fa6735ce57067a3c39c59e2932943aa8baf43419815e9c743f50e198d88ef80d87fc193b8bcba011c685471146c0741954095eed74e41f86de38c8 |
47 |
DIST rustc-1.41.1-src.tar.xz 93754192 BLAKE2B 235ece650d0c75e1c8700ce73d3811997cd0d827b850a6dd435a269f3f86d85849d54755ea346c5ddcbe0d1224836fd78213f6abeab4a9a8c4c3e2d8a05ff7b4 SHA512 ef33565c9cf4e27ca279072bfed3301e0276c09407d49727640746ba78d289de285278d64b1cce8708461fd6c97c7ab2ea8d56e7a4c4a23b2e66e2d164c35fc9 |
48 |
DIST rustc-1.42.0-src.tar.xz 94186592 BLAKE2B 82298ef3da44188546bb945bcbfc1af630e6a4466b643667da08a04a33c6417afd68fc86302bdd22ab36c208fdb13cbc479e762d1217c05507bbfeb13bfbef7e SHA512 589bfdc92deedd33b8ea0df7f7c64c2a9a085fbea64936eff92f81e812309c060ed7a7adc96f6010d7adf62a68434a230da0f6c5b3540df4e0a5c6de05a31b16 |
49 |
+DIST rustc-1.43.0-src.tar.xz 94354332 BLAKE2B 845b52b6e447b3c9bf3256256f0215056989334d99dc17d196fd088b4c515928602632ce8882316dff6dee462c22aebf5bc7f21da0b4b206ec88bc178ff69163 SHA512 dbff18567f2971da4eb13c670c30b136757692df1bc5024cdc0406f3c30574d3485fd616724987bcc765bc5f64c8ed5026f0e96f11eacb035e00256ed190b4f3 |
50 |
|
51 |
diff --git a/dev-lang/rust/files/0012-Ignore-broken-and-non-applicable-tests.patch b/dev-lang/rust/files/0012-Ignore-broken-and-non-applicable-tests.patch |
52 |
new file mode 100644 |
53 |
index 00000000000..45fda8aeaf8 |
54 |
--- /dev/null |
55 |
+++ b/dev-lang/rust/files/0012-Ignore-broken-and-non-applicable-tests.patch |
56 |
@@ -0,0 +1,89 @@ |
57 |
+From 1879d1d1a284bf51c752e47db284ce22701ed5d0 Mon Sep 17 00:00:00 2001 |
58 |
+From: Samuel Holland <samuel@××××××××.org> |
59 |
+Date: Sun, 16 Sep 2018 16:38:48 +0000 |
60 |
+Subject: [PATCH 12/15] Ignore broken and non-applicable tests |
61 |
+ |
62 |
+c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, #56475 |
63 |
+env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox) |
64 |
+long-linker-command-lines: takes >10 minutes to run (but still passes) |
65 |
+simd-intrinsic-generic-bitmask.rs: broken on BE, #59356 |
66 |
+sparc-struct-abi: no sparc target |
67 |
+sysroot-crates-are-unstable: can't run rustc without RPATH |
68 |
+--- |
69 |
+ src/test/codegen/sparc-struct-abi.rs | 1 + |
70 |
+ src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile | 2 ++ |
71 |
+ src/test/run-make-fulldeps/long-linker-command-lines/Makefile | 2 ++ |
72 |
+ src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile | 2 ++ |
73 |
+ src/test/ui/env-funky-keys.rs | 1 + |
74 |
+ src/test/ui/simd/simd-intrinsic-generic-bitmask.rs | 2 ++ |
75 |
+ 6 files changed, 10 insertions(+) |
76 |
+ |
77 |
+diff --git a/src/test/codegen/sparc-struct-abi.rs b/src/test/codegen/sparc-struct-abi.rs |
78 |
+index 78e5b14a212..6f93e93286b 100644 |
79 |
+--- a/src/test/codegen/sparc-struct-abi.rs |
80 |
++++ b/src/test/codegen/sparc-struct-abi.rs |
81 |
+@@ -4,6 +4,7 @@ |
82 |
+ |
83 |
+ // only-sparc64 |
84 |
+ // compile-flags: -O --target=sparc64-unknown-linux-gnu --crate-type=rlib |
85 |
++// ignore-test |
86 |
+ #![feature(no_core, lang_items)] |
87 |
+ #![no_core] |
88 |
+ |
89 |
+diff --git a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile |
90 |
+index f124ca2ab61..363b18f0985 100644 |
91 |
+--- a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile |
92 |
++++ b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile |
93 |
+@@ -1,3 +1,5 @@ |
94 |
++# ignore-aarch64 |
95 |
++ |
96 |
+ -include ../tools.mk |
97 |
+ |
98 |
+ all: |
99 |
+diff --git a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile |
100 |
+index 5876fbc94bc..5f167ece1a2 100644 |
101 |
+--- a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile |
102 |
++++ b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile |
103 |
+@@ -1,3 +1,5 @@ |
104 |
++# ignore-test |
105 |
++ |
106 |
+ -include ../tools.mk |
107 |
+ |
108 |
+ all: |
109 |
+diff --git a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile |
110 |
+index 9e770706857..6d92ec5cec8 100644 |
111 |
+--- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile |
112 |
++++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile |
113 |
+@@ -1,1 +1,3 @@ |
114 |
++# ignore-test |
115 |
++ |
116 |
+ all: |
117 |
+ python2.7 test.py |
118 |
+diff --git a/src/test/ui/env-funky-keys.rs b/src/test/ui/env-funky-keys.rs |
119 |
+index c5c824ac58d..f3fe047a79c 100644 |
120 |
+--- a/src/test/ui/env-funky-keys.rs |
121 |
++++ b/src/test/ui/env-funky-keys.rs |
122 |
+@@ -1,6 +1,7 @@ |
123 |
+ // run-pass |
124 |
+ // Ignore this test on Android, because it segfaults there. |
125 |
+ |
126 |
++// ignore-test |
127 |
+ // ignore-android |
128 |
+ // ignore-windows |
129 |
+ // ignore-cloudabi no execve |
130 |
+diff --git a/src/test/ui/simd/simd-intrinsic-generic-bitmask.rs b/src/test/ui/simd/simd-intrinsic-generic-bitmask.rs |
131 |
+index b28f742a92e..3ee4ccce731 100644 |
132 |
+--- a/src/test/ui/simd/simd-intrinsic-generic-bitmask.rs |
133 |
++++ b/src/test/ui/simd/simd-intrinsic-generic-bitmask.rs |
134 |
+@@ -2,6 +2,8 @@ |
135 |
+ #![allow(non_camel_case_types)] |
136 |
+ |
137 |
+ // ignore-emscripten |
138 |
++// ignore-powerpc |
139 |
++// ignore-powerpc64 |
140 |
+ |
141 |
+ // Test that the simd_bitmask intrinsic produces correct results. |
142 |
+ |
143 |
+-- |
144 |
+2.24.1 |
145 |
+ |
146 |
|
147 |
diff --git a/dev-lang/rust/files/1.43.0-llvm10-LLVMTimeTraceProfilerInitialize.patch b/dev-lang/rust/files/1.43.0-llvm10-LLVMTimeTraceProfilerInitialize.patch |
148 |
new file mode 100644 |
149 |
index 00000000000..552edddd457 |
150 |
--- /dev/null |
151 |
+++ b/dev-lang/rust/files/1.43.0-llvm10-LLVMTimeTraceProfilerInitialize.patch |
152 |
@@ -0,0 +1,26 @@ |
153 |
+From 724b7ee92f3e83af2a451b726ad990fe7db54528 Mon Sep 17 00:00:00 2001 |
154 |
+From: Nikita Popov <nikita.ppv@×××××.com> |
155 |
+Date: Tue, 4 Feb 2020 20:35:50 +0100 |
156 |
+Subject: [PATCH] Fix timeTraceProfilerInitialize for LLVM 10 |
157 |
+ |
158 |
+--- |
159 |
+ src/rustllvm/PassWrapper.cpp | 6 +++++- |
160 |
+ 1 file changed, 5 insertions(+), 1 deletion(-) |
161 |
+ |
162 |
+diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp |
163 |
+index 65071c3ed86e0..ebf4d4017a813 100644 |
164 |
+--- a/src/rustllvm/PassWrapper.cpp |
165 |
++++ b/src/rustllvm/PassWrapper.cpp |
166 |
+@@ -67,7 +67,11 @@ extern "C" void LLVMInitializePasses() { |
167 |
+ } |
168 |
+ |
169 |
+ extern "C" void LLVMTimeTraceProfilerInitialize() { |
170 |
+-#if LLVM_VERSION_GE(9, 0) |
171 |
++#if LLVM_VERSION_GE(10, 0) |
172 |
++ timeTraceProfilerInitialize( |
173 |
++ /* TimeTraceGranularity */ 0, |
174 |
++ /* ProcName */ "rustc"); |
175 |
++#elif LLVM_VERSION_GE(9, 0) |
176 |
+ timeTraceProfilerInitialize(); |
177 |
+ #endif |
178 |
+ } |
179 |
|
180 |
diff --git a/dev-lang/rust/files/1.43.0-llvm10.patch b/dev-lang/rust/files/1.43.0-llvm10.patch |
181 |
new file mode 100644 |
182 |
index 00000000000..14940716abf |
183 |
--- /dev/null |
184 |
+++ b/dev-lang/rust/files/1.43.0-llvm10.patch |
185 |
@@ -0,0 +1,194 @@ |
186 |
+From fe83c6cd5922fd6f964fa40ca704fb7f92426202 Mon Sep 17 00:00:00 2001 |
187 |
+From: Nikita Popov <nikita.ppv@×××××.com> |
188 |
+Date: Tue, 4 Feb 2020 19:23:45 +0100 |
189 |
+Subject: [PATCH 2/7] Remove trailing newline from llvm-config output |
190 |
+ |
191 |
+--- |
192 |
+ src/bootstrap/test.rs | 2 ++ |
193 |
+ 1 file changed, 2 insertions(+) |
194 |
+ |
195 |
+diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs |
196 |
+index 4cfda606c4bc8..aaec10ff10b38 100644 |
197 |
+--- a/src/bootstrap/test.rs |
198 |
++++ b/src/bootstrap/test.rs |
199 |
+@@ -1142,6 +1142,8 @@ impl Step for Compiletest { |
200 |
+ let llvm_config = builder.ensure(native::Llvm { target: builder.config.build }); |
201 |
+ if !builder.config.dry_run { |
202 |
+ let llvm_version = output(Command::new(&llvm_config).arg("--version")); |
203 |
++ // Remove trailing newline from llvm-config output. |
204 |
++ let llvm_version = llvm_version.trim_end(); |
205 |
+ cmd.arg("--llvm-version").arg(llvm_version); |
206 |
+ } |
207 |
+ if !builder.is_rust_llvm(target) { |
208 |
+ |
209 |
+From 545f18e8f1c2227b74091fbca5c73595f65eeeed Mon Sep 17 00:00:00 2001 |
210 |
+From: Nikita Popov <nikita.ppv@×××××.com> |
211 |
+Date: Sat, 18 Jan 2020 23:00:30 +0100 |
212 |
+Subject: [PATCH 3/7] Fix LLVM version handling in compiletest |
213 |
+ |
214 |
+Convert version string to integer before comparing. Otherwise |
215 |
+we get into trouble with double digit versions ;) |
216 |
+--- |
217 |
+ src/tools/compiletest/src/header.rs | 27 +++++++++++++++++++++------ |
218 |
+ 1 file changed, 21 insertions(+), 6 deletions(-) |
219 |
+ |
220 |
+diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs |
221 |
+index 2a24a8c3c9485..cb648db8830ef 100644 |
222 |
+--- a/src/tools/compiletest/src/header.rs |
223 |
++++ b/src/tools/compiletest/src/header.rs |
224 |
+@@ -191,6 +191,7 @@ impl EarlyProps { |
225 |
+ return true; |
226 |
+ } |
227 |
+ if let Some(ref actual_version) = config.llvm_version { |
228 |
++ let actual_version = version_to_int(actual_version); |
229 |
+ if line.starts_with("min-llvm-version") { |
230 |
+ let min_version = line |
231 |
+ .trim_end() |
232 |
+@@ -199,7 +200,7 @@ impl EarlyProps { |
233 |
+ .expect("Malformed llvm version directive"); |
234 |
+ // Ignore if actual version is smaller the minimum required |
235 |
+ // version |
236 |
+- &actual_version[..] < min_version |
237 |
++ actual_version < version_to_int(min_version) |
238 |
+ } else if line.starts_with("min-system-llvm-version") { |
239 |
+ let min_version = line |
240 |
+ .trim_end() |
241 |
+@@ -208,7 +209,7 @@ impl EarlyProps { |
242 |
+ .expect("Malformed llvm version directive"); |
243 |
+ // Ignore if using system LLVM and actual version |
244 |
+ // is smaller the minimum required version |
245 |
+- config.system_llvm && &actual_version[..] < min_version |
246 |
++ config.system_llvm && actual_version < version_to_int(min_version) |
247 |
+ } else if line.starts_with("ignore-llvm-version") { |
248 |
+ // Syntax is: "ignore-llvm-version <version1> [- <version2>]" |
249 |
+ let range_components = line |
250 |
+@@ -219,15 +220,15 @@ impl EarlyProps { |
251 |
+ .take(3) // 3 or more = invalid, so take at most 3. |
252 |
+ .collect::<Vec<&str>>(); |
253 |
+ match range_components.len() { |
254 |
+- 1 => &actual_version[..] == range_components[0], |
255 |
++ 1 => actual_version == version_to_int(range_components[0]), |
256 |
+ 2 => { |
257 |
+- let v_min = range_components[0]; |
258 |
+- let v_max = range_components[1]; |
259 |
++ let v_min = version_to_int(range_components[0]); |
260 |
++ let v_max = version_to_int(range_components[1]); |
261 |
+ if v_max < v_min { |
262 |
+ panic!("Malformed LLVM version range: max < min") |
263 |
+ } |
264 |
+ // Ignore if version lies inside of range. |
265 |
+- &actual_version[..] >= v_min && &actual_version[..] <= v_max |
266 |
++ actual_version >= v_min && actual_version <= v_max |
267 |
+ } |
268 |
+ _ => panic!("Malformed LLVM version directive"), |
269 |
+ } |
270 |
+@@ -238,6 +239,20 @@ impl EarlyProps { |
271 |
+ false |
272 |
+ } |
273 |
+ } |
274 |
++ |
275 |
++ fn version_to_int(version: &str) -> u32 { |
276 |
++ let version_without_suffix = version.split('-').next().unwrap(); |
277 |
++ let components: Vec<u32> = version_without_suffix |
278 |
++ .split('.') |
279 |
++ .map(|s| s.parse().expect("Malformed version component")) |
280 |
++ .collect(); |
281 |
++ match components.len() { |
282 |
++ 1 => components[0] * 10000, |
283 |
++ 2 => components[0] * 10000 + components[1] * 100, |
284 |
++ 3 => components[0] * 10000 + components[1] * 100 + components[2], |
285 |
++ _ => panic!("Malformed version"), |
286 |
++ } |
287 |
++ } |
288 |
+ } |
289 |
+ } |
290 |
+ |
291 |
+ |
292 |
+From e06fff0609fedf95b826d82ff32ff836b0e3f3da Mon Sep 17 00:00:00 2001 |
293 |
+From: Nikita Popov <nikita.ppv@×××××.com> |
294 |
+Date: Sun, 19 Jan 2020 22:47:45 +0100 |
295 |
+Subject: [PATCH 4/7] Adjust data layout in test |
296 |
+ |
297 |
+--- |
298 |
+ .../run-make-fulldeps/target-specs/my-awesome-platform.json | 2 +- |
299 |
+ .../target-specs/my-x86_64-unknown-linux-gnu-platform.json | 2 +- |
300 |
+ 2 files changed, 2 insertions(+), 2 deletions(-) |
301 |
+ |
302 |
+diff --git a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json |
303 |
+index 8d028280a8da7..00de3de05f07a 100644 |
304 |
+--- a/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json |
305 |
++++ b/src/test/run-make-fulldeps/target-specs/my-awesome-platform.json |
306 |
+@@ -1,5 +1,5 @@ |
307 |
+ { |
308 |
+- "data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128", |
309 |
++ "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128", |
310 |
+ "linker-flavor": "gcc", |
311 |
+ "llvm-target": "i686-unknown-linux-gnu", |
312 |
+ "target-endian": "little", |
313 |
+diff --git a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json |
314 |
+index 48040ae3da0ef..6d5e964ed4fee 100644 |
315 |
+--- a/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json |
316 |
++++ b/src/test/run-make-fulldeps/target-specs/my-x86_64-unknown-linux-gnu-platform.json |
317 |
+@@ -1,6 +1,6 @@ |
318 |
+ { |
319 |
+ "pre-link-args": {"gcc": ["-m64"]}, |
320 |
+- "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128", |
321 |
++ "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", |
322 |
+ "linker-flavor": "gcc", |
323 |
+ "llvm-target": "x86_64-unknown-linux-gnu", |
324 |
+ "target-endian": "little", |
325 |
+ |
326 |
+From 724b7ee92f3e83af2a451b726ad990fe7db54528 Mon Sep 17 00:00:00 2001 |
327 |
+From: Nikita Popov <nikita.ppv@×××××.com> |
328 |
+Date: Tue, 4 Feb 2020 20:35:50 +0100 |
329 |
+Subject: [PATCH 5/7] Fix timeTraceProfilerInitialize for LLVM 10 |
330 |
+ |
331 |
+--- |
332 |
+ src/rustllvm/PassWrapper.cpp | 6 +++++- |
333 |
+ 1 file changed, 5 insertions(+), 1 deletion(-) |
334 |
+ |
335 |
+diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp |
336 |
+index 65071c3ed86e0..ebf4d4017a813 100644 |
337 |
+--- a/src/rustllvm/PassWrapper.cpp |
338 |
++++ b/src/rustllvm/PassWrapper.cpp |
339 |
+@@ -67,7 +67,11 @@ extern "C" void LLVMInitializePasses() { |
340 |
+ } |
341 |
+ |
342 |
+ extern "C" void LLVMTimeTraceProfilerInitialize() { |
343 |
+-#if LLVM_VERSION_GE(9, 0) |
344 |
++#if LLVM_VERSION_GE(10, 0) |
345 |
++ timeTraceProfilerInitialize( |
346 |
++ /* TimeTraceGranularity */ 0, |
347 |
++ /* ProcName */ "rustc"); |
348 |
++#elif LLVM_VERSION_GE(9, 0) |
349 |
+ timeTraceProfilerInitialize(); |
350 |
+ #endif |
351 |
+ } |
352 |
+ |
353 |
+From aed9cf36bb4b9c6b357e395552dbb5e1802feec9 Mon Sep 17 00:00:00 2001 |
354 |
+From: Nikita Popov <nikita.ppv@×××××.com> |
355 |
+Date: Mon, 2 Mar 2020 22:37:55 +0100 |
356 |
+Subject: [PATCH 6/7] Update CreateMemSet() usage for LLVM 10 |
357 |
+ |
358 |
+--- |
359 |
+ src/rustllvm/RustWrapper.cpp | 5 +++++ |
360 |
+ 1 file changed, 5 insertions(+) |
361 |
+ |
362 |
+diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp |
363 |
+index 49b6e1bfec38d..002eb031dac64 100644 |
364 |
+--- a/src/rustllvm/RustWrapper.cpp |
365 |
++++ b/src/rustllvm/RustWrapper.cpp |
366 |
+@@ -1300,8 +1300,13 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B, |
367 |
+ LLVMValueRef Dst, unsigned DstAlign, |
368 |
+ LLVMValueRef Val, |
369 |
+ LLVMValueRef Size, bool IsVolatile) { |
370 |
++#if LLVM_VERSION_GE(10, 0) |
371 |
++ return wrap(unwrap(B)->CreateMemSet( |
372 |
++ unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile)); |
373 |
++#else |
374 |
+ return wrap(unwrap(B)->CreateMemSet( |
375 |
+ unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile)); |
376 |
++#endif |
377 |
+ } |
378 |
+ |
379 |
+ extern "C" LLVMValueRef |
380 |
|
381 |
diff --git a/dev-lang/rust/rust-1.43.0.ebuild b/dev-lang/rust/rust-1.43.0.ebuild |
382 |
new file mode 100644 |
383 |
index 00000000000..f667f663374 |
384 |
--- /dev/null |
385 |
+++ b/dev-lang/rust/rust-1.43.0.ebuild |
386 |
@@ -0,0 +1,413 @@ |
387 |
+# Copyright 1999-2020 Gentoo Authors |
388 |
+# Distributed under the terms of the GNU General Public License v2 |
389 |
+ |
390 |
+EAPI=7 |
391 |
+ |
392 |
+PYTHON_COMPAT=( python3_{6,7,8} ) |
393 |
+ |
394 |
+inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing multilib-build python-any-r1 rust-toolchain toolchain-funcs |
395 |
+ |
396 |
+if [[ ${PV} = *beta* ]]; then |
397 |
+ betaver=${PV//*beta} |
398 |
+ BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" |
399 |
+ MY_P="rustc-beta" |
400 |
+ SLOT="beta/${PV}" |
401 |
+ SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz" |
402 |
+else |
403 |
+ ABI_VER="$(ver_cut 1-2)" |
404 |
+ SLOT="stable/${ABI_VER}" |
405 |
+ MY_P="rustc-${PV}" |
406 |
+ SRC="${MY_P}-src.tar.xz" |
407 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" |
408 |
+fi |
409 |
+ |
410 |
+RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0" |
411 |
+ |
412 |
+DESCRIPTION="Systems programming language from Mozilla" |
413 |
+HOMEPAGE="https://www.rust-lang.org/" |
414 |
+ |
415 |
+SRC_URI=" |
416 |
+ https://static.rust-lang.org/dist/${SRC} -> rustc-${PV}-src.tar.xz |
417 |
+ !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) ) |
418 |
+" |
419 |
+ |
420 |
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 |
421 |
+ NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore ) |
422 |
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
423 |
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} |
424 |
+ |
425 |
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" |
426 |
+ |
427 |
+IUSE="clippy cpu_flags_x86_sse2 debug doc libressl miri nightly parallel-compiler rls rustfmt system-bootstrap system-llvm wasm ${ALL_LLVM_TARGETS[*]}" |
428 |
+ |
429 |
+# Please keep the LLVM dependency block separate. Since LLVM is slotted, |
430 |
+# we need to *really* make sure we're not pulling more than one slot |
431 |
+# simultaneously. |
432 |
+ |
433 |
+# How to use it: |
434 |
+# 1. List all the working slots (with min versions) in ||, newest first. |
435 |
+# 2. Update the := to specify *max* version, e.g. < 11. |
436 |
+# 3. Specify LLVM_MAX_SLOT, e.g. 10. |
437 |
+LLVM_DEPEND=" |
438 |
+ || ( |
439 |
+ sys-devel/llvm:10[${LLVM_TARGET_USEDEPS// /,}] |
440 |
+ sys-devel/llvm:9[${LLVM_TARGET_USEDEPS// /,}] |
441 |
+ ) |
442 |
+ <sys-devel/llvm-11:= |
443 |
+ wasm? ( sys-devel/lld ) |
444 |
+" |
445 |
+LLVM_MAX_SLOT=10 |
446 |
+ |
447 |
+BOOTSTRAP_DEPEND="|| ( >=dev-lang/rust-1.$(($(ver_cut 2) - 1)) >=dev-lang/rust-bin-1.$(($(ver_cut 2) - 1)) )" |
448 |
+ |
449 |
+# libgit2 should be at least same as bungled into libgit-sys #707746 |
450 |
+COMMON_DEPEND=" |
451 |
+ >=dev-libs/libgit2-0.99:= |
452 |
+ net-libs/libssh2:= |
453 |
+ net-libs/http-parser:= |
454 |
+ net-misc/curl:=[ssl] |
455 |
+ sys-libs/zlib:= |
456 |
+ !libressl? ( dev-libs/openssl:0= ) |
457 |
+ libressl? ( dev-libs/libressl:0= ) |
458 |
+ elibc_musl? ( sys-libs/libunwind ) |
459 |
+ system-llvm? ( |
460 |
+ ${LLVM_DEPEND} |
461 |
+ ) |
462 |
+" |
463 |
+ |
464 |
+DEPEND="${COMMON_DEPEND} |
465 |
+ ${PYTHON_DEPS} |
466 |
+ || ( |
467 |
+ >=sys-devel/gcc-4.7 |
468 |
+ >=sys-devel/clang-3.5 |
469 |
+ ) |
470 |
+ system-bootstrap? ( ${BOOTSTRAP_DEPEND} ) |
471 |
+ !system-llvm? ( |
472 |
+ dev-util/cmake |
473 |
+ dev-util/ninja |
474 |
+ ) |
475 |
+" |
476 |
+ |
477 |
+RDEPEND="${COMMON_DEPEND} |
478 |
+ >=app-eselect/eselect-rust-20190311 |
479 |
+" |
480 |
+ |
481 |
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) |
482 |
+ miri? ( nightly ) |
483 |
+ parallel-compiler? ( nightly ) |
484 |
+ wasm? ( llvm_targets_WebAssembly ) |
485 |
+ x86? ( cpu_flags_x86_sse2 ) |
486 |
+" |
487 |
+ |
488 |
+QA_FLAGS_IGNORED=" |
489 |
+ usr/bin/.*-${PV} |
490 |
+ usr/lib.*/lib.*.so |
491 |
+ usr/lib/rustlib/.*/codegen-backends/librustc_codegen_llvm-llvm.so |
492 |
+ usr/lib/rustlib/.*/lib/lib.*.so |
493 |
+" |
494 |
+ |
495 |
+QA_SONAME="usr/lib.*/librustc_macros.*.so" |
496 |
+ |
497 |
+PATCHES=( |
498 |
+ "${FILESDIR}"/1.40.0-add-soname.patch |
499 |
+ "${FILESDIR}"/0012-Ignore-broken-and-non-applicable-tests.patch |
500 |
+ "${FILESDIR}"/1.43.0-llvm10.patch |
501 |
+ "${FILESDIR}"/1.42.0-libressl.patch |
502 |
+) |
503 |
+ |
504 |
+S="${WORKDIR}/${MY_P}-src" |
505 |
+ |
506 |
+toml_usex() { |
507 |
+ usex "$1" true false |
508 |
+} |
509 |
+ |
510 |
+pre_build_checks() { |
511 |
+ CHECKREQS_DISK_BUILD="9G" |
512 |
+ eshopts_push -s extglob |
513 |
+ if is-flagq '-g?(gdb)?([1-9])'; then |
514 |
+ CHECKREQS_DISK_BUILD="15G" |
515 |
+ fi |
516 |
+ eshopts_pop |
517 |
+ check-reqs_pkg_setup |
518 |
+} |
519 |
+ |
520 |
+pkg_pretend() { |
521 |
+ pre_build_checks |
522 |
+} |
523 |
+ |
524 |
+pkg_setup() { |
525 |
+ pre_build_checks |
526 |
+ python-any-r1_pkg_setup |
527 |
+ |
528 |
+ export LIBGIT2_SYS_USE_PKG_CONFIG=1 |
529 |
+ export LIBSSH2_SYS_USE_PKG_CONFIG=1 |
530 |
+ export PKG_CONFIG_ALLOW_CROSS=1 |
531 |
+ |
532 |
+ if use system-llvm; then |
533 |
+ llvm_pkg_setup |
534 |
+ |
535 |
+ local llvm_config="$(get_llvm_prefix "$LLVM_MAX_SLOT")/bin/llvm-config" |
536 |
+ |
537 |
+ export LLVM_LINK_SHARED=1 |
538 |
+ export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)" |
539 |
+ fi |
540 |
+} |
541 |
+ |
542 |
+src_prepare() { |
543 |
+ if ! use system-bootstrap; then |
544 |
+ local rust_stage0_root="${WORKDIR}"/rust-stage0 |
545 |
+ local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)" |
546 |
+ |
547 |
+ "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \ |
548 |
+ --destdir="${rust_stage0_root}" --prefix=/ || die |
549 |
+ fi |
550 |
+ |
551 |
+ default |
552 |
+} |
553 |
+ |
554 |
+src_configure() { |
555 |
+ local rust_target="" rust_targets="" arch_cflags |
556 |
+ |
557 |
+ # Collect rust target names to compile standard libs for all ABIs. |
558 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
559 |
+ rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\"" |
560 |
+ done |
561 |
+ if use wasm; then |
562 |
+ rust_targets="${rust_targets},\"wasm32-unknown-unknown\"" |
563 |
+ fi |
564 |
+ rust_targets="${rust_targets#,}" |
565 |
+ |
566 |
+ local tools="\"cargo\"," |
567 |
+ if use clippy; then |
568 |
+ tools="\"clippy\",$tools" |
569 |
+ fi |
570 |
+ if use miri; then |
571 |
+ tools="\"miri\",$tools" |
572 |
+ fi |
573 |
+ if use rls; then |
574 |
+ tools="\"rls\",\"analysis\",\"src\",$tools" |
575 |
+ fi |
576 |
+ if use rustfmt; then |
577 |
+ tools="\"rustfmt\",$tools" |
578 |
+ fi |
579 |
+ |
580 |
+ local rust_stage0_root |
581 |
+ if use system-bootstrap; then |
582 |
+ rust_stage0_root="$(rustc --print sysroot)" |
583 |
+ else |
584 |
+ rust_stage0_root="${WORKDIR}"/rust-stage0 |
585 |
+ fi |
586 |
+ |
587 |
+ rust_target="$(rust_abi)" |
588 |
+ |
589 |
+ cat <<- EOF > "${S}"/config.toml |
590 |
+ [llvm] |
591 |
+ optimize = $(toml_usex !debug) |
592 |
+ release-debuginfo = $(toml_usex debug) |
593 |
+ assertions = $(toml_usex debug) |
594 |
+ ninja = true |
595 |
+ targets = "${LLVM_TARGETS// /;}" |
596 |
+ experimental-targets = "" |
597 |
+ link-shared = $(toml_usex system-llvm) |
598 |
+ [build] |
599 |
+ build = "${rust_target}" |
600 |
+ host = ["${rust_target}"] |
601 |
+ target = [${rust_targets}] |
602 |
+ cargo = "${rust_stage0_root}/bin/cargo" |
603 |
+ rustc = "${rust_stage0_root}/bin/rustc" |
604 |
+ docs = $(toml_usex doc) |
605 |
+ compiler-docs = $(toml_usex doc) |
606 |
+ submodules = false |
607 |
+ python = "${EPYTHON}" |
608 |
+ locked-deps = true |
609 |
+ vendor = true |
610 |
+ extended = true |
611 |
+ tools = [${tools}] |
612 |
+ verbose = 2 |
613 |
+ sanitizers = false |
614 |
+ profiler = false |
615 |
+ cargo-native-static = false |
616 |
+ [install] |
617 |
+ prefix = "${EPREFIX}/usr" |
618 |
+ libdir = "lib" |
619 |
+ docdir = "share/doc/${PF}" |
620 |
+ mandir = "share/man" |
621 |
+ [rust] |
622 |
+ optimize = true |
623 |
+ debug = $(toml_usex debug) |
624 |
+ debug-assertions = $(toml_usex debug) |
625 |
+ debuginfo-level-rustc = 0 |
626 |
+ backtrace = true |
627 |
+ incremental = false |
628 |
+ default-linker = "$(tc-getCC)" |
629 |
+ parallel-compiler = $(toml_usex parallel-compiler) |
630 |
+ channel = "$(usex nightly nightly stable)" |
631 |
+ rpath = false |
632 |
+ verbose-tests = true |
633 |
+ optimize-tests = $(toml_usex !debug) |
634 |
+ codegen-tests = true |
635 |
+ dist-src = false |
636 |
+ lld = $(usex system-llvm false $(toml_usex wasm)) |
637 |
+ backtrace-on-ice = true |
638 |
+ jemalloc = false |
639 |
+ [dist] |
640 |
+ src-tarball = false |
641 |
+ EOF |
642 |
+ |
643 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
644 |
+ rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) |
645 |
+ arch_cflags="$(get_abi_CFLAGS ${v##*.})" |
646 |
+ |
647 |
+ cat <<- EOF >> "${S}"/config.env |
648 |
+ CFLAGS_${rust_target}=${arch_cflags} |
649 |
+ EOF |
650 |
+ |
651 |
+ cat <<- EOF >> "${S}"/config.toml |
652 |
+ [target.${rust_target}] |
653 |
+ cc = "$(tc-getBUILD_CC)" |
654 |
+ cxx = "$(tc-getBUILD_CXX)" |
655 |
+ linker = "$(tc-getCC)" |
656 |
+ ar = "$(tc-getAR)" |
657 |
+ EOF |
658 |
+ # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true; |
659 |
+ if use elibc_musl; then |
660 |
+ cat <<- EOF >> "${S}"/config.toml |
661 |
+ crt-static = false |
662 |
+ EOF |
663 |
+ fi |
664 |
+ if use system-llvm; then |
665 |
+ cat <<- EOF >> "${S}"/config.toml |
666 |
+ llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" |
667 |
+ EOF |
668 |
+ fi |
669 |
+ done |
670 |
+ if use wasm; then |
671 |
+ cat <<- EOF >> "${S}"/config.toml |
672 |
+ [target.wasm32-unknown-unknown] |
673 |
+ linker = "$(usex system-llvm lld rust-lld)" |
674 |
+ EOF |
675 |
+ fi |
676 |
+ |
677 |
+ einfo "Rust configured with the following settings:" |
678 |
+ cat "${S}"/config.toml || die |
679 |
+} |
680 |
+ |
681 |
+src_compile() { |
682 |
+ env $(cat "${S}"/config.env) RUST_BACKTRACE=1\ |
683 |
+ "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die |
684 |
+} |
685 |
+ |
686 |
+src_test() { |
687 |
+ env $(cat "${S}"/config.env) RUST_BACKTRACE=1\ |
688 |
+ "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml -j$(makeopts_jobs) --no-doc --no-fail-fast \ |
689 |
+ src/test/codegen \ |
690 |
+ src/test/codegen-units \ |
691 |
+ src/test/compile-fail \ |
692 |
+ src/test/incremental \ |
693 |
+ src/test/mir-opt \ |
694 |
+ src/test/pretty \ |
695 |
+ src/test/run-fail \ |
696 |
+ src/test/run-make \ |
697 |
+ src/test/run-make-fulldeps \ |
698 |
+ src/test/ui \ |
699 |
+ src/test/ui-fulldeps || die |
700 |
+} |
701 |
+ |
702 |
+src_install() { |
703 |
+ env $(cat "${S}"/config.env) DESTDIR="${D}" \ |
704 |
+ "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml || die |
705 |
+ |
706 |
+ # bug #689562, #689160 |
707 |
+ rm "${D}/etc/bash_completion.d/cargo" || die |
708 |
+ rmdir "${D}"/etc{/bash_completion.d,} || die |
709 |
+ dobashcomp build/tmp/dist/cargo-image/etc/bash_completion.d/cargo |
710 |
+ |
711 |
+ mv "${ED}/usr/bin/rustc" "${ED}/usr/bin/rustc-${PV}" || die |
712 |
+ mv "${ED}/usr/bin/rustdoc" "${ED}/usr/bin/rustdoc-${PV}" || die |
713 |
+ mv "${ED}/usr/bin/rust-gdb" "${ED}/usr/bin/rust-gdb-${PV}" || die |
714 |
+ mv "${ED}/usr/bin/rust-gdbgui" "${ED}/usr/bin/rust-gdbgui-${PV}" || die |
715 |
+ mv "${ED}/usr/bin/rust-lldb" "${ED}/usr/bin/rust-lldb-${PV}" || die |
716 |
+ mv "${ED}/usr/bin/cargo" "${ED}/usr/bin/cargo-${PV}" || die |
717 |
+ if use clippy; then |
718 |
+ mv "${ED}/usr/bin/clippy-driver" "${ED}/usr/bin/clippy-driver-${PV}" || die |
719 |
+ mv "${ED}/usr/bin/cargo-clippy" "${ED}/usr/bin/cargo-clippy-${PV}" || die |
720 |
+ fi |
721 |
+ if use miri; then |
722 |
+ mv "${ED}/usr/bin/miri" "${ED}/usr/bin/miri-${PV}" || die |
723 |
+ mv "${ED}/usr/bin/cargo-miri" "${ED}/usr/bin/cargo-miri-${PV}" || die |
724 |
+ fi |
725 |
+ if use rls; then |
726 |
+ mv "${ED}/usr/bin/rls" "${ED}/usr/bin/rls-${PV}" || die |
727 |
+ fi |
728 |
+ if use rustfmt; then |
729 |
+ mv "${ED}/usr/bin/rustfmt" "${ED}/usr/bin/rustfmt-${PV}" || die |
730 |
+ mv "${ED}/usr/bin/cargo-fmt" "${ED}/usr/bin/cargo-fmt-${PV}" || die |
731 |
+ fi |
732 |
+ |
733 |
+ # Move public shared libs to abi specific libdir |
734 |
+ # Private and target specific libs MUST stay in /usr/lib/rustlib/${rust_target}/lib |
735 |
+ if [[ $(get_libdir) != lib ]]; then |
736 |
+ dodir /usr/$(get_libdir) |
737 |
+ mv "${ED}/usr/lib"/*.so "${ED}/usr/$(get_libdir)/" || die |
738 |
+ fi |
739 |
+ |
740 |
+ dodoc COPYRIGHT |
741 |
+ rm "${ED}/usr/share/doc/${P}"/*.old || die |
742 |
+ rm "${ED}/usr/share/doc/${P}/LICENSE-APACHE" || die |
743 |
+ rm "${ED}/usr/share/doc/${P}/LICENSE-MIT" || die |
744 |
+ |
745 |
+ # note: eselect-rust adds EROOT to all paths below |
746 |
+ cat <<-EOF > "${T}/provider-${P}" |
747 |
+ /usr/bin/cargo |
748 |
+ /usr/bin/rustdoc |
749 |
+ /usr/bin/rust-gdb |
750 |
+ /usr/bin/rust-gdbgui |
751 |
+ /usr/bin/rust-lldb |
752 |
+ EOF |
753 |
+ if use clippy; then |
754 |
+ echo /usr/bin/clippy-driver >> "${T}/provider-${P}" |
755 |
+ echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" |
756 |
+ fi |
757 |
+ if use miri; then |
758 |
+ echo /usr/bin/miri >> "${T}/provider-${P}" |
759 |
+ echo /usr/bin/cargo-miri >> "${T}/provider-${P}" |
760 |
+ fi |
761 |
+ if use rls; then |
762 |
+ echo /usr/bin/rls >> "${T}/provider-${P}" |
763 |
+ fi |
764 |
+ if use rustfmt; then |
765 |
+ echo /usr/bin/rustfmt >> "${T}/provider-${P}" |
766 |
+ echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" |
767 |
+ fi |
768 |
+ |
769 |
+ insinto /etc/env.d/rust |
770 |
+ doins "${T}/provider-${P}" |
771 |
+} |
772 |
+ |
773 |
+pkg_postinst() { |
774 |
+ eselect rust update --if-unset |
775 |
+ |
776 |
+ elog "Rust installs a helper script for calling GDB and LLDB," |
777 |
+ elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." |
778 |
+ |
779 |
+ if has_version app-editors/emacs; then |
780 |
+ elog "install app-emacs/rust-mode to get emacs support for rust." |
781 |
+ fi |
782 |
+ |
783 |
+ if has_version app-editors/gvim || has_version app-editors/vim; then |
784 |
+ elog "install app-vim/rust-vim to get vim support for rust." |
785 |
+ fi |
786 |
+ |
787 |
+ if use elibc_musl; then |
788 |
+ ewarn "${PN} on *-musl targets is configured with crt-static" |
789 |
+ ewarn "" |
790 |
+ ewarn "you will need to set RUSTFLAGS=\"-C target-feature=-crt-static\" in make.conf" |
791 |
+ ewarn "to use it with portage, otherwise you may see failures like" |
792 |
+ ewarn "error: cannot produce proc-macro for serde_derive v1.0.98 as the target " |
793 |
+ ewarn "x86_64-unknown-linux-musl does not support these crate types" |
794 |
+ fi |
795 |
+} |
796 |
+ |
797 |
+pkg_postrm() { |
798 |
+ eselect rust cleanup |
799 |
+} |