Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/
Date: Fri, 01 Jul 2022 19:32:51
Message-Id: 1656703744.30eee63620d1f005c0d9cdb7d2d8f2cd573a80fe.gyakovlev@gentoo
1 commit: 30eee63620d1f005c0d9cdb7d2d8f2cd573a80fe
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 1 17:42:58 2022 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 1 19:29:04 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30eee636
7
8 dev-lang/rust: add 1.62.0
9
10 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
11
12 dev-lang/rust/Manifest | 34 ++
13 dev-lang/rust/rust-1.62.0.ebuild | 728 +++++++++++++++++++++++++++++++++++++++
14 2 files changed, 762 insertions(+)
15
16 diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest
17 index 1c59907ce35c..e0866bb19c3b 100644
18 --- a/dev-lang/rust/Manifest
19 +++ b/dev-lang/rust/Manifest
20 @@ -94,9 +94,43 @@ DIST rust-1.60.0-x86_64-unknown-linux-gnu.tar.xz 154271340 BLAKE2B 7ee48c165e6ec
21 DIST rust-1.60.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 7454407a16e2b6c89226252c7e706086c9bb8016183df1180c54e88ec0d6622a0829d4acda959a093702bb1d95d4f2678976ced69fcc219afb42ab631e459d40 SHA512 eb3550e27e361860075a22d9b4821c6d078d7e4c82ad688a64e813adbce9922b9ab2dc64d1fd4d74d20be9af122ff05819d521677a43ad1c1092bd498d325a8a
22 DIST rust-1.60.0-x86_64-unknown-linux-musl.tar.xz 258420992 BLAKE2B 6b446c06fd8d511910110eccfd55c1116f3468ffe87274d6b90c7a2a1ccd298471f62d1bfb807ddab2f66fbac58995e903414455c76fe2b14c9659f00e8413a0 SHA512 6f5a53968f44bf7be563d32eaddea439d8f388858db3d3b58a89b22cc2252e195b56b0e8895f4254c40274035e221657504958c8f1e331befca012d480118f3b
23 DIST rust-1.60.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 680e7267a188a5286938d9c3284968121a7783cba196bf863affd6b927344e1a88cf7b97016d53c74560179439fc7fe9dd700a295c7c00b139472320323861cb SHA512 071efcfad0074a03de454835c512e98b466662b27bef2fb31def0bb82531b4048eba59a529621fda515800e19c4f3c62a33a364ecca8cecbaa09fae842b894b6
24 +DIST rust-1.61.0-aarch64-unknown-linux-gnu.tar.xz 226403096 BLAKE2B b9927e6d364fe791bef49cea5f0904629a2f01e6a71325c1769c67b845725ae6f54a1a8c0530fa5048591dd0ecfd50a40224243f935b38ad269e35ce2e1c59d9 SHA512 1c00830f67b75eaf23ab759e8218fca48e424cad0ede02e737e341d105f6f8b8113e4d4181cde1b43f9369af9c2f238fbdcac27ccad3dd02db878e2f4e6ba35b
25 +DIST rust-1.61.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 697df0294d01a19eca2f9b7597df3826e79ea790766c5c5a7b73f5a04919cf64f1489f34c9d2c397523432243e7f3f29f42440ba9aee127753868529196810cf SHA512 78cbc7eeb552965a1b6c4cfc9c8404017fe195acefbda1aa203d1c2ba969b3ac28388930bb4f3ca5dda7ecac5e61163ae0a5d06967eab9f0a7cada87c6b2dc58
26 +DIST rust-1.61.0-aarch64-unknown-linux-musl.tar.xz 220966060 BLAKE2B e03c6418fed773d1028363979726648d1ffa0e04d6879688efefc15f95fbeff3ff9c0dc7c16a53fedb18c4e0b16e060cee9f3566b0f96027e5dc68820fda149f SHA512 e806f78ecc9edd12bb991533c6bfc95da30c8eaacbfc54f0f4dbf3a95a011da82fca13cf3ef23594a9d1d9d8c79c8186fe98b60658a2cd5c0ed2c6e3984468d0
27 +DIST rust-1.61.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 426c4c8dac07269d184f61bf2447957cdbdacafdf27fac5ab5a0eea958e15fb3eeed0753dadb1d1bb157322ca5e8c6b7c10d946c4bd3a089ccd8275d0a310014 SHA512 b231afc0c3604aba64277c4f018f1f4b30417bd2fd113919b8b584d5482523b961071a50394a4906d8ba8536685fcff4710b51fee7832a7a041dcb902f1c5ff1
28 +DIST rust-1.61.0-arm-unknown-linux-gnueabi.tar.xz 200226676 BLAKE2B c55c36524249eaf9ab1e040b6742e1ada46b32bf0511338d23536663050b46103b1765aeb2a145be9cdc0b602d83526fe902fc431e0793d1a307ab0d4b61a356 SHA512 3a9f52b9f4f2a972477a48b629b8345f151d32d491be0cbf3692b76f05ddbd3319de1da7b10959d37fffc08e12b3196a6f4462cc2476ad80d2f9750e0b189cad
29 +DIST rust-1.61.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 34f251ee19ace45c411f161b383dcda35b8dea62e135cdeceddd73ca029920b0f0ea0484fb79c9680d9b4403c5c01d76d4fd2fb47fd65a2fbcb0375e56a1586b SHA512 641ce73107609d55f98ae00a03a9efd58985539e46a834ceffe5af79822309a40a4eac59e5cec3b1654da733f463f3bca438f42ecbaf5fce5d276466317a7e54
30 +DIST rust-1.61.0-arm-unknown-linux-gnueabihf.tar.xz 200078864 BLAKE2B 02403c024bf02b9ec42fd0baf52856fbcce2a10477d19e68e4ad06110aaabb90496543fc3de5f385428396979fbb80cdb27f28b4cef8af9266c18fa87a995c30 SHA512 155b2f0c341280bfb7db066b639dc50580a07b21ad6f9f6255a8645d5d944d58fbaff505f1de0c3f51ed92ca0d4dc75d9b92e2aab7e8b64f8c42d3af0a714fe6
31 +DIST rust-1.61.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 6b4875ac242f11f47518f17a0a039539e56cf3cef78f1e3cb4bc2174e60d6d0f0d444b4c0cfa007643202b5ce92a4cb979e92b5f6f559eb90fd78fdd5f870e57 SHA512 f2618ba9f076c10d0ddd23129e6e8e7050fd1126d7767c8b74c53be209ca87f9bebbc09069f6aed55e14de64b1478fd93b370be7e60858b5226fcfc1e8ed87c0
32 +DIST rust-1.61.0-armv7-unknown-linux-gnueabihf.tar.xz 206757912 BLAKE2B c702e17e225becc681713a3e819cc38c727377d280a1963efd4e6b1d27e0dbbb71ad0bec4d7add8319417846cf54bb7b5901af0f633b180ca9a5f169c709e43a SHA512 88dbb7a35a8424e5b197566515c21122c1da71df146abb304d7dbb50380b4771a741910abefc9d79831146b28b657ffe53cae07f0392e83a7279a7795aadf0e6
33 +DIST rust-1.61.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B f4b93feba557d81638ead6c3ad72f2e5c321c1103b473096e312d8a3191e98aac65aff0ebcb6f2c23701de17f2602ba18a6462c24a678c2bc2a13e1003189271 SHA512 72d8152d206c1ca9d69ed4704b8638c32b5f136ad985fd4790961935f1b44f08df0960e03066de2dd1cc9f7a140e8070f0a6e671f59c751506847d9e247c5ecd
34 +DIST rust-1.61.0-i686-unknown-linux-gnu.tar.xz 218220208 BLAKE2B da47b131676258747e27704e2a1abb844567e2ac9ccffdd1c87edaa677e04b1fe73227f7b6afa437d8fe2f2690352623343b8318906038206b5b684fa8eafcc7 SHA512 f19e1a5253c57d250d4de7f0f54b70a296d92bba2e22d8b842bcbb311e393e3bf24c28621f490584497c586c6fdbc41f5af55d86a074b93efaa62d313121cc4a
35 +DIST rust-1.61.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 3b154ab9d414ec6d7dea13c6b2d2def9613544b3d8f6464385fa390bb6228d73826032ed6e536a9a2dd379499ec500788b149c838d5ad1a50f545a47b19a2cbd SHA512 f06ab7e865bf56c153586e146438079ff3ee3de86c610e463cd0ce67c090349b9dd4fa587d9eab0dea4b908770bca0dab955f797ebcc5aee2617a981ff23eb23
36 +DIST rust-1.61.0-mips-unknown-linux-gnu.tar.xz 157918296 BLAKE2B 0551ab0898491129828be9cd7d6fd22a56c329f85ae9767c8ca216cac16ae3f93d30913c50c8cea8daa2f98878147e2f15f587e38e9e0fca7c8c4b6d3ead6870 SHA512 02cf5d1ed8c28bd52b7c27ba696de30ee23322ddd1e2ef953cd95a6d0b31c63ea66071bfb22c4d11a780243e62e21407d7ada2592b08caac67d7d79e7d9ee0f2
37 +DIST rust-1.61.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 2d050374431b8d48b6a0a3e171d4d2f62cfd8a2df70ddbf0d374bb9351e684d15d3ade7f6717e6abba1de47c4899f0f7575a4ca537d1a39a57e03ea4b0ae281e SHA512 6e2d01d3b8218cae46008328226286abe3f4323891ab41129f9af94b4526d5b21700fa84c880b4efe38d39c57b2a0946eb82e3ac58950761b20f4def1d8b82f2
38 +DIST rust-1.61.0-mips64-unknown-linux-gnuabi64.tar.xz 162321252 BLAKE2B d49ec8d3a5eec2085a26b4da22a31e5631e3665333a030e4683446cfe3f71e86e466b827942d6a62d32f469ff7fe9208aa51ba9d47822a54d40d89bef45636e5 SHA512 1e6003127963b836c343ae06586b152b1f227529d05b555aefa0bd7d4b92124215cfa1038aba1236c0c42ecd8e429253db4faa13ed388c16a8659e71b0008fe7
39 +DIST rust-1.61.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B b031019589b12cdf45f0a938c7479ad219c257643b88108d0c524088530df783338d64c1b356055e34a38df8908653c25fc286949826bb7e3539d63c78c36a66 SHA512 ee9178251f5a79803871fa76a22395e4b43958582930f92cf1f5e76970c1583f9b0403da7c05bd8a7cdd83839b319a6640adcaaa5475e9ab5bffb43146116b09
40 +DIST rust-1.61.0-mipsel-unknown-linux-gnu.tar.xz 162148648 BLAKE2B 492e0c811c9fae9d0052fcdfffe6d96d43674e1775edaf31d63024e56763d44c02763fd70e768ac0987d260665b86d78aa55a0652f5acbf097a3e9a472aa4d9f SHA512 637b081d8357d46030ca206c8feb54a38d9696a0bdbbad9a892ee4a472f29976c82b814f14cc987ad9e473e70d22347e7e01e81f0f59e82dbaad62153c1ec32f
41 +DIST rust-1.61.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 9323f7488fdf603e81018c4b6afa11da952eb6051e9480fee027326ebccd15befed97c75c981f621d7eda3daf2d082c5fb12af426e48cb4c0c733ab55c46af6e SHA512 9d1e6062c4a7714aa754ea586f9bbe3a988e5e6d1e6309316bde89fa83ccddb837e96a8de13fbd4b932c8fc37be89de06802f12f689e17b1ae6cd97b5e2db561
42 +DIST rust-1.61.0-powerpc-unknown-linux-gnu.tar.xz 180802408 BLAKE2B 41ecab76e35d9ee2b9658730f46ece4191e706714b3b90b6021b4bd9ed2c4f0d563e0c0b39bdc7e633237d55c5375379565d7932e7ffb4896851831f64f61559 SHA512 ed19698f32c1af73ba8c402395b6ee30381d1fff6026d2c94e45ad89ef197cffc1529dc21402e2b463deb47aba0ed4d63d69c62908cdc099da463835757f3fe3
43 +DIST rust-1.61.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 438143b3474d0cb9e1a19b93de28544f02672e245bba7855da286fb15c58db93021e44d432fbe4a0949592b57cb23b373abd5c0a3f960f6975a0cf433352462e SHA512 7a570c64a79adf78c8c28342d9ab39e8ed953cd44b8038e03beb888b5611625bae95e88220c9c88236ff1672f20ad61976d116da7689cf29f53112deb9b75858
44 +DIST rust-1.61.0-powerpc64-unknown-linux-gnu.tar.xz 187335836 BLAKE2B 6feca68e47f7e19355ba623cda1d1cd15351017d388d94e2b9d6821493b8a77a09c95148a8fcf7124e3b0c9a9ee205c9f5c14af04172e2d02ea239355755b364 SHA512 b8afcb47653877dd47a808b4aecd95bca715a96311652e0616125e75bc5a457364b0caba2918e2e3e8df2d1fe0afb6fb384bbfa44fde25ebe0dd368414984acb
45 +DIST rust-1.61.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 20bc76dea5484d2a6bf60ffdacc1dacb8d3f7abdb428fee3b1d3e6e19d499f18afbe667a5de96a28005661bd0b4f5e4c8429df917a31b86d72b9aaa9ec56c7e0 SHA512 cf10c0f1ca50894deba5f02a4e3491fe61ea8def4b0f76fe790eb52ff66295d2570ae50acea66a51e710822d6109a2ab3c8f1e703388ae0ee19fcfc5657d4f38
46 +DIST rust-1.61.0-powerpc64le-unknown-linux-gnu.tar.xz 196945316 BLAKE2B 23ac372f7bbeac3eb757adcb6ca93187ad01492992327533452ab348ec899cb97f5ac9335b32039a62ccf4c34125de3c4b6c1d7829839c95f638b6531be59c57 SHA512 6cf969cef60d2b70db17902ceb71d2616de0df1ff4fda15578347372bf5a349fc8f4377eb1d003abb84a93a122ab0e54aac52c95568813148d3c0113d663a07f
47 +DIST rust-1.61.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 6b4bdcba7c5b681512b98b39f8035788f612ee1c8f44d98d58f8a29bc71e470d57ae587a6ea2e02a22263d40bb452054d03483a3922db6c131d3947e65da23bb SHA512 cd102d958ad3ca62f534033473664e867892dce0ca8a2f96271ecfabe34e0afbd63d8281086c5cd692fdb961894313e7430ce2e1d14c3a686b40d8a514c124e3
48 +DIST rust-1.61.0-riscv64gc-unknown-linux-gnu.tar.xz 190408604 BLAKE2B 1f37d88201f0e3517194d810f99ce3167fa132c72f8580704750b926b838956157b1ccd303ccf5de15615733383d1009cc135ede7dd8dc7c1e39b4246a8ed604 SHA512 8f6f469484ff9c10af2b1a822a8193f313ac244783921c68dc1feee4d6897e7083cfb90d19384a266d41b97aeb845ef073ed955fb7beaf7e1810d682185c2d42
49 +DIST rust-1.61.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c413b2f55e3d45dbfccf193f5cb9f6866abf895d23c850e3744a0bd897c2c812f57457211efaab7416c0d8fc079cc4feaa35de879ad76356a961e704e711be46 SHA512 0155b4e0ba86cc190b85f2f82e8ee75c14825e52e05ab3446283512f0b42f113d85ef89d72e0929382637dc0a44ef72f06552957285463c2edd7f83d9c8234ff
50 +DIST rust-1.61.0-s390x-unknown-linux-gnu.tar.xz 214196912 BLAKE2B 31eeaabdbca2fa837610179eafd0cb6cde2ce8d4feb57e86cd1fc8962e1f8b84bf067d7782414380616d5b56fef5db19c91c54c89f5dd935debf6ed2d3841466 SHA512 7de0ea08c4834e60d12098d92d4366689c0b959f58667bc68e35ad3c976011e8d9375566cebd9260933e13bd74105d297dabf40a0d09b34f83905d4cb9995f7f
51 +DIST rust-1.61.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 617bfd93b883cc36c8504ac326813511bee205a508489be168060863d967efe9a2e8276c3834d872f419317047ba83624c996be9d6f913be58f9feab66f292b2 SHA512 933689de3c1fabc31dd1910844479b3505e1a8b8474fdaeb4936df118a6da4f9597c45f0a0056d5c1efc33ae8ffb2910f5aa07b91afbd231ad7c20f0c79ceeb4
52 +DIST rust-1.61.0-x86_64-unknown-linux-gnu.tar.xz 157592468 BLAKE2B 0877c0794280a5ab7e74553c02cebad67e36148a3f34a709973310d89d7ea65dc8ecfa8b9c461e4f96939ed2ff09b7bacbef0b4fcf409758a0429bc431f87ebe SHA512 365191453f37775cf8bed66e12224294d4d99f3bacc635c3c13f05bf8585838a04b602c2fef7964f26a6cc35ab432a5c0a9745e9ffad0a83b0c761ec02de3484
53 +DIST rust-1.61.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 5296a8df210a4cf2fd7dffcba1ae6bd8cda9e408ff4c55d997199c2890b9faab9e8d6d22a3c0961786bb80231836047929621edf9043d474b352fe28bd9192e8 SHA512 cb97e84cd793aa8676c41297d8da14125855c008815e65d8191868eb88241ccb408c6f9ae85b7ba8de1a02ea8923f5e042f4fea662fa593e5ec03505b41ee52d
54 +DIST rust-1.61.0-x86_64-unknown-linux-musl.tar.xz 259724324 BLAKE2B d005bd2794d196136c42842fbb7bc64d827898b5713f768cf0e88be5a40e3906139027ee58571cfccd8d2c864f672d1986da28c72f0d1c4a7f78d18efe14385e SHA512 96d09ac3a48bb2956dd6bf219e605c68327a94d09e72290ee74781c4886dce93b217163fb08dac0ce69bfaa2e3ab8cccd4a26d10b9df4c3162822a38e355bdb6
55 +DIST rust-1.61.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B e1c8061c80cd5445f7df9c44044ccb47731704b93d4e86cf95bd3b1b08a3c3cdb61e21349088cd0127632c63a0f7c22f0fa209809450dd81607bf7353d61a7b4 SHA512 587f487a3c8159a4b102f15a484a0ffa4f32c2abd2fb4ca078c27d36f6ff365c95015a99494e852631e9f92bfc9f33a0266c5f62b7edfce823c34993ff6a836b
56 DIST rustc-1.59.0-src.tar.xz 128942756 BLAKE2B b28114f14c9a0fec7db56fde79a985360fd8438c3b14eede49ed12e540c2636be960d0fd800c569af193886ac76fe8bf604d5dae59214ae08cb0cc6cc0ca404e SHA512 acace866871d13a55d365f65d7e15c192c3cd33096862571df6317e066b7474d668b95ae281e0244967778c05f1e33966c3c55616218bd25d3770a2b2d4f0365
57 DIST rustc-1.59.0-src.tar.xz.asc 801 BLAKE2B 061701c4fdbde930798f9f938ca3642204ae4a2ad9396937ca7d604268813d6d68f4979f20d35abdbbfeec0bb389acd86c9d3d84256db85861f6b11e3dbef80e SHA512 1b90bc01f9d68ba1f70591c4ae707295d7727b790d170a0b757d654684e59d3c26c45b66a21f9ac762debb6867494660c73daaf10be9bd567a38be44c0009f72
58 DIST rustc-1.60.0-src.tar.xz 136183048 BLAKE2B 8030f32c21f81af6abc7a282aab1189cb7d680c6bce58c119a1beaad71a3eeb36a696eef46a22d366e2c41a2f9182a9a5aa527426f2c8db05278184c37297dd0 SHA512 d0c113e8c2c67bf10773c9403dc4c4700c4deb2fb287bfec51e565d3473d2b481d8ae2c90b272cd67b3a87d7443ea25a34c7b40ba8cd7106bf5d71126ab141c3
59 DIST rustc-1.60.0-src.tar.xz.asc 801 BLAKE2B 02a2c140e091ea6913a760daa93aa57ba6a7631d0b99867669ce68641d562d436f13ed1f1578713184f06c9307d46e19dfd7c8d74a516b04293bc65c02b90707 SHA512 8136d19d4f3f4c45249b59b689f01d4edf108535ffe1f813771bd244cde1c66184a0bde5a0acfed4fb01015812458204244bbb54e6f5fa86e9b1ef5e92e805e3
60 DIST rustc-1.61.0-src.tar.xz 136696780 BLAKE2B 604299aa5c8dd7dff9802236898ca5d4fda8c54028d0aa557a6fe34c15941eb6e8c1dc5d2e172cd3680152ed1ff3fa9e58eb9b6a3b6f8f4ccccd949d810d31a7 SHA512 9bbdcc1c37f7b889be0c8d195963b4c3b65267a63ea309315eda12bd3b2cd36e0060301805dfc7da440c0a8702d085ccb0bf763155b27035a078769333637fb3
61 DIST rustc-1.61.0-src.tar.xz.asc 801 BLAKE2B 46384fd77c72ecf5cd7c783655f9345e4d52718c737470548a9f3498af9cbb93c3bf618464507cd10185c39a5207fd6669c6c82841c8c82fa325001cbe659cb0 SHA512 5ea807254f0d7c207f10f1fb224101d9ae3a3c81aff16d2ba2ea4af1fe92345d1a25336b5cff0964aba9ed249e38ab9d3df41eb1217e048988093cdb46da8962
62 +DIST rustc-1.62.0-src.tar.xz 135644992 BLAKE2B f9133310dc951361588bdc0b631c7fc9e2187dbb6a71b4631786d68c0f9d221d12cc78f509df0a08a23beb6e647f18712db176ac62623c5b621e22281adf62c2 SHA512 02872a8409b0490fa9fa7a70756cbf103643694df6b2e2aea32ad8b70032a3162c7751cd92d78291587ee0120daeb9bc1ae5ec6136c7eb6eb584d8be3032dd3d
63 +DIST rustc-1.62.0-src.tar.xz.asc 801 BLAKE2B 1d9a6fcafdfc2f46b098403e36e401cc6b3834d4f7fffaa82f20a332f8843a0af10c814c3f585c6e062fd5e9fab3d231ab03cc0caa449acd1c8a9eea077c1932 SHA512 646a895d19847ab0cc1d2f85ce1643625a1785acda31d37ed9776257f8e4625b65e16e4b9f3210e816d4516633d963a0d7b520e35582366ee75059dcb2f1313f
64
65 diff --git a/dev-lang/rust/rust-1.62.0.ebuild b/dev-lang/rust/rust-1.62.0.ebuild
66 new file mode 100644
67 index 000000000000..8c14010bd458
68 --- /dev/null
69 +++ b/dev-lang/rust/rust-1.62.0.ebuild
70 @@ -0,0 +1,728 @@
71 +# Copyright 1999-2022 Gentoo Authors
72 +# Distributed under the terms of the GNU General Public License v2
73 +
74 +EAPI=8
75 +
76 +PYTHON_COMPAT=( python3_{8..11} )
77 +
78 +inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing \
79 + multilib multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig
80 +
81 +if [[ ${PV} = *beta* ]]; then
82 + betaver=${PV//*beta}
83 + BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}"
84 + MY_P="rustc-beta"
85 + SLOT="beta/${PV}"
86 + SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz"
87 +else
88 + ABI_VER="$(ver_cut 1-2)"
89 + SLOT="stable/${ABI_VER}"
90 + MY_P="rustc-${PV}"
91 + SRC="${MY_P}-src.tar.xz"
92 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~sparc ~x86"
93 +fi
94 +
95 +RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0"
96 +
97 +DESCRIPTION="Systems programming language from Mozilla"
98 +HOMEPAGE="https://www.rust-lang.org/"
99 +
100 +SRC_URI="
101 + https://static.rust-lang.org/dist/${SRC}
102 + verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc )
103 + !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) )
104 +"
105 +
106 +# keep in sync with llvm ebuild of the same version as bundled one.
107 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
108 + NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore )
109 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
110 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
111 +
112 +LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
113 +
114 +IUSE="clippy cpu_flags_x86_sse2 debug dist doc miri nightly parallel-compiler profiler rls rustfmt rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
115 +
116 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
117 +# we need to *really* make sure we're not pulling more than one slot
118 +# simultaneously.
119 +
120 +# How to use it:
121 +# List all the working slots in LLVM_VALID_SLOTS, newest first.
122 +LLVM_VALID_SLOTS=( 14 )
123 +LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}"
124 +
125 +# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation
126 +# (-) usedep needed because we may build with older llvm without that target
127 +LLVM_DEPEND="|| ( "
128 +for _s in ${LLVM_VALID_SLOTS[@]}; do
129 + LLVM_DEPEND+=" ( "
130 + for _x in ${ALL_LLVM_TARGETS[@]}; do
131 + LLVM_DEPEND+="
132 + ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] )"
133 + done
134 + LLVM_DEPEND+=" )"
135 +done
136 +unset _s _x
137 +LLVM_DEPEND+=" )
138 + <sys-devel/llvm-$(( LLVM_MAX_SLOT + 1 )):=
139 + wasm? ( sys-devel/lld )
140 +"
141 +
142 +# to bootstrap we need at least exactly previous version, or same.
143 +# most of the time previous versions fail to bootstrap with newer
144 +# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok,
145 +# but it fails to bootstrap with 1.48.x
146 +# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.txt
147 +RUST_DEP_PREV="$(ver_cut 1).$(($(ver_cut 2) - 1))*"
148 +RUST_DEP_CURR="$(ver_cut 1).$(ver_cut 2)*"
149 +BOOTSTRAP_DEPEND="||
150 + (
151 + =dev-lang/rust-"${RUST_DEP_PREV}"
152 + =dev-lang/rust-bin-"${RUST_DEP_PREV}"
153 + =dev-lang/rust-"${RUST_DEP_CURR}"
154 + =dev-lang/rust-bin-"${RUST_DEP_CURR}"
155 + )
156 +"
157 +
158 +BDEPEND="${PYTHON_DEPS}
159 + app-eselect/eselect-rust
160 + || (
161 + >=sys-devel/gcc-4.7
162 + >=sys-devel/clang-3.5
163 + )
164 + system-bootstrap? ( ${BOOTSTRAP_DEPEND} )
165 + !system-llvm? (
166 + >=dev-util/cmake-3.13.4
167 + dev-util/ninja
168 + )
169 + test? ( sys-devel/gdb )
170 + verify-sig? ( sec-keys/openpgp-keys-rust )
171 +"
172 +
173 +DEPEND="
174 + >=app-arch/xz-utils-5.2
175 + net-misc/curl:=[http2,ssl]
176 + sys-libs/zlib:=
177 + dev-libs/openssl:0=
178 + elibc_musl? ( sys-libs/libunwind:= )
179 + system-llvm? ( ${LLVM_DEPEND} )
180 +"
181 +
182 +RDEPEND="${DEPEND}
183 + app-eselect/eselect-rust
184 + sys-apps/lsb-release
185 +"
186 +
187 +REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
188 + miri? ( nightly )
189 + parallel-compiler? ( nightly )
190 + rls? ( rust-src )
191 + test? ( ${ALL_LLVM_TARGETS[*]} )
192 + wasm? ( llvm_targets_WebAssembly )
193 + x86? ( cpu_flags_x86_sse2 )
194 +"
195 +
196 +# we don't use cmake.eclass, but can get a warning
197 +CMAKE_WARN_UNUSED_CLI=no
198 +
199 +QA_FLAGS_IGNORED="
200 + usr/lib/${PN}/${PV}/bin/.*
201 + usr/lib/${PN}/${PV}/libexec/.*
202 + usr/lib/${PN}/${PV}/lib/lib.*.so
203 + usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/.*
204 + usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
205 +"
206 +
207 +QA_SONAME="
208 + usr/lib/${PN}/${PV}/lib/lib.*.so.*
209 + usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so
210 +"
211 +
212 +QA_PRESTRIPPED="
213 + usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/rust-llvm-dwp
214 +"
215 +
216 +# An rmeta file is custom binary format that contains the metadata for the crate.
217 +# rmeta files do not support linking, since they do not contain compiled object files.
218 +# so we can safely silence the warning for this QA check.
219 +QA_EXECSTACK="usr/lib/${PN}/${PV}/lib/rustlib/*/lib*.rlib:lib.rmeta"
220 +
221 +# causes double bootstrap
222 +RESTRICT="test"
223 +
224 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/rust.asc
225 +
226 +PATCHES=(
227 + "${FILESDIR}"/1.55.0-ignore-broken-and-non-applicable-tests.patch
228 + "${FILESDIR}"/1.61.0-gentoo-musl-target-specs.patch
229 +)
230 +
231 +S="${WORKDIR}/${MY_P}-src"
232 +
233 +toml_usex() {
234 + usex "${1}" true false
235 +}
236 +
237 +bootstrap_rust_version_check() {
238 + # never call from pkg_pretend. eselect-rust may be not installed yet.
239 + [[ ${MERGE_TYPE} == binary ]] && return
240 + local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))"
241 + local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))"
242 + local rustc_version=( $(eselect --brief rust show 2>/dev/null) )
243 + rustc_version=${rustc_version[0]#rust-bin-}
244 + rustc_version=${rustc_version#rust-}
245 +
246 + [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output"
247 +
248 + if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then
249 + eerror "Rust >=${rustc_wanted} is required"
250 + eerror "please run 'eselect rust' and set correct rust version"
251 + die "selected rust version is too old"
252 + elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then
253 + eerror "Rust <${rustc_toonew} is required"
254 + eerror "please run 'eselect rust' and set correct rust version"
255 + die "selected rust version is too new"
256 + else
257 + einfo "Using rust ${rustc_version} to build"
258 + fi
259 +}
260 +
261 +pre_build_checks() {
262 + local M=8192
263 + # multiply requirements by 1.3 if we are doing x86-multilib
264 + if use amd64; then
265 + M=$(( $(usex abi_x86_32 13 10) * ${M} / 10 ))
266 + fi
267 + M=$(( $(usex clippy 128 0) + ${M} ))
268 + M=$(( $(usex miri 128 0) + ${M} ))
269 + M=$(( $(usex rls 512 0) + ${M} ))
270 + M=$(( $(usex rustfmt 256 0) + ${M} ))
271 + # add 2G if we compile llvm and 256M per llvm_target
272 + if ! use system-llvm; then
273 + M=$(( 2048 + ${M} ))
274 + local ltarget
275 + for ltarget in ${ALL_LLVM_TARGETS[@]}; do
276 + M=$(( $(usex ${ltarget} 256 0) + ${M} ))
277 + done
278 + fi
279 + M=$(( $(usex wasm 256 0) + ${M} ))
280 + M=$(( $(usex debug 2 1) * ${M} ))
281 + eshopts_push -s extglob
282 + if is-flagq '-g?(gdb)?([1-9])'; then
283 + M=$(( 15 * ${M} / 10 ))
284 + fi
285 + eshopts_pop
286 + M=$(( $(usex system-bootstrap 0 1024) + ${M} ))
287 + M=$(( $(usex doc 256 0) + ${M} ))
288 + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
289 +}
290 +
291 +llvm_check_deps() {
292 + has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]"
293 +}
294 +
295 +pkg_pretend() {
296 + pre_build_checks
297 +}
298 +
299 +pkg_setup() {
300 + pre_build_checks
301 + python-any-r1_pkg_setup
302 +
303 + export LIBGIT2_NO_PKG_CONFIG=1 #749381
304 +
305 + use system-bootstrap && bootstrap_rust_version_check
306 +
307 + if use system-llvm; then
308 + llvm_pkg_setup
309 +
310 + local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
311 + export LLVM_LINK_SHARED=1
312 + export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)"
313 + fi
314 +}
315 +
316 +src_prepare() {
317 + if ! use system-bootstrap; then
318 + local rust_stage0_root="${WORKDIR}"/rust-stage0
319 + local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
320 +
321 + "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \
322 + --without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die
323 + fi
324 +
325 + default
326 +}
327 +
328 +src_configure() {
329 + local rust_target="" rust_targets="" arch_cflags use_libcxx="false"
330 +
331 + # Collect rust target names to compile standard libs for all ABIs.
332 + for v in $(multilib_get_enabled_abi_pairs); do
333 + rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
334 + done
335 + if use wasm; then
336 + rust_targets="${rust_targets},\"wasm32-unknown-unknown\""
337 + if use system-llvm; then
338 + # un-hardcode rust-lld linker for this target
339 + # https://bugs.gentoo.org/715348
340 + sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm_base.rs || die
341 + fi
342 + fi
343 + rust_targets="${rust_targets#,}"
344 +
345 + local tools="\"cargo\","
346 + if use clippy; then
347 + tools="\"clippy\",$tools"
348 + fi
349 + if use miri; then
350 + tools="\"miri\",$tools"
351 + fi
352 + if use profiler; then
353 + tools="\"rust-demangler\",$tools"
354 + fi
355 + if use rls; then
356 + tools="\"rls\",\"analysis\",$tools"
357 + fi
358 + if use rustfmt; then
359 + tools="\"rustfmt\",$tools"
360 + fi
361 + if use rust-src; then
362 + tools="\"src\",$tools"
363 + fi
364 +
365 + local rust_stage0_root
366 + if use system-bootstrap; then
367 + local printsysroot
368 + printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")"
369 + rust_stage0_root="${printsysroot}"
370 + else
371 + rust_stage0_root="${WORKDIR}"/rust-stage0
372 + fi
373 + # in case of prefix it will be already prefixed, as --print sysroot returns full path
374 + [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory"
375 +
376 + rust_target="$(rust_abi)"
377 +
378 + # https://bugs.gentoo.org/732632
379 + if tc-is-clang; then
380 + local clang_slot="$(clang-major-version)"
381 + if { has_version "sys-devel/clang:${clang_slot}[default-libcxx]" || is-flagq -stdlib=libc++; }; then
382 + use_libcxx="true"
383 + fi
384 + fi
385 +
386 + local cm_btype="$(usex debug DEBUG RELEASE)"
387 + cat <<- _EOF_ > "${S}"/config.toml
388 + changelog-seen = 2
389 + [llvm]
390 + download-ci-llvm = false
391 + optimize = $(toml_usex !debug)
392 + release-debuginfo = $(toml_usex debug)
393 + assertions = $(toml_usex debug)
394 + ninja = true
395 + targets = "${LLVM_TARGETS// /;}"
396 + experimental-targets = ""
397 + link-shared = $(toml_usex system-llvm)
398 + $(if [[ ${use_libcxx} == true ]]; then
399 + echo "use-libcxx = true"
400 + echo "static-libstdcpp = false"
401 + fi)
402 + $(case "${rust_target}" in
403 + i586-*-linux-*)
404 + # https://github.com/rust-lang/rust/issues/93059
405 + echo 'cflags = "-fcf-protection=none"'
406 + echo 'cxxflags = "-fcf-protection=none"'
407 + echo 'ldflags = "-fcf-protection=none"'
408 + ;;
409 + *)
410 + ;;
411 + esac)
412 + build-config = { CMAKE_C_FLAGS_${cm_btype} = "${CFLAGS}", CMAKE_CXX_FLAGS_${cm_btype} = "${CXXFLAGS}", CMAKE_EXE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}", CMAKE_MODULE_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}", CMAKE_SHARED_LINKER_FLAGS_${cm_btype} = "${LDFLAGS}", CMAKE_STATIC_LINKER_FLAGS_${cm_btype} = "${ARFLAGS}" }
413 + [build]
414 + build-stage = 2
415 + test-stage = 2
416 + doc-stage = 2
417 + build = "${rust_target}"
418 + host = ["${rust_target}"]
419 + target = [${rust_targets}]
420 + cargo = "${rust_stage0_root}/bin/cargo"
421 + rustc = "${rust_stage0_root}/bin/rustc"
422 + rustfmt = "${rust_stage0_root}/bin/rustfmt"
423 + docs = $(toml_usex doc)
424 + compiler-docs = false
425 + submodules = false
426 + python = "${EPYTHON}"
427 + locked-deps = true
428 + vendor = true
429 + extended = true
430 + tools = [${tools}]
431 + verbose = 2
432 + sanitizers = false
433 + profiler = $(toml_usex profiler)
434 + cargo-native-static = false
435 + [install]
436 + prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
437 + sysconfdir = "etc"
438 + docdir = "share/doc/rust"
439 + bindir = "bin"
440 + libdir = "lib"
441 + mandir = "share/man"
442 + [rust]
443 + # https://github.com/rust-lang/rust/issues/54872
444 + codegen-units-std = 1
445 + optimize = true
446 + debug = $(toml_usex debug)
447 + debug-assertions = $(toml_usex debug)
448 + debug-assertions-std = $(toml_usex debug)
449 + debuginfo-level = $(usex debug 2 0)
450 + debuginfo-level-rustc = $(usex debug 2 0)
451 + debuginfo-level-std = $(usex debug 2 0)
452 + debuginfo-level-tools = $(usex debug 2 0)
453 + debuginfo-level-tests = 0
454 + backtrace = true
455 + incremental = false
456 + default-linker = "$(tc-getCC)"
457 + parallel-compiler = $(toml_usex parallel-compiler)
458 + channel = "$(usex nightly nightly stable)"
459 + description = "gentoo"
460 + rpath = false
461 + verbose-tests = true
462 + optimize-tests = $(toml_usex !debug)
463 + codegen-tests = true
464 + dist-src = false
465 + remap-debuginfo = true
466 + lld = $(usex system-llvm false $(toml_usex wasm))
467 + # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it
468 + # https://github.com/rust-lang/rust/issues/74976
469 + # https://github.com/rust-lang/rust/issues/76526
470 + deny-warnings = $(usex wasm $(usex doc false true) true)
471 + backtrace-on-ice = true
472 + jemalloc = false
473 + [dist]
474 + src-tarball = false
475 + compression-formats = ["xz"]
476 + _EOF_
477 +
478 + for v in $(multilib_get_enabled_abi_pairs); do
479 + rust_target=$(rust_abi $(get_abi_CHOST ${v##*.}))
480 + arch_cflags="$(get_abi_CFLAGS ${v##*.})"
481 +
482 + cat <<- _EOF_ >> "${S}"/config.env
483 + CFLAGS_${rust_target}=${arch_cflags}
484 + _EOF_
485 +
486 + cat <<- _EOF_ >> "${S}"/config.toml
487 + [target.${rust_target}]
488 + ar = "$(tc-getAR)"
489 + cc = "$(tc-getCC)"
490 + cxx = "$(tc-getCXX)"
491 + linker = "$(tc-getCC)"
492 + ranlib = "$(tc-getRANLIB)"
493 + _EOF_
494 + # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
495 + if use elibc_musl; then
496 + cat <<- _EOF_ >> "${S}"/config.toml
497 + crt-static = false
498 + _EOF_
499 + fi
500 + if use system-llvm; then
501 + cat <<- _EOF_ >> "${S}"/config.toml
502 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
503 + _EOF_
504 + fi
505 + done
506 + if use wasm; then
507 + cat <<- _EOF_ >> "${S}"/config.toml
508 + [target.wasm32-unknown-unknown]
509 + linker = "$(usex system-llvm lld rust-lld)"
510 + # wasm target does not have profiler_builtins https://bugs.gentoo.org/848483
511 + profiler = false
512 + _EOF_
513 + fi
514 +
515 + if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below
516 + # experimental cross support
517 + # discussion: https://bugs.gentoo.org/679878
518 + # TODO: c*flags, clang, system-llvm, cargo.eclass target support
519 + # it would be much better if we could split out stdlib
520 + # complilation to separate ebuild and abuse CATEGORY to
521 + # just install to /usr/lib/rustlib/<target>
522 +
523 + # extra targets defined as a bash array
524 + # spec format: <LLVM target>:<rust-target>:<CTARGET>
525 + # best place would be /etc/portage/env/dev-lang/rust
526 + # Example:
527 + # RUST_CROSS_TARGETS=(
528 + # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
529 + # )
530 + # no extra hand holding is done, no target transformations, all
531 + # values are passed as-is with just basic checks, so it's up to user to supply correct values
532 + # valid rust targets can be obtained with
533 + # rustc --print target-list
534 + # matching cross toolchain has to be installed
535 + # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one)
536 + # only gcc toolchains installed with crossdev are checked for now.
537 +
538 + # BUG: we can't pass host flags to cross compiler, so just filter for now
539 + # BUG: this should be more fine-grained.
540 + filter-flags '-mcpu=*' '-march=*' '-mtune=*'
541 +
542 + local cross_target_spec
543 + for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do
544 + # extracts first element form <LLVM target>:<rust-target>:<CTARGET>
545 + local cross_llvm_target="${cross_target_spec%%:*}"
546 + # extracts toolchain triples, <rust-target>:<CTARGET>
547 + local cross_triples="${cross_target_spec#*:}"
548 + # extracts first element after before : separator
549 + local cross_rust_target="${cross_triples%%:*}"
550 + # extracts last element after : separator
551 + local cross_toolchain="${cross_triples##*:}"
552 + use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled"
553 + command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain"
554 +
555 + cat <<- _EOF_ >> "${S}"/config.toml
556 + [target.${cross_rust_target}]
557 + ar = "${cross_toolchain}-ar"
558 + cc = "${cross_toolchain}-gcc"
559 + cxx = "${cross_toolchain}-g++"
560 + linker = "${cross_toolchain}-gcc"
561 + ranlib = "${cross_toolchain}-ranlib"
562 + _EOF_
563 + if use system-llvm; then
564 + cat <<- _EOF_ >> "${S}"/config.toml
565 + llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
566 + _EOF_
567 + fi
568 + if [[ "${cross_toolchain}" == *-musl* ]]; then
569 + cat <<- _EOF_ >> "${S}"/config.toml
570 + musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr"
571 + _EOF_
572 + fi
573 +
574 + # append cross target to "normal" target list
575 + # example 'target = ["powerpc64le-unknown-linux-gnu"]'
576 + # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]'
577 +
578 + rust_targets="${rust_targets},\"${cross_rust_target}\""
579 + sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die
580 +
581 + ewarn
582 + ewarn "Enabled ${cross_rust_target} rust target"
583 + ewarn "Using ${cross_toolchain} cross toolchain"
584 + ewarn
585 + if ! has_version -b 'sys-devel/binutils[multitarget]' ; then
586 + ewarn "'sys-devel/binutils[multitarget]' is not installed"
587 + ewarn "'strip' will be unable to strip cross libraries"
588 + ewarn "cross targets will be installed with full debug information"
589 + ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files"
590 + ewarn
591 + ewarn "Alternatively llvm-strip can be used, it supports stripping any target"
592 + ewarn "define STRIP=\"llvm-strip\" to use it (experimental)"
593 + ewarn
594 + fi
595 + done
596 + fi # I_KNOW_WHAT_I_AM_DOING_CROSS
597 +
598 + einfo "Rust configured with the following flags:"
599 + echo
600 + echo RUSTFLAGS="${RUSTFLAGS:-}"
601 + echo RUSTFLAGS_BOOTSTRAP="${RUSTFLAGS_BOOTSTRAP:-}"
602 + echo RUSTFLAGS_NOT_BOOTSTRAP="${RUSTFLAGS_NOT_BOOTSTRAP:-}"
603 + env | grep "CARGO_TARGET_.*_RUSTFLAGS="
604 + cat "${S}"/config.env || die
605 + echo
606 + einfo "config.toml contents:"
607 + cat "${S}"/config.toml || die
608 + echo
609 +}
610 +
611 +src_compile() {
612 + # we need \n IFS to have config.env with spaces loaded properly. #734018
613 + (
614 + IFS=$'\n'
615 + env $(cat "${S}"/config.env) RUST_BACKTRACE=1\
616 + "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
617 + )
618 +}
619 +
620 +src_test() {
621 + # https://rustc-dev-guide.rust-lang.org/tests/intro.html
622 +
623 + # those are basic and codegen tests.
624 + local tests=(
625 + codegen
626 + codegen-units
627 + compile-fail
628 + incremental
629 + mir-opt
630 + pretty
631 + run-make
632 + )
633 +
634 + # fails if llvm is not built with ALL targets.
635 + # and known to fail with system llvm sometimes.
636 + use system-llvm || tests+=( assembly )
637 +
638 + # fragile/expensive/less important tests
639 + # or tests that require extra builds
640 + # TODO: instead of skipping, just make some nonfatal.
641 + if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then
642 + tests+=(
643 + rustdoc
644 + rustdoc-js
645 + rustdoc-js-std
646 + rustdoc-ui
647 + run-make-fulldeps
648 + ui
649 + ui-fulldeps
650 + )
651 + fi
652 +
653 + local i failed=()
654 + einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}"
655 + for i in "${tests[@]}"; do
656 + local t="src/test/${i}"
657 + einfo "rust_src_test: running ${t}"
658 + if ! (
659 + IFS=$'\n'
660 + env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \
661 + "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \
662 + -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}"
663 + )
664 + then
665 + failed+=( "${t}" )
666 + eerror "rust_src_test: ${t} failed"
667 + fi
668 + done
669 +
670 + if [[ ${#failed[@]} -ne 0 ]]; then
671 + eerror "rust_src_test: failure summary: ${failed[@]}"
672 + die "aborting due to test failures"
673 + fi
674 +}
675 +
676 +src_install() {
677 + (
678 + IFS=$'\n'
679 + env $(cat "${S}"/config.env) DESTDIR="${D}" \
680 + "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die
681 + )
682 +
683 + # bug #689562, #689160
684 + rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die
685 + rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die
686 + newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo
687 +
688 + local symlinks=(
689 + cargo
690 + rustc
691 + rustdoc
692 + rust-gdb
693 + rust-gdbgui
694 + rust-lldb
695 + )
696 +
697 + use clippy && symlinks+=( clippy-driver cargo-clippy )
698 + use miri && symlinks+=( miri cargo-miri )
699 + use profiler && symlinks+=( rust-demangler )
700 + use rls && symlinks+=( rls )
701 + use rustfmt && symlinks+=( rustfmt cargo-fmt )
702 +
703 + einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}"
704 + local i
705 + for i in "${symlinks[@]}"; do
706 + # we need realpath on /usr/bin/* symlink return version-appended binary path.
707 + # so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver>
708 + # need to fix eselect-rust to remove this hack.
709 + local ver_i="${i}-${PV}"
710 + if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then
711 + einfo "Installing ${i} symlink"
712 + ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die
713 + else
714 + ewarn "${i} symlink requested, but source file not found"
715 + ewarn "please report this"
716 + fi
717 + dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}"
718 + done
719 +
720 + # symlinks to switch components to active rust in eselect
721 + dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}"
722 + dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}"
723 + dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}"
724 + dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}"
725 + dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}"
726 +
727 + newenvd - "50${P}" <<-_EOF_
728 + LDPATH="${EPREFIX}/usr/lib/rust/lib"
729 + MANPATH="${EPREFIX}/usr/lib/rust/man"
730 + $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
731 + $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
732 + _EOF_
733 +
734 + rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die
735 + rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die
736 +
737 + # note: eselect-rust adds EROOT to all paths below
738 + cat <<-_EOF_ > "${T}/provider-${P}"
739 + /usr/bin/cargo
740 + /usr/bin/rustdoc
741 + /usr/bin/rust-gdb
742 + /usr/bin/rust-gdbgui
743 + /usr/bin/rust-lldb
744 + /usr/lib/rustlib
745 + /usr/lib/rust/lib
746 + /usr/lib/rust/libexec
747 + /usr/lib/rust/man
748 + /usr/share/doc/rust
749 + _EOF_
750 +
751 + if use clippy; then
752 + echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
753 + echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
754 + fi
755 + if use miri; then
756 + echo /usr/bin/miri >> "${T}/provider-${P}"
757 + echo /usr/bin/cargo-miri >> "${T}/provider-${P}"
758 + fi
759 + if use profiler; then
760 + echo /usr/bin/rust-demangler >> "${T}/provider-${P}"
761 + fi
762 + if use rls; then
763 + echo /usr/bin/rls >> "${T}/provider-${P}"
764 + fi
765 + if use rustfmt; then
766 + echo /usr/bin/rustfmt >> "${T}/provider-${P}"
767 + echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
768 + fi
769 +
770 + insinto /etc/env.d/rust
771 + doins "${T}/provider-${P}"
772 +
773 + if use dist; then
774 + insinto "/usr/lib/${PN}/${PV}/dist"
775 + doins -r "${S}/build/dist/."
776 + fi
777 +}
778 +
779 +pkg_postinst() {
780 + eselect rust update
781 +
782 + if has_version sys-devel/gdb || has_version dev-util/lldb; then
783 + elog "Rust installs a helper script for calling GDB and LLDB,"
784 + elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}."
785 + fi
786 +
787 + if has_version app-editors/emacs; then
788 + elog "install app-emacs/rust-mode to get emacs support for rust."
789 + fi
790 +
791 + if has_version app-editors/gvim || has_version app-editors/vim; then
792 + elog "install app-vim/rust-vim to get vim support for rust."
793 + fi
794 +}
795 +
796 +pkg_postrm() {
797 + eselect rust cleanup
798 +}