From nobody Mon Dec 12 21:20:29 2022 X-Original-To: ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NWF0N52bKz4jZ9g for ; Mon, 12 Dec 2022 21:20:36 +0000 (UTC) (envelope-from mirror176@hotmail.com) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04olkn2066.outbound.protection.outlook.com [40.92.46.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NWF0M5cr2z4L35 for ; Mon, 12 Dec 2022 21:20:35 +0000 (UTC) (envelope-from mirror176@hotmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hotmail.com header.s=selector1 header.b=QaAf7j+U; spf=pass (mx1.freebsd.org: domain of mirror176@hotmail.com designates 40.92.46.66 as permitted sender) smtp.mailfrom=mirror176@hotmail.com; dmarc=pass (policy=none) header.from=hotmail.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Unc6yBgurCDhhm+I9zqOgVa5FKPlqoD34C9OcMl+m5T/0ybjK+YIcbvMetETpo4C5IxMEdMm1YVq4fa0YrHTObBFglvFu90KW42Y3C1p0P5hvGgoNOEDhM1g8F8G21Vi7BN4GedYZ1H6Nrst1eQReSTpzOPpTz9t7Cavk6GRqzodO+HFGkfCfQJplKIK9me85haVdCvXiZnDcbx1aPO+GOTeSx0A3i6+CD2yaY/F7YgE+9Xhnr8+39bJh0bCQDfEzV3VVWnD8w8gobwoIN9aLhLRU51d1v9Ci+ayELEP45K+UvcJjT0Ly/6QP4La4QLRkZoU0d2ik8m7OyLHk3C0UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WxgxYoMK/4yrkt3Cad+KadxEcbVnBcevxkopMSs4b5c=; b=LQCfHS7b2SbaO+mqP1MHXj/upD1jrMoVUlvL4jRImmThvohrsQ8J3/O9Tz61Epm4WOQatWEt6KqKZ+QmaIdRzPtcqSMf3wLt2Xozlu3D/i5opuITKM2ZT3w7+RA/jMPrxkhIlXzGabAFRCr0kmA6zZS8SP4VUlJ/QiPsCj2l7sZMGo+M18OGYmcbmGgLVEwZt3LEXKdTu1J8tm+J7iVqrUUTCtSl9/i8QMvjsHs/EM3IyfNichYukKbmGgKyum939lgmRkd1X4Hk/ZC+rTnSBuwAmZaS3vo7SHghgBjNjGWPDMups6rQD2oq93K+rs/BAH3gm0BIesHu/BQVL4NEdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WxgxYoMK/4yrkt3Cad+KadxEcbVnBcevxkopMSs4b5c=; b=QaAf7j+UWO6IPTKHL83ogT/YHX/wLtQxUN/fpV7S+Hmmff1r+qOhKchQmik1DqghNEFWBV/PJrT94++Rj9sRhJepwmAMYv3HpbKWmP9IRJS1Oz7y0ITod8RCd1JHaJhS1+RiDLFd37hjfiawYC4M+a3QUhtOpQBtQl/5kcDBzYWYsmKNxMMNfCp63YtqcFxdczHPdlWdts/6iugCYdhvEN6tBlcNYitQiPPPujhT8FtoLVBrdYibvU5csA0zCfY8tY1ABYeVc5LlP1kZF15sErt8nprSjVDIyLbL/YnuGPr1JAWHqB+Zx1UhZkqbjiHTnzPFuR4fOyGoVm/lBj/JpA== Received: from CO1PR11MB4770.namprd11.prod.outlook.com (2603:10b6:303:94::19) by IA0PR11MB7694.namprd11.prod.outlook.com (2603:10b6:208:409::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 21:20:32 +0000 Received: from CO1PR11MB4770.namprd11.prod.outlook.com ([fe80::93a7:bfdb:13ed:cd3b]) by CO1PR11MB4770.namprd11.prod.outlook.com ([fe80::93a7:bfdb:13ed:cd3b%4]) with mapi id 15.20.5880.019; Mon, 12 Dec 2022 21:20:32 +0000 Message-ID: Date: Mon, 12 Dec 2022 14:20:29 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: lang/rust is super slow to build Content-Language: en-US To: ports@freebsd.org References: From: "Edward Sanford Sutton, III" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TMN: [apoYAo9n0FLAPXInByqfFd9Clb/atVvM] X-ClientProxiedBy: BYAPR07CA0107.namprd07.prod.outlook.com (2603:10b6:a03:12b::48) To CO1PR11MB4770.namprd11.prod.outlook.com (2603:10b6:303:94::19) X-Microsoft-Original-Message-ID: <008b6d6d-aff2-7999-013e-defea411071f@hotmail.com> List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB4770:EE_|IA0PR11MB7694:EE_ X-MS-Office365-Filtering-Correlation-Id: b2703e37-084b-46f6-a796-08dadc86b366 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cwyPrKDTzip5XineyAV7YptXrVAH0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zExNVRI?= =?utf-8?B?K3ZpWUlDdndwYklJNmVDT2t3eTZDN1JuZi9VaDZUUDlhcU9tQmxGMXRXdnI2?= =?utf-8?B?aXA0N2NWNVJUMnNzQ1BiTWxxM1g1R21zV2VlS1BvaDZmcCtiZVBzMmtMbWNM?= =?utf-8?B?eHYzUHM1SzRxUXR2elViVWxyZ2draFFNNjlPdnI5QStmeGJSMzdIUDlHaHNQ?= =?utf-8?B?K21iRzJwYzFsWnk0MVYxYVNGaHUyZ2xFemIvanVWN01GclpMcE0zaTRPNkxU?= =?utf-8?B?akhVQzdGS2xkM205eG9sNVIrUk9ZWUdwZExjQ3cyaE1zdzJLeE5yMDg3anB0?= =?utf-8?B?MklrOHoxREw0VlBrR0NSMnBTL0YvVU5xbUpGYzJVL3Z4cGo3MlhDMVdHYWlV?= =?utf-8?B?L25xRlJuYS9hTlExak1uYXpzVGYrcTRhcmpreDdlOFZSU3dkdmx3UFUwUzU3?= =?utf-8?B?VkxmRUE4SG9kdnVDQUNPTisyUkxybUVnamlnb0dLWjNJK2p5Y1dQOUdUa3dC?= =?utf-8?B?b0VHTTVibURWZTRVZ3Jqd1JCY1hmazh3TWE2b3NzRFNBYmZoOURLMXBBPT0=?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-e8f36.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: b2703e37-084b-46f6-a796-08dadc86b366 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4770.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 21:20:32.3048 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7694 X-Spamd-Result: default: False [0.23 / 15.00]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; NEURAL_SPAM_MEDIUM(0.84)[0.840]; NEURAL_HAM_LONG(-0.83)[-0.825]; DMARC_POLICY_ALLOW(-0.50)[hotmail.com,none]; NEURAL_HAM_SHORT(-0.29)[-0.285]; R_DKIM_ALLOW(-0.20)[hotmail.com:s=selector1]; R_SPF_ALLOW(-0.20)[+ip4:40.92.0.0/15]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:8075, ipnet:40.80.0.0/12, country:US]; FREEMAIL_ENVFROM(0.00)[hotmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[40.92.46.66:from]; MLMMJ_DEST(0.00)[ports@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_NONE(0.00)[hotmail.com:dkim]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[hotmail.com:+]; FREEMAIL_FROM(0.00)[hotmail.com]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4NWF0M5cr2z4L35 X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N On 12/12/22 12:27, Pat Maddox wrote: > Using poudriere, lang/rust is at 2 hours and counting on my 10-core i9 > w/ 128 gigs of RAM. > > Does that sound right? It seems extremely slow to me, but this is my > first time building it. > > How long does it take others to build? What options are you using, or > any other suggestions for shortening the time? My last build was 6 hours 43 minutes but I am on an older i7-3820 with 1/2 the cores disabled and likely had CPU+RAM oversaturated with unrelated tasks and had more than 1 core working on Rust. Short answer for my poudriere stuff in general which also helps Rust is I usually set cores per port=cores in system and then set poudriere to build 2 to 4 ports simultaneously; running under idprio usually keeps system fairly responsive despite overloaded CPU but RAM going to swap or running out is more troublesome. Running (up to) 8 jobs on my system with 32GB RAM with 1 core per job was never a good default. I find too many times that cores are idle due to dependencies blocking future jobs and at the end its common I have a big task sitting around being worked on alone for a long time. "USE_TMPFS=all" in poudriere.conf speeds up the repeated teardown+buildup of build environments a lot but goes through my limited RAM much too fast though only on a few bigger ports but they always end up trying to build together. Mot all ports are compatible with MAKE_JOBS (usually forces it off when that's the case) and there are times where less than maximum cores will be in use (sometimes only 1) so building multiple ports simultaneously helps make better use of CPU. If you have multiple jobs per port and multiple ports building simultaneously then its likely you can have CPU busy while doing other tasks like tearing down+building up a port; try to balance CPU allocation between those 2 #s and you can minimize when either limitation leaves resources idle, moreso if oversaturating cores. ccache 'may' help with future repeat builds but it only accelerates c/c++ and not rust compiler commands so will be limited. Using packages compressed with best will slow down their creation but takes less disk space and can result in faster decompression. tzst instead of txz with maximum compression can speedup both package creation and extraction but will cost more disk space. Longer answer including what tweaks go where to make that happen is below. I do set /usr/local/etc/poudriere.d/make.conf with various paramaters. Went to tzst instead of txz which builds larger packages but figure its a bit faster compressing+decompressing and uses less RAM (a common shortage for me) but I haven't properly tested that it helped me. Still have the XZ customization in case I switch back; it helped force higher compression for smaller packages at the expense of more CPU+RAM to make them. If I recall, xz extraction speed was related to how much data it reads; smaller but CPU+RAM expensive to make packages extract faster (assuming you don't run out of RAM on extraction step). Jobs I set based on my limited cores but I think ports tree. PKG_COMPRESSION_FORMAT= tzst PKG_COMPRESSION_LEVEL= best XZ_OPT+= -9e -Mmax CCACHE_COMPRESS=yes CCACHE_COMPRESSLEVEL=9 MAKE_JOBS_NUMBER=4 I use either of the entries below added to /usr/local/etc/poudriere.conf to force permitting multiple cores to be used per port or per selected ports; either is required for MAKE_JOBS_NUMBER in the earlier make.conf to be used. Last I recall, poudriere still defaults to 1 CPU per port which makes individual ports potentially much slower under the expectation of using other cores for other ports. Some ports cannot benefit from 2+ cores at different parts of its build stage and sometimes poudriere won't have enough ports available due to dependencies or reaching the end of the queue to keep all cores busy at 1 core per port. ALLOW_MAKE_JOBS=yes ALLOW_MAKE_JOBS_PACKAGES="pkg ccache perl* gettext-tools zstd w3m cmake gtk* ruby* py* chromium open* *office* binutils *gcc* llvm* mesa-dri *web* rust samba* mysql* openblas *jdk* osg* vtk* dcmtk plasma5-plasma-desktop node krita firefox thunderbird virtualbox* qt5-declarative suitesparse qt5-webengine" I generally execute poudriere with `git -C /usr/ports pull --ff-only&&idprio 31 poudriere bulk -J2:12 -j local -p local -f /root/installed-port-list -f /root/prime-origin` so I start from an updated tree, make it a background job to keep system more responsive (maybe its not the best way), I limit it to building 2 ports simultaneously as 32GB with "USE_TMPFS=all" in poudriere.conf can lead to over 1/2 my RAM being used on a single port and going higher likely results in swap and crashing builds especially when considering other system use like Firefox (best not used or restarted due to excessive RAM consumption with many windows+tabs), ":12" likely needs more tuning, I try to use my local ports tree and src tree but poudriere may be introducing additional checks as a result which slows it down a lot. I use two separate files where I can maintain a list of what is on my system from a manually typed list of "I want this" which makes it so I could easily do a new OS install or fully wipe packages and cleanup /usr/local of any debris and get reinstalled back to where I want to be. I use `pkg prime-origins > /root/prime-origins` which only lists the final ends of the dependency tree even if I want a dependency to always be installed too; good way to generate a minimal current list of necessary package installs to have your current complete set if you haven't properly kept track of all desired packages; not having desired dependencies not and such end branches means removing packages or having dependencies of end branches change will lead to me potentially uninstalling desired packages with `pkg autoremove`. If a port is broken then it gets attempted unless I make sure both lists don't attempt to build it and if removed I then have 2 files I have to cleanup before poudriere runs again. Not sure how much ccache helps, but its faster anytime any port is building any compatible c/c++ with minimal added overhead for any compile it doesn't already have a compatible cache for. "compiler_check = content" in ccache.conf helps keep cache compatible if I rebuild a compiler that isn't actually an update but still isn't enough to help with new port version extracts to a different path; really seems like primary port extraction should take place in a nonversion dependent path. I believe it is devel/sccache that would help speed up anything that compiles using the rust compiler but thought I heard it was a little slower with c/c++ and poudriere/ports tree doesn't have built in support for it like it does ccache. > Pat >