commit: f1fee78db8c5c9b10b90d41a267daac8474ff597 Author: orbea <orbea <AT> riseup <DOT> net> AuthorDate: Sat Jan 15 04:26:44 2022 +0000 Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com> CommitDate: Sat Jan 15 19:12:40 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=f1fee78d
dev-lang/rust: Remove old version and patches Signed-off-by: orbea <orbea <AT> riseup.net> Closes: https://github.com/gentoo/libressl/pull/376 Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com> dev-lang/rust/Manifest | 34 -- dev-lang/rust/files/1.51.0-bootstrap-panic.patch | 43 -- dev-lang/rust/files/1.51.0-slow-doc-install.patch | 92 --- .../rust/files/rustc-1.51.0-backport-pr81728.patch | 181 ------ .../rust/files/rustc-1.51.0-backport-pr81741.patch | 44 -- .../rust/files/rustc-1.51.0-backport-pr82289.patch | 96 --- .../rust/files/rustc-1.51.0-backport-pr82292.patch | 120 ---- .../rust/files/rustc-1.51.0-backport-pr83629.patch | 142 ----- dev-lang/rust/rust-1.52.1.ebuild | 677 --------------------- 9 files changed, 1429 deletions(-) diff --git a/dev-lang/rust/Manifest b/dev-lang/rust/Manifest index 1342d4f..c8dda48 100644 --- a/dev-lang/rust/Manifest +++ b/dev-lang/rust/Manifest @@ -1,35 +1,3 @@ -DIST rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz 208849064 BLAKE2B 1570536f63237ce04222f78c8c1d0592b3d0bacb62e2a1e2b87f9cd74c8d304837f9259c154e6ddfc5d0fc36c1d69aba34cb27d41346d4e7400ad1950ff19f8f SHA512 2af31290e1065a4611f34e6cc8c62ee494c222becfb21ec6707059c119069b0adf0eec23e56bad4a3cc8690b2556309ec58cbd9003a959983689cc46c7c63361 -DIST rust-1.51.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B cc2cef574740ea5eb632235dca2889a7c6a6941169ac011d3a888cdefb8e5a5af5bb9ade93207ccb6adc82eb6ae1b5ed605954cea2561163c538fcbbcdb647f8 SHA512 43abb6e19c1ca905cb2d047503f4473584e06b8daecff3b6e45ac93dadc2c7f37118e3b66124180a9951b2f5eedf212174a37c661a7775600bd200eb089801f9 -DIST rust-1.51.0-aarch64-unknown-linux-musl.tar.xz 209607568 BLAKE2B 8a8d677fac5aa68be8b689bd999894f0b51910d50d86d70db4cc9b60695703dd74b68578b72d9d410d2d163aebd3fbab0993ebf79486a103ef588cb849dc2038 SHA512 d7ca480f4e07f88a49b475d2fcd132126defff21c26a665d1b444b97ce5e44404f9106bb844a5e35d4933a51c2d8a5aabc8ee42a2515c02a559c81937920be4d -DIST rust-1.51.0-aarch64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 0759b58a1647b0c0a29fc295edb31e793a0688d6a4b6eb8febe4364421f53cd1f4c0555abf7c8d4fb25bd7c15c9aeaa8d520390d8d3b61c213a591ccee7b9887 SHA512 bc2135b94f9c4e7b2616d886e84a268f52404abed2b827bdca5ab8f98071801e171234f18aa27a367b5dbd0df0e207b0aac8a30be59fff807ff70f21279614e2 -DIST rust-1.51.0-arm-unknown-linux-gnueabi.tar.xz 194362256 BLAKE2B 20c1559d3b1f32c9ca6f5e9740dff0d9fd859be33ca58d59733fff1566ed0b75dd398facbcd15c8d7c862bee945198b0235973d5f683fd78f82cca52429b269c SHA512 fadb5084152b6fa148c1d584c8ba766201012c0a70bdf273f5d4b89b249d7f520997b12809a0db68c9d1d76283fee892f83b6ef687cbb025c08960ffff7e5eea -DIST rust-1.51.0-arm-unknown-linux-gnueabi.tar.xz.asc 801 BLAKE2B 546fad9428e7261ef78e92d6542ebcd2b1b11c54bb4dc1fbcb7ca622551e6b4fc443f16305f9f37572ff2f24e5dfab491fadf3a128e009c77aa0218b271bbe5e SHA512 580954dde6e5a89a9a16d0b93570275e81f488f0a77952cd4e3878894f9865f2a128bac2aaf0567ffc9e7cf9809808088a819bf7b0e54d8fa6224abe677d1732 -DIST rust-1.51.0-arm-unknown-linux-gnueabihf.tar.xz 193918308 BLAKE2B 6799652205422d96c95949a4afa8a321a8a4e0cd42543f321898fdba5b27bb645f9eeb50edb63a43902cc74026a786c12a22af67313bc6ac0843b1e638077d64 SHA512 cd0dba1ebdff9692aef0026d94da38ba7856b64004404b75d0d385b8f9f53eed1ddd0e900e49cda60fc5190fe305d96f6f00d0053f4409479ab991fafa90338c -DIST rust-1.51.0-arm-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B 41cad50cdebc0cb4e59f6c914b30b071dd7a70b6278c03a7349eb51a9ec6976fbaeacaea96f13e8ad91a283a3de4f548cf8e352179359f5697520813bc47e274 SHA512 d74a183dba390ea053ee746575788481e3970572e61b7b55acff521c8f4a9da5a3f4e3feff5c3b26162acdc00eed1c4240a4fbdcac3fa117455ac49d8ce62985 -DIST rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz 197028040 BLAKE2B 801526d0fc9cdfc25a63227afdfc1bf9e0e6fa0b80f6306d86b68ca16adf4996b755b6ade1a4e898bfaf25565b5b49a358a9ed364bfe5d67c308744814a843de SHA512 c602dcc7fd1343b310f5e3074bf63f2428ca7c15cdce8999fa4655de5a4bda5a13255fc12bee3d0632f6cb93220a883fb36d24061dca6795d23afa9f8fdae57f -DIST rust-1.51.0-armv7-unknown-linux-gnueabihf.tar.xz.asc 801 BLAKE2B dd94fb91fb6dba9788b178ea74b73c0df78f496d6f57382969836ade9aacda1696f363c4cef8126426040620ef934a2f2681d89d5e3a703d9114d8d152abb6f8 SHA512 40a3f61341ec996650b6e4e8552007b822b7990b2154483a7d7a7dcbae4eb2913d4ffb5319037256ff5931ee01320d1c3ce307aa7c9fd90a782646de4edcd2e9 -DIST rust-1.51.0-i686-unknown-linux-gnu.tar.xz 213348860 BLAKE2B bd6c1d5ce9f20b961e3db8c69b022402acbdf06029e0802863292bcac89b0f88e6e6d02f625be52e8753d772aad8ac01125ff6832072b5d3d41a9ec7bf5c6a6f SHA512 05d08e44827dcba8197667deb9a7f3584465085ce1b79a38deb138849a07c716646a70f1cc2cee02b41c45ec7c3a3b7800a3fae62ebe04d6f72f017a5d722bab -DIST rust-1.51.0-i686-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c09c5ce8df8834758cf8049872142104023af24f31a2efc97ee201e6b2db56c1b7dd1baccd608ca1f3de416efd162408a01170fff9b7070cac80df32fa30012d SHA512 6aad34b773cfe0ec30f80dacb7482247515ed1e7025a322d22ce7a2b1a6dc49929f71b9c3a6bd05622b70dd8f37fde5cc809ac32c4724b98098630158dddcfdf -DIST rust-1.51.0-mips-unknown-linux-gnu.tar.xz 155944968 BLAKE2B ab9ad78f147b439beec9e92e643cc48814666c5e8fa244981d0919237844006aa2879a4058145d0bdafe89793402e65982d9fd3f0c6253f6a1805bf3381b4caf SHA512 378cfacfc66f1e8a4aeeb3715db9d3cefb4582db8a3b8fc62f05ac50a16db302b250c1696605c17cebe75923010b361b3a9883f7567a26cdcd60fc8379d2d7b3 -DIST rust-1.51.0-mips-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B d072b66f210244c3cb534a040679ee5c5433703fe309a05565a91b4cc8fd50b0e09320067dc48a7255aa0561ca6029fcab3ef4b782f40097a9646c5c77727344 SHA512 c7f1789e577c89397c59e288d2351fdb08bb9626df9d2a4d15c13a1474b67f8474be27d9f8a13fb55c53f9a17e47825b84473f487fa3866a8e30e4141b26aaa6 -DIST rust-1.51.0-mips64-unknown-linux-gnuabi64.tar.xz 161859704 BLAKE2B a60484b7d009633763f10be8affc33715992f6eee5643d147078840675c900be0ff7f9bd985680836dc7d8467d7d118863cb5bed0f85bb135f0e352318946f32 SHA512 e99437a1b79e8821f6c1eaea92a8c5348e6fb4aa1a4fecbfecc950bf71fd7cd58712d336a67e00f95554bb01565f1daa1221699e142e9e673d8ce2cbb8910008 -DIST rust-1.51.0-mips64-unknown-linux-gnuabi64.tar.xz.asc 801 BLAKE2B 85aca04845291448d9ec9c5b37f556e890155574982496d8967829b56b3c4caab1aa40c71e007392a05337ca917a70aa107007cf5c73c8eb8fa95bbcb6f7debf SHA512 4ebd8e0bad5c66a12bfb606f6b28aa63430af5e6344ce91d2be958f1f479fad0d5af6a53006999a321cacfea50fc623629f633f95ff747790c2702aa8dfe9c76 -DIST rust-1.51.0-mipsel-unknown-linux-gnu.tar.xz 159164156 BLAKE2B ccccc1e8abf529f9f023cd793dd78c9bfece359a770e03cfae808ac017ae0171ca0dbabb870c5ad57670a9ec562c393d2ffef3490e46423420be6a9a20cc8937 SHA512 31aecea3016e30dd610b610b86ec23f9832061abfbc55c7e43d942d4b0e8e521aecb37306bdb4a810ddcfc4e9d9a6cf057d6802d053ce9abf1cad401b6440d67 -DIST rust-1.51.0-mipsel-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e61e17518d7d326f188b84855b771c7bc2d7f23347dfadaf0783b4fcbb7dfd233ed2262c6ffa75b55baee7e83e94b5c47d24b937e540c6a2892b20d320fcefbb SHA512 e0ffb031f600a58a2f7a76b1b26f5453e9de4d4edf6652d75d0cdd92e4495844601d56b521482e172c72b7463ab667ea65e610baa4f68c5f59333dd8f3cf1155 -DIST rust-1.51.0-powerpc-unknown-linux-gnu.tar.xz 167534676 BLAKE2B 5c74ebaf5d5e736bbfb8d963faff6d0fa5725017c738c4a5adf4b4e8c812ff8234b9e03e1a6ba2b6ab718469541e8c398e095ae22f155ccf9290e50ae0595a52 SHA512 9984e464a4e7d18042a8a2d99d26c4436a0ae2b2d281d5c8a42aedb0b78ab5e72f2392ea96e84b2f5892d772d28ee2feb89636f8d1a060a30098faa4e7f259eb -DIST rust-1.51.0-powerpc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B c8ee6ea39b19cb160527145aeb32206eef6665df1e2c3ce690a136ead20b8114a5806b209a926da7608ffce94e6d65910b7a282cb353345a83a8e2b589df489f SHA512 886c62e4592568ad7b966f933641236ce59a037b65a00e0bfab6d2d6bb62cf994cdd8e392dd2f51b9c958e4e3c0c3763b9dec6be5a4faf27aac5d8d0a225abe2 -DIST rust-1.51.0-powerpc64-unknown-linux-gnu.tar.xz 182726600 BLAKE2B d9051eea2d9486b6b4d858a3f6730210de5aac958853de82b3f822b3e0decd1b8a9a9b371b250ffde9ac19be4ccbe09e58c51a78b7e1fb2dd48e61c8a902e5b5 SHA512 4c1864a81d4c32bd95e0381454beae2a1d5b4cb47196821e64fc261133acfa2fa1e514dd6cdb68551559c4da2a2483edf5c6c14246adbea85c3027f88d401e06 -DIST rust-1.51.0-powerpc64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e1fe8c5764cb11f722893c7efcfb76d5f17ee80a104ede360fedbc8cd1e2996246e0a770959398a524ae55bdfb075dedb2c2583816bd3de28034dddbf248a54c SHA512 3b7e3f15f5a2a4876175a26d7b4332d4a6847a565d5de4c2cb67c52cf26308215286777ea9d89366543ddd1ce353d6a920153549b6641ffeae8e9954470aecfc -DIST rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz 192084372 BLAKE2B d127c1827956c7594da5b69346168504b22726e176f03172b599e0a0fae2400e273684090f1d0fd05c33f193b3918c98ccd64c3647b0577b51431c3409083b2f SHA512 b53a741d1d75637fb31ddb0364e1f91427c3818ca145f819b906d13c32c638ae77fbaa567a6220b6bf69f38cc00d2b95615778a86f4acadd63efe2e62b1b01ef -DIST rust-1.51.0-powerpc64le-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B f79f8e1ad8cb0dbc6e1cb45fab2bd19a03d1939518529841155e7a00d9a42e3eb2539ae424c68af7140399a2b37c6ff5a00c55f0467ce4acf6fd7b1ddf525a63 SHA512 785ab118197d53b5f4512cdb07e6277c9ff58b9e53610dcce1c9f928cac8a20b1fbaaa7acad8cbe4370a3fe6dda5f726e8021e8987688a9ec242f73ed8d12adb -DIST rust-1.51.0-riscv64gc-unknown-linux-gnu.tar.xz 179131092 BLAKE2B 1d8cc335cfc434871e1916793974eabd14fa96f49ee9b0f9ae004326c405dbadccd0249ff28dddfecb9921cae4e886f4114a8221e09fd7944f2d2e96bdb12bd2 SHA512 7fb76c3ddc952b43320bf3497d890ff79aa5634df22f38958835cd1d4044bef44257af22d7473675afb42a7c2fc9ac713f210d6bfe1e61ed56d5265f58add540 -DIST rust-1.51.0-riscv64gc-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B b0cbee67d6bc37ccdcdf2c563667f3b3e4ec7377e5c86b627cfbbd7385425508778bd67887f46067476ffbf3b5f2719d6b5490d2fe5261db5e7f4da4bbc94be1 SHA512 fdf1ed20eec719435a557be8e6bf6766b0b56e27fa49c65b2c412875a1c76919ff6d6a4d8d14bafa8aa96eb42deca65869db6ca5d2b61a84a0af07dbeb1e9ae9 -DIST rust-1.51.0-s390x-unknown-linux-gnu.tar.xz 191632144 BLAKE2B d1690825f59e8ed1ed4855556ff36c05efbc941097744e31fd9207309087d53880d418f737aa0cb9371b973c9c3d56f05ed03533df04402242194ef13b8d608d SHA512 a72ad31c6306f939c4f963133ddc0b3fabc9e506bdff5e318f5275658b7271a675a51d208d306d94fb01739cbcf0f62f018fc7490ca6db54b301852202749d16 -DIST rust-1.51.0-s390x-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 355e753ddca453ca36a8c1e4f361e9655bdb54f856a642be3d4024772266ed1771a2673ab1026c64bbf7ac8d1fc30fb1924a939cc3ea290e98b137edb48bbf6a SHA512 89bf145b8e620eac99b0fe4a79ee205a04550c664bba1e22a7611ef37736cca3cb911ac89659126e0c6fa60e4dbfdf0dd54a8693e496d4c37e4f7d3f518e2740 -DIST rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz 147543532 BLAKE2B 44ac97f6b650e65de257b362121091176e02fac60aa534ec83ddbc4e16eb32f7a4a7999cc28eac446f5790572552fee5c2589350cb6d159a946d90007d85c7db SHA512 9f95045119bcd5ef7be54f5b5bdc9ebc6bd6c48437d90762a1cfbc03281882f81087e1877eecae9573ba5e7cd7c11ef5fed979034c57f45b6547cbfeb11eef6d -DIST rust-1.51.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B 033c41c165cf50a63479d1352a33abe94a63d9730f02016d09bf2e8a8804587d4fc802c047e7417e0befca2d5df5ca8c79a714ec1c1fb389240b6e8931fb9e9b SHA512 e314a7db9aaff445b67f828bf9a98705032071928e2102524c0c720a3b8feb292b8c6766838b92da2d213e93bf53fb780fc856b0370238fbb7e20431d2de6d5c -DIST rust-1.51.0-x86_64-unknown-linux-musl.tar.xz 233773068 BLAKE2B cc9de90b967cc81005ce5c897d3fd6dc4e3880be96ac82c41382d19a8aca0244845830db7a33eaef85b6bdef0c00ae02c0390db932fa49f76e362af2c68edb56 SHA512 d8df3c4c3de435629986e21bc6b31edfb73cba394e76cf87ee98d2936f73aef60c988d020da7ec1188f6448eacad9d5aefed073f4f88ffa2eaac54ac7e3cb3f7 -DIST rust-1.51.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 2e2c20fe99b33e5361b1945f54b77d5e8acad34d1be9cadfd1971b2882e38bc4403a5a67769a74fdd7ab21434784f03084780ef827e26318168bf5d531f9e9bd SHA512 42392e8283a28d58d4874dbf97caa0377f27c6599c272c715fcdefee48551004d491f0509f2894f5696a2820f11dbb333e3bf878cbdf24b0c58add4a493acecc DIST rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz 215549836 BLAKE2B d4179cc67772cd6b92085d68f4bb9de006fca7d8470a56766ac5d94a0379ae675d18c5275ec2ed1eab71274ce4f416a77f3ce74d849a1d4118b5a7ddec205a3c SHA512 7a26e14be6b27c7084c7c85b312341ab991c2df91ea53128f14707a4c725dd03ba7df30b9e9fcef39a509ab4f5d5feb028b99d6d9ffcc059996ed29b83eb90b9 DIST rust-1.52.0-aarch64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B e66afc44186f48548dffcd7c6d7d92b4fbecea48bf3f7970d211844b5401a2556a138993517d049265109146a48856c7106616100ed63a5fa3f263d7023af6b6 SHA512 75ff89cd071641b01f4d483aca5997f6b3857d477b6fb40e6fdf11ff2ecdca74618cc59a9f0d1d2f942bde2d9a8738ac6f821d21d79f3ed85830ef530636a607 DIST rust-1.52.0-aarch64-unknown-linux-musl.tar.xz 214159336 BLAKE2B 1b2afb80df6bf75d516127f07d57d12d876f12879c1d87059ab1c40ee1325ddb4e0c22f2fa185dab72f7633bce7d2ff5ed92ce4e88d4e118ac80630a061ec0c4 SHA512 9461c7272ac3e2c854e8e5f24cd57e5d648a3f923a9413eebd9f45a143d27378bc09c4d30ee7a1773a56baa31066dcc9f955b0805ce9f47d81b52e47a3a3e369 @@ -222,8 +190,6 @@ DIST rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz 151033748 BLAKE2B 61ecece6a8aa3 DIST rust-1.57.0-x86_64-unknown-linux-gnu.tar.xz.asc 801 BLAKE2B ea41b27fd25cc75efac73203688ee0882767fc76a2fe09b5e424c42467d3e332463c5560cc58f3b20f6e4b44289a25cfb0d36e38a7a9a7b3950ef875a59dc9ae SHA512 8b955bfce6c130e4b95054b98646f7f9b89e621256759ee1ff533df5f777312dd7adbb192ee0076c9b9baa6883a74a9def50ef598ba8c707762290d465c9a8b7 DIST rust-1.57.0-x86_64-unknown-linux-musl.tar.xz 260333980 BLAKE2B 75342ae8637355e714d5217d78604cfa6a601d3f9bc0ed4667ff0ca57c6521567b19b9bdb10f79761e2e5fd21ca10e12f3fae0c65791118fdb0c35f8f88349f4 SHA512 204ed493528757b8e3e8df13d062c9ae74c75c3e3adc1a2efc0dfc33d2525629168a558dd32653f44a4365191bf203a4415a77152276288a8e122e6bd587394a DIST rust-1.57.0-x86_64-unknown-linux-musl.tar.xz.asc 801 BLAKE2B 506400c3ea70469cbda0e492e85d41b7f94fba790ec19d1c3491bf4a00d283f97c8fb37319ad6c4a43b22a2195c21d1b9e3c16a5b2a9a82833ff61ad49bdc793 SHA512 793369dc7a854c48a72d81446a0c8eb9d83a071af77758e0bcbb8e4d518fb87c5a23c085202b9b427a02bdd772ad9c82724b34295b851f26f384c3e801bf9a04 -DIST rustc-1.52.1-src.tar.xz 115109508 BLAKE2B c5d73f5884037d287d88ba9fdaf63a36678b692e1b510920045797ab29f1660f05cda901e19411ff83ec3084c4130034c269976b1056220f3e629cff116d07f0 SHA512 55f5053ce40d4eba4663052817aef6a6275139ca229c89cd1ec44711458b412720203301d8c7975aac5720a91fcaf21847f8184f641cbb0004f722520283c73c -DIST rustc-1.52.1-src.tar.xz.asc 801 BLAKE2B ea2f89289b4d9cf90a0d10148bf3494805c00e7822cc98addf0b602c35e4635bb1963d79168b395a5f7c7bd024070284fccd19757982daa0d554dcac166fd4d7 SHA512 0d692a085c017b03b8a135a28f7e6f1d7e05642d2e99f0f1fbc397e766bb8fed4b4c6b4c9157b79d9bb0c4229607dbc35711cd463c62a9966a4efb6f197de7d3 DIST rustc-1.53.0-src.tar.xz 115686332 BLAKE2B fa068f89d42f927fdc79ee31aad1386eaf2aa596a060e059c5a1a73fe48c48d008fc952cd6c7912b743e41d77a94b205639eed0f728b2539b62f18a772cabfe3 SHA512 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24 DIST rustc-1.53.0-src.tar.xz.asc 801 BLAKE2B 75d3aa4122968f10a119f7a04df897f496588c7a1a2ddf1ea2222099c9efb0e320f5677a26c3271f86e7f500120664485f54c6025ae3c6df30d2b0fe758f5826 SHA512 e337579b9ab4febca4594c2c5d42c279b51cfc745c383be9a430204188311a25319c04c73fde34fdb2bb98a88bfd8daaddc67765834330e6c279a6e5a5648247 DIST rustc-1.54.0-src.tar.xz 116286856 BLAKE2B 5ac47822646a0b6205f09282168b4d4ddcace9f6bc8f242c890327ca4074626f129514f8bcae5c5556015745f718990cce490658076f5cd3526623439540416b SHA512 5162f85b43ca2c5af93fdbfb2597d75df8a838f7fcc025a5298499ce1043db50f1ea2fbba753e47ce5daad3d80d4b612acf6527ef902c34117763e687fdbbcfa diff --git a/dev-lang/rust/files/1.51.0-bootstrap-panic.patch b/dev-lang/rust/files/1.51.0-bootstrap-panic.patch deleted file mode 100644 index 529d5a1..0000000 --- a/dev-lang/rust/files/1.51.0-bootstrap-panic.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 31c93397bde772764cda3058e16f9cef61895090 Mon Sep 17 00:00:00 2001 -From: Joshua Nelson <jyn...@gmail.com> -Date: Mon, 8 Feb 2021 22:51:21 -0500 -Subject: [PATCH] Use format string in bootstrap panic instead of a string - directly - -This fixes the following warning when compiling with nightly: - -``` -warning: panic message is not a string literal - --> src/bootstrap/builder.rs:1515:24 - | -1515 | panic!(out); - | ^^^ - | - = note: `#[warn(non_fmt_panic)]` on by default - = note: this is no longer accepted in Rust 2021 -help: add a "{}" format string to Display the message - | -1515 | panic!("{}", out); - | ^^^^^ -help: or use std::panic::panic_any instead - | -1515 | std::panic::panic_any(out); - | ^^^^^^^^^^^^^^^^^^^^^^ -``` ---- - src/bootstrap/builder.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs -index f1a160250dbe1..0f5fcb4af400d 100644 ---- a/src/bootstrap/builder.rs -+++ b/src/bootstrap/builder.rs -@@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> { - for el in stack.iter().rev() { - out += &format!("\t{:?}\n", el); - } -- panic!(out); -+ panic!("{}", out); - } - if let Some(out) = self.cache.get(&step) { - self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step)); diff --git a/dev-lang/rust/files/1.51.0-slow-doc-install.patch b/dev-lang/rust/files/1.51.0-slow-doc-install.patch deleted file mode 100644 index 4aa7a71..0000000 --- a/dev-lang/rust/files/1.51.0-slow-doc-install.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 6dfd700c595a8853fd58349c38c4768b922a2e85 Mon Sep 17 00:00:00 2001 -From: Anders Kaseorg <ande...@mit.edu> -Date: Sat, 17 Apr 2021 22:20:36 -0700 -Subject: [PATCH] bootstrap: Restore missing --bulk-dirs for rust-docs, - rustc-docs - -The --bulk-dirs argument was removed for rust-docs in commit -c768ce138427b1844c1f6594daba9c0e33928032 and rustc-docs in commit -8ca46fc7a83734c9622f11f25d16b82316f44bcc (#79788), presumably by -mistake; that slowed down installation of rust-docs from under a -second to some twenty *minutes*. Restoring --bulk-dirs reverses this -slowdown. - -Fixes #80684. - -Signed-off-by: Anders Kaseorg <ande...@mit.edu> ---- - src/bootstrap/dist.rs | 4 ++-- - src/bootstrap/tarball.rs | 17 +++++++++++++++++ - 2 files changed, 19 insertions(+), 2 deletions(-) - -diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs -index 38ebe0e52083d..aee3c8324bc11 100644 ---- a/src/bootstrap/dist.rs -+++ b/src/bootstrap/dist.rs -@@ -74,7 +74,7 @@ impl Step for Docs { - - let mut tarball = Tarball::new(builder, "rust-docs", &host.triple); - tarball.set_product_name("Rust Documentation"); -- tarball.add_dir(&builder.doc_out(host), dest); -+ tarball.add_bulk_dir(&builder.doc_out(host), dest); - tarball.add_file(&builder.src.join("src/doc/robots.txt"), dest, 0o644); - Some(tarball.generate()) - } -@@ -107,7 +107,7 @@ impl Step for RustcDocs { - - let mut tarball = Tarball::new(builder, "rustc-docs", &host.triple); - tarball.set_product_name("Rustc Documentation"); -- tarball.add_dir(&builder.compiler_doc_out(host), "share/doc/rust/html/rustc"); -+ tarball.add_bulk_dir(&builder.compiler_doc_out(host), "share/doc/rust/html/rustc"); - Some(tarball.generate()) - } - } -diff --git a/src/bootstrap/tarball.rs b/src/bootstrap/tarball.rs -index b02d7e062a524..9ff5c2327e0f7 100644 ---- a/src/bootstrap/tarball.rs -+++ b/src/bootstrap/tarball.rs -@@ -99,6 +99,7 @@ pub(crate) struct Tarball<'a> { - temp_dir: PathBuf, - image_dir: PathBuf, - overlay_dir: PathBuf, -+ bulk_dirs: Vec<PathBuf>, - - include_target_in_component_name: bool, - is_preview: bool, -@@ -137,6 +138,7 @@ impl<'a> Tarball<'a> { - temp_dir, - image_dir, - overlay_dir, -+ bulk_dirs: Vec::new(), - - include_target_in_component_name: false, - is_preview: false, -@@ -201,6 +203,11 @@ impl<'a> Tarball<'a> { - self.builder.cp_r(src.as_ref(), &dest); - } - -+ pub(crate) fn add_bulk_dir(&mut self, src: impl AsRef<Path>, dest: impl AsRef<Path>) { -+ self.bulk_dirs.push(dest.as_ref().to_path_buf()); -+ self.add_dir(src, dest); -+ } -+ - pub(crate) fn generate(self) -> GeneratedTarball { - let mut component_name = self.component.clone(); - if self.is_preview { -@@ -221,6 +228,16 @@ impl<'a> Tarball<'a> { - .arg("--image-dir") - .arg(&this.image_dir) - .arg(format!("--component-name={}", &component_name)); -+ -+ if let Some((dir, dirs)) = this.bulk_dirs.split_first() { -+ let mut arg = dir.as_os_str().to_os_string(); -+ for dir in dirs { -+ arg.push(","); -+ arg.push(dir); -+ } -+ cmd.arg("--bulk-dirs").arg(&arg); -+ } -+ - this.non_bare_args(cmd); - }) - } diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr81728.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr81728.patch deleted file mode 100644 index 20373f4..0000000 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr81728.patch +++ /dev/null @@ -1,181 +0,0 @@ -From 70f17ca715d3d7e2fd79cc909b95fd3a6357c13e Mon Sep 17 00:00:00 2001 -From: Yechan Bae <yec...@gatech.edu> -Date: Wed, 3 Feb 2021 16:36:33 -0500 -Subject: [PATCH 1/2] Fixes #80335 - ---- - library/alloc/src/str.rs | 42 ++++++++++++++++++++++---------------- - library/alloc/tests/str.rs | 30 +++++++++++++++++++++++++++ - 2 files changed, 54 insertions(+), 18 deletions(-) - -diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs -index 70e0c7dba5ea..a7584c6b6510 100644 ---- a/library/alloc/src/str.rs -+++ b/library/alloc/src/str.rs -@@ -90,8 +90,8 @@ fn join(slice: &Self, sep: &str) -> String { - } - } - --macro_rules! spezialize_for_lengths { -- ($separator:expr, $target:expr, $iter:expr; $($num:expr),*) => { -+macro_rules! specialize_for_lengths { -+ ($separator:expr, $target:expr, $iter:expr; $($num:expr),*) => {{ - let mut target = $target; - let iter = $iter; - let sep_bytes = $separator; -@@ -102,7 +102,8 @@ macro_rules! spezialize_for_lengths { - $num => { - for s in iter { - copy_slice_and_advance!(target, sep_bytes); -- copy_slice_and_advance!(target, s.borrow().as_ref()); -+ let content_bytes = s.borrow().as_ref(); -+ copy_slice_and_advance!(target, content_bytes); - } - }, - )* -@@ -110,11 +111,13 @@ macro_rules! spezialize_for_lengths { - // arbitrary non-zero size fallback - for s in iter { - copy_slice_and_advance!(target, sep_bytes); -- copy_slice_and_advance!(target, s.borrow().as_ref()); -+ let content_bytes = s.borrow().as_ref(); -+ copy_slice_and_advance!(target, content_bytes); - } - } - } -- }; -+ target -+ }} - } - - macro_rules! copy_slice_and_advance { -@@ -153,7 +156,7 @@ fn join_generic_copy<B, T, S>(slice: &[S], sep: &[T]) -> Vec<T> - // if the `len` calculation overflows, we'll panic - // we would have run out of memory anyway and the rest of the function requires - // the entire Vec pre-allocated for safety -- let len = sep_len -+ let reserved_len = sep_len - .checked_mul(iter.len()) - .and_then(|n| { - slice.iter().map(|s| s.borrow().as_ref().len()).try_fold(n, usize::checked_add) -@@ -161,22 +164,25 @@ fn join_generic_copy<B, T, S>(slice: &[S], sep: &[T]) -> Vec<T> - .expect("attempt to join into collection with len > usize::MAX"); - - // crucial for safety -- let mut result = Vec::with_capacity(len); -- assert!(result.capacity() >= len); -+ let mut result = Vec::with_capacity(reserved_len); -+ debug_assert!(result.capacity() >= reserved_len); - - result.extend_from_slice(first.borrow().as_ref()); - - unsafe { -- { -- let pos = result.len(); -- let target = result.get_unchecked_mut(pos..len); -- -- // copy separator and slices over without bounds checks -- // generate loops with hardcoded offsets for small separators -- // massive improvements possible (~ x2) -- spezialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); -- } -- result.set_len(len); -+ let pos = result.len(); -+ let target = result.get_unchecked_mut(pos..reserved_len); -+ -+ // copy separator and slices over without bounds checks -+ // generate loops with hardcoded offsets for small separators -+ // massive improvements possible (~ x2) -+ let remain = specialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); -+ -+ // issue #80335: A weird borrow implementation can return different -+ // slices for the length calculation and the actual copy, so -+ // `remain.len()` might be non-zero. -+ let result_len = reserved_len - remain.len(); -+ result.set_len(result_len); - } - result - } -diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs -index 604835e6cc4a..6df8d8c2f354 100644 ---- a/library/alloc/tests/str.rs -+++ b/library/alloc/tests/str.rs -@@ -160,6 +160,36 @@ fn test_join_for_different_lengths_with_long_separator() { - test_join!("~~~~~a~~~~~bc", ["", "a", "bc"], "~~~~~"); - } - -+#[test] -+fn test_join_isue_80335() { -+ use core::{borrow::Borrow, cell::Cell}; -+ -+ struct WeirdBorrow { -+ state: Cell<bool>, -+ } -+ -+ impl Default for WeirdBorrow { -+ fn default() -> Self { -+ WeirdBorrow { state: Cell::new(false) } -+ } -+ } -+ -+ impl Borrow<str> for WeirdBorrow { -+ fn borrow(&self) -> &str { -+ let state = self.state.get(); -+ if state { -+ "0" -+ } else { -+ self.state.set(true); -+ "123456" -+ } -+ } -+ } -+ -+ let arr: [WeirdBorrow; 3] = Default::default(); -+ test_join!("0-0-0", arr, "-"); -+} -+ - #[test] - #[cfg_attr(miri, ignore)] // Miri is too slow - fn test_unsafe_slice() { --- -2.31.1 - - -From 10020817d2e6756be1ff2ac3c182af97cf7fe904 Mon Sep 17 00:00:00 2001 -From: Yechan Bae <yec...@gatech.edu> -Date: Sat, 20 Mar 2021 13:42:54 -0400 -Subject: [PATCH 2/2] Update the comment - ---- - library/alloc/src/str.rs | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs -index a7584c6b6510..4d1e876457b8 100644 ---- a/library/alloc/src/str.rs -+++ b/library/alloc/src/str.rs -@@ -163,7 +163,7 @@ fn join_generic_copy<B, T, S>(slice: &[S], sep: &[T]) -> Vec<T> - }) - .expect("attempt to join into collection with len > usize::MAX"); - -- // crucial for safety -+ // prepare an uninitialized buffer - let mut result = Vec::with_capacity(reserved_len); - debug_assert!(result.capacity() >= reserved_len); - -@@ -178,9 +178,9 @@ fn join_generic_copy<B, T, S>(slice: &[S], sep: &[T]) -> Vec<T> - // massive improvements possible (~ x2) - let remain = specialize_for_lengths!(sep, target, iter; 0, 1, 2, 3, 4); - -- // issue #80335: A weird borrow implementation can return different -- // slices for the length calculation and the actual copy, so -- // `remain.len()` might be non-zero. -+ // A weird borrow implementation may return different -+ // slices for the length calculation and the actual copy. -+ // Make sure we don't expose uninitialized bytes to the caller. - let result_len = reserved_len - remain.len(); - result.set_len(result_len); - } --- -2.31.1 - diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr81741.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr81741.patch deleted file mode 100644 index 8ef22ee..0000000 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr81741.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 40d3f2d7ef5835317fe9df9ecc01f4c363def4fd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebast...@centricular.com> -Date: Thu, 4 Feb 2021 10:23:01 +0200 -Subject: [PATCH] Increment `self.index` before calling - `Iterator::self.a.__iterator_get_unchecked` in `Zip` `TrustedRandomAccess` - specialization - -Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the -index would not have been incremented yet and another call to -`Iterator::next` would read from the same index again, which is not -allowed according to the API contract of `TrustedRandomAccess` for -`!Clone`. - -Fixes https://github.com/rust-lang/rust/issues/81740 - -(cherry picked from commit 86a4b27475aab52b998c15f5758540697cc9cff0) ---- - library/core/src/iter/adapters/zip.rs | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs -index 98b8dca96140..9f9835345200 100644 ---- a/library/core/src/iter/adapters/zip.rs -+++ b/library/core/src/iter/adapters/zip.rs -@@ -198,12 +198,13 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { - Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i))) - } - } else if A::may_have_side_effect() && self.index < self.a.size() { -+ let i = self.index; -+ self.index += 1; - // match the base implementation's potential side effects -- // SAFETY: we just checked that `self.index` < `self.a.len()` -+ // SAFETY: we just checked that `i` < `self.a.len()` - unsafe { -- self.a.__iterator_get_unchecked(self.index); -+ self.a.__iterator_get_unchecked(i); - } -- self.index += 1; - None - } else { - None --- -2.31.1 - diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr82289.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr82289.patch deleted file mode 100644 index 5cf5433..0000000 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr82289.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 5222e2ba2d97cd716a379b4ae6bc62c5f7c2dd36 Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato <giaco.stevan...@gmail.com> -Date: Fri, 19 Feb 2021 12:15:37 +0100 -Subject: [PATCH 1/3] Increment self.len in specialized ZipImpl to avoid - underflow in size_hint - -(cherry picked from commit 66a260617a88ed1ad55a46f03c5a90d5ad3004d3) ---- - library/core/src/iter/adapters/zip.rs | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs -index 9f9835345200..f08bfac837fe 100644 ---- a/library/core/src/iter/adapters/zip.rs -+++ b/library/core/src/iter/adapters/zip.rs -@@ -200,6 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { - } else if A::may_have_side_effect() && self.index < self.a.size() { - let i = self.index; - self.index += 1; -+ self.len += 1; - // match the base implementation's potential side effects - // SAFETY: we just checked that `i` < `self.a.len()` - unsafe { --- -2.31.1 - - -From d39669fc8282830a374d19d204f7b4ee8eb1e381 Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato <giaco.stevan...@gmail.com> -Date: Fri, 19 Feb 2021 12:16:12 +0100 -Subject: [PATCH 2/3] Add test for underflow in specialized Zip's size_hint - -(cherry picked from commit 8b9ac4d4155c74db5b317046033ab9c05a09e351) ---- - library/core/tests/iter/adapters/zip.rs | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs -index 1fce0951e365..a59771039295 100644 ---- a/library/core/tests/iter/adapters/zip.rs -+++ b/library/core/tests/iter/adapters/zip.rs -@@ -245,3 +245,23 @@ fn test_double_ended_zip() { - assert_eq!(it.next_back(), Some((3, 3))); - assert_eq!(it.next(), None); - } -+ -+#[test] -+fn test_issue_82282() { -+ fn overflowed_zip(arr: &[i32]) -> impl Iterator<Item = (i32, &())> { -+ static UNIT_EMPTY_ARR: [(); 0] = []; -+ -+ let mapped = arr.into_iter().map(|i| *i); -+ let mut zipped = mapped.zip(UNIT_EMPTY_ARR.iter()); -+ zipped.next(); -+ zipped -+ } -+ -+ let arr = [1, 2, 3]; -+ let zip = overflowed_zip(&arr).zip(overflowed_zip(&arr)); -+ -+ assert_eq!(zip.size_hint(), (0, Some(0))); -+ for _ in zip { -+ panic!(); -+ } -+} --- -2.31.1 - - -From 4b382167dd5ed5a6eac0cf314bfb86e3704b6e76 Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato <giaco.stevan...@gmail.com> -Date: Fri, 19 Feb 2021 12:17:48 +0100 -Subject: [PATCH 3/3] Remove useless comparison since now self.index <= - self.len is an invariant - -(cherry picked from commit aeb4ea739efb70e0002a4a9c4c7b8027dd0620b3) ---- - library/core/src/iter/adapters/zip.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs -index f08bfac837fe..dcbcb1ce7200 100644 ---- a/library/core/src/iter/adapters/zip.rs -+++ b/library/core/src/iter/adapters/zip.rs -@@ -261,7 +261,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> - if sz_a != sz_b { - let sz_a = self.a.size(); - if a_side_effect && sz_a > self.len { -- for _ in 0..sz_a - cmp::max(self.len, self.index) { -+ for _ in 0..sz_a - self.len { - self.a.next_back(); - } - } --- -2.31.1 - diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr82292.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr82292.patch deleted file mode 100644 index 4baf72a..0000000 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr82292.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 0babb88efc4d36f3defafc3c3c0343793fa05d52 Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato <giaco.stevan...@gmail.com> -Date: Wed, 3 Mar 2021 21:09:01 +0100 -Subject: [PATCH 1/2] Prevent Zip specialization from calling - __iterator_get_unchecked twice with the same index after calling next_back - -(cherry picked from commit 2371914a05f8f2763dffe6e2511d0870bcd6b461) ---- - library/core/src/iter/adapters/zip.rs | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/library/core/src/iter/adapters/zip.rs b/library/core/src/iter/adapters/zip.rs -index dcbcb1ce7200..7dac0c63ca2d 100644 ---- a/library/core/src/iter/adapters/zip.rs -+++ b/library/core/src/iter/adapters/zip.rs -@@ -13,9 +13,10 @@ - pub struct Zip<A, B> { - a: A, - b: B, -- // index and len are only used by the specialized version of zip -+ // index, len and a_len are only used by the specialized version of zip - index: usize, - len: usize, -+ a_len: usize, - } - impl<A: Iterator, B: Iterator> Zip<A, B> { - pub(in crate::iter) fn new(a: A, b: B) -> Zip<A, B> { -@@ -110,6 +111,7 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B> - b, - index: 0, // unused - len: 0, // unused -+ a_len: 0, // unused - } - } - -@@ -184,8 +186,9 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B> - B: TrustedRandomAccess + Iterator, - { - fn new(a: A, b: B) -> Self { -- let len = cmp::min(a.size(), b.size()); -- Zip { a, b, index: 0, len } -+ let a_len = a.size(); -+ let len = cmp::min(a_len, b.size()); -+ Zip { a, b, index: 0, len, a_len } - } - - #[inline] -@@ -197,7 +200,7 @@ fn next(&mut self) -> Option<(A::Item, B::Item)> { - unsafe { - Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i))) - } -- } else if A::may_have_side_effect() && self.index < self.a.size() { -+ } else if A::may_have_side_effect() && self.index < self.a_len { - let i = self.index; - self.index += 1; - self.len += 1; -@@ -264,6 +267,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> - for _ in 0..sz_a - self.len { - self.a.next_back(); - } -+ self.a_len = self.len; - } - let sz_b = self.b.size(); - if b_side_effect && sz_b > self.len { -@@ -275,6 +279,7 @@ fn next_back(&mut self) -> Option<(A::Item, B::Item)> - } - if self.index < self.len { - self.len -= 1; -+ self.a_len -= 1; - let i = self.len; - // SAFETY: `i` is smaller than the previous value of `self.len`, - // which is also smaller than or equal to `self.a.len()` and `self.b.len()` --- -2.31.1 - - -From 19af66a6f3e2bbb4780bb9eae7eb53bd13e3dd0f Mon Sep 17 00:00:00 2001 -From: Giacomo Stevanato <giaco.stevan...@gmail.com> -Date: Fri, 19 Feb 2021 15:25:09 +0100 -Subject: [PATCH 2/2] Add relevant test - -(cherry picked from commit c1bfb9a78db6d481be1d03355672712c766e20b0) ---- - library/core/tests/iter/adapters/zip.rs | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/library/core/tests/iter/adapters/zip.rs b/library/core/tests/iter/adapters/zip.rs -index a59771039295..000c15f72c88 100644 ---- a/library/core/tests/iter/adapters/zip.rs -+++ b/library/core/tests/iter/adapters/zip.rs -@@ -265,3 +265,26 @@ fn overflowed_zip(arr: &[i32]) -> impl Iterator<Item = (i32, &())> { - panic!(); - } - } -+ -+#[test] -+fn test_issue_82291() { -+ use std::cell::Cell; -+ -+ let mut v1 = [()]; -+ let v2 = [()]; -+ -+ let called = Cell::new(0); -+ -+ let mut zip = v1 -+ .iter_mut() -+ .map(|r| { -+ called.set(called.get() + 1); -+ r -+ }) -+ .zip(&v2); -+ -+ zip.next_back(); -+ assert_eq!(called.get(), 1); -+ zip.next(); -+ assert_eq!(called.get(), 1); -+} --- -2.31.1 - diff --git a/dev-lang/rust/files/rustc-1.51.0-backport-pr83629.patch b/dev-lang/rust/files/rustc-1.51.0-backport-pr83629.patch deleted file mode 100644 index 7f68d95..0000000 --- a/dev-lang/rust/files/rustc-1.51.0-backport-pr83629.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 3834e7b7393bf1a0d7df02ccd1d2e896c1465769 Mon Sep 17 00:00:00 2001 -From: The8472 <g...@infinite-source.de> -Date: Mon, 29 Mar 2021 04:22:34 +0200 -Subject: [PATCH 1/2] add testcase for double-drop during Vec in-place - collection - ---- - library/alloc/tests/vec.rs | 38 +++++++++++++++++++++++++++++++++++++- - 1 file changed, 37 insertions(+), 1 deletion(-) - -diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs -index 5c7ff67bc621..4cdb7eefcdf1 100644 ---- a/library/alloc/tests/vec.rs -+++ b/library/alloc/tests/vec.rs -@@ -954,7 +954,7 @@ fn test_from_iter_specialization_head_tail_drop() { - } - - #[test] --fn test_from_iter_specialization_panic_drop() { -+fn test_from_iter_specialization_panic_during_iteration_drops() { - let drop_count: Vec<_> = (0..=2).map(|_| Rc::new(())).collect(); - let src: Vec<_> = drop_count.iter().cloned().collect(); - let iter = src.into_iter(); -@@ -977,6 +977,42 @@ fn test_from_iter_specialization_panic_drop() { - ); - } - -+#[test] -+fn test_from_iter_specialization_panic_during_drop_leaks() { -+ static mut DROP_COUNTER: usize = 0; -+ -+ #[derive(Debug)] -+ enum Droppable { -+ DroppedTwice(Box<i32>), -+ PanicOnDrop, -+ } -+ -+ impl Drop for Droppable { -+ fn drop(&mut self) { -+ match self { -+ Droppable::DroppedTwice(_) => { -+ unsafe { -+ DROP_COUNTER += 1; -+ } -+ println!("Dropping!") -+ } -+ Droppable::PanicOnDrop => { -+ if !std::thread::panicking() { -+ panic!(); -+ } -+ } -+ } -+ } -+ } -+ -+ let _ = std::panic::catch_unwind(AssertUnwindSafe(|| { -+ let v = vec![Droppable::DroppedTwice(Box::new(123)), Droppable::PanicOnDrop]; -+ let _ = v.into_iter().take(0).collect::<Vec<_>>(); -+ })); -+ -+ assert_eq!(unsafe { DROP_COUNTER }, 1); -+} -+ - #[test] - fn test_cow_from() { - let borrowed: &[_] = &["borrowed", "(slice)"]; --- -2.31.1 - - -From 8e2706343e1ce1c5a2d3a2ceaaaa010aaeb21d93 Mon Sep 17 00:00:00 2001 -From: The8472 <g...@infinite-source.de> -Date: Mon, 29 Mar 2021 04:22:48 +0200 -Subject: [PATCH 2/2] fix double-drop in in-place collect specialization - ---- - library/alloc/src/vec/into_iter.rs | 27 ++++++++++++++------- - library/alloc/src/vec/source_iter_marker.rs | 4 +-- - 2 files changed, 20 insertions(+), 11 deletions(-) - -diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs -index f131d06bb18f..74adced53f6d 100644 ---- a/library/alloc/src/vec/into_iter.rs -+++ b/library/alloc/src/vec/into_iter.rs -@@ -85,20 +85,29 @@ fn as_raw_mut_slice(&mut self) -> *mut [T] { - ptr::slice_from_raw_parts_mut(self.ptr as *mut T, self.len()) - } - -- pub(super) fn drop_remaining(&mut self) { -- unsafe { -- ptr::drop_in_place(self.as_mut_slice()); -- } -- self.ptr = self.end; -- } -+ /// Drops remaining elements and relinquishes the backing allocation. -+ /// -+ /// This is roughly equivalent to the following, but more efficient -+ /// -+ /// ``` -+ /// # let mut into_iter = Vec::<u8>::with_capacity(10).into_iter(); -+ /// (&mut into_iter).for_each(core::mem::drop); -+ /// unsafe { core::ptr::write(&mut into_iter, Vec::new().into_iter()); } -+ /// ``` -+ pub(super) fn forget_allocation_drop_remaining(&mut self) { -+ let remaining = self.as_raw_mut_slice(); - -- /// Relinquishes the backing allocation, equivalent to -- /// `ptr::write(&mut self, Vec::new().into_iter())` -- pub(super) fn forget_allocation(&mut self) { -+ // overwrite the individual fields instead of creating a new -+ // struct and then overwriting &mut self. -+ // this creates less assembly - self.cap = 0; - self.buf = unsafe { NonNull::new_unchecked(RawVec::NEW.ptr()) }; - self.ptr = self.buf.as_ptr(); - self.end = self.buf.as_ptr(); -+ -+ unsafe { -+ ptr::drop_in_place(remaining); -+ } - } - } - -diff --git a/library/alloc/src/vec/source_iter_marker.rs b/library/alloc/src/vec/source_iter_marker.rs -index 8c0e95559fa1..9301f7a5184e 100644 ---- a/library/alloc/src/vec/source_iter_marker.rs -+++ b/library/alloc/src/vec/source_iter_marker.rs -@@ -78,9 +78,9 @@ impl<T, I> SpecFromIter<T, I> for Vec<T> - } - - // drop any remaining values at the tail of the source -- src.drop_remaining(); - // but prevent drop of the allocation itself once IntoIter goes out of scope -- src.forget_allocation(); -+ // if the drop panics then we also leak any elements collected into dst_buf -+ src.forget_allocation_drop_remaining(); - - let vec = unsafe { - let len = dst.offset_from(dst_buf) as usize; --- -2.31.1 - diff --git a/dev-lang/rust/rust-1.52.1.ebuild b/dev-lang/rust/rust-1.52.1.ebuild deleted file mode 100644 index f1b3385..0000000 --- a/dev-lang/rust/rust-1.52.1.ebuild +++ /dev/null @@ -1,677 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..9} ) - -inherit bash-completion-r1 check-reqs estack flag-o-matic llvm multiprocessing \ - multilib-build python-any-r1 rust-toolchain toolchain-funcs verify-sig - -if [[ ${PV} = *beta* ]]; then - betaver=${PV//*beta} - BETA_SNAPSHOT="${betaver:0:4}-${betaver:4:2}-${betaver:6:2}" - MY_P="rustc-beta" - SLOT="beta/${PV}" - SRC="${BETA_SNAPSHOT}/rustc-beta-src.tar.xz -> rustc-${PV}-src.tar.xz" -else - ABI_VER="$(ver_cut 1-2)" - SLOT="stable/${ABI_VER}" - MY_P="rustc-${PV}" - SRC="${MY_P}-src.tar.xz" - KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86" -fi - -RUST_STAGE0_VERSION="1.$(($(ver_cut 2) - 1)).0" - -DESCRIPTION="Systems programming language from Mozilla" -HOMEPAGE="https://www.rust-lang.org/" - -SRC_URI=" - https://static.rust-lang.org/dist/${SRC} - verify-sig? ( https://static.rust-lang.org/dist/${SRC}.asc ) - !system-bootstrap? ( $(rust_all_arch_uris rust-${RUST_STAGE0_VERSION}) ) -" - -# keep in sync with llvm ebuild of the same version as bundled one. -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430 - NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore ) -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) -LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?} - -LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA" - -IUSE="clippy cpu_flags_x86_sse2 debug doc miri nightly parallel-compiler rls rustfmt system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}" - -# Please keep the LLVM dependency block separate. Since LLVM is slotted, -# we need to *really* make sure we're not pulling more than one slot -# simultaneously. - -# How to use it: -# List all the working slots in LLVM_VALID_SLOTS, newest first. -LLVM_VALID_SLOTS=( 12 ) -LLVM_MAX_SLOT="${LLVM_VALID_SLOTS[0]}" - -# splitting usedeps needed to avoid CI/pkgcheck's UncheckableDep limitation -# (-) usedep needed because we may build with older llvm without that target -LLVM_DEPEND="|| ( " -for _s in ${LLVM_VALID_SLOTS[@]}; do - LLVM_DEPEND+=" ( " - for _x in ${ALL_LLVM_TARGETS[@]}; do - LLVM_DEPEND+=" - ${_x}? ( sys-devel/llvm:${_s}[${_x}(-)] )" - done - LLVM_DEPEND+=" )" -done -unset _s _x -LLVM_DEPEND+=" ) - <sys-devel/llvm-$(( LLVM_MAX_SLOT + 1 )):= - wasm? ( sys-devel/lld ) -" - -# to bootstrap we need at least exactly previous version, or same. -# most of the time previous versions fail to bootstrap with newer -# for example 1.47.x, requires at least 1.46.x, 1.47.x is ok, -# but it fails to bootstrap with 1.48.x -# https://github.com/rust-lang/rust/blob/${PV}/src/stage0.txt -BOOTSTRAP_DEPEND="|| - ( - =dev-lang/rust-$(ver_cut 1).$(($(ver_cut 2) - 1))* - =dev-lang/rust-bin-$(ver_cut 1).$(($(ver_cut 2) - 1))* - =dev-lang/rust-$(ver_cut 1).$(ver_cut 2)* - =dev-lang/rust-bin-$(ver_cut 1).$(ver_cut 2)* - ) -" - -BDEPEND="${PYTHON_DEPS} - app-eselect/eselect-rust - || ( - >=sys-devel/gcc-4.7 - >=sys-devel/clang-3.5 - ) - system-bootstrap? ( ${BOOTSTRAP_DEPEND} ) - !system-llvm? ( - >=dev-util/cmake-3.13.4 - dev-util/ninja - ) - test? ( sys-devel/gdb ) - verify-sig? ( app-crypt/openpgp-keys-rust ) -" - -DEPEND=" - >=app-arch/xz-utils-5.2 - net-misc/curl:=[http2,ssl] - sys-libs/zlib:= - dev-libs/openssl:0= - elibc_musl? ( sys-libs/libunwind:= ) - system-llvm? ( ${LLVM_DEPEND} ) -" - -# we need to block older versions due to layout changes. -RDEPEND="${DEPEND} - app-eselect/eselect-rust - !<dev-lang/rust-1.47.0-r1 - !<dev-lang/rust-bin-1.47.0-r1 -" - -REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} ) - miri? ( nightly ) - parallel-compiler? ( nightly ) - test? ( ${ALL_LLVM_TARGETS[*]} ) - wasm? ( llvm_targets_WebAssembly ) - x86? ( cpu_flags_x86_sse2 ) -" - -# we don't use cmake.eclass, but can get a warnings -CMAKE_WARN_UNUSED_CLI=no - -QA_FLAGS_IGNORED=" - usr/lib/${PN}/${PV}/bin/.* - usr/lib/${PN}/${PV}/libexec/.* - usr/lib/${PN}/${PV}/lib/lib.*.so - usr/lib/${PN}/${PV}/lib/rustlib/.*/bin/.* - usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so -" - -QA_SONAME=" - usr/lib/${PN}/${PV}/lib/lib.*.so.* - usr/lib/${PN}/${PV}/lib/rustlib/.*/lib/lib.*.so -" - -# An rmeta file is custom binary format that contains the metadata for the crate. -# rmeta files do not support linking, since they do not contain compiled object files. -# so we can safely silence the warning for this QA check. -QA_EXECSTACK="usr/lib/${PN}/${PV}/lib/rustlib/*/lib*.rlib:lib.rmeta" - -# causes double bootstrap -RESTRICT="test" - -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/rust.asc - -PATCHES=( - "${FILESDIR}"/1.47.0-libressl.patch - "${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch - "${FILESDIR}"/1.49.0-gentoo-musl-target-specs.patch - "${FILESDIR}"/1.51.0-slow-doc-install.patch -) - -S="${WORKDIR}/${MY_P}-src" - -toml_usex() { - usex "${1}" true false -} - -bootstrap_rust_version_check() { - # never call from pkg_pretend. eselect-rust may be not installed yet. - [[ ${MERGE_TYPE} == binary ]] && return - local rustc_wanted="$(ver_cut 1).$(($(ver_cut 2) - 1))" - local rustc_toonew="$(ver_cut 1).$(($(ver_cut 2) + 1))" - local rustc_version=( $(eselect --brief rust show 2>/dev/null) ) - rustc_version=${rustc_version[0]#rust-bin-} - rustc_version=${rustc_version#rust-} - - [[ -z "${rustc_version}" ]] && die "Failed to determine rust version, check 'eselect rust' output" - - if ver_test "${rustc_version}" -lt "${rustc_wanted}" ; then - eerror "Rust >=${rustc_wanted} is required" - eerror "please run 'eselect rust' and set correct rust version" - die "selected rust version is too old" - elif ver_test "${rustc_version}" -ge "${rustc_toonew}" ; then - eerror "Rust <${rustc_toonew} is required" - eerror "please run 'eselect rust' and set correct rust version" - die "selected rust version is too new" - else - einfo "Using rust ${rustc_version} to build" - fi -} - -pre_build_checks() { - local M=8192 - # multiply requirements by 1.5 if we are doing x86-multilib - if use amd64; then - M=$(( $(usex abi_x86_32 15 10) * ${M} / 10 )) - fi - M=$(( $(usex clippy 128 0) + ${M} )) - M=$(( $(usex miri 128 0) + ${M} )) - M=$(( $(usex rls 512 0) + ${M} )) - M=$(( $(usex rustfmt 256 0) + ${M} )) - # add 2G if we compile llvm and 256M per llvm_target - if ! use system-llvm; then - M=$(( 2048 + ${M} )) - local ltarget - for ltarget in ${ALL_LLVM_TARGETS[@]}; do - M=$(( $(usex ${ltarget} 256 0) + ${M} )) - done - fi - M=$(( $(usex wasm 256 0) + ${M} )) - M=$(( $(usex debug 2 1) * ${M} )) - eshopts_push -s extglob - if is-flagq '-g?(gdb)?([1-9])'; then - M=$(( 15 * ${M} / 10 )) - fi - eshopts_pop - M=$(( $(usex system-bootstrap 0 1024) + ${M} )) - M=$(( $(usex doc 256 0) + ${M} )) - CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} -} - -llvm_check_deps() { - has_version -r "sys-devel/llvm:${LLVM_SLOT}[${LLVM_TARGET_USEDEPS// /,}]" -} - -pkg_pretend() { - pre_build_checks -} - -pkg_setup() { - pre_build_checks - python-any-r1_pkg_setup - - export LIBGIT2_NO_PKG_CONFIG=1 #749381 - - use system-bootstrap && bootstrap_rust_version_check - - if use system-llvm; then - llvm_pkg_setup - - local llvm_config="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" - export LLVM_LINK_SHARED=1 - export RUSTFLAGS="${RUSTFLAGS} -Lnative=$("${llvm_config}" --libdir)" - fi -} - -src_prepare() { - if ! use system-bootstrap; then - local rust_stage0_root="${WORKDIR}"/rust-stage0 - local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)" - - "${WORKDIR}/${rust_stage0}"/install.sh --disable-ldconfig \ - --without=rust-docs --destdir="${rust_stage0_root}" --prefix=/ || die - fi - - default -} - -src_configure() { - local rust_target="" rust_targets="" arch_cflags - - # Collect rust target names to compile standard libs for all ABIs. - for v in $(multilib_get_enabled_abi_pairs); do - rust_targets="${rust_targets},\"$(rust_abi $(get_abi_CHOST ${v##*.}))\"" - done - if use wasm; then - rust_targets="${rust_targets},\"wasm32-unknown-unknown\"" - if use system-llvm; then - # un-hardcode rust-lld linker for this target - # https://bugs.gentoo.org/715348 - sed -i '/linker:/ s/rust-lld/wasm-ld/' compiler/rustc_target/src/spec/wasm32_base.rs || die - fi - fi - rust_targets="${rust_targets#,}" - - local tools="\"cargo\"," - if use clippy; then - tools="\"clippy\",$tools" - fi - if use miri; then - tools="\"miri\",$tools" - fi - if use rls; then - tools="\"rls\",\"analysis\",\"src\",$tools" - fi - if use rustfmt; then - tools="\"rustfmt\",$tools" - fi - - local rust_stage0_root - if use system-bootstrap; then - local printsysroot - printsysroot="$(rustc --print sysroot || die "Can't determine rust's sysroot")" - rust_stage0_root="${printsysroot}" - else - rust_stage0_root="${WORKDIR}"/rust-stage0 - fi - # in case of prefix it will be already prefixed, as --print sysroot returns full path - [[ -d ${rust_stage0_root} ]] || die "${rust_stage0_root} is not a directory" - - rust_target="$(rust_abi)" - - cat <<- _EOF_ > "${S}"/config.toml - [llvm] - download-ci-llvm = false - optimize = $(toml_usex !debug) - release-debuginfo = $(toml_usex debug) - assertions = $(toml_usex debug) - ninja = true - targets = "${LLVM_TARGETS// /;}" - experimental-targets = "" - link-shared = $(toml_usex system-llvm) - [build] - build = "${rust_target}" - host = ["${rust_target}"] - target = [${rust_targets}] - cargo = "${rust_stage0_root}/bin/cargo" - rustc = "${rust_stage0_root}/bin/rustc" - rustfmt = "${rust_stage0_root}/bin/rustfmt" - docs = $(toml_usex doc) - compiler-docs = false - submodules = false - python = "${EPYTHON}" - locked-deps = true - vendor = true - extended = true - tools = [${tools}] - verbose = 2 - sanitizers = false - profiler = false - cargo-native-static = false - [install] - prefix = "${EPREFIX}/usr/lib/${PN}/${PV}" - sysconfdir = "etc" - docdir = "share/doc/rust" - bindir = "bin" - libdir = "lib" - mandir = "share/man" - [rust] - # https://github.com/rust-lang/rust/issues/54872 - codegen-units-std = 1 - optimize = true - debug = $(toml_usex debug) - debug-assertions = $(toml_usex debug) - debug-assertions-std = $(toml_usex debug) - debuginfo-level = $(usex debug 2 0) - debuginfo-level-rustc = $(usex debug 2 0) - debuginfo-level-std = $(usex debug 2 0) - debuginfo-level-tools = $(usex debug 2 0) - debuginfo-level-tests = 0 - backtrace = true - incremental = false - default-linker = "$(tc-getCC)" - parallel-compiler = $(toml_usex parallel-compiler) - channel = "$(usex nightly nightly stable)" - description = "gentoo" - rpath = false - verbose-tests = true - optimize-tests = $(toml_usex !debug) - codegen-tests = true - dist-src = false - remap-debuginfo = true - lld = $(usex system-llvm false $(toml_usex wasm)) - # only deny warnings if doc+wasm are NOT requested, documenting stage0 wasm std fails without it - # https://github.com/rust-lang/rust/issues/74976 - # https://github.com/rust-lang/rust/issues/76526 - deny-warnings = $(usex wasm $(usex doc false true) true) - backtrace-on-ice = true - jemalloc = false - [dist] - src-tarball = false - compression-formats = ["gz"] - _EOF_ - - for v in $(multilib_get_enabled_abi_pairs); do - rust_target=$(rust_abi $(get_abi_CHOST ${v##*.})) - arch_cflags="$(get_abi_CFLAGS ${v##*.})" - - cat <<- _EOF_ >> "${S}"/config.env - CFLAGS_${rust_target}=${arch_cflags} - _EOF_ - - cat <<- _EOF_ >> "${S}"/config.toml - [target.${rust_target}] - cc = "$(tc-getBUILD_CC)" - cxx = "$(tc-getBUILD_CXX)" - linker = "$(tc-getCC)" - ar = "$(tc-getAR)" - _EOF_ - # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true; - if use elibc_musl; then - cat <<- _EOF_ >> "${S}"/config.toml - crt-static = false - _EOF_ - fi - if use system-llvm; then - cat <<- _EOF_ >> "${S}"/config.toml - llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" - _EOF_ - fi - done - if use wasm; then - cat <<- _EOF_ >> "${S}"/config.toml - [target.wasm32-unknown-unknown] - linker = "$(usex system-llvm lld rust-lld)" - _EOF_ - fi - - if [[ -n ${I_KNOW_WHAT_I_AM_DOING_CROSS} ]]; then # whitespace intentionally shifted below - # experimental cross support - # discussion: https://bugs.gentoo.org/679878 - # TODO: c*flags, clang, system-llvm, cargo.eclass target support - # it would be much better if we could split out stdlib - # complilation to separate ebuild and abuse CATEGORY to - # just install to /usr/lib/rustlib/<target> - - # extra targets defined as a bash array - # spec format: <LLVM target>:<rust-target>:<CTARGET> - # best place would be /etc/portage/env/dev-lang/rust - # Example: - # RUST_CROSS_TARGETS=( - # "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu" - # ) - # no extra hand holding is done, no target transformations, all - # values are passed as-is with just basic checks, so it's up to user to supply correct values - # valid rust targets can be obtained with - # rustc --print target-list - # matching cross toolchain has to be installed - # matching LLVM_TARGET has to be enabled for both rust and llvm (if using system one) - # only gcc toolchains installed with crossdev are checked for now. - - # BUG: we can't pass host flags to cross compiler, so just filter for now - # BUG: this should be more fine-grained. - filter-flags '-mcpu=*' '-march=*' '-mtune=*' - - local cross_target_spec - for cross_target_spec in "${RUST_CROSS_TARGETS[@]}";do - # extracts first element form <LLVM target>:<rust-target>:<CTARGET> - local cross_llvm_target="${cross_target_spec%%:*}" - # extracts toolchain triples, <rust-target>:<CTARGET> - local cross_triples="${cross_target_spec#*:}" - # extracts first element after before : separator - local cross_rust_target="${cross_triples%%:*}" - # extracts last element after : separator - local cross_toolchain="${cross_triples##*:}" - use llvm_targets_${cross_llvm_target} || die "need llvm_targets_${cross_llvm_target} target enabled" - command -v ${cross_toolchain}-gcc > /dev/null 2>&1 || die "need ${cross_toolchain} cross toolchain" - - cat <<- _EOF_ >> "${S}"/config.toml - [target.${cross_rust_target}] - cc = "${cross_toolchain}-gcc" - cxx = "${cross_toolchain}-g++" - linker = "${cross_toolchain}-gcc" - ar = "${cross_toolchain}-ar" - _EOF_ - if use system-llvm; then - cat <<- _EOF_ >> "${S}"/config.toml - llvm-config = "$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" - _EOF_ - fi - if [[ "${cross_toolchain}" == *-musl* ]]; then - cat <<- _EOF_ >> "${S}"/config.toml - musl-root = "$(${cross_toolchain}-gcc -print-sysroot)/usr" - _EOF_ - fi - - # append cross target to "normal" target list - # example 'target = ["powerpc64le-unknown-linux-gnu"]' - # becomes 'target = ["powerpc64le-unknown-linux-gnu","aarch64-unknown-linux-gnu"]' - - rust_targets="${rust_targets},\"${cross_rust_target}\"" - sed -i "/^target = \[/ s#\[.*\]#\[${rust_targets}\]#" config.toml || die - - ewarn - ewarn "Enabled ${cross_rust_target} rust target" - ewarn "Using ${cross_toolchain} cross toolchain" - ewarn - if ! has_version -b 'sys-devel/binutils[multitarget]' ; then - ewarn "'sys-devel/binutils[multitarget]' is not installed" - ewarn "'strip' will be unable to strip cross libraries" - ewarn "cross targets will be installed with full debug information" - ewarn "enable 'multitarget' USE flag for binutils to be able to strip object files" - ewarn - ewarn "Alternatively llvm-strip can be used, it supports stripping any target" - ewarn "define STRIP=\"llvm-strip\" to use it (experimental)" - ewarn - fi - done - fi # I_KNOW_WHAT_I_AM_DOING_CROSS - - einfo "Rust configured with the following flags:" - echo - echo "RUSTFLAGS=\"${RUSTFLAGS:-}\"" - echo "RUSTFLAGS_BOOTSTRAP=\"${RUSTFLAGS_BOOTSTRAP:-}\"" - echo "RUSTFLAGS_NOT_BOOTSTRAP=\"${RUSTFLAGS_NOT_BOOTSTRAP:-}\"" - cat "${S}"/config.env || die - echo - einfo "config.toml contents:" - cat "${S}"/config.toml || die - echo -} - -src_compile() { - # we need \n IFS to have config.env with spaces loaded properly. #734018 - ( - IFS=$'\n' - env $(cat "${S}"/config.env) RUST_BACKTRACE=1\ - "${EPYTHON}" ./x.py dist -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die - ) -} - -src_test() { - # https://rustc-dev-guide.rust-lang.org/tests/intro.html - - # those are basic and codegen tests. - local tests=( - codegen - codegen-units - compile-fail - incremental - mir-opt - pretty - run-make - ) - - # fails if llvm is not built with ALL targets. - # and known to fail with system llvm sometimes. - use system-llvm || tests+=( assembly ) - - # fragile/expensive/less important tests - # or tests that require extra builds - # TODO: instead of skipping, just make some nonfatal. - if [[ ${ERUST_RUN_EXTRA_TESTS:-no} != no ]]; then - tests+=( - rustdoc - rustdoc-js - rustdoc-js-std - rustdoc-ui - run-make-fulldeps - ui - ui-fulldeps - ) - fi - - local i failed=() - einfo "rust_src_test: enabled tests ${tests[@]/#/src/test/}" - for i in "${tests[@]}"; do - local t="src/test/${i}" - einfo "rust_src_test: running ${t}" - if ! ( - IFS=$'\n' - env $(cat "${S}"/config.env) RUST_BACKTRACE=1 \ - "${EPYTHON}" ./x.py test -vv --config="${S}"/config.toml \ - -j$(makeopts_jobs) --no-doc --no-fail-fast "${t}" - ) - then - failed+=( "${t}" ) - eerror "rust_src_test: ${t} failed" - fi - done - - if [[ ${#failed[@]} -ne 0 ]]; then - eerror "rust_src_test: failure summary: ${failed[@]}" - die "aborting due to test failures" - fi -} - -src_install() { - ( - IFS=$'\n' - env $(cat "${S}"/config.env) DESTDIR="${D}" \ - "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die - ) - - # bug #689562, #689160 - rm -v "${ED}/usr/lib/${PN}/${PV}/etc/bash_completion.d/cargo" || die - rmdir -v "${ED}/usr/lib/${PN}/${PV}"/etc{/bash_completion.d,} || die - newbashcomp src/tools/cargo/src/etc/cargo.bashcomp.sh cargo - - local symlinks=( - cargo - rustc - rustdoc - rust-gdb - rust-gdbgui - rust-lldb - ) - - use clippy && symlinks+=( clippy-driver cargo-clippy ) - use miri && symlinks+=( miri cargo-miri ) - use rls && symlinks+=( rls ) - use rustfmt && symlinks+=( rustfmt cargo-fmt ) - - einfo "installing eselect-rust symlinks and paths: ${symlinks[@]}" - local i - for i in "${symlinks[@]}"; do - # we need realpath on /usr/bin/* symlink return version-appended binary path. - # so /usr/bin/rustc should point to /usr/lib/rust/<ver>/bin/rustc-<ver> - # need to fix eselect-rust to remove this hack. - local ver_i="${i}-${PV}" - if [[ -f "${ED}/usr/lib/${PN}/${PV}/bin/${i}" ]]; then - einfo "Installing ${i} symlink" - ln -v "${ED}/usr/lib/${PN}/${PV}/bin/${i}" "${ED}/usr/lib/${PN}/${PV}/bin/${ver_i}" || die - else - ewarn "${i} symlink requested, but source file not found" - ewarn "please report this" - fi - dosym "../lib/${PN}/${PV}/bin/${ver_i}" "/usr/bin/${ver_i}" - done - - # symlinks to switch components to active rust in eselect - dosym "${PV}/lib" "/usr/lib/${PN}/lib-${PV}" - dosym "${PV}/libexec" "/usr/lib/${PN}/libexec-${PV}" - dosym "${PV}/share/man" "/usr/lib/${PN}/man-${PV}" - dosym "rust/${PV}/lib/rustlib" "/usr/lib/rustlib-${PV}" - dosym "../../lib/${PN}/${PV}/share/doc/rust" "/usr/share/doc/${P}" - - newenvd - "50${P}" <<-_EOF_ - LDPATH="${EPREFIX}/usr/lib/rust/lib" - MANPATH="${EPREFIX}/usr/lib/rust/man" - $(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '') - $(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '') - _EOF_ - - rm -rf "${ED}/usr/lib/${PN}/${PV}"/*.old || die - rm -rf "${ED}/usr/lib/${PN}/${PV}/doc"/*.old || die - - # note: eselect-rust adds EROOT to all paths below - cat <<-_EOF_ > "${T}/provider-${P}" - /usr/bin/cargo - /usr/bin/rustdoc - /usr/bin/rust-gdb - /usr/bin/rust-gdbgui - /usr/bin/rust-lldb - /usr/lib/rustlib - /usr/lib/rust/lib - /usr/lib/rust/libexec - /usr/lib/rust/man - /usr/share/doc/rust - _EOF_ - - if use clippy; then - echo /usr/bin/clippy-driver >> "${T}/provider-${P}" - echo /usr/bin/cargo-clippy >> "${T}/provider-${P}" - fi - if use miri; then - echo /usr/bin/miri >> "${T}/provider-${P}" - echo /usr/bin/cargo-miri >> "${T}/provider-${P}" - fi - if use rls; then - echo /usr/bin/rls >> "${T}/provider-${P}" - fi - if use rustfmt; then - echo /usr/bin/rustfmt >> "${T}/provider-${P}" - echo /usr/bin/cargo-fmt >> "${T}/provider-${P}" - fi - - insinto /etc/env.d/rust - doins "${T}/provider-${P}" -} - -pkg_postinst() { - eselect rust update - - if has_version sys-devel/gdb || has_version dev-util/lldb; then - elog "Rust installs a helper script for calling GDB and LLDB," - elog "for your convenience it is installed under /usr/bin/rust-{gdb,lldb}-${PV}." - fi - - if has_version app-editors/emacs; then - elog "install app-emacs/rust-mode to get emacs support for rust." - fi - - if has_version app-editors/gvim || has_version app-editors/vim; then - elog "install app-vim/rust-vim to get vim support for rust." - fi -} - -pkg_postrm() { - eselect rust cleanup -}