1 |
commit: ee0b0c2a15a7fbf9e7346f708d88bafdd4336239 |
2 |
Author: orbea <orbea <AT> riseup <DOT> net> |
3 |
AuthorDate: Wed Sep 21 17:15:40 2022 +0000 |
4 |
Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com> |
5 |
CommitDate: Fri Sep 23 15:59:40 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=ee0b0c2a |
7 |
|
8 |
dev-lang/rust: Add 1.63.0-r1 |
9 |
|
10 |
Signed-off-by: orbea <orbea <AT> riseup.net> |
11 |
Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com> |
12 |
|
13 |
dev-lang/rust/Manifest | 34 + |
14 |
.../rust/files/1.62.1-musl-dynamic-linking.patch | 25 + |
15 |
dev-lang/rust/files/1.63.0-CVE-2022-36113.patch | 48 ++ |
16 |
dev-lang/rust/files/1.63.0-CVE-2022-36114.patch | 102 +++ |
17 |
dev-lang/rust/rust-1.63.0-r1.ebuild | 771 +++++++++++++++++++++ |
18 |
5 files changed, 980 insertions(+) |
19 |
|
20 |
diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest |
21 |
index 9b6c54d..c74098e 100644 |
22 |
--- a/dev-lang/rust/Manifest |
23 |
+++ b/dev-lang/rust/Manifest |
24 |
@@ -126,6 +126,38 @@ DIST rust-1.61.0-x86_64-unknown-linux-gnu.tar.xz 157592468 BLAKE2B 0877c0794280a |
25 |
DIST rust-1.61.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 5296a8df210a4cf2fd7dffcba1ae6bd8cda9e408ff4c55d997199c2890b9faab9e8d6d22a3c0961786bb80231836047929621edf9043d474b352fe28bd9192e8 SHA512 cb97e84cd793aa8676c41297d8da14125855c008815e65d8191868eb88241ccb408c6f9ae85b7ba8de1a02ea8923f5e042f4fea662fa593e5ec03505b41ee52d |
26 |
DIST rust-1.61.0-x86_64-unknown-linux-musl.tar.xz 259724324 BLAKE2B d005bd2794d196136c42842fbb7bc64d827898b5713f768cf0e88be5a40e3906139027ee58571cfccd8d2c864f672d1986da28c72f0d1c4a7f78d18efe14385e SHA512 96d09ac3a48bb2956dd6bf219e605c68327a94d09e72290ee74781c4886dce93b217163fb08dac0ce69bfaa2e3ab8cccd4a26d10b9df4c3162822a38e355bdb6 |
27 |
DIST rust-1.61.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B e1c8061c80cd5445f7df9c44044ccb47731704b93d4e86cf95bd3b1b08a3c3cdb61e21349088cd0127632c63a0f7c22f0fa209809450dd81607bf7353d61a7b4 SHA512 587f487a3c8159a4b102f15a484a0ffa4f32c2abd2fb4ca078c27d36f6ff365c95015a99494e852631e9f92bfc9f33a0266c5f62b7edfce823c34993ff6a836b |
28 |
+DIST rust-1.62.0-aarch64-unknown-linux-gnu.tar.xz 228388556 BLAKE2B 2b2d8428c97bfeb64bd999670e4ef2b6c4732cdfd7cac0cf37c5adb8ee83fd467e1e94bcb6a9edf28838fd052d19a7cbc273175c8360696bbec4523e1ff069a6 SHA512 10964fe48ee59ef2e44e9d0a0daa750cd06cc52198664b544166a846667366e7f0000129612f4d68e1530dab28987f62ccacd82f6d5663d0091cf7a451469219 |
29 |
+DIST rust-1.62.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 6cf85d71d188bc931cbb21dac1387fa9fb8b45bcf0984bfd5af1a3f1ac581b74e37df337138b05b2d74ed1572d6e859418c33c2fe4bb72f5a3b15cb6302060d4 SHA512 452610627d8d01474ed38b7d3ff7c3c0174cc5b3468cbd0f274b6124ff6497dcae6f0abb6b9688f64be89c524c8fe18aaf5fd56dcd2530df6c247688cac1a230 |
30 |
+DIST rust-1.62.0-aarch64-unknown-linux-musl.tar.xz 223168712 BLAKE2B 9007a612ed5ec279c346abaeb4213a71d3acae9e5b1934380c9959e74db8b196b59f1197d1714a076040ff68f2b4f0e4937feb226cfaa0bdd272838d67eb07cb SHA512 253ba647102cb5599cfbfbfaf5f77ab2389e4bc77bce6cfd8aba037f6bd349081965d505fc30e9538df9353e923e66fa451ab73076d7224703cab1e24a81cf1f |
31 |
+DIST rust-1.62.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 54d54528fed34d0325d50a44ea732c99268d0acd2d78fe778dee369e18e9d7f6a8164617715a8c73aae59d2e856ff437343087542d2eeba9e613cd0418e9cf43 SHA512 79a049aad9cf0d50455747bbd2809611ca9d8eb2890c4a0dda71b64842c75cc4503f9f308d6f418e0f207d5cea04d21b352d45c1774a24b9270071d232dfb1d6 |
32 |
+DIST rust-1.62.0-arm-unknown-linux-gnueabi.tar.xz 203832692 BLAKE2B 964278ec2d9375d864cd03f7ec4fae1ca89fceebad51ccc2a017fbdf5ed354bd599d8c3eaf9eb9e86870f3d4b7fae8bb9011ae630742b3cc9e6ed38e14e8eae4 SHA512 d388e752fe7fa67c91719858be9ffc872c2b8fa45f6d63ae18298a79bc242e640784722d82461629bd0f07ce56a7dd850376ca9882bf0a084a5a19b01e5d59f3 |
33 |
+DIST rust-1.62.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 1f24c48e0648f80d7107db921917372bd51ff4b630bd36830d5bb76386b486776311c67854bd4d6366e820003b89ba1a4c8eecbe001f2221c1063661c71ab513 SHA512 f134e874d59bc7979e821f881098f9d91eb81a1c5c68db80d738def722273ecf4957d842c3f0ee9f9b415448477bcd0b022624cea95f99850bd2267dc545423f |
34 |
+DIST rust-1.62.0-arm-unknown-linux-gnueabihf.tar.xz 203946052 BLAKE2B b0e2a8a0068dc758d772f3dbc8003a57fdb43ead64e30bdf338c60b195bb2f78ef7e7a6df6dd2f02f13f47b9e913ab2fc010ce9fc6d39d5014709a71886e7eb6 SHA512 515d16b3ec5e8ec4af24c6baaf4e5443774c2140e5379019f29ce8a63eb1fd908408f42092e0fc0c3dd5e62ac7d43357af13fd74678cd2635451a2d775934386 |
35 |
+DIST rust-1.62.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 661439263a89d2206fbb7c3e00ac42e5975403670953df6be12dbf10e624a3bce0a16a846084aa621284e1d2dbb997af19b0f45808a2ddf7bb65af306a1745ba SHA512 bade26ccb646cc16822ae3235c00d048373f6c38eea79af128e3f299e8a69086fd254b4cd7c602c653d6573232594a27c7f8eb915797b8f1afbf56db3efb5008 |
36 |
+DIST rust-1.62.0-armv7-unknown-linux-gnueabihf.tar.xz 209318492 BLAKE2B 959488e4a957e19e5fe44e9b2b83406e135d7598cf4fa9db3b132c80cc40a54a73dee3c0b3db6f2f9299adf1b2d80fe453d1f0dab73fe46cacd5fa2ebf45b3ac SHA512 2c447c39f22f1f11f1e58d6adfea440a7d0bb91ffbb60df555b4e3eb41379b586f531a31c3ef86bb5e7a5b46889071f509157dc031fa174d93942d21dd241180 |
37 |
+DIST rust-1.62.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B a1e12a459d62fccd35bbc34d043f8a7512dfe3edb6563f02b84bfdd1e4cdf9c16570302644d71dc208dfe9782f48d4310a13b748d22571d1d43dcf7b61b2819a SHA512 82d2d1eb7ee0f8ba0bfaf93cd2ef0899973f535080af960a2b0f54049285df43e758a9bbe2f0e36e64e85bd530e4511e8ed828ce046c82b74a252b92e7dd42db |
38 |
+DIST rust-1.62.0-i686-unknown-linux-gnu.tar.xz 223720860 BLAKE2B 117364630b38f4a97f9b7183ca7e9f30836ffd0f73c4e3ce2af97ad3c837edc7fa247afba70858009b5ba34bcb7adc87f29b8c87f03f79d060d9bab68b0625ba SHA512 99a87fef7870ee3478ac2faf1ebaec9fde28737ddc2423ec3da4173051f542e24b5666b0e276b3fdd2f02259f16bd119bf79515d057c63da2f6659c0e7ea2fd3 |
39 |
+DIST rust-1.62.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B b9b4289aa38ad09d7f5098665a490dfa934676c37385f966d10c978f5320e374976617fb31a5e835661a81edab1ff244c74d8f8f5748954817db8171ed251b0d SHA512 9c44413bf71c416ad08289b4fa0223cb2a5299609ea5c94aff4f0bf7e793a9794155ee0c12a9f19c1c6e20112eb642f22be357d287adcea4e53e0285214c9661 |
40 |
+DIST rust-1.62.0-mips-unknown-linux-gnu.tar.xz 161572400 BLAKE2B b1f4b797319574b4e7cfb0d591988444238f3a735466e336b4c13e3af6754d18962f6f282011147c35ea48df375651d4cad3c368042073ff4da35c9ea6ab4855 SHA512 8c3cbb699f1a821889b70c56653380ad2a6d42d2ed444610cad5971230f3cbe5b7e71f1775f21788f0f54dad2f9c2c7eaa81ecde1a319d98ffcdb3701d6ef144 |
41 |
+DIST rust-1.62.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B b68152d3a6221cb57d03826055477be0701c6520228ef2c67cf856a4d5bee5854ecc7dfe3e062121ba5d1e82be0eda0691e0d133ba5d644fed78fbf328021a9f SHA512 eedc2ba881ae0e2d709c8f2cb92ad360c091953b48bf77ce5eb1c93e296f0d532e29f9613d21327e8ca388cc5db7d26a8e612300bb3f94195db08d1d40f15909 |
42 |
+DIST rust-1.62.0-mips64-unknown-linux-gnuabi64.tar.xz 166210748 BLAKE2B d3a612e44132db49ab41eaf822a472f11b24b250ad1c5ca61a85b161d0a892d392d9a4789b42b4f35968887895e964ffbb5dfa69a8205b2ee94baf02cb2ef311 SHA512 f3ea74fad41c197c8af69d65ff6024832ddfeb3c7fd4913b35219b1954fc7b6d3ebc345686043ee3250c17624e133b6c8680272b5b73c38dce1d6c39b763b002 |
43 |
+DIST rust-1.62.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B 15806c5684651c2920692d36c733ad8b8a6b8d39e901889457988205e04dd425083bf119053040b73ddba65a44d9330db021a85094d2c84e60c7cd1724d95116 SHA512 46f83dc667361cf4bd10103b1aa990796c1a45ee1af02c142f068fee7aa235c9d982189757184378b2230940134b1462116c09a3c0c043810e077fcf33bac316 |
44 |
+DIST rust-1.62.0-mipsel-unknown-linux-gnu.tar.xz 165275936 BLAKE2B a875ff4675559f9a4b7ff87c271dc4f51112a68c06677b78bbd97f7b4af8f69c75407ef711a9d700ddbf9d85863e24c2f3e27956181bbe00e4afd83220290998 SHA512 9e489cb27b9b8f00e9fd2210b3bf5c1e60ddc83c5fe3d9a381fc4469badda89c02948554d70710d8438333d6629c24282a8a9855241e46ded9c6cf368dce1c2e |
45 |
+DIST rust-1.62.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 63b7d7487a7dd561a95a175584b798fea1b4157e59b660ec2063724e6ef4ceb7455a1912fb73a88c9315de0d80e6e622ef5c81258b670833e15c421cc3bbc562 SHA512 83420778147112aec58ad81f39f61a13fef97dbae6ff927c55a360588cab56cb58c48c31d19ed6b3b77d73277b044559db6184224d4e4d5bd5371e4cd3f701c2 |
46 |
+DIST rust-1.62.0-powerpc-unknown-linux-gnu.tar.xz 183062288 BLAKE2B c987b07862687203f716494cf5dde444d150628ae021f7a0ed990b47c892b7c247a6f8e790a2a88d49c3abcfe6236b18bbebaf76e0f2720a8c318b8f8e3e5a01 SHA512 d0db86e475fadf2535bc6955abb7b6e397553ad6843ddd369e15c9c35800866f27dcd0515a898a65f7ca868672cf458114320769cd14db258a279cfd3de3c57b |
47 |
+DIST rust-1.62.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7398231bfc5624f6e7ef8af55405b861fc06fbfbca9159b9c60a1ab27a5bee6551d228958e6f56abfb598c6f24f53d35f510e863176d03639c47703bd8064c7c SHA512 8713ef73a1a9f30f246dc61086993f2f4a8d6f04595401b312c43fc97f667b44126e4b7f176001b68622d452bb74ee460d60ae2e6d44938e02c4da4fcdfc7855 |
48 |
+DIST rust-1.62.0-powerpc64-unknown-linux-gnu.tar.xz 191619800 BLAKE2B 276f427d0ceed4926f46081c57f6aba69e3c541d896dbbd0375da0d1f6461840e20ab8b7cbb9dec53b67dfff668e91fc8c68ea70aa3d9f333e2b21ec345a876f SHA512 039d321f90f960276ad06ccdcc2549d2c07335d61b21abcc534b33ff406e130d54dd3d79d471be9588546e30f5e1d4952e33c7890cb2d66eac80436471d3db89 |
49 |
+DIST rust-1.62.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 8ca8447d2c69ba58439ed36077882da80696427190761e5dcde99c8957fd476c73fbcc8111ebb3409c86e0a7c315dfbf7f1202204f7755a9ed87eb523bf34e38 SHA512 0f8efdf23aacf435e06854aed7f4366f5fe0f83a9a256d1026b02c2817badbd072a726bce052b0333e8cdc2907fd0e5b81a9cdef617a34e7d963d9d3c4742fb5 |
50 |
+DIST rust-1.62.0-powerpc64le-unknown-linux-gnu.tar.xz 201394312 BLAKE2B 60bc2fc5beee3f6d0ce695fed0c2148982b6ae3936bbf44fe0ccb97be80e9a2532f20c7234c924f500c4edc3bf82d4ca25b1f1dadc89bb29718c4a9e41bb8894 SHA512 4a8cfcffb7069e2bc4679a8da9acecf12514c512854bb9eef6f3f861e319b0098fd206d743ef7a0f25ef5b65892ad9dcc0adc1bc19525900c3edf5ea5489849e |
51 |
+DIST rust-1.62.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 55391a58d2ffd6c21b1ff6d77595e424cf269ad44d59f7c2a29d149306563028b402e7393e4d802a47818d7e831455768e86d4f9d882ad0ca70cf216ed72c9db SHA512 c1cf19959de1348ed34448a3f9999ef53324be81d1c99967e4091406463dc0dc28a384f8f04e07e4b54791d1d4a2b1c4aea570503abb0c91c83eafdb5e389243 |
52 |
+DIST rust-1.62.0-riscv64gc-unknown-linux-gnu.tar.xz 194848260 BLAKE2B 35a283e87bd0d338500ed71d539760cc19a1522875d20f7cdf8cce7ac79fdf993530082e0078a9f12c2df41d3366dec30f5326f9584ab9dd0bc37811bc931e1b SHA512 60a9e4a0ffec3763e6e5f4f9a7f3f52f423b6af86eeb4eddbd5fa00682ec3f6881a6d0be717079f508c1d0ef94f3d794b7da2884ed5b7c88219aabd49bf20662 |
53 |
+DIST rust-1.62.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 2cc8e9724e3d0f3af2d5c8e8c9f51f7f5e2d36a9e8cda23bf16fdcce0ecbd1a8965b0fc7b339dc27c779346cfe3f26fe8a2d3e1929431a2190452cbe4a949978 SHA512 587b6ab43a3c0258b0393e13f9f231f086527dd28f7f65fa6f00ac61c974e1d8c0305c2cc154a8a106d506b17f505ec8d8e6e5d39d4512072ab39da680fa1574 |
54 |
+DIST rust-1.62.0-s390x-unknown-linux-gnu.tar.xz 218505248 BLAKE2B 6f8026b1779527f0dd781843e2f2deb423c2b541711d3e8efb981ea972cd5405568e6ca274e1b78cc6427e038d59e147652da26cedaa83b02f5daa79491db2f3 SHA512 10c99efe46acbe2bdbd27f28cae28d6db223c3cee2abc835d04f7ff1662c8b998d354ae22af9dcf00c078e96cdbb1f01df5f6c9e9c587d3459ea88f9acf37267 |
55 |
+DIST rust-1.62.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7053c6f041695ad7b9c5ea304a0d71b9b17c5737b7d7082ef2de6e52dc52bc18c170c3fe7e7a658823abc5f80ab775b544dd2b2b3e27690bd8209357945b0f04 SHA512 8bc1d64180f55b0ed93fd506bc193a51e4519a66ed8d6f4e331395bcdb8584171d81397d594460952d7983129aa08e278ee15a584571d404f2f6a304d1d7241d |
56 |
+DIST rust-1.62.0-x86_64-unknown-linux-gnu.tar.xz 153662720 BLAKE2B ff19ebb8a0607b5a3a29b2676dc12466e0c9969f6ac31a588a5dff2d3c10ade70e705873e2606ed84efeaeeb87b8afe6c88285edbdd2bf1a8433f24c48009c21 SHA512 b329dc015dc70ceae0a3b9b8d8e674fb443769bf82f88ed06ca306cedaa52e26756a2491c92315e51b63d4272c0a1f43b2150d5636101814f6e2b59772f1f048 |
57 |
+DIST rust-1.62.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B a1602b9cfbdf1b66c479f13b7171cb445068b5f18eae620435b25c3ab1e762e41977e31f02158d259acf16b0c8cdf895af16d6f68904939333b030f21b6c7a01 SHA512 2d79af9fca5a7e19448aeefd330fcc436c3ecb8e617662f144b12303ef2a214a3ae3ec4d9a42f68a4d0d6e343b81b495deddf3df23031aacfbead0c97b083174 |
58 |
+DIST rust-1.62.0-x86_64-unknown-linux-musl.tar.xz 254266584 BLAKE2B f566cdc94726532c50726ccf081eb2b825e52a56c74eb9d9e846f9933dafedef0a8a1b7c485938f96ae9945706192218cc318750738596923329bc23ef770ce1 SHA512 9cd01f0539db8cd344e9dd39fc5ffcd5b65c9c8c95ed692b9f7c23bc19c970c9f0056f8c8bb61813f1402143177a5b1c20bf844e64af8cf0be110e17e30aa4af |
59 |
+DIST rust-1.62.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 46f38806b5a6b67953c607d4a3074a9177e14245e746771d876530c398ea98019e534a22a099c087ea2386124cc952f0a488e45f8175922b19b42441d6607938 SHA512 bc30af1e75cbfc8b488782af26d91ccee6e3b3220913af8d2ca3fc6beb5790bd81e3348f8da5c0c542bd13ab6c4cee77f50f4ba0d48e9600620034acc2dafe15 |
60 |
DIST rustc-1.59.0-src.tar.xz 128942756 BLAKE2B b28114f14c9a0fec7db56fde79a985360fd8438c3b14eede49ed12e540c2636be960d0fd800c569af193886ac76fe8bf604d5dae59214ae08cb0cc6cc0ca404e SHA512 acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365 |
61 |
DIST rustc-1.59.0-src.tar.xz.asc 801 BLAKE2B 061701c4fdbde930798f9f938ca3642204ae4a2ad9396937ca7d604268813d6d68f4979f20d35abdbbfeec0bb389acd86c9d3d84256db85861f6b11e3dbef80e SHA512 1b90bc01f9d68ba1f70591c4ae707295d7727b790d170a0b757d654684e59d3c26c45b66a21f9ac762debb6867494660c73daaf10be9bd567a38be44c0009f72 |
62 |
DIST rustc-1.60.0-src.tar.xz 136183048 BLAKE2B 8030f32c21f81af6abc7a282aab1189cb7d680c6bce58c119a1beaad71a3eeb36a696eef46a22d366e2c41a2f9182a9a5aa527426f2c8db05278184c37297dd0 SHA512 d0c113e8c2c67bf10773c9403dc4c4700c4deb2fb287bfec51e565d3473d2b481d8ae2c90b272cd67b3a87d7443ea25a34c7b40ba8cd7106bf5d71126ab141c3 |
63 |
@@ -136,3 +168,5 @@ DIST rustc-1.62.0-src.tar.xz 135644992 BLAKE2B f9133310dc951361588bdc0b631c7fc9e |
64 |
DIST rustc-1.62.0-src.tar.xz.asc 801 BLAKE2B 1d9a6fcafdfc2f46b098403e36e401cc6b3834d4f7fffaa82f20a332f8843a0af10c814c3f585c6e062fd5e9fab3d231ab03cc0caa449acd1c8a9eea077c1932 SHA512 646a895d19847ab0cc1d2f85ce1643625a1785acda31d37ed9776257f8e4625b65e16e4b9f3210e816d4516633d963a0d7b520e35582366ee75059dcb2f1313f |
65 |
DIST rustc-1.62.1-src.tar.xz 135644156 BLAKE2B ff8428362153770c57d53cb7eef07b75944d47ec747d9c337cc7ba9f38dfd749415c9a00acf9d9d8743874ba1c51da7915315bd25e011eeb8a2aaa8812773850 SHA512 6f7fa855acdf20525e907a6fc8c7aa8b206603e3bcbd532d3bdce165380f0019f45dba2b2b06d20b541381accf67ca0d256fbddfcb1642a2e60e1237807d5410 |
66 |
DIST rustc-1.62.1-src.tar.xz.asc 801 BLAKE2B dd0e917f8b587eb8318a9c820df5ee9a052f14e7dea05d8afcb3cf687fa2e362e6d2f4d20fa94a19bdf97227c9ef29548a6e267ffd9113bfdc36cc42f341d8b8 SHA512 698bfd419c218a6cccce04869279708cf6084adc464a64d7dd1c981c0577249cd06b4de132634085c792c838aa1e1beaa11a5a06ea0e5f4c1a6f4e28afe65a3c |
67 |
+DIST rustc-1.63.0-src.tar.xz 136597192 BLAKE2B 52eb64ee11e7d9724a4c2654f7eea13521959ac5e04a4925eed5c89ec3661a7827146d6f9a9d05c98466bd4b74393af7bb18d9f418c785924f559833434dfe38 SHA512 0dd3cd1546bd9c1438afe0c4694e1ed80507f6b437674682c0474e13f83457e9ced4560ddeee58602e01837140f9e34a9e24c6828643dd6f613e07755af6997c |
68 |
+DIST rustc-1.63.0-src.tar.xz.asc 801 BLAKE2B b6c133768e368a7aeb0a4612a4c824d13f91ccdca6660feb5774ed6d79537084020780532c882ae3c9e4b6be3d36ceb0652eb134a580293ba8d8be74c4ba3c6e SHA512 f8807d46b9a3ca2a15a60f8062d63b3ee6e3210657cc752c948b3c7aa1626ec63cbd57529d010ad33f07ac47cf70dbf2cb50f200587338f77c631fc9e6786b17 |
69 |
|
70 |
diff --git a/dev-lang/rust/files/1.62.1-musl-dynamic-linking.patch b/dev-lang/rust/files/1.62.1-musl-dynamic-linking.patch |
71 |
new file mode 100644 |
72 |
index 0000000..fd56396 |
73 |
--- /dev/null |
74 |
+++ b/dev-lang/rust/files/1.62.1-musl-dynamic-linking.patch |
75 |
@@ -0,0 +1,25 @@ |
76 |
+From e42709c46647dab342b826d30324f3e6e5590e00 Mon Sep 17 00:00:00 2001 |
77 |
+From: Jory Pratt <anarchy@g.o> |
78 |
+Date: Tue, 2 Aug 2022 18:32:53 -0500 |
79 |
+Subject: [PATCH] Enable dynamic linking by default for musl |
80 |
+ |
81 |
+Signed-off-by: Jory Pratt <anarchy@g.o> |
82 |
+--- |
83 |
+ compiler/rustc_target/src/spec/linux_musl_base.rs | 2 +- |
84 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
85 |
+ |
86 |
+diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs |
87 |
+index 207a87ab0..8a5a43363 100644 |
88 |
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs |
89 |
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs |
90 |
+@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions { |
91 |
+ base.crt_objects_fallback = Some(CrtObjectsFallback::Musl); |
92 |
+ |
93 |
+ // These targets statically link libc by default |
94 |
+- base.crt_static_default = true; |
95 |
++ base.crt_static_default = false; |
96 |
+ |
97 |
+ base |
98 |
+ } |
99 |
+-- |
100 |
+2.35.1 |
101 |
|
102 |
diff --git a/dev-lang/rust/files/1.63.0-CVE-2022-36113.patch b/dev-lang/rust/files/1.63.0-CVE-2022-36113.patch |
103 |
new file mode 100644 |
104 |
index 0000000..a87687d |
105 |
--- /dev/null |
106 |
+++ b/dev-lang/rust/files/1.63.0-CVE-2022-36113.patch |
107 |
@@ -0,0 +1,48 @@ |
108 |
+From 97b80919e404b0768ea31ae329c3b4da54bed05a Mon Sep 17 00:00:00 2001 |
109 |
+From: Josh Triplett <josh@××××××××××××.org> |
110 |
+Date: Thu, 18 Aug 2022 17:17:19 +0200 |
111 |
+Subject: [PATCH] CVE-2022-36113: avoid unpacking .cargo-ok from the crate |
112 |
+ |
113 |
+--- |
114 |
+ src/cargo/sources/registry/mod.rs | 15 ++++++++++----- |
115 |
+ 1 file changed, 10 insertions(+), 5 deletions(-) |
116 |
+gyakovlev: 'sed -i 's|/src/cargo|/src/tools/cargo/src/cargo|g' |
117 |
+ |
118 |
+diff --git a/src/tools/cargo/src/cargo/sources/registry/mod.rs b/src/tools/cargo/src/cargo/sources/registry/mod.rs |
119 |
+index c17b822fd0..a2863bf78a 100644 |
120 |
+--- a/src/tools/cargo/src/cargo/sources/registry/mod.rs |
121 |
++++ b/src/tools/cargo/src/cargo/sources/registry/mod.rs |
122 |
+@@ -639,6 +639,13 @@ impl<'cfg> RegistrySource<'cfg> { |
123 |
+ prefix |
124 |
+ ) |
125 |
+ } |
126 |
++ // Prevent unpacking the lockfile from the crate itself. |
127 |
++ if entry_path |
128 |
++ .file_name() |
129 |
++ .map_or(false, |p| p == PACKAGE_SOURCE_LOCK) |
130 |
++ { |
131 |
++ continue; |
132 |
++ } |
133 |
+ // Unpacking failed |
134 |
+ let mut result = entry.unpack_in(parent).map_err(anyhow::Error::from); |
135 |
+ if cfg!(windows) && restricted_names::is_windows_reserved_path(&entry_path) { |
136 |
+@@ -654,16 +661,14 @@ impl<'cfg> RegistrySource<'cfg> { |
137 |
+ .with_context(|| format!("failed to unpack entry at `{}`", entry_path.display()))?; |
138 |
+ } |
139 |
+ |
140 |
+- // The lock file is created after unpacking so we overwrite a lock file |
141 |
+- // which may have been extracted from the package. |
142 |
++ // Now that we've finished unpacking, create and write to the lock file to indicate that |
143 |
++ // unpacking was successful. |
144 |
+ let mut ok = OpenOptions::new() |
145 |
+- .create(true) |
146 |
++ .create_new(true) |
147 |
+ .read(true) |
148 |
+ .write(true) |
149 |
+ .open(&path) |
150 |
+ .with_context(|| format!("failed to open `{}`", path.display()))?; |
151 |
+- |
152 |
+- // Write to the lock file to indicate that unpacking was successful. |
153 |
+ write!(ok, "ok")?; |
154 |
+ |
155 |
+ Ok(unpack_dir.to_path_buf()) |
156 |
|
157 |
diff --git a/dev-lang/rust/files/1.63.0-CVE-2022-36114.patch b/dev-lang/rust/files/1.63.0-CVE-2022-36114.patch |
158 |
new file mode 100644 |
159 |
index 0000000..1afbaa9 |
160 |
--- /dev/null |
161 |
+++ b/dev-lang/rust/files/1.63.0-CVE-2022-36114.patch |
162 |
@@ -0,0 +1,102 @@ |
163 |
+From d1f9553c825f6d7481453be8d58d0e7f117988a7 Mon Sep 17 00:00:00 2001 |
164 |
+From: Josh Triplett <josh@××××××××××××.org> |
165 |
+Date: Thu, 18 Aug 2022 17:45:45 +0200 |
166 |
+Subject: [PATCH] CVE-2022-36114: limit the maximum unpacked size of a crate to |
167 |
+ 512MB |
168 |
+ |
169 |
+This gives users of custom registries the same protections, using the |
170 |
+same size limit that crates.io uses. |
171 |
+ |
172 |
+`LimitErrorReader` code copied from crates.io. |
173 |
+--- |
174 |
+ src/cargo/sources/registry/mod.rs | 6 +++++- |
175 |
+ src/cargo/util/io.rs | 27 +++++++++++++++++++++++++++ |
176 |
+ src/cargo/util/mod.rs | 2 ++ |
177 |
+ 3 files changed, 34 insertions(+), 1 deletion(-) |
178 |
+ create mode 100644 src/cargo/util/io.rs |
179 |
+gyakovlev: 'sed -i 's|/src/cargo|/src/tools/cargo/src/cargo|g' |
180 |
+ |
181 |
+diff --git a/src/tools/cargo/src/cargo/sources/registry/mod.rs b/src/tools/cargo/src/cargo/sources/registry/mod.rs |
182 |
+index a2863bf78a..c9c414e500 100644 |
183 |
+--- a/src/tools/cargo/src/cargo/sources/registry/mod.rs |
184 |
++++ b/src/tools/cargo/src/cargo/sources/registry/mod.rs |
185 |
+@@ -182,7 +182,9 @@ use crate::util::hex; |
186 |
+ use crate::util::interning::InternedString; |
187 |
+ use crate::util::into_url::IntoUrl; |
188 |
+ use crate::util::network::PollExt; |
189 |
+-use crate::util::{restricted_names, CargoResult, Config, Filesystem, OptVersionReq}; |
190 |
++use crate::util::{ |
191 |
++ restricted_names, CargoResult, Config, Filesystem, LimitErrorReader, OptVersionReq, |
192 |
++}; |
193 |
+ |
194 |
+ const PACKAGE_SOURCE_LOCK: &str = ".cargo-ok"; |
195 |
+ pub const CRATES_IO_INDEX: &str = "https://github.com/rust-lang/crates.io-index"; |
196 |
+@@ -194,6 +196,7 @@ const VERSION_TEMPLATE: &str = "{version}"; |
197 |
+ const PREFIX_TEMPLATE: &str = "{prefix}"; |
198 |
+ const LOWER_PREFIX_TEMPLATE: &str = "{lowerprefix}"; |
199 |
+ const CHECKSUM_TEMPLATE: &str = "{sha256-checksum}"; |
200 |
++const MAX_UNPACK_SIZE: u64 = 512 * 1024 * 1024; |
201 |
+ |
202 |
+ /// A "source" for a local (see `local::LocalRegistry`) or remote (see |
203 |
+ /// `remote::RemoteRegistry`) registry. |
204 |
+@@ -615,6 +618,7 @@ impl<'cfg> RegistrySource<'cfg> { |
205 |
+ } |
206 |
+ } |
207 |
+ let gz = GzDecoder::new(tarball); |
208 |
++ let gz = LimitErrorReader::new(gz, MAX_UNPACK_SIZE); |
209 |
+ let mut tar = Archive::new(gz); |
210 |
+ let prefix = unpack_dir.file_name().unwrap(); |
211 |
+ let parent = unpack_dir.parent().unwrap(); |
212 |
+diff --git a/src/tools/cargo/src/cargo/util/io.rs b/src/tools/cargo/src/cargo/util/io.rs |
213 |
+new file mode 100644 |
214 |
+index 0000000000..f62672db03 |
215 |
+--- /dev/null |
216 |
++++ b/src/tools/cargo/src/cargo/util/io.rs |
217 |
+@@ -0,0 +1,27 @@ |
218 |
++use std::io::{self, Read, Take}; |
219 |
++ |
220 |
++#[derive(Debug)] |
221 |
++pub struct LimitErrorReader<R> { |
222 |
++ inner: Take<R>, |
223 |
++} |
224 |
++ |
225 |
++impl<R: Read> LimitErrorReader<R> { |
226 |
++ pub fn new(r: R, limit: u64) -> LimitErrorReader<R> { |
227 |
++ LimitErrorReader { |
228 |
++ inner: r.take(limit), |
229 |
++ } |
230 |
++ } |
231 |
++} |
232 |
++ |
233 |
++impl<R: Read> Read for LimitErrorReader<R> { |
234 |
++ fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { |
235 |
++ match self.inner.read(buf) { |
236 |
++ Ok(0) if self.inner.limit() == 0 => Err(io::Error::new( |
237 |
++ io::ErrorKind::Other, |
238 |
++ "maximum limit reached when reading", |
239 |
++ )), |
240 |
++ e => e, |
241 |
++ } |
242 |
++ } |
243 |
++} |
244 |
++ |
245 |
+diff --git a/src/tools/cargo/src/cargo/util/mod.rs b/src/tools/cargo/src/cargo/util/mod.rs |
246 |
+index 28f685c209..47bbf37aad 100644 |
247 |
+--- a/src/tools/cargo/src/cargo/util/mod.rs |
248 |
++++ b/src/tools/cargo/src/cargo/util/mod.rs |
249 |
+@@ -14,6 +14,7 @@ pub use self::hasher::StableHasher; |
250 |
+ pub use self::hex::{hash_u64, short_hash, to_hex}; |
251 |
+ pub use self::into_url::IntoUrl; |
252 |
+ pub use self::into_url_with_base::IntoUrlWithBase; |
253 |
++pub(crate) use self::io::LimitErrorReader; |
254 |
+ pub use self::lev_distance::{closest, closest_msg, lev_distance}; |
255 |
+ pub use self::lockserver::{LockServer, LockServerClient, LockServerStarted}; |
256 |
+ pub use self::progress::{Progress, ProgressStyle}; |
257 |
+@@ -44,6 +45,7 @@ pub mod important_paths; |
258 |
+ pub mod interning; |
259 |
+ pub mod into_url; |
260 |
+ mod into_url_with_base; |
261 |
++mod io; |
262 |
+ pub mod job; |
263 |
+ pub mod lev_distance; |
264 |
+ mod lockserver; |
265 |
|
266 |
diff --git a/dev-lang/rust/rust-1.63.0-r1.ebuild b/dev-lang/rust/rust-1.63.0-r1.ebuild |
267 |
new file mode 100644 |
268 |
index 0000000..8ed366c |
269 |
--- /dev/null |
270 |
+++ b/dev-lang/rust/rust-1.63.0-r1.ebuild |
271 |
@@ -0,0 +1,771 @@ |
272 |
+# Copyright 1999-2022 Gentoo Authors |
273 |
+# Distributed under the terms of the GNU General Public License v2 |
274 |
+ |
275 |
+EAPI=8 |
276 |
+ |
277 |
+PYTHON_COMPAT=( python3_{8..11} ) |
278 |
+ |
279 |
+inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing \ |
280 |
+ multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig |
281 |
+ |
282 |
+if [[ ${PV} = *beta* ]]; then |
283 |
+ betaver=${PV//*beta} |
284 |
+ BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" |
285 |
+ MY_P="rustc-beta" |
286 |
+ SLOT="beta/${PV}" |
287 |
+ SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz" |
288 |
+else |
289 |
+ ABI_VER="$(ver_cut 1-2)" |
290 |
+ SLOT="stable/${ABI_VER}" |
291 |
+ MY_P="rustc-${PV}" |
292 |
+ SRC="${MY_P}-src.tar.xz" |
293 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~sparc ~x86" |
294 |
+fi |
295 |
+ |
296 |
+RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0" |
297 |
+ |
298 |
+DESCRIPTION="Systems programming language from Mozilla" |
299 |
+HOMEPAGE="https://www.rust-lang.org/" |
300 |
+ |
301 |
+SRC_URI=" |
302 |
+ https://static.rust-lang.org/dist/${SRC} |
303 |
+ verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc ) |
304 |
+ !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) ) |
305 |
+" |
306 |
+ |
307 |
+# keep in sync with llvm ebuild of the same version as bundled one. |
308 |
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 |
309 |
+ NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore ) |
310 |
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
311 |
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?} |
312 |
+ |
313 |
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" |
314 |
+ |
315 |
+IUSE="clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind miri nightly parallel-compiler profiler rls rustfmt rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}" |
316 |
+ |
317 |
+# Please keep the LLVM dependency block separate. Since LLVM is slotted, |
318 |
+# we need to *really* make sure we're not pulling more than one slot |
319 |
+# simultaneously. |
320 |
+ |
321 |
+# How to use it: |
322 |
+# List all the working slots in LLVM_VALID_SLOTS, newest first. |
323 |
+LLVM_VALID_SLOTS=( 14 ) |
324 |
+LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}" |
325 |
+ |
326 |
+# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation |
327 |
+# (-) usedep needed because we may build with older llvm without that target |
328 |
+LLVM_DEPEND="|| ( " |
329 |
+for _s in ${LLVM_VALID_SLOTS[@]}; do |
330 |
+ LLVM_DEPEND+=" ( " |
331 |
+ for _x in ${ALL_LLVM_TARGETS[@]}; do |
332 |
+ LLVM_DEPEND+=" |
333 |
+ ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] )" |
334 |
+ done |
335 |
+ LLVM_DEPEND+=" )" |
336 |
+done |
337 |
+unset _s _x |
338 |
+LLVM_DEPEND+=" ) |
339 |
+ <sys-devel/llvm-$(( LLVM_MAX_SLOT + 1 )):= |
340 |
+ wasm? ( sys-devel/lld ) |
341 |
+" |
342 |
+ |
343 |
+# to bootstrap we need at least exactly previous version, or same. |
344 |
+# most of the time previous versions fail to bootstrap with newer |
345 |
+# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok, |
346 |
+# but it fails to bootstrap with 1.48.x |
347 |
+# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.txt |
348 |
+RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*" |
349 |
+RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*" |
350 |
+BOOTSTRAP_DEPEND="|| |
351 |
+ ( |
352 |
+ =dev-lang/rust-"${RUST_DEP_PREV}" |
353 |
+ =dev-lang/rust-bin-"${RUST_DEP_PREV}" |
354 |
+ =dev-lang/rust-"${RUST_DEP_CURR}" |
355 |
+ =dev-lang/rust-bin-"${RUST_DEP_CURR}" |
356 |
+ ) |
357 |
+" |
358 |
+ |
359 |
+BDEPEND="${PYTHON_DEPS} |
360 |
+ app-eselect/eselect-rust |
361 |
+ || ( |
362 |
+ >=sys-devel/gcc-4.7 |
363 |
+ >=sys-devel/clang-3.5 |
364 |
+ ) |
365 |
+ system-bootstrap? ( ${BOOTSTRAP_DEPEND} ) |
366 |
+ !system-llvm? ( |
367 |
+ >=dev-util/cmake-3.13.4 |
368 |
+ dev-util/ninja |
369 |
+ ) |
370 |
+ test? ( sys-devel/gdb ) |
371 |
+ verify-sig? ( sec-keys/openpgp-keys-rust ) |
372 |
+" |
373 |
+ |
374 |
+DEPEND=" |
375 |
+ >=app-arch/xz-utils-5.2 |
376 |
+ net-misc/curl:=[http2,ssl] |
377 |
+ sys-libs/zlib:= |
378 |
+ dev-libs/openssl:0= |
379 |
+ system-llvm? ( |
380 |
+ ${LLVM_DEPEND} |
381 |
+ llvm-libunwind? ( sys-libs/llvm-libunwind:= ) |
382 |
+ ) |
383 |
+ !system-llvm? ( |
384 |
+ !llvm-libunwind? ( |
385 |
+ elibc_musl? ( sys-libs/libunwind:= ) |
386 |
+ ) |
387 |
+ ) |
388 |
+" |
389 |
+ |
390 |
+RDEPEND="${DEPEND} |
391 |
+ app-eselect/eselect-rust |
392 |
+ sys-apps/lsb-release |
393 |
+" |
394 |
+ |
395 |
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) |
396 |
+ miri? ( nightly ) |
397 |
+ parallel-compiler? ( nightly ) |
398 |
+ rls? ( rust-src ) |
399 |
+ test? ( ${ALL_LLVM_TARGETS[*]} ) |
400 |
+ wasm? ( llvm_targets_WebAssembly ) |
401 |
+ x86? ( cpu_flags_x86_sse2 ) |
402 |
+" |
403 |
+ |
404 |
+# we don't use cmake.eclass, but can get a warning |
405 |
+CMAKE_WARN_UNUSED_CLI=no |
406 |
+ |
407 |
+QA_FLAGS_IGNORED=" |
408 |
+ usr/lib/${PN}/${PV}/bin/.* |
409 |
+ usr/lib/${PN}/${PV}/libexec/.* |
410 |
+ usr/lib/${PN}/${PV}/lib/lib.*.so |
411 |
+ usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/.* |
412 |
+ usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so |
413 |
+" |
414 |
+ |
415 |
+QA_SONAME=" |
416 |
+ usr/lib/${PN}/${PV}/lib/lib.*.so.* |
417 |
+ usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so |
418 |
+" |
419 |
+ |
420 |
+QA_PRESTRIPPED=" |
421 |
+ usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/rust-llvm-dwp |
422 |
+" |
423 |
+ |
424 |
+# An rmeta file is custom binary format that contains the metadata for the crate. |
425 |
+# rmeta files do not support linking, since they do not contain compiled object files. |
426 |
+# so we can safely silence the warning for this QA check. |
427 |
+QA_EXECSTACK="usr/lib/${PN}/${PV}/lib/rustlib/*/lib*.rlib:lib.rmeta" |
428 |
+ |
429 |
+# causes double bootstrap |
430 |
+RESTRICT="test" |
431 |
+ |
432 |
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/rust.asc |
433 |
+ |
434 |
+PATCHES=( |
435 |
+ "${FILESDIR}"/1.55.0-ignore-broken-and-non-applicable-tests.patch |
436 |
+ "${FILESDIR}"/1.62.1-musl-dynamic-linking.patch |
437 |
+ "${FILESDIR}"/1.61.0-gentoo-musl-target-specs.patch |
438 |
+ "${FILESDIR}"/1.63.0-CVE-2022-36113.patch |
439 |
+ "${FILESDIR}"/1.63.0-CVE-2022-36114.patch |
440 |
+ "${FILESDIR}"/1.62.0-libressl.patch |
441 |
+) |
442 |
+ |
443 |
+S="${WORKDIR}/${MY_P}-src" |
444 |
+ |
445 |
+toml_usex() { |
446 |
+ usex "${1}" true false |
447 |
+} |
448 |
+ |
449 |
+bootstrap_rust_version_check() { |
450 |
+ # never call from pkg_pretend. eselect-rust may be not installed yet. |
451 |
+ [[ ${MERGE_TYPE} == binary ]] && return |
452 |
+ local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))" |
453 |
+ local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))" |
454 |
+ local rustc_version=( $(eselect --brief rust show 2>/dev/null) ) |
455 |
+ rustc_version=${rustc_version[0]#rust-bin-} |
456 |
+ rustc_version=${rustc_version#rust-} |
457 |
+ |
458 |
+ [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output" |
459 |
+ |
460 |
+ if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then |
461 |
+ eerror "Rust >=${rustc_wanted} is required" |
462 |
+ eerror "please run 'eselect rust' and set correct rust version" |
463 |
+ die "selected rust version is too old" |
464 |
+ elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then |
465 |
+ eerror "Rust <${rustc_toonew} is required" |
466 |
+ eerror "please run 'eselect rust' and set correct rust version" |
467 |
+ die "selected rust version is too new" |
468 |
+ else |
469 |
+ einfo "Using rust ${rustc_version} to build" |
470 |
+ fi |
471 |
+} |
472 |
+ |
473 |
+pre_build_checks() { |
474 |
+ local M=8192 |
475 |
+ # multiply requirements by 1.3 if we are doing x86-multilib |
476 |
+ if use amd64; then |
477 |
+ M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 )) |
478 |
+ fi |
479 |
+ M=$(( $(usex clippy 128 0) + ${M} )) |
480 |
+ M=$(( $(usex miri 128 0) + ${M} )) |
481 |
+ M=$(( $(usex rls 512 0) + ${M} )) |
482 |
+ M=$(( $(usex rustfmt 256 0) + ${M} )) |
483 |
+ # add 2G if we compile llvm and 256M per llvm_target |
484 |
+ if ! use system-llvm; then |
485 |
+ M=$(( 2048 + ${M} )) |
486 |
+ local ltarget |
487 |
+ for ltarget in ${ALL_LLVM_TARGETS[@]}; do |
488 |
+ M=$(( $(usex ${ltarget} 256 0) + ${M} )) |
489 |
+ done |
490 |
+ fi |
491 |
+ M=$(( $(usex wasm 256 0) + ${M} )) |
492 |
+ M=$(( $(usex debug 2 1) * ${M} )) |
493 |
+ eshopts_push -s extglob |
494 |
+ if is-flagq '-g?(gdb)?([1-9])'; then |
495 |
+ M=$(( 15 * ${M} / 10 )) |
496 |
+ fi |
497 |
+ eshopts_pop |
498 |
+ M=$(( $(usex system-bootstrap 0 1024) + ${M} )) |
499 |
+ M=$(( $(usex doc 256 0) + ${M} )) |
500 |
+ CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} |
501 |
+} |
502 |
+ |
503 |
+llvm_check_deps() { |
504 |
+ has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]" |
505 |
+} |
506 |
+ |
507 |
+pkg_pretend() { |
508 |
+ pre_build_checks |
509 |
+} |
510 |
+ |
511 |
+pkg_setup() { |
512 |
+ pre_build_checks |
513 |
+ python-any-r1_pkg_setup |
514 |
+ |
515 |
+ export LIBGIT2_NO_PKG_CONFIG=1 #749381 |
516 |
+ |
517 |
+ use system-bootstrap && bootstrap_rust_version_check |
518 |
+ |
519 |
+ if use system-llvm; then |
520 |
+ llvm_pkg_setup |
521 |
+ |
522 |
+ local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" |
523 |
+ export LLVM_LINK_SHARED=1 |
524 |
+ export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)" |
525 |
+ fi |
526 |
+} |
527 |
+ |
528 |
+esetup_unwind_hack() { |
529 |
+ # https://bugs.gentoo.org/870280 |
530 |
+ # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system. |
531 |
+ # it should trigger for internal bootstrap or system-bootstrap with rust-bin. |
532 |
+ # the whole idea is for stage0 to bootstrap with fake libgcc_s. |
533 |
+ # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler. |
534 |
+ local fakelib="${T}/fakelib" |
535 |
+ mkdir -p "${fakelib}" || die |
536 |
+ # we need both symlinks, one for cargo runtime, other for linker. |
537 |
+ ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die |
538 |
+ ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die |
539 |
+ export LD_LIBRARY_PATH="${fakelib}" |
540 |
+ export RUSTFLAGS+=" -L${fakelib}" |
541 |
+ # this is a literally magic variable that gets through cargo cache, without it some |
542 |
+ # crates ignore RUSTFLAGS. |
543 |
+ # this variable can not contain leading space. |
544 |
+ export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}" |
545 |
+} |
546 |
+ |
547 |
+src_prepare() { |
548 |
+ if ! use system-bootstrap; then |
549 |
+ has_version sys-devel/gcc || esetup_unwind_hack |
550 |
+ local rust_stage0_root="${WORKDIR}"/rust-stage0 |
551 |
+ local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)" |
552 |
+ |
553 |
+ "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \ |
554 |
+ --without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die |
555 |
+ fi |
556 |
+ |
557 |
+ default |
558 |
+} |
559 |
+ |
560 |
+src_configure() { |
561 |
+ use system-llvm && filter-flags '-flto*' # https://bugs.gentoo.org/862109 |
562 |
+ |
563 |
+ local rust_target="" rust_targets="" arch_cflags use_libcxx="false" |
564 |
+ |
565 |
+ # Collect rust target names to compile standard libs for all ABIs. |
566 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
567 |
+ rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\"" |
568 |
+ done |
569 |
+ if use wasm; then |
570 |
+ rust_targets="${rust_targets},\"wasm32-unknown-unknown\"" |
571 |
+ if use system-llvm; then |
572 |
+ # un-hardcode rust-lld linker for this target |
573 |
+ # https://bugs.gentoo.org/715348 |
574 |
+ sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm_base.rs || die |
575 |
+ fi |
576 |
+ fi |
577 |
+ rust_targets="${rust_targets#,}" |
578 |
+ |
579 |
+ local tools="\"cargo\"," |
580 |
+ if use clippy; then |
581 |
+ tools="\"clippy\",$tools" |
582 |
+ fi |
583 |
+ if use miri; then |
584 |
+ tools="\"miri\",$tools" |
585 |
+ fi |
586 |
+ if use profiler; then |
587 |
+ tools="\"rust-demangler\",$tools" |
588 |
+ fi |
589 |
+ if use rls; then |
590 |
+ tools="\"rls\",\"analysis\",$tools" |
591 |
+ fi |
592 |
+ if use rustfmt; then |
593 |
+ tools="\"rustfmt\",$tools" |
594 |
+ fi |
595 |
+ if use rust-src; then |
596 |
+ tools="\"src\",$tools" |
597 |
+ fi |
598 |
+ |
599 |
+ local rust_stage0_root |
600 |
+ if use system-bootstrap; then |
601 |
+ local printsysroot |
602 |
+ printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")" |
603 |
+ rust_stage0_root="${printsysroot}" |
604 |
+ else |
605 |
+ rust_stage0_root="${WORKDIR}"/rust-stage0 |
606 |
+ fi |
607 |
+ # in case of prefix it will be already prefixed, as --print sysroot returns full path |
608 |
+ [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory" |
609 |
+ |
610 |
+ rust_target="$(rust_abi)" |
611 |
+ |
612 |
+ # https://bugs.gentoo.org/732632 |
613 |
+ if tc-is-clang; then |
614 |
+ local clang_slot="$(clang-major-version)" |
615 |
+ if { has_version "sys-devel/clang:${clang_slot}[default-libcxx]" || is-flagq -stdlib=libc++; }; then |
616 |
+ use_libcxx="true" |
617 |
+ fi |
618 |
+ fi |
619 |
+ |
620 |
+ local cm_btype="$(usex debug DEBUG RELEASE)" |
621 |
+ cat <<- _EOF_ > "${S}"/config.toml |
622 |
+ changelog-seen = 2 |
623 |
+ [llvm] |
624 |
+ download-ci-llvm = false |
625 |
+ optimize = $(toml_usex !debug) |
626 |
+ release-debuginfo = $(toml_usex debug) |
627 |
+ assertions = $(toml_usex debug) |
628 |
+ ninja = true |
629 |
+ targets = "${LLVM_TARGETS// /;}" |
630 |
+ experimental-targets = "" |
631 |
+ link-shared = $(toml_usex system-llvm) |
632 |
+ $(if [[ ${use_libcxx} == true ]]; then |
633 |
+ echo "use-libcxx = true" |
634 |
+ echo "static-libstdcpp = false" |
635 |
+ fi) |
636 |
+ $(case "${rust_target}" in |
637 |
+ i586-*-linux-*) |
638 |
+ # https://github.com/rust-lang/rust/issues/93059 |
639 |
+ echo 'cflags = "-fcf-protection=none"' |
640 |
+ echo 'cxxflags = "-fcf-protection=none"' |
641 |
+ echo 'ldflags = "-fcf-protection=none"' |
642 |
+ ;; |
643 |
+ *) |
644 |
+ ;; |
645 |
+ esac) |
646 |
+ [llvm.build-config] |
647 |
+ CMAKE_VERBOSE_MAKEFILE = "ON" |
648 |
+ CMAKE_C_FLAGS_${cm_btype} = "${CFLAGS}" |
649 |
+ CMAKE_CXX_FLAGS_${cm_btype} = "${CXXFLAGS}" |
650 |
+ CMAKE_EXE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}" |
651 |
+ CMAKE_MODULE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}" |
652 |
+ CMAKE_SHARED_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}" |
653 |
+ CMAKE_STATIC_LINKER_FLAGS_${cm_btype} = "${ARFLAGS}" |
654 |
+ [build] |
655 |
+ build-stage = 2 |
656 |
+ test-stage = 2 |
657 |
+ doc-stage = 2 |
658 |
+ build = "${rust_target}" |
659 |
+ host = ["${rust_target}"] |
660 |
+ target = [${rust_targets}] |
661 |
+ cargo = "${rust_stage0_root}/bin/cargo" |
662 |
+ rustc = "${rust_stage0_root}/bin/rustc" |
663 |
+ rustfmt = "${rust_stage0_root}/bin/rustfmt" |
664 |
+ docs = $(toml_usex doc) |
665 |
+ compiler-docs = false |
666 |
+ submodules = false |
667 |
+ python = "${EPYTHON}" |
668 |
+ locked-deps = true |
669 |
+ vendor = true |
670 |
+ extended = true |
671 |
+ tools = [${tools}] |
672 |
+ verbose = 2 |
673 |
+ sanitizers = false |
674 |
+ profiler = $(toml_usex profiler) |
675 |
+ cargo-native-static = false |
676 |
+ [install] |
677 |
+ prefix = "${EPREFIX}/usr/lib/${PN}/${PV}" |
678 |
+ sysconfdir = "etc" |
679 |
+ docdir = "share/doc/rust" |
680 |
+ bindir = "bin" |
681 |
+ libdir = "lib" |
682 |
+ mandir = "share/man" |
683 |
+ [rust] |
684 |
+ # https://github.com/rust-lang/rust/issues/54872 |
685 |
+ codegen-units-std = 1 |
686 |
+ optimize = true |
687 |
+ debug = $(toml_usex debug) |
688 |
+ debug-assertions = $(toml_usex debug) |
689 |
+ debug-assertions-std = $(toml_usex debug) |
690 |
+ debuginfo-level = $(usex debug 2 0) |
691 |
+ debuginfo-level-rustc = $(usex debug 2 0) |
692 |
+ debuginfo-level-std = $(usex debug 2 0) |
693 |
+ debuginfo-level-tools = $(usex debug 2 0) |
694 |
+ debuginfo-level-tests = 0 |
695 |
+ backtrace = true |
696 |
+ incremental = false |
697 |
+ default-linker = "$(tc-getCC)" |
698 |
+ parallel-compiler = $(toml_usex parallel-compiler) |
699 |
+ channel = "$(usex nightly nightly stable)" |
700 |
+ description = "gentoo" |
701 |
+ rpath = false |
702 |
+ verbose-tests = true |
703 |
+ optimize-tests = $(toml_usex !debug) |
704 |
+ codegen-tests = true |
705 |
+ dist-src = false |
706 |
+ remap-debuginfo = true |
707 |
+ lld = $(usex system-llvm false $(toml_usex wasm)) |
708 |
+ # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it |
709 |
+ # https://github.com/rust-lang/rust/issues/74976 |
710 |
+ # https://github.com/rust-lang/rust/issues/76526 |
711 |
+ deny-warnings = $(usex wasm $(usex doc false true) true) |
712 |
+ backtrace-on-ice = true |
713 |
+ jemalloc = false |
714 |
+ [dist] |
715 |
+ src-tarball = false |
716 |
+ compression-formats = ["xz"] |
717 |
+ _EOF_ |
718 |
+ |
719 |
+ for v in $(multilib_get_enabled_abi_pairs); do |
720 |
+ rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) |
721 |
+ arch_cflags="$(get_abi_CFLAGS ${v##*.})" |
722 |
+ |
723 |
+ cat <<- _EOF_ >> "${S}"/config.env |
724 |
+ CFLAGS_${rust_target}=${arch_cflags} |
725 |
+ _EOF_ |
726 |
+ |
727 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
728 |
+ [target.${rust_target}] |
729 |
+ ar = "$(tc-getAR)" |
730 |
+ cc = "$(tc-getCC)" |
731 |
+ cxx = "$(tc-getCXX)" |
732 |
+ linker = "$(tc-getCC)" |
733 |
+ ranlib = "$(tc-getRANLIB)" |
734 |
+ llvm-libunwind = "$(usex llvm-libunwind $(usex system-llvm system in-tree) no)" |
735 |
+ _EOF_ |
736 |
+ # by default librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true; |
737 |
+ # but we patch it and set to false here as well |
738 |
+ if use elibc_musl; then |
739 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
740 |
+ crt-static = false |
741 |
+ _EOF_ |
742 |
+ fi |
743 |
+ if use system-llvm; then |
744 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
745 |
+ llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" |
746 |
+ _EOF_ |
747 |
+ fi |
748 |
+ done |
749 |
+ if use wasm; then |
750 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
751 |
+ [target.wasm32-unknown-unknown] |
752 |
+ linker = "$(usex system-llvm lld rust-lld)" |
753 |
+ # wasm target does not have profiler_builtins https://bugs.gentoo.org/848483 |
754 |
+ profiler = false |
755 |
+ _EOF_ |
756 |
+ fi |
757 |
+ |
758 |
+ if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below |
759 |
+ # experimental cross support |
760 |
+ # discussion: https://bugs.gentoo.org/679878 |
761 |
+ # TODO: c*flags, clang, system-llvm, cargo.eclass target support |
762 |
+ # it would be much better if we could split out stdlib |
763 |
+ # complilation to separate ebuild and abuse CATEGORY to |
764 |
+ # just install to /usr/lib/rustlib/<target> |
765 |
+ |
766 |
+ # extra targets defined as a bash array |
767 |
+ # spec format: <LLVM target>:<rust-target>:<CTARGET> |
768 |
+ # best place would be /etc/portage/env/dev-lang/rust |
769 |
+ # Example: |
770 |
+ # RUST_CROSS_TARGETS=( |
771 |
+ # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu" |
772 |
+ # ) |
773 |
+ # no extra hand holding is done, no target transformations, all |
774 |
+ # values are passed as-is with just basic checks, so it's up to user to supply correct values |
775 |
+ # valid rust targets can be obtained with |
776 |
+ # rustc --print target-list |
777 |
+ # matching cross toolchain has to be installed |
778 |
+ # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one) |
779 |
+ # only gcc toolchains installed with crossdev are checked for now. |
780 |
+ |
781 |
+ # BUG: we can't pass host flags to cross compiler, so just filter for now |
782 |
+ # BUG: this should be more fine-grained. |
783 |
+ filter-flags '-mcpu=*' '-march=*' '-mtune=*' |
784 |
+ |
785 |
+ local cross_target_spec |
786 |
+ for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do |
787 |
+ # extracts first element form <LLVM target>:<rust-target>:<CTARGET> |
788 |
+ local cross_llvm_target="${cross_target_spec%%:*}" |
789 |
+ # extracts toolchain triples, <rust-target>:<CTARGET> |
790 |
+ local cross_triples="${cross_target_spec#*:}" |
791 |
+ # extracts first element after before : separator |
792 |
+ local cross_rust_target="${cross_triples%%:*}" |
793 |
+ # extracts last element after : separator |
794 |
+ local cross_toolchain="${cross_triples##*:}" |
795 |
+ use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled" |
796 |
+ command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain" |
797 |
+ |
798 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
799 |
+ [target.${cross_rust_target}] |
800 |
+ ar = "${cross_toolchain}-ar" |
801 |
+ cc = "${cross_toolchain}-gcc" |
802 |
+ cxx = "${cross_toolchain}-g++" |
803 |
+ linker = "${cross_toolchain}-gcc" |
804 |
+ ranlib = "${cross_toolchain}-ranlib" |
805 |
+ _EOF_ |
806 |
+ if use system-llvm; then |
807 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
808 |
+ llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" |
809 |
+ _EOF_ |
810 |
+ fi |
811 |
+ if [[ "${cross_toolchain}" == *-musl* ]]; then |
812 |
+ cat <<- _EOF_ >> "${S}"/config.toml |
813 |
+ musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr" |
814 |
+ _EOF_ |
815 |
+ fi |
816 |
+ |
817 |
+ # append cross target to "normal" target list |
818 |
+ # example 'target = ["powerpc64le-unknown-linux-gnu"]' |
819 |
+ # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]' |
820 |
+ |
821 |
+ rust_targets="${rust_targets},\"${cross_rust_target}\"" |
822 |
+ sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die |
823 |
+ |
824 |
+ ewarn |
825 |
+ ewarn "Enabled ${cross_rust_target} rust target" |
826 |
+ ewarn "Using ${cross_toolchain} cross toolchain" |
827 |
+ ewarn |
828 |
+ if ! has_version -b 'sys-devel/binutils[multitarget]' ; then |
829 |
+ ewarn "'sys-devel/binutils[multitarget]' is not installed" |
830 |
+ ewarn "'strip' will be unable to strip cross libraries" |
831 |
+ ewarn "cross targets will be installed with full debug information" |
832 |
+ ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files" |
833 |
+ ewarn |
834 |
+ ewarn "Alternatively llvm-strip can be used, it supports stripping any target" |
835 |
+ ewarn "define STRIP=\"llvm-strip\" to use it (experimental)" |
836 |
+ ewarn |
837 |
+ fi |
838 |
+ done |
839 |
+ fi # I_KNOW_WHAT_I_AM_DOING_CROSS |
840 |
+ |
841 |
+ einfo "Rust configured with the following flags:" |
842 |
+ echo |
843 |
+ echo RUSTFLAGS="\"${RUSTFLAGS}\"" |
844 |
+ echo RUSTFLAGS_BOOTSTRAP="\"${RUSTFLAGS_BOOTSTRAP}\"" |
845 |
+ echo RUSTFLAGS_NOT_BOOTSTRAP="\"${RUSTFLAGS_NOT_BOOTSTRAP}\"" |
846 |
+ echo MAGIC_EXTRA_RUSTFLAGS="\"${MAGIC_EXTRA_RUSTFLAGS}\"" |
847 |
+ env | grep "CARGO_TARGET_.*_RUSTFLAGS=" |
848 |
+ cat "${S}"/config.env || die |
849 |
+ echo |
850 |
+ einfo "config.toml contents:" |
851 |
+ cat "${S}"/config.toml || die |
852 |
+ echo |
853 |
+} |
854 |
+ |
855 |
+src_compile() { |
856 |
+ # we need \n IFS to have config.env with spaces loaded properly. #734018 |
857 |
+ ( |
858 |
+ IFS=$'\n' |
859 |
+ env $(cat "${S}"/config.env) RUST_BACKTRACE=1\ |
860 |
+ "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die |
861 |
+ ) |
862 |
+} |
863 |
+ |
864 |
+src_test() { |
865 |
+ # https://rustc-dev-guide.rust-lang.org/tests/intro.html |
866 |
+ |
867 |
+ # those are basic and codegen tests. |
868 |
+ local tests=( |
869 |
+ codegen |
870 |
+ codegen-units |
871 |
+ compile-fail |
872 |
+ incremental |
873 |
+ mir-opt |
874 |
+ pretty |
875 |
+ run-make |
876 |
+ ) |
877 |
+ |
878 |
+ # fails if llvm is not built with ALL targets. |
879 |
+ # and known to fail with system llvm sometimes. |
880 |
+ use system-llvm || tests+=( assembly ) |
881 |
+ |
882 |
+ # fragile/expensive/less important tests |
883 |
+ # or tests that require extra builds |
884 |
+ # TODO: instead of skipping, just make some nonfatal. |
885 |
+ if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then |
886 |
+ tests+=( |
887 |
+ rustdoc |
888 |
+ rustdoc-js |
889 |
+ rustdoc-js-std |
890 |
+ rustdoc-ui |
891 |
+ run-make-fulldeps |
892 |
+ ui |
893 |
+ ui-fulldeps |
894 |
+ ) |
895 |
+ fi |
896 |
+ |
897 |
+ local i failed=() |
898 |
+ einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}" |
899 |
+ for i in "${tests[@]}"; do |
900 |
+ local t="src/test/${i}" |
901 |
+ einfo "rust_src_test: running ${t}" |
902 |
+ if ! ( |
903 |
+ IFS=$'\n' |
904 |
+ env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \ |
905 |
+ "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \ |
906 |
+ -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}" |
907 |
+ ) |
908 |
+ then |
909 |
+ failed+=( "${t}" ) |
910 |
+ eerror "rust_src_test: ${t} failed" |
911 |
+ fi |
912 |
+ done |
913 |
+ |
914 |
+ if [[ ${#failed[@]} -ne 0 ]]; then |
915 |
+ eerror "rust_src_test: failure summary: ${failed[@]}" |
916 |
+ die "aborting due to test failures" |
917 |
+ fi |
918 |
+} |
919 |
+ |
920 |
+src_install() { |
921 |
+ ( |
922 |
+ IFS=$'\n' |
923 |
+ env $(cat "${S}"/config.env) DESTDIR="${D}" \ |
924 |
+ "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die |
925 |
+ ) |
926 |
+ |
927 |
+ # bug #689562, #689160 |
928 |
+ rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die |
929 |
+ rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die |
930 |
+ newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo |
931 |
+ |
932 |
+ local symlinks=( |
933 |
+ cargo |
934 |
+ rustc |
935 |
+ rustdoc |
936 |
+ rust-gdb |
937 |
+ rust-gdbgui |
938 |
+ rust-lldb |
939 |
+ ) |
940 |
+ |
941 |
+ use clippy && symlinks+=( clippy-driver cargo-clippy ) |
942 |
+ use miri && symlinks+=( miri cargo-miri ) |
943 |
+ use profiler && symlinks+=( rust-demangler ) |
944 |
+ use rls && symlinks+=( rls ) |
945 |
+ use rustfmt && symlinks+=( rustfmt cargo-fmt ) |
946 |
+ |
947 |
+ einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}" |
948 |
+ local i |
949 |
+ for i in "${symlinks[@]}"; do |
950 |
+ # we need realpath on /usr/bin/* symlink return version-appended binary path. |
951 |
+ # so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver> |
952 |
+ # need to fix eselect-rust to remove this hack. |
953 |
+ local ver_i="${i}-${PV}" |
954 |
+ if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then |
955 |
+ einfo "Installing ${i} symlink" |
956 |
+ ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die |
957 |
+ else |
958 |
+ ewarn "${i} symlink requested, but source file not found" |
959 |
+ ewarn "please report this" |
960 |
+ fi |
961 |
+ dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}" |
962 |
+ done |
963 |
+ |
964 |
+ # symlinks to switch components to active rust in eselect |
965 |
+ dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}" |
966 |
+ dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}" |
967 |
+ dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}" |
968 |
+ dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}" |
969 |
+ dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}" |
970 |
+ |
971 |
+ newenvd - "50${P}" <<-_EOF_ |
972 |
+ LDPATH="${EPREFIX}/usr/lib/rust/lib" |
973 |
+ MANPATH="${EPREFIX}/usr/lib/rust/man" |
974 |
+ $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '') |
975 |
+ $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '') |
976 |
+ _EOF_ |
977 |
+ |
978 |
+ rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die |
979 |
+ rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die |
980 |
+ |
981 |
+ # note: eselect-rust adds EROOT to all paths below |
982 |
+ cat <<-_EOF_ > "${T}/provider-${P}" |
983 |
+ /usr/bin/cargo |
984 |
+ /usr/bin/rustdoc |
985 |
+ /usr/bin/rust-gdb |
986 |
+ /usr/bin/rust-gdbgui |
987 |
+ /usr/bin/rust-lldb |
988 |
+ /usr/lib/rustlib |
989 |
+ /usr/lib/rust/lib |
990 |
+ /usr/lib/rust/libexec |
991 |
+ /usr/lib/rust/man |
992 |
+ /usr/share/doc/rust |
993 |
+ _EOF_ |
994 |
+ |
995 |
+ if use clippy; then |
996 |
+ echo /usr/bin/clippy-driver >> "${T}/provider-${P}" |
997 |
+ echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" |
998 |
+ fi |
999 |
+ if use miri; then |
1000 |
+ echo /usr/bin/miri >> "${T}/provider-${P}" |
1001 |
+ echo /usr/bin/cargo-miri >> "${T}/provider-${P}" |
1002 |
+ fi |
1003 |
+ if use profiler; then |
1004 |
+ echo /usr/bin/rust-demangler >> "${T}/provider-${P}" |
1005 |
+ fi |
1006 |
+ if use rls; then |
1007 |
+ echo /usr/bin/rls >> "${T}/provider-${P}" |
1008 |
+ fi |
1009 |
+ if use rustfmt; then |
1010 |
+ echo /usr/bin/rustfmt >> "${T}/provider-${P}" |
1011 |
+ echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" |
1012 |
+ fi |
1013 |
+ |
1014 |
+ insinto /etc/env.d/rust |
1015 |
+ doins "${T}/provider-${P}" |
1016 |
+ |
1017 |
+ if use dist; then |
1018 |
+ insinto "/usr/lib/${PN}/${PV}/dist" |
1019 |
+ doins -r "${S}/build/dist/." |
1020 |
+ fi |
1021 |
+} |
1022 |
+ |
1023 |
+pkg_postinst() { |
1024 |
+ eselect rust update |
1025 |
+ |
1026 |
+ if has_version sys-devel/gdb || has_version dev-util/lldb; then |
1027 |
+ elog "Rust installs a helper script for calling GDB and LLDB," |
1028 |
+ elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." |
1029 |
+ fi |
1030 |
+ |
1031 |
+ if has_version app-editors/emacs; then |
1032 |
+ elog "install app-emacs/rust-mode to get emacs support for rust." |
1033 |
+ fi |
1034 |
+ |
1035 |
+ if has_version app-editors/gvim || has_version app-editors/vim; then |
1036 |
+ elog "install app-vim/rust-vim to get vim support for rust." |
1037 |
+ fi |
1038 |
+} |
1039 |
+ |
1040 |
+pkg_postrm() { |
1041 |
+ eselect rust cleanup |
1042 |
+} |