Gentoo Archives: gentoo-commits

From: Quentin Retornaz <gentoo@××××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: dev-lang/rust/files/, dev-lang/rust/
Date: Tue, 31 Jan 2023 23:14:52
Message-Id: 1675206867.65b92d04da4ab9bbbefe6e1eab2cfb15a0fd7a04.quentin@gentoo
1 commit: 65b92d04da4ab9bbbefe6e1eab2cfb15a0fd7a04
2 Author: orbea <orbea <AT> riseup <DOT> net>
3 AuthorDate: Sat Jan 28 17:20:56 2023 +0000
4 Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
5 CommitDate: Tue Jan 31 23:14:27 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=65b92d04
7
8 dev-lang/rust: Add 1.67.0
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 dev-lang/rust/files/1.67.0-bootstrap.patch | 38 ++
15 dev-lang/rust/rust-1.67.0.ebuild | 749 +++++++++++++++++++++++++++++
16 3 files changed, 821 insertions(+)
17
18 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
19 index 48fbca7..c3dc06f 100644
20 --- a/dev-lang/rust/Manifest
21 +++ b/dev-lang/rust/Manifest
22 @@ -62,7 +62,41 @@ DIST rust-1.65.0-x86_64-unknown-linux-gnu.tar.xz 162028064 BLAKE2B 8c572cc304c16
23 DIST rust-1.65.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7a9287b6125eab2c14a026d6b4d8a3e980b9fedac0436b75b1bf314b093b5e39de0d70045e183a2e823d729d24f43f6251a2fc28b072e3caa1950fbbddf149e6 SHA512 16abed6d7a17b9e5f3e399865ed5fee01272c8e6696ea2e784a6fb149df16da2c4123572dfb56c3c44d407d388033e52b552cd164600629cf61b33c011e4e415
24 DIST rust-1.65.0-x86_64-unknown-linux-musl.tar.xz 266683288 BLAKE2B 4312a53bca3e33f6633fd5eed1b17754813e54d688185ff4cca6c5d6b24713994fb5fc424113ab08c121319cc79da3d7d89518d18dbb1b491bc8ba2ec831c12e SHA512 6c7ddc98da3227b23dd681615bb8f8ea883f3bdd9547e35733cf6acaf2a625301c53449b1a3ddf88dad9a5c940f8324c3e1bb31d871092fc848b863256c85935
25 DIST rust-1.65.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 054f1b773518a9640f3d9226510cb0b00a7f8dc4a9046c325b82d038a50c699a8bd84f71ed62790e9b96b4d65ad12ea631f6a8bc18b3bafd66db3d21137cd378 SHA512 39aa000c2a1359cfd7d2eda2b22a9b10c0fe4aa024862b7ea67bd488e06fdee6f5cc4e98db7486b84ce53f1c299bbd5391f63e25df0358184533a5fdced4ce61
26 +DIST rust-1.66.1-aarch64-unknown-linux-gnu.tar.xz 248806760 BLAKE2B fc5474257221705de7a8220029a406145b886914e59a3ae1ca4048b5789d4bdfa1b11506f7473590efb65c36463d0c34b2a185a407fb31247714eab715a9e3f0 SHA512 3f6f0f03d88c7f175efdf9ed541a4e1965df5473a7865e7611ad8df51cf53a12b27e3493c4b2021749e0c912dd844f9117616d2c740a5e9242872f07d3978c48
27 +DIST rust-1.66.1-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 4fdbf4edaf4a346557996faceda168bbd74064566a902811c52772ba832f4ab96b3128dbe06e06de4e54cceb642b837e1cb1ff7e30ff9c0739f9ec44aedec8a9 SHA512 7e59bba51666275559362515f31fcbb0635055de7d85f3e3d6598b2caa9fe2c5656032c221327debc2d174592cb981c86212ec7860d5b73d55e90c02a0258c58
28 +DIST rust-1.66.1-aarch64-unknown-linux-musl.tar.xz 228044080 BLAKE2B 8cb2341e84c2f8df44a0484a6a559148260c1300e81e6ab145bb57920d65fd44af8144cd0150ab9c203aa2a000f09e0696a53668e7b8d0984f9fd4710012b736 SHA512 6bb116af95b7946609017afa68eebb5278e568f852d879fd0f068d4ef10afdc7638ced0a87683080240a24f7e52f119cbe0268639906984ef8bddbe4c5dcd43d
29 +DIST rust-1.66.1-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 6b7ff46ef90437ca89322d66c0ec78d549d65d0d206704ac6e72c9f427e9d7224162291b37dde40b35954795c8879a3f380dfbf1de38da0c979b33ee315d5aea SHA512 935055c5dc28e4b2b44a5b1279d401a0b939ba576c1d8157de083d8a726fed678b5420cfd090e94dc1e9a309cc070329590515c4110fc241f9b5be7f8df2d493
30 +DIST rust-1.66.1-arm-unknown-linux-gnueabi.tar.xz 207170588 BLAKE2B 0c3a52fb3549c63ccbb43109cf54cb676812d49461344629b1c0f8d4747a40c9f6b6d050c9e27da6dad5914cf491fa7653a107b9f9e3a7f851ebecef2a98588c SHA512 6e4e385caf95a3ddc2fe4a05ecec745b721bf2eac9846d61e8ffaef749b1db2e506b7face55aa72cc7ffcda340f69185f30eb1d456a9f063c7a7c7ed7fd4eb9b
31 +DIST rust-1.66.1-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 8068dac7f1078470cabdeadfde8722bc96a1271e5572a4b84b7d108b173d87d1be32eef9b9be67b2c6bb3ab72dfc6a524476bfa46e222c29bc93724a183410c6 SHA512 ab3e4c7e470d4f7736e452c7118ab945747db5566b7e6d1c81359c3e224ec348b18193d4cd054772e878f791308dce792630fd4f10f750efc7e0e23b150c16d2
32 +DIST rust-1.66.1-arm-unknown-linux-gnueabihf.tar.xz 208535556 BLAKE2B cd1454141cd89f63d401047801b88421d9a2906425bfc4482a24fa1b468d2db382a939cb64b836808a1d0438f464d28a83b7e8097e2f97f1053a5fac7bc6de29 SHA512 92abac3fd13319b9edc6daee72689ae29e463bb317ed08580e04ff6f31b0ba5816052b8d26914d9c224ea47399517b388db78ce8ec17629795ea3988c353e2c6
33 +DIST rust-1.66.1-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B f828310aecad4d96c9074688f0211ba7e5286f0b3e669cb6fb1b9e3ae3adc776d6fdfda0702103cc571771eb404307df6f55c498fbd8dd006e02338cbc14893e SHA512 d3b88b83efd4303b5fde991672594d25c253b0fc6d66875dc217808190903f28a6afe8977a9ac436542c42675a12c0e244bba9aafb239c15f2ffcfe533ed92b2
34 +DIST rust-1.66.1-armv7-unknown-linux-gnueabihf.tar.xz 212774560 BLAKE2B 4bad7755067da0a99135cc8212928b78ff254e143908712c1cb77d41ce7a8db1c7d2eed3b12b916214d03f0bf0be17d81b2669ddb5f3722fee921f2d65aec491 SHA512 4cd871dd6cdf379c71290287ae2125ef57c2d5d52753285f064a6d96e8cb586cb263ee49f7b099ede8f3e15f1bbc5b286628acf242de4fb3ba8e5d80323c08bf
35 +DIST rust-1.66.1-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 56504503b1b45a43f10b01f3e470667c93fc12036506b94cefb66f4241bf457d537899c2db4894027ef7f649eec627ad7bef8e1989523aa8ab67ba3f51976f23 SHA512 0a7de37872ac1a8c07ad1ac02d2bec9fb614175a5f394d603ca0c894d3d6cb12a35877e38c807da29ef89c7465a27080cfa0d5fd8ac21884fa5bc3f3c47fbe9b
36 +DIST rust-1.66.1-i686-unknown-linux-gnu.tar.xz 234959096 BLAKE2B 0e0583c460092539e8813feaa0f65a026f4f52357571be5bcaef114f062c598ac5d2e3f4f22c88514b9b0a9e53e256a25eb2f18353642a8e40c6156df4309b54 SHA512 19cafc7763b40aa48543c5678f3c4d23b552f091bf6dc592f57ec950856802b3e7dee98d06b73ead0861630ff101260d741082fc1cc65c7f256e4591b821068b
37 +DIST rust-1.66.1-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B dd2c75d23caac69aa5e8cc965d5de9705f9f8e5f0be53cdd87e51deb07875579cf948bd6a7a02f10de3fcdbc70fb1cc46a4b616af44f3296787e5d9a32557490 SHA512 9364bf48b262c797815cc3f38188bdbe595cd39839b5bdcd43f7da07fdd421c61ab93ff4fa65d6b20f7d15e8eff190cb0d8a92a806878b1db5ccb62e80eddfeb
38 +DIST rust-1.66.1-mips-unknown-linux-gnu.tar.xz 187966796 BLAKE2B 193f18a9c56465d297ee2b3f1d9a8a67d8a6b1d07565503e6f5b31d4bd5b05782f45e95ee50a93e6d1b91275e9769a9d56518349a456f55392dc28b9d3a1ee82 SHA512 8f23b47f38ca42af3dccb395fa183edee3f18a478bdf1f7de2135e5afc6dd87d14508f7e2ada938dd64eb51f5acee27d0417fae6e3b1c114c6c812006206d89c
39 +DIST rust-1.66.1-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B a04c0f9320d663658b758e6b89709645433a0d16548c511945c439ce134617c8a05d7e9ff988e8f7a1ef62a726284548bf8b259648f614c3a2205ee9c02b3a91 SHA512 4b581b997a643c0ee6105c141c7859e86d9b2cb6dda85d867593829978911dc5a6c343a11712a334b94188078c0d3b1e7e734334b8b4a16b38afab228172bc6b
40 +DIST rust-1.66.1-mips64-unknown-linux-gnuabi64.tar.xz 184874416 BLAKE2B 64d96a026634cce03496be36ea7a42986e0fedc75d6c61e0f9a6ffe5cd3432bacd353276636c58989d02328be62f760bc0157c5999262bbac5c570dbc049635a SHA512 ce4b5ff464e358b085c18c21697cf7f339c19db163a873bf68b24e2febf42e69e582bbfc9f95cc38a6c96610a8ccfe6ec431cb2f98be10c48f9c1cbf027456a0
41 +DIST rust-1.66.1-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B fdcc56efc4f7df5d13595661d59354e4fcc757e966360fccf8a86d42f31f952334b9cedd107d23e4132b90e3082013cc26076a0754455d2759e2bb878afe023e SHA512 c5918b76fdfa39ba89c980ec2d252b3755439c8baece26d27f3515e800061370c2715620a052d3f22bd57412d058f5e3f53084bee08b5026b0f50112e6c41b93
42 +DIST rust-1.66.1-mipsel-unknown-linux-gnu.tar.xz 191073888 BLAKE2B b88ebb699e97e7e243138bf5674956afac0204bcc19882efd59340bd45256e9ba07b7e160895faffd81c62b533b2d305b088c08d3a99060e91025627ec8b7c7b SHA512 9afe6b80df0e24f2cedd65e7ab5fb25cd28be69b3e442c80a8f92291c7ad7ff7c2f8ec2e901bdeeb8084467700db4c19055edfe4ca8ccf7f6ffbf69e5c20426f
43 +DIST rust-1.66.1-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 9a8c4eb0683465c63d1d5f25eedbc2ee96331960cbb2704d67a806852a05544f646cfe8220a3582d6e05dd30e63fdb736d176c0467166192501d168e5a0fb7d2 SHA512 e35e0e6b94feb551dc1a06e36ad0c70fe2641dc5671fc74fe99baede8c40cbca828259eafbf790af43cb8775fcf8c38442d2ca3349277b07bacbb508676b25d3
44 +DIST rust-1.66.1-powerpc-unknown-linux-gnu.tar.xz 209784584 BLAKE2B d582f2efaf7401dfc8ece24026653dd52acd3bd5f3a87d12eaf1be5170909ebf009189312d59d5508beb6a68bb88545ce97af1d87049dd61b2736ddd9fbb9ffc SHA512 b8a9f4115864e0e6262c603e11b2dd9a66706c120aecbd0e7b0acc79ff1675f0dbbd2c6c0095d21be664a04408e610f07b4e09adc31f73b0fc92dbb2083f9b13
45 +DIST rust-1.66.1-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 1bf9e84765268fd89e4e18adc5584dc5b7517217e2c042e6a4b4b68d9716f0502df83115308451792d800458c71535f9bebcd1254f0d26e0359cc19e398d651d SHA512 93b7bc720dd9f0324a6a3a066e26d218236f8a87e50d4ee827d1f785eacc1e289d3635d7653d38197294c4ab4bbf6e15acd2341517f1a75c1e48a2034f5bdd3e
46 +DIST rust-1.66.1-powerpc64-unknown-linux-gnu.tar.xz 211414032 BLAKE2B fcd16f3cffc4a8fa4d42daa75562d48c1a9aeb487b72a461a7a300fc15a51ef478afd8a129a34681c9035b3b846c3fc713e9f128e55ec0f3688022bf92ee2529 SHA512 8acd1e8b4ebd25d31652cbaca0173c87499fce233525d516279557d63c50cbf36d4bdce0bd73ab4b69d9dd95d0f3a91b7b80f77ae3a3f23de7660ee38b5e6b59
47 +DIST rust-1.66.1-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d07e572b2dd85f47c7cde4d6e328ba35f20f143d637a5b0b9d295f24b9bc3bccd72282718351419784a32c5d26189557beb2fd143792e3115aea4640650b4371 SHA512 dcc1708cb37bcf2820c7f6280fedfbfebc8a85ed76f6e5acc64f6b1f768b32f2895d737f7209ef8a7f81f339047531e28675f3a31e3f648d382359550f255095
48 +DIST rust-1.66.1-powerpc64le-unknown-linux-gnu.tar.xz 223088628 BLAKE2B 1627b274c35596e7fa932e42d8a14e6487fc74d34b1d8e2c4661d6346bcf3dc6adbea86ad62de8c9901b3cf7616e92e07d5d9f7002ef39d20a0c2a418e2533a5 SHA512 4834a7a794967b32c3daf633c4627e3ae9adb60268bb409f8886607ba8799f98fc8774a8652a41bba1e8147fd51e8a30ceb569cc22ac1f29e23d335974374aa2
49 +DIST rust-1.66.1-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 105e598220ad4c82ea4822b3b09744f6445e962dc4c9d9c01846f2e51586d2d18c71ed9ec9ed3c3e4d76715879e8e714d3ea47628fa9bad2ceca1c0f34faaa6a SHA512 cc368e40e09fe42df2c01d124912e7dd90b14c694512d6761e4c25cd183998bb1b5426916087ed05488260e916f4ac97f53dac27e278b53ae1f8387c086e384e
50 +DIST rust-1.66.1-riscv64gc-unknown-linux-gnu.tar.xz 189480332 BLAKE2B 98f9cd36895a415967f4392ec58ff290850bbb094c473ec8a7956888b22dd9cec412f540f73acaa99c17ceb3c2255d6745f1072f7e170ff5e28fb6475ee396fa SHA512 ce35e57cbe0e92a33e9efac4be3c8f650615197728654f775a3784ff28d823907f59fef0743d63d65d034cff8079cbc000a98531f2fcfbeb8f33de66d772a4be
51 +DIST rust-1.66.1-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B ab78efea869dd2233cfa9929995546c33146ee0d92b262549a44d2b5bfa6e1309cb32c831f8a3be4baeb0e27f1abc044e03d87de23eb28c6057f5ac383d4d9b7 SHA512 c9f5764c78031bdaf8106c53a4774f55acf6308be057bd8acdf1c07863daeb5fbf2a5bc8fcefdf9fc0391a2984e7b1b7aaa11d89402938575df2ca38a3758739
52 +DIST rust-1.66.1-s390x-unknown-linux-gnu.tar.xz 226436776 BLAKE2B a45528d58550b51a0e5d589e3f44ae5bde739e58e9172d83822068235f753007094129da606b034aa534aa9e5bb85c020adc8f7054d59b61f1fe0fbdece2e894 SHA512 ce22b52c9ea4dd3ac9f8ac84a6a50f7a2c031c485ae01fc57be1ce922b927f2e138862b620dd6a538375a0e6c5ca4d693b32643b26f9f647d0ec1d6eee8a799c
53 +DIST rust-1.66.1-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e705dc1a56d686c540e9a3667a0e14bff66f27f789f7a4022fb9a7d3919deca0cb264eee8da4fb0d54d625bf86798a2926176c0f148218a97bc4cd94f3c2d192 SHA512 5a657456f75aea4246fb3b7ec8c43ba2ace111ee41ee22ff26c05f246b699eb7ad76703168aafc1ebd88673390e13ac03caf7dcfbf270eef2cb5f943bdd5296f
54 +DIST rust-1.66.1-x86_64-unknown-linux-gnu.tar.xz 186651920 BLAKE2B de89dd720320da6a8f27f5499e90d417eb3d3a9a934deddda8fdda279694ff33312af14c4c5be1c8b4e22333d5663b4c51c2d1d22914876bc4ab6e39dbf16476 SHA512 8bcbbd4a9246dd48c4109b9c91852b3a470036a8c0ac31b77cb4c05a205644a5829c5c38977240ab51e25778d1f9c7c3cda303da3f6b50a98d6a4eccb0f73782
55 +DIST rust-1.66.1-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d313eafed62763b0905636ff22d6c736696c55e55d2442512a95e239b5b37199fdb125d312284b2a249782fa61d552284c8eb3ef8c9aa9ea36283a9fb975dd66 SHA512 c491f07c77baeac6b92c2425092c1b3694e72c49d4e6e511597aac03d51930cd414a95b0d691a9b23df266fba8df3dd90bf7d30624383bd213403fe0cbc83ffb
56 +DIST rust-1.66.1-x86_64-unknown-linux-musl.tar.xz 270294752 BLAKE2B b068a9400f29e9318e8d52f2c37df72f1b8fd91ca0bba342e6681544595a7f2697bf10437be6c4612a36d2781cc915920b498273ab12dbe1163c41d9d4e9b438 SHA512 df03ef29b03924346ef2a4b5dbf1c7ce6e33fb1f357eb04b0fa80e48a607b29f5929ce587412c9dd3f385d6382f0229c19d0ce78d6c060ddc0539429d3cfc606
57 +DIST rust-1.66.1-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B a262a2a020a142ea8e3906a9c93d9294906ee51f5d22efd4ef041b6032524d2714e0b511f7deb366c0ee3337ecd52f1e091b6bfed01615eaa9026996100afe2d SHA512 f390b3a788c5b15b1acee01505b6501ad4a3170cd2f23ec490b02294ce0a62c3f708f1e66c0ba8258a1042dea0401a1e09d31d34e99558f50b0f65b359354182
58 DIST rustc-1.65.0-src.tar.xz 139674928 BLAKE2B a218263fb67e306b153f5a6dae95b5ec653acaa5eb4b833862d6f0fd4685a8cec097dadc1b8a934e1bf6055672c7a617f9a0ad4a7dbf2e78084297f10b7ada04 SHA512 3d0369ed3028209c4ecb9b9e7b5f5e3a20be8cc05199675df4f091d62a96c0734bc1dbd7630928fe162792392ec6d0daf9ceed10771531ce022200c7b631e3be
59 DIST rustc-1.65.0-src.tar.xz.asc 801 BLAKE2B 43ff92011cd6f7f34ce0495fa341379e5907d032ea90f91e533e5edaec6ad518aad50a9d8b2694074d6909ee96aa779403b16e95792e962e79c1b967542ae26f SHA512 75b9be53363022c81333117876cbcc573bbd4733edf767cbb164218644efb1a9c4bfc2aa73aaa1e39f248a84f1adacb1930a94a6e63f60093ff760fb9ae02efc
60 DIST rustc-1.66.1-src.tar.xz 141692940 BLAKE2B 3fae45345998386fda1b11ec896fac4613b8e3f0092bc0df29c9685f4a4012c0bd1b600911c2d19bcfa8f5a84b8a3c39d4c9e062a62cd61925b59129e1cd72b9 SHA512 1944c024c603140d0a9236043a3bd1d0d211dd8d368d6d82a3a620f1ff43b29624755b0943f2b38b40a188c7eee77a840238ea757eaf435e2a3fa6a0e6b82832
61 DIST rustc-1.66.1-src.tar.xz.asc 801 BLAKE2B 18e27c88b39eed29147854733c5533b7fffc417ff0b3bd5982174ffa2c5f6d217e2e28ced4da75863a4557800e7ad7a124a4bbb0def4c20da7ed543602185941 SHA512 4511f41ad3d098a339ea3173e3ffa692d1d3cd3ec9dd45af68e4491471f9a72a2e866f6924090eb366bdf6f856650d981eabe1cd851843a17f4a6e4f1dfbc8a9
62 +DIST rustc-1.67.0-src.tar.xz 142750964 BLAKE2B 5dcea694548f5162bed6020ca12ecfa178fba479fbe6f29ec310f9c5cfaae13999de7b861498e92561f21001fed295d21dd9230ccb5da2f20c638309e785cfda SHA512 6d1ddb54c0ee2c4f8ccf73f3c306c8d8868feb738d5e77eb5a5d25f716395c27d1b3666929c87f9dc84213a9acfdb56254feac92ef0fea3147e2c644391c12b4
63 +DIST rustc-1.67.0-src.tar.xz.asc 801 BLAKE2B b46159b7cbe081cb34d82b2642397788d09d09f9e55fd961a491862c2c1827b0752530fa74e1a8245cab9ff898d2f021bfdae4820edca34a87c9e18202d7a31e SHA512 cceb0aa5d43c476a051c77263fe152085b8d7d337f78117077a1e460bb9e31b75becd36a8f571fc1275a268ac1107d680012a82a7378851d2a9f16748d95a929
64
65 diff --git a/dev-lang/rust/files/1.67.0-bootstrap.patch b/dev-lang/rust/files/1.67.0-bootstrap.patch
66 new file mode 100644
67 index 0000000..eb16066
68 --- /dev/null
69 +++ b/dev-lang/rust/files/1.67.0-bootstrap.patch
70 @@ -0,0 +1,38 @@
71 +From 675fa0b3dd5fe14b43ad5b7862f4528df7322468 Mon Sep 17 00:00:00 2001
72 +From: Michael Goulet <michael@××××.io>
73 +Date: Mon, 12 Dec 2022 18:29:33 +0000
74 +Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20fix=20unsoundness=20in=20bootstr?=
75 + =?UTF-8?q?ap=20cache=20code?=
76 +MIME-Version: 1.0
77 +Content-Type: text/plain; charset=UTF-8
78 +Content-Transfer-Encoding: 8bit
79 +
80 +---
81 + src/bootstrap/cache.rs | 8 ++++----
82 + 1 file changed, 4 insertions(+), 4 deletions(-)
83 +
84 +diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs
85 +index be5c9bb078808..05f25af68ea8f 100644
86 +--- a/src/bootstrap/cache.rs
87 ++++ b/src/bootstrap/cache.rs
88 +@@ -89,16 +89,16 @@ impl<T: Internable + Hash> Hash for Interned<T> {
89 +
90 + impl<T: Internable + Deref> Deref for Interned<T> {
91 + type Target = T::Target;
92 +- fn deref(&self) -> &'static Self::Target {
93 ++ fn deref(&self) -> &Self::Target {
94 + let l = T::intern_cache().lock().unwrap();
95 +- unsafe { mem::transmute::<&Self::Target, &'static Self::Target>(l.get(*self)) }
96 ++ unsafe { mem::transmute::<&Self::Target, &Self::Target>(l.get(*self)) }
97 + }
98 + }
99 +
100 + impl<T: Internable + AsRef<U>, U: ?Sized> AsRef<U> for Interned<T> {
101 +- fn as_ref(&self) -> &'static U {
102 ++ fn as_ref(&self) -> &U {
103 + let l = T::intern_cache().lock().unwrap();
104 +- unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) }
105 ++ unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) }
106 + }
107 + }
108 +
109
110 diff --git a/dev-lang/rust/rust-1.67.0.ebuild b/dev-lang/rust/rust-1.67.0.ebuild
111 new file mode 100644
112 index 0000000..68ed8f4
113 --- /dev/null
114 +++ b/dev-lang/rust/rust-1.67.0.ebuild
115 @@ -0,0 +1,749 @@
116 +# Copyright 1999-2023 Gentoo Authors
117 +# Distributed under the terms of the GNU General Public License v2
118 +
119 +EAPI=8
120 +
121 +PYTHON_COMPAT=( python3_{9..11} )
122 +
123 +inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing \
124 + multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
125 +
126 +if [[ ${PV} = *beta* ]]; then
127 + betaver=${PV//*beta}
128 + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
129 + MY_P="rustc-beta"
130 + SLOT="beta/${PV}"
131 + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz"
132 +else
133 + ABI_VER="$(ver_cut 1-2)"
134 + SLOT="stable/${ABI_VER}"
135 + MY_P="rustc-${PV}"
136 + SRC="${MY_P}-src.tar.xz"
137 + KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
138 +fi
139 +
140 +RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).1"
141 +
142 +DESCRIPTION="Systems programming language from Mozilla"
143 +HOMEPAGE="https://www.rust-lang.org/"
144 +
145 +SRC_URI="
146 + https://static.rust-lang.org/dist/${SRC}
147 + verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
148 + !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
149 +"
150 +
151 +# keep in sync with llvm ebuild of the same version as bundled one.
152 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
153 + NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
154 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
155 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
156 +
157 +LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4 UoI-NCSA"
158 +
159 +IUSE="clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind miri nightly parallel-compiler profiler rustfmt rust-analyzer rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
160 +
161 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
162 +# we need to *really* make sure we're not pulling more than one slot
163 +# simultaneously.
164 +
165 +# How to use it:
166 +# List all the working slots in LLVM_VALID_SLOTS, newest first.
167 +LLVM_VALID_SLOTS=( 15 )
168 +LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}"
169 +
170 +# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
171 +# (-) usedep needed because we may build with older llvm without that target
172 +LLVM_DEPEND="|| ( "
173 +for _s in ${LLVM_VALID_SLOTS[@]}; do
174 + LLVM_DEPEND+=" ( "
175 + for _x in ${ALL_LLVM_TARGETS[@]}; do
176 + LLVM_DEPEND+="
177 + ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] )
178 + wasm? ( sys-devel/lld:${_s} )"
179 + done
180 + LLVM_DEPEND+=" )"
181 +done
182 +unset _s _x
183 +LLVM_DEPEND+=" )
184 + <sys-devel/llvm-$(( LLVM_MAX_SLOT + 1 )):=
185 +"
186 +
187 +# to bootstrap we need at least exactly previous version, or same.
188 +# most of the time previous versions fail to bootstrap with newer
189 +# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
190 +# but it fails to bootstrap with 1.48.x
191 +# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.json
192 +RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
193 +RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
194 +BOOTSTRAP_DEPEND="||
195 + (
196 + =dev-lang/rust-"${RUST_DEP_PREV}"
197 + =dev-lang/rust-bin-"${RUST_DEP_PREV}"
198 + =dev-lang/rust-"${RUST_DEP_CURR}"
199 + =dev-lang/rust-bin-"${RUST_DEP_CURR}"
200 + )
201 +"
202 +
203 +BDEPEND="${PYTHON_DEPS}
204 + app-eselect/eselect-rust
205 + || (
206 + >=sys-devel/gcc-4.7
207 + >=sys-devel/clang-3.5
208 + )
209 + system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
210 + !system-llvm? (
211 + >=dev-util/cmake-3.13.4
212 + dev-util/ninja
213 + )
214 + test? ( sys-devel/gdb )
215 + verify-sig? ( sec-keys/openpgp-keys-rust )
216 +"
217 +
218 +DEPEND="
219 + >=app-arch/xz-utils-5.2
220 + net-misc/curl:=[http2,ssl]
221 + sys-libs/zlib:=
222 + dev-libs/openssl:0=
223 + system-llvm? (
224 + ${LLVM_DEPEND}
225 + llvm-libunwind? ( sys-libs/llvm-libunwind:= )
226 + )
227 + !system-llvm? (
228 + !llvm-libunwind? (
229 + elibc_musl? ( sys-libs/libunwind:= )
230 + )
231 + )
232 +"
233 +
234 +RDEPEND="${DEPEND}
235 + app-eselect/eselect-rust
236 + sys-apps/lsb-release
237 +"
238 +
239 +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
240 + miri? ( nightly )
241 + parallel-compiler? ( nightly )
242 + test? ( ${ALL_LLVM_TARGETS[*]} )
243 + wasm? ( llvm_targets_WebAssembly )
244 + x86? ( cpu_flags_x86_sse2 )
245 +"
246 +
247 +# we don't use cmake.eclass, but can get a warning
248 +CMAKE_WARN_UNUSED_CLI=no
249 +
250 +QA_FLAGS_IGNORED="
251 + usr/lib/${PN}/${PV}/bin/.*
252 + usr/lib/${PN}/${PV}/libexec/.*
253 + usr/lib/${PN}/${PV}/lib/lib.*.so
254 + usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/.*
255 + usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
256 +"
257 +
258 +QA_SONAME="
259 + usr/lib/${PN}/${PV}/lib/lib.*.so.*
260 + usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
261 +"
262 +
263 +QA_PRESTRIPPED="
264 + usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/rust-llvm-dwp
265 + usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/self-contained/crtn.o
266 +"
267 +
268 +# An rmeta file is custom binary format that contains the metadata for the crate.
269 +# rmeta files do not support linking, since they do not contain compiled object files.
270 +# so we can safely silence the warning for this QA check.
271 +QA_EXECSTACK="usr/lib/${PN}/${PV}/lib/rustlib/*/lib*.rlib:lib.rmeta"
272 +
273 +# causes double bootstrap
274 +RESTRICT="test"
275 +
276 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/rust.asc
277 +
278 +PATCHES=(
279 + "${FILESDIR}"/1.64.0-libressl.patch
280 + "${FILESDIR}"/1.65.0-ignore-broken-and-non-applicable-tests.patch
281 + "${FILESDIR}"/1.62.1-musl-dynamic-linking.patch
282 + "${FILESDIR}"/1.67.0-bootstrap.patch
283 +)
284 +
285 +S="${WORKDIR}/${MY_P}-src"
286 +
287 +toml_usex() {
288 + usex "${1}" true false
289 +}
290 +
291 +bootstrap_rust_version_check() {
292 + # never call from pkg_pretend. eselect-rust may be not installed yet.
293 + [[ ${MERGE_TYPE} == binary ]] && return
294 + local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
295 + local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
296 + local rustc_version=( $(eselect --brief rust show 2>/dev/null) )
297 + rustc_version=${rustc_version[0]#rust-bin-}
298 + rustc_version=${rustc_version#rust-}
299 +
300 + [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
301 +
302 + if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
303 + eerror "Rust >=${rustc_wanted} is required"
304 + eerror "please run 'eselect rust' and set correct rust version"
305 + die "selected rust version is too old"
306 + elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
307 + eerror "Rust <${rustc_toonew} is required"
308 + eerror "please run 'eselect rust' and set correct rust version"
309 + die "selected rust version is too new"
310 + else
311 + einfo "Using rust ${rustc_version} to build"
312 + fi
313 +}
314 +
315 +pre_build_checks() {
316 + local M=8192
317 + # multiply requirements by 1.3 if we are doing x86-multilib
318 + if use amd64; then
319 + M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
320 + fi
321 + M=$(( $(usex clippy 128 0) + ${M} ))
322 + M=$(( $(usex miri 128 0) + ${M} ))
323 + M=$(( $(usex rustfmt 256 0) + ${M} ))
324 + # add 2G if we compile llvm and 256M per llvm_target
325 + if ! use system-llvm; then
326 + M=$(( 2048 + ${M} ))
327 + local ltarget
328 + for ltarget in ${ALL_LLVM_TARGETS[@]}; do
329 + M=$(( $(usex ${ltarget} 256 0) + ${M} ))
330 + done
331 + fi
332 + M=$(( $(usex wasm 256 0) + ${M} ))
333 + M=$(( $(usex debug 2 1) * ${M} ))
334 + eshopts_push -s extglob
335 + if is-flagq '-g?(gdb)?([1-9])'; then
336 + M=$(( 15 * ${M} / 10 ))
337 + fi
338 + eshopts_pop
339 + M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
340 + M=$(( $(usex doc 256 0) + ${M} ))
341 + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
342 +}
343 +
344 +llvm_check_deps() {
345 + has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]"
346 +}
347 +
348 +# Is LLVM being linked against libc++?
349 +is_libcxx_linked() {
350 + local code='#include <ciso646>
351 +#if defined(_LIBCPP_VERSION)
352 + HAVE_LIBCXX
353 +#endif
354 +'
355 + local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
356 + [[ ${out} == *HAVE_LIBCXX* ]]
357 +}
358 +
359 +pkg_pretend() {
360 + pre_build_checks
361 +}
362 +
363 +pkg_setup() {
364 + pre_build_checks
365 + python-any-r1_pkg_setup
366 +
367 + export LIBGIT2_NO_PKG_CONFIG=1 #749381
368 +
369 + use system-bootstrap && bootstrap_rust_version_check
370 +
371 + if use system-llvm; then
372 + llvm_pkg_setup
373 +
374 + local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
375 + export LLVM_LINK_SHARED=1
376 + export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
377 + fi
378 +}
379 +
380 +esetup_unwind_hack() {
381 + # https://bugs.gentoo.org/870280
382 + # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
383 + # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
384 + # the whole idea is for stage0 to bootstrap with fake libgcc_s.
385 + # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
386 + local fakelib="${T}/fakelib"
387 + mkdir -p "${fakelib}" || die
388 + # we need both symlinks, one for cargo runtime, other for linker.
389 + ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
390 + ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
391 + export LD_LIBRARY_PATH="${fakelib}"
392 + export RUSTFLAGS+=" -L${fakelib}"
393 + # this is a literally magic variable that gets through cargo cache, without it some
394 + # crates ignore RUSTFLAGS.
395 + # this variable can not contain leading space.
396 + export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
397 +}
398 +
399 +src_prepare() {
400 + if ! use system-bootstrap; then
401 + has_version sys-devel/gcc || esetup_unwind_hack
402 + local rust_stage0_root="${WORKDIR}"/rust-stage0
403 + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
404 +
405 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
406 + --without=rust-docs-json-preview,rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
407 + fi
408 +
409 + # this libressl version check is terrible
410 + sed -e 's/d397af804c0b786978867528635fa9148cd2ad0e6abd591ace21b5bd3719c38d/896afea18b1072d4c715421ff2ed7e428b57aadec44d4680dcb991a6229a1edc/' \
411 + -i vendor/openssl-sys/.cargo-checksum.json || die
412 + # fix for libressl
413 + sed -e 's/7d5ca02f34cffe51db3568c500c9a8a70cef879871a0f466e3344142644acf12/e9eef35f1c18dd9844960d1d315e84ad99a05ab1247f0f54e3c2eab244988256/' \
414 + -i vendor/libssh2-sys/.cargo-checksum.json || die
415 +
416 + default
417 +}
418 +
419 +src_configure() {
420 + filter-flags '-flto*' # https://bugs.gentoo.org/862109 https://bugs.gentoo.org/866231
421 +
422 + local rust_target="" rust_targets="" arch_cflags
423 +
424 + # Collect rust target names to compile standard libs for all ABIs.
425 + for v in $(multilib_get_enabled_abi_pairs); do
426 + rust_targets+=",\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
427 + done
428 + if use wasm; then
429 + rust_targets+=",\"wasm32-unknown-unknown\""
430 + if use system-llvm; then
431 + # un-hardcode rust-lld linker for this target
432 + # https://bugs.gentoo.org/715348
433 + sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm_base.rs || die
434 + fi
435 + fi
436 + rust_targets="${rust_targets#,}"
437 +
438 + local tools='"cargo"'
439 + use clippy && tools+=',"clippy"'
440 + use miri && tools+=',"miri"'
441 + use profiler && tools+=',"rust-demangler"'
442 + use rustfmt && tools+=',"rustfmt"'
443 + use rust-analyzer && tools+=',"rust-analyzer","analysis"'
444 + use rust-src && tools+=',"src"'
445 +
446 + local rust_stage0_root
447 + if use system-bootstrap; then
448 + local printsysroot
449 + printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
450 + rust_stage0_root="${printsysroot}"
451 + else
452 + rust_stage0_root="${WORKDIR}"/rust-stage0
453 + fi
454 + # in case of prefix it will be already prefixed, as --print sysroot returns full path
455 + [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
456 +
457 + rust_target="$(rust_abi)"
458 +
459 + local cm_btype="$(usex debug DEBUG RELEASE)"
460 + cat <<- _EOF_ > "${S}"/config.toml
461 + changelog-seen = 2
462 + [llvm]
463 + download-ci-llvm = false
464 + optimize = $(toml_usex !debug)
465 + release-debuginfo = $(toml_usex debug)
466 + assertions = $(toml_usex debug)
467 + ninja = true
468 + targets = "${LLVM_TARGETS// /;}"
469 + experimental-targets = ""
470 + link-shared = $(toml_usex system-llvm)
471 + $(if is_libcxx_linked; then
472 + # https://bugs.gentoo.org/732632
473 + echo "use-libcxx = true"
474 + echo "static-libstdcpp = false"
475 + fi)
476 + $(case "${rust_target}" in
477 + i586-*-linux-*)
478 + # https://github.com/rust-lang/rust/issues/93059
479 + echo 'cflags = "-fcf-protection=none"'
480 + echo 'cxxflags = "-fcf-protection=none"'
481 + echo 'ldflags = "-fcf-protection=none"'
482 + ;;
483 + *)
484 + ;;
485 + esac)
486 + [llvm.build-config]
487 + CMAKE_VERBOSE_MAKEFILE = "ON"
488 + CMAKE_C_FLAGS_${cm_btype} = "${CFLAGS}"
489 + CMAKE_CXX_FLAGS_${cm_btype} = "${CXXFLAGS}"
490 + CMAKE_EXE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}"
491 + CMAKE_MODULE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}"
492 + CMAKE_SHARED_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}"
493 + CMAKE_STATIC_LINKER_FLAGS_${cm_btype} = "${ARFLAGS}"
494 + [build]
495 + build-stage = 2
496 + test-stage = 2
497 + build = "${rust_target}"
498 + host = ["${rust_target}"]
499 + target = [${rust_targets}]
500 + cargo = "${rust_stage0_root}/bin/cargo"
501 + rustc = "${rust_stage0_root}/bin/rustc"
502 + rustfmt = "${rust_stage0_root}/bin/rustfmt"
503 + docs = $(toml_usex doc)
504 + compiler-docs = false
505 + submodules = false
506 + python = "${EPYTHON}"
507 + locked-deps = true
508 + vendor = true
509 + extended = true
510 + tools = [${tools}]
511 + verbose = 2
512 + sanitizers = false
513 + profiler = $(toml_usex profiler)
514 + cargo-native-static = false
515 + [install]
516 + prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
517 + sysconfdir = "etc"
518 + docdir = "share/doc/rust"
519 + bindir = "bin"
520 + libdir = "lib"
521 + mandir = "share/man"
522 + [rust]
523 + # https://github.com/rust-lang/rust/issues/54872
524 + codegen-units-std = 1
525 + optimize = true
526 + debug = $(toml_usex debug)
527 + debug-assertions = $(toml_usex debug)
528 + debug-assertions-std = $(toml_usex debug)
529 + debuginfo-level = $(usex debug 2 0)
530 + debuginfo-level-rustc = $(usex debug 2 0)
531 + debuginfo-level-std = $(usex debug 2 0)
532 + debuginfo-level-tools = $(usex debug 2 0)
533 + debuginfo-level-tests = 0
534 + backtrace = true
535 + incremental = false
536 + default-linker = "$(tc-getCC)"
537 + parallel-compiler = $(toml_usex parallel-compiler)
538 + channel = "$(usex nightly nightly stable)"
539 + description = "gentoo"
540 + rpath = false
541 + verbose-tests = true
542 + optimize-tests = $(toml_usex !debug)
543 + codegen-tests = true
544 + dist-src = false
545 + remap-debuginfo = true
546 + lld = $(usex system-llvm false $(toml_usex wasm))
547 + # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it
548 + # https://github.com/rust-lang/rust/issues/74976
549 + # https://github.com/rust-lang/rust/issues/76526
550 + deny-warnings = $(usex wasm $(usex doc false true) true)
551 + backtrace-on-ice = true
552 + jemalloc = false
553 + [dist]
554 + src-tarball = false
555 + compression-formats = ["xz"]
556 + _EOF_
557 +
558 + for v in $(multilib_get_enabled_abi_pairs); do
559 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
560 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
561 +
562 + export CFLAGS_${rust_target//-/_}="${arch_cflags}"
563 +
564 + cat <<- _EOF_ >> "${S}"/config.toml
565 + [target.${rust_target}]
566 + ar = "$(tc-getAR)"
567 + cc = "$(tc-getCC)"
568 + cxx = "$(tc-getCXX)"
569 + linker = "$(tc-getCC)"
570 + ranlib = "$(tc-getRANLIB)"
571 + llvm-libunwind = "$(usex llvm-libunwind $(usex system-llvm system in-tree) no)"
572 + _EOF_
573 + if use system-llvm; then
574 + cat <<- _EOF_ >> "${S}"/config.toml
575 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
576 + _EOF_
577 + fi
578 + # by default librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
579 + # but we patch it and set to false here as well
580 + if use elibc_musl; then
581 + cat <<- _EOF_ >> "${S}"/config.toml
582 + crt-static = false
583 + _EOF_
584 + fi
585 + done
586 + if use wasm; then
587 + cat <<- _EOF_ >> "${S}"/config.toml
588 + [target.wasm32-unknown-unknown]
589 + linker = "$(usex system-llvm lld rust-lld)"
590 + # wasm target does not have profiler_builtins https://bugs.gentoo.org/848483
591 + profiler = false
592 + _EOF_
593 + fi
594 +
595 + if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below
596 + # experimental cross support
597 + # discussion: https://bugs.gentoo.org/679878
598 + # TODO: c*flags, clang, system-llvm, cargo.eclass target support
599 + # it would be much better if we could split out stdlib
600 + # complilation to separate ebuild and abuse CATEGORY to
601 + # just install to /usr/lib/rustlib/<target>
602 +
603 + # extra targets defined as a bash array
604 + # spec format: <LLVM target>:<rust-target>:<CTARGET>
605 + # best place would be /etc/portage/env/dev-lang/rust
606 + # Example:
607 + # RUST_CROSS_TARGETS=(
608 + # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
609 + # )
610 + # no extra hand holding is done, no target transformations, all
611 + # values are passed as-is with just basic checks, so it's up to user to supply correct values
612 + # valid rust targets can be obtained with
613 + # rustc --print target-list
614 + # matching cross toolchain has to be installed
615 + # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one)
616 + # only gcc toolchains installed with crossdev are checked for now.
617 +
618 + # BUG: we can't pass host flags to cross compiler, so just filter for now
619 + # BUG: this should be more fine-grained.
620 + filter-flags '-mcpu=*' '-march=*' '-mtune=*'
621 +
622 + local cross_target_spec
623 + for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
624 + # extracts first element form <LLVM target>:<rust-target>:<CTARGET>
625 + local cross_llvm_target="${cross_target_spec%%:*}"
626 + # extracts toolchain triples, <rust-target>:<CTARGET>
627 + local cross_triples="${cross_target_spec#*:}"
628 + # extracts first element after before : separator
629 + local cross_rust_target="${cross_triples%%:*}"
630 + # extracts last element after : separator
631 + local cross_toolchain="${cross_triples##*:}"
632 + use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled"
633 + command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain"
634 +
635 + cat <<- _EOF_ >> "${S}"/config.toml
636 + [target.${cross_rust_target}]
637 + ar = "${cross_toolchain}-ar"
638 + cc = "${cross_toolchain}-gcc"
639 + cxx = "${cross_toolchain}-g++"
640 + linker = "${cross_toolchain}-gcc"
641 + ranlib = "${cross_toolchain}-ranlib"
642 + _EOF_
643 + if use system-llvm; then
644 + cat <<- _EOF_ >> "${S}"/config.toml
645 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
646 + _EOF_
647 + fi
648 + if [[ "${cross_toolchain}" == *-musl* ]]; then
649 + cat <<- _EOF_ >> "${S}"/config.toml
650 + musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr"
651 + _EOF_
652 + fi
653 +
654 + # append cross target to "normal" target list
655 + # example 'target = ["powerpc64le-unknown-linux-gnu"]'
656 + # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
657 +
658 + rust_targets="${rust_targets},\"${cross_rust_target}\""
659 + sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die
660 +
661 + ewarn
662 + ewarn "Enabled ${cross_rust_target} rust target"
663 + ewarn "Using ${cross_toolchain} cross toolchain"
664 + ewarn
665 + if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
666 + ewarn "'sys-devel/binutils[multitarget]' is not installed"
667 + ewarn "'strip' will be unable to strip cross libraries"
668 + ewarn "cross targets will be installed with full debug information"
669 + ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files"
670 + ewarn
671 + ewarn "Alternatively llvm-strip can be used, it supports stripping any target"
672 + ewarn "define STRIP=\"llvm-strip\" to use it (experimental)"
673 + ewarn
674 + fi
675 + done
676 + fi # I_KNOW_WHAT_I_AM_DOING_CROSS
677 +
678 + einfo "Rust configured with the following flags:"
679 + echo
680 + echo RUSTFLAGS="\"${RUSTFLAGS}\""
681 + echo RUSTFLAGS_BOOTSTRAP="\"${RUSTFLAGS_BOOTSTRAP}\""
682 + echo RUSTFLAGS_NOT_BOOTSTRAP="\"${RUSTFLAGS_NOT_BOOTSTRAP}\""
683 + echo MAGIC_EXTRA_RUSTFLAGS="\"${MAGIC_EXTRA_RUSTFLAGS}\""
684 + env | grep "CARGO_TARGET_.*_RUSTFLAGS="
685 + env | grep "CFLAGS_.*"
686 + echo
687 + einfo "config.toml contents:"
688 + cat "${S}"/config.toml || die
689 + echo
690 +}
691 +
692 +src_compile() {
693 + RUST_BACKTRACE=1 "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
694 +}
695 +
696 +src_test() {
697 + # https://rustc-dev-guide.rust-lang.org/tests/intro.html
698 +
699 + # those are basic and codegen tests.
700 + local tests=(
701 + codegen
702 + codegen-units
703 + compile-fail
704 + incremental
705 + mir-opt
706 + pretty
707 + run-make
708 + )
709 +
710 + # fails if llvm is not built with ALL targets.
711 + # and known to fail with system llvm sometimes.
712 + use system-llvm || tests+=( assembly )
713 +
714 + # fragile/expensive/less important tests
715 + # or tests that require extra builds
716 + # TODO: instead of skipping, just make some nonfatal.
717 + if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
718 + tests+=(
719 + rustdoc
720 + rustdoc-js
721 + rustdoc-js-std
722 + rustdoc-ui
723 + run-make-fulldeps
724 + ui
725 + ui-fulldeps
726 + )
727 + fi
728 +
729 + local i failed=()
730 + einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
731 + for i in "${tests[@]}"; do
732 + local t="src/test/${i}"
733 + einfo "rust_src_test: running ${t}"
734 + if ! RUST_BACKTRACE=1 "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \
735 + -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"
736 + then
737 + failed+=( "${t}" )
738 + eerror "rust_src_test: ${t} failed"
739 + fi
740 + done
741 +
742 + if [[ ${#failed[@]} -ne 0 ]]; then
743 + eerror "rust_src_test: failure summary: ${failed[@]}"
744 + die "aborting due to test failures"
745 + fi
746 +}
747 +
748 +src_install() {
749 + DESTDIR="${D}" "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
750 +
751 + # bug #689562, #689160
752 + rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die
753 + rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die
754 + newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo
755 +
756 + local symlinks=(
757 + cargo
758 + rustc
759 + rustdoc
760 + rust-gdb
761 + rust-gdbgui
762 + rust-lldb
763 + )
764 +
765 + use clippy && symlinks+=( clippy-driver cargo-clippy )
766 + use miri && symlinks+=( miri cargo-miri )
767 + use profiler && symlinks+=( rust-demangler )
768 + use rustfmt && symlinks+=( rustfmt cargo-fmt )
769 + use rust-analyzer && symlinks+=( rust-analyzer )
770 +
771 + einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}"
772 + local i
773 + for i in "${symlinks[@]}"; do
774 + # we need realpath on /usr/bin/* symlink return version-appended binary path.
775 + # so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver>
776 + # need to fix eselect-rust to remove this hack.
777 + local ver_i="${i}-${PV}"
778 + if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then
779 + einfo "Installing ${i} symlink"
780 + ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die
781 + else
782 + ewarn "${i} symlink requested, but source file not found"
783 + ewarn "please report this"
784 + fi
785 + dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}"
786 + done
787 +
788 + # symlinks to switch components to active rust in eselect
789 + dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}"
790 + dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}"
791 + dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}"
792 + dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}"
793 + dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
794 +
795 + newenvd - "50${P}" <<-_EOF_
796 + LDPATH="${EPREFIX}/usr/lib/rust/lib"
797 + MANPATH="${EPREFIX}/usr/lib/rust/man"
798 + _EOF_
799 +
800 + rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die
801 + rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die
802 +
803 + # note: eselect-rust adds EROOT to all paths below
804 + cat <<-_EOF_ > "${T}/provider-${P}"
805 + /usr/bin/cargo
806 + /usr/bin/rustdoc
807 + /usr/bin/rust-gdb
808 + /usr/bin/rust-gdbgui
809 + /usr/bin/rust-lldb
810 + /usr/lib/rustlib
811 + /usr/lib/rust/lib
812 + /usr/lib/rust/libexec
813 + /usr/lib/rust/man
814 + /usr/share/doc/rust
815 + _EOF_
816 +
817 + if use clippy; then
818 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
819 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
820 + fi
821 + if use miri; then
822 + echo /usr/bin/miri >> "${T}/provider-${P}"
823 + echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
824 + fi
825 + if use profiler; then
826 + echo /usr/bin/rust-demangler >> "${T}/provider-${P}"
827 + fi
828 + if use rustfmt; then
829 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
830 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
831 + fi
832 + if use rust-analyzer; then
833 + echo /usr/bin/rust-analyzer >> "${T}/provider-${P}"
834 + fi
835 +
836 + insinto /etc/env.d/rust
837 + doins "${T}/provider-${P}"
838 +
839 + if use dist; then
840 + insinto "/usr/lib/${PN}/${PV}/dist"
841 + doins -r "${S}/build/dist/."
842 + fi
843 +}
844 +
845 +pkg_postinst() {
846 + eselect rust update
847 +
848 + if has_version sys-devel/gdb || has_version dev-util/lldb; then
849 + elog "Rust installs a helper script for calling GDB and LLDB,"
850 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
851 + fi
852 +
853 + if has_version app-editors/emacs; then
854 + elog "install app-emacs/rust-mode to get emacs support for rust."
855 + fi
856 +
857 + if has_version app-editors/gvim || has_version app-editors/vim; then
858 + elog "install app-vim/rust-vim to get vim support for rust."
859 + fi
860 +}
861 +
862 +pkg_postrm() {
863 + eselect rust cleanup
864 +}