From unknown Sat Jun 14 19:20:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Sep 2022 23:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57788@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166311347927754 (code B ref -1); Tue, 13 Sep 2022 23:58:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Sep 2022 23:57:59 +0000 Received: from localhost ([127.0.0.1]:53150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYFmw-0007DY-8k for submit@debbugs.gnu.org; Tue, 13 Sep 2022 19:57:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:35442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYFmr-0007DL-LO for submit@debbugs.gnu.org; Tue, 13 Sep 2022 19:57:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYFmr-0008UB-Cj for guix-patches@gnu.org; Tue, 13 Sep 2022 19:57:53 -0400 Received: from world.peace.net ([64.112.178.59]:55026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYFmp-0007gH-69 for guix-patches@gnu.org; Tue, 13 Sep 2022 19:57:53 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYFmm-0000Jj-DP; Tue, 13 Sep 2022 19:57:48 -0400 From: Mark H Weaver Date: Tue, 13 Sep 2022 19:56:46 -0400 Message-ID: <874jxahlpi.fsf@netris.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.112.178.59; envelope-from=mhw@netris.org; helo=world.peace.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain The following patch, which I've tested only on my private branch of Guix, dramatically reduces the amount of memory and time required to build Rust. With this patch applied, I'm able to build Rust on a Thinkpad X200 with only 4 GB of RAM using both cores. Without it, I'm unable to build Rust at all, even with parallel builds disabled, running in a bare text-only terminal, and with every nonessential daemon stopped. When I tried, a single compiler process used more than 9 GB of virtual memory with heavy thrashing before the OOM killer finally put it out of its misery. Moreover, with this patch the builds are dramatically faster than I've previously observed. In my earlier bootstraps of Rust (up to rust-1.51), it took about 5 hours to build each compiler on my machine. Now it takes only about 2 hours per compiler, except for the initial bootstrap (1.54) which takes about 4 hours. The following patch is meant to be applied to the 'staging' branch, but I've only tested it on my own private branch, which is based on very old 'master' (April 2021) and is thus quite different by now. I offer it here in case it might be of interest, although it hasn't been tested on contemporary Guix. I'm not subscribed to this mailing list, so please make sure to CC me on any replies you'd like me to see. Regards, Mark --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-rust-Disable-debug-info-to-reduce-build-memory-r.patch Content-Description: [PATCH] gnu: rust: Disable debug info to reduce build memory requirements >From 74a004295dc7bb6bdb20172aaf4778435bdf5832 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 13 Sep 2022 19:28:03 -0400 Subject: [PATCH] gnu: rust: Disable debug info to reduce build memory requirements. This dramatically reduces the memory required to build Rust, and also speeds up the build. * gnu/packages/patches/mrustc-disable-debug.patch: New file * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/rust.scm (%mrustc-source): Apply patch. (rust-bootstrap, rust-1.55)[arguments]: In 'build' phase, set CARGO_PROFILE_DEV_DEBUG environment variable to "false". --- gnu/local.mk | 1 + .../patches/mrustc-disable-debug.patch | 110 ++++++++++++++++++ gnu/packages/rust.scm | 7 +- 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/mrustc-disable-debug.patch diff --git a/gnu/local.mk b/gnu/local.mk index cc96b77e03..a7f81ceda5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1521,6 +1521,7 @@ dist_patch_DATA = \ %D%/packages/patches/monero-use-system-miniupnpc.patch \ %D%/packages/patches/mosaicatcher-unbundle-htslib.patch \ %D%/packages/patches/mrrescue-support-love-11.patch \ + %D%/packages/patches/mrustc-disable-debug.patch \ %D%/packages/patches/mrustc-riscv64-support.patch \ %D%/packages/patches/mtools-mformat-uninitialized.patch \ %D%/packages/patches/mupen64plus-ui-console-notice.patch \ diff --git a/gnu/packages/patches/mrustc-disable-debug.patch b/gnu/packages/patches/mrustc-disable-debug.patch new file mode 100644 index 0000000000..6458cecb31 --- /dev/null +++ b/gnu/packages/patches/mrustc-disable-debug.patch @@ -0,0 +1,110 @@ +diff -ru mrustc-0.10-orig/Makefile mrustc-0.10/Makefile +--- mrustc-0.10-orig/Makefile 2022-09-13 07:49:26.299978699 -0400 ++++ mrustc-0.10/Makefile 2022-09-13 07:52:19.243970927 -0400 +@@ -38,9 +38,9 @@ + # - Disable deleting intermediate files + .SECONDARY: + +-LINKFLAGS := -g ++LINKFLAGS := + LIBS := -lz +-CXXFLAGS := -g -Wall ++CXXFLAGS := -Wall + CXXFLAGS += -std=c++14 + #CXXFLAGS += -Wextra + CXXFLAGS += -O2 +diff -ru mrustc-0.10-orig/tools/common/Makefile mrustc-0.10/tools/common/Makefile +--- mrustc-0.10-orig/tools/common/Makefile 2022-09-13 07:49:26.335978698 -0400 ++++ mrustc-0.10/tools/common/Makefile 2022-09-13 07:50:58.243974567 -0400 +@@ -11,7 +11,7 @@ + BIN := ../../bin/common_lib.a + OBJS = toml.o path.o debug.o + +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + + CXXFLAGS += $(CXXFLAGS_EXTRA) + +diff -ru mrustc-0.10-orig/tools/dump_hirfile/Makefile mrustc-0.10/tools/dump_hirfile/Makefile +--- mrustc-0.10-orig/tools/dump_hirfile/Makefile 2022-09-13 07:49:26.335978698 -0400 ++++ mrustc-0.10/tools/dump_hirfile/Makefile 2022-09-13 07:51:02.723974366 -0400 +@@ -15,7 +15,7 @@ + OBJS := main.o + + LINKFLAGS := -g -lpthread -lz +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + CXXFLAGS += -I ../common -I ../../src -I ../../src/include + + CXXFLAGS += $(CXXFLAGS_EXTRA) +diff -ru mrustc-0.10-orig/tools/minicargo/build.cpp mrustc-0.10/tools/minicargo/build.cpp +--- mrustc-0.10-orig/tools/minicargo/build.cpp 2022-09-13 07:49:26.335978698 -0400 ++++ mrustc-0.10/tools/minicargo/build.cpp 2022-09-13 07:47:19.567984395 -0400 +@@ -956,7 +956,7 @@ + } + } + } +- if( true /*this->enable_debug*/ ) { ++ if( false /*this->enable_debug*/ ) { + args.push_back("-g"); + args.push_back("--cfg"); args.push_back("debug_assertions"); + } +@@ -1106,7 +1106,7 @@ + args.push_back("--crate-type"); args.push_back("bin"); + args.push_back("-o"); args.push_back(outfile); + args.push_back("-L"); args.push_back(this->get_output_dir(true).str()); // NOTE: Forces `is_for_host` to true here. +- if( true ) ++ if( false ) + { + args.push_back("-g"); + } +diff -ru mrustc-0.10-orig/tools/minicargo/Makefile mrustc-0.10/tools/minicargo/Makefile +--- mrustc-0.10-orig/tools/minicargo/Makefile 2022-09-13 07:49:26.335978698 -0400 ++++ mrustc-0.10/tools/minicargo/Makefile 2022-09-13 07:51:07.011974173 -0400 +@@ -16,7 +16,7 @@ + OBJS := main.o build.o manifest.o repository.o cfg.o + + LINKFLAGS := -g -lpthread +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + CXXFLAGS += -I ../common + + CXXFLAGS += $(CXXFLAGS_EXTRA) +diff -ru mrustc-0.10-orig/tools/mir_opt_test/Makefile mrustc-0.10/tools/mir_opt_test/Makefile +--- mrustc-0.10-orig/tools/mir_opt_test/Makefile 2022-09-13 07:49:26.339978698 -0400 ++++ mrustc-0.10/tools/mir_opt_test/Makefile 2022-09-13 07:51:10.555974014 -0400 +@@ -15,7 +15,7 @@ + LIBS := ../../bin/mrustc.a ../../bin/common_lib.a + + LINKFLAGS := -g -lpthread -lz +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + CXXFLAGS += -I ../common -I ../../src/include -I ../../src -I . + CXXFLAGS += -Wno-misleading-indentation # Gets REALLY confused by the TU_ARM macro + +diff -ru mrustc-0.10-orig/tools/standalone_miri/Makefile mrustc-0.10/tools/standalone_miri/Makefile +--- mrustc-0.10-orig/tools/standalone_miri/Makefile 2022-09-13 07:49:26.339978698 -0400 ++++ mrustc-0.10/tools/standalone_miri/Makefile 2022-09-13 07:51:14.731973826 -0400 +@@ -15,7 +15,7 @@ + OBJS += miri.o miri_extern.o miri_intrinsic.o + + LINKFLAGS := -g -lpthread +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + CXXFLAGS += -I ../common -I ../../src/include -I . + CXXFLAGS += -Wno-misleading-indentation # Gets REALLY confused by the TU_ARM macro + +diff -ru mrustc-0.10-orig/tools/testrunner/Makefile mrustc-0.10/tools/testrunner/Makefile +--- mrustc-0.10-orig/tools/testrunner/Makefile 2022-09-13 07:49:26.339978698 -0400 ++++ mrustc-0.10/tools/testrunner/Makefile 2022-09-13 07:51:24.819973373 -0400 +@@ -5,8 +5,8 @@ + BIN := ../../bin/testrunner + OBJS := main.o path.o + +-LINKFLAGS := -g +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++LINKFLAGS := ++CXXFLAGS := -Wall -std=c++14 -O2 + + CXXFLAGS += $(CXXFLAGS_EXTRA) + LINKFLAGS += $(LINKFLAGS_EXTRA) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 25295a283e..7d1b17ad5f 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -139,7 +139,8 @@ (define %mrustc-source (sha256 (base32 "0f7kh4n2663sn0z3xib8gzw0s97qpvwag40g2vs3bfjlrbpgi9z0")) - (patches (search-patches "mrustc-riscv64-support.patch"))))) + (patches (search-patches "mrustc-riscv64-support.patch" + "mrustc-disable-debug.patch"))))) ;;; Rust 1.54 is special in that it is built with mrustc, which shortens the ;;; bootstrap path. @@ -297,6 +298,8 @@ (define rust-bootstrap ;; to set the level of parallelism. (setenv "PARLEVEL" (number->string job-count)) (setenv "CARGO_BUILD_JOBS" (number->string job-count)) + ;; reduce memory requirements during the build + (setenv "CARGO_PROFILE_DEV_DEBUG" "false") (display "Building mrustc...\n") (apply invoke "make" make-flags) @@ -453,6 +456,8 @@ (define rust-1.55 (replace 'build ;; The standard library source location moved in this release. (lambda* (#:key parallel-build? #:allow-other-keys) + ;; reduce memory requirements during the build + (setenv "CARGO_PROFILE_DEV_DEBUG" "false") (let ((job-spec (string-append "-j" (if parallel-build? (number->string (parallel-job-count)) -- 2.37.1 --=-=-= Content-Type: text/plain -- Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about . --=-=-=-- From unknown Sat Jun 14 19:20:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 10:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mark H Weaver Cc: 57788@debbugs.gnu.org Received: via spool by 57788-submit@debbugs.gnu.org id=B57788.166513898213643 (code B ref 57788); Fri, 07 Oct 2022 10:37:02 +0000 Received: (at 57788) by debbugs.gnu.org; 7 Oct 2022 10:36:22 +0000 Received: from localhost ([127.0.0.1]:34436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogkiL-0003Xz-Hw for submit@debbugs.gnu.org; Fri, 07 Oct 2022 06:36:21 -0400 Received: from mail-ej1-f48.google.com ([209.85.218.48]:45756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogkiI-0003Xl-OR for 57788@debbugs.gnu.org; Fri, 07 Oct 2022 06:36:20 -0400 Received: by mail-ej1-f48.google.com with SMTP id sc25so4262190ejc.12 for <57788@debbugs.gnu.org>; Fri, 07 Oct 2022 03:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=pi0f6+R71mRcCqz5YMOb/qWMWwuhG+3SbmvGp1p6GAk=; b=B9M0vdBKrZOA6Ldm6aesMcnw9K0cJUey6m9J0JqASwSmJni+PbaZDmcCU97ANgM5RA Os+qFJ+c398crSMyQsqA7TkQCY/WmMpuWrruJP0q9xhR6osW0V9cKWUjKUcjypSlE0RA +ppFOL+yeddIYE+RBZTEvetekjVTzlJs00Zw0fZEVwyeifCYFby6jNNnkftYOhrGI5Tt bU1e0QK5W//BqfaeOLPeEn6rBmU0cT4JsDULngaEtX3IaRk9khC56iMeFQdvX7j85S7R YlH1XqXR752M2t41YINvfnb/IIAtUV0Ybjm4l8oCB+iaBbfcxk6W3EULSqaK6MCVKyj/ iPPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pi0f6+R71mRcCqz5YMOb/qWMWwuhG+3SbmvGp1p6GAk=; b=V8jbTSYWcE3w6b/VbDVUU1KJ09ud7m70WskC+WwMp5QrDGovqiJ22DyNfrQRP+5ZCI yzsGp9ImLcWU/ayrjpvHdGcPRE/SDhNHwS9jBSEpc23KQr85nLd9bWiNVkwwvLWPKwk2 bYbFVQFiMrFkbpA2N6rpNTL49P8NSXHHCavRpPuMiDYq9HX2gg5eV+4y/X0SCEjDiUOY WMkDx67y7Exp/zM+tCAdPB515i/QhWrqOgoM0PAhiE2oZ4uYe2I4Tddj1RLpoJf4WinN +7skOEyFFvASWk3HvaoKBs9o+HaruzPP4h31RvEMGxT3DJAgr0HtfxE6nFSM5kDnjkyp AQrA== X-Gm-Message-State: ACrzQf183IbxLhgwAq6oZsmm0oVSbvaoTuzxfcC9TuYraVVSElxlNcLQ DqpIrDvvSd9uYvuY72jQqeM= X-Google-Smtp-Source: AMsMyM6WzIowGAxOEAC+KNluCEkjSiI2wxJ4Atjg3sHCTwlDj5tMQ4dZ8U1RR1kTLLAj92X1FWuBrQ== X-Received: by 2002:a17:907:1c1a:b0:78d:426c:2828 with SMTP id nc26-20020a1709071c1a00b0078d426c2828mr3612195ejc.331.1665138972682; Fri, 07 Oct 2022 03:36:12 -0700 (PDT) Received: from localhost ([141.226.13.62]) by smtp.gmail.com with ESMTPSA id v8-20020a50a448000000b004590d4e35cdsm1192933edb.54.2022.10.07.03.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 03:36:12 -0700 (PDT) Date: Fri, 7 Oct 2022 13:36:08 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Mark H Weaver , 57788@debbugs.gnu.org References: <874jxahlpi.fsf@netris.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WULFXluBVDDoUPOd" Content-Disposition: inline In-Reply-To: <874jxahlpi.fsf@netris.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --WULFXluBVDDoUPOd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 13, 2022 at 07:56:46PM -0400, Mark H Weaver wrote: > The following patch, which I've tested only on my private branch of > Guix, dramatically reduces the amount of memory and time required to > build Rust. >=20 > With this patch applied, I'm able to build Rust on a Thinkpad X200 with > only 4 GB of RAM using both cores. Without it, I'm unable to build Rust > at all, even with parallel builds disabled, running in a bare text-only > terminal, and with every nonessential daemon stopped. When I tried, a > single compiler process used more than 9 GB of virtual memory with heavy > thrashing before the OOM killer finally put it out of its misery. Your x200 is an x86_64? How much RAM+swap did you end up using with this patch? I was going to point you to a patch upstream in mrustc but I can't find it now, where they disabled debug builds by default, but I can't find it now. > Moreover, with this patch the builds are dramatically faster than I've > previously observed. In my earlier bootstraps of Rust (up to > rust-1.51), it took about 5 hours to build each compiler on my machine. > Now it takes only about 2 hours per compiler, except for the initial > bootstrap (1.54) which takes about 4 hours. I tested it out on my machine, it brought the build time down from 101 minutes to 71 minutes. Not the same improvement, but still noticeable. > The following patch is meant to be applied to the 'staging' branch, but > I've only tested it on my own private branch, which is based on very old > 'master' (April 2021) and is thus quite different by now. >=20 > I offer it here in case it might be of interest, although it hasn't been > tested on contemporary Guix. I'm not subscribed to this mailing list, > so please make sure to CC me on any replies you'd like me to see. >=20 > Regards, > Mark I'm building out to librsvg on staging right now with this patch applied, so hopefully we'll see that it's good. I'm assuming that setting CARGO_PROFILE_DEV_DEBUG to false won't cause any problems. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --WULFXluBVDDoUPOd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmNAARQACgkQQarn3Mo9 g1H9Ig/8CPD6cSIksJVB31qEtCeaNnt97RG4D0H9jCOwJgRs+EWusoQ24vVpvJ5c f5NPZT7g6jqasTrQu4pFEWpkeLnCDNPk+L9r9rqFTUo6yE19SiZWpNltuFQA489I kNuAyxAryVE+x0Li+PQZ5dDqTwRDOM7H6l8+rPBwDouKoU16t/GEzuN6lrEuG3l0 YWJUntOa6BjK8p1jLTQKi/CWWon3eeAsJoUWJbGWKoYcGsAZUpbk0qFKIswbev/Q WzkIs693gbMVYvWbU/3SuzhYSJJM0Fj2qIMzyfAqpAo0KfiJ2NGTg/wancerFPxY K8KAjWvu2NAjc6wgcpLTBCUH/Sg4CgS5h5c2MCfXSu8MhxCgHBqWXjLt2u88f1pS moJdC4D/agLbICgLyk/ejENeR7860m2ogScYlREHZVE/Bw+ysCj8ZRSXveKkxgTj MenLbBRnY1HoqZ8AgHyuSaNjIKpOEXq9w/i05I1nhccTuyyDEAM5OkbOdTtUFX5C f+MApCF5mSYj4L+ZGwBLrIudOljnBRFtybb+sAFn2yqHJcV+n+ozTfMzrV8s8cA2 3eUxXOYYUSJAUPnVEqejq+PHsijS9IKJ2Q1SJo8/xJ5Md/HrUvcTL8ucBIZ/tTaz zs4uFvoHNneOJbbhGr7kkrXddB8zkn3//W/tPZmCK5hpq78T6dg= =oZ2F -----END PGP SIGNATURE----- --WULFXluBVDDoUPOd-- From unknown Sat Jun 14 19:20:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 57788@debbugs.gnu.org Received: via spool by 57788-submit@debbugs.gnu.org id=B57788.16651803376592 (code B ref 57788); Fri, 07 Oct 2022 22:06:01 +0000 Received: (at 57788) by debbugs.gnu.org; 7 Oct 2022 22:05:37 +0000 Received: from localhost ([127.0.0.1]:37619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogvTM-0001iG-RR for submit@debbugs.gnu.org; Fri, 07 Oct 2022 18:05:37 -0400 Received: from world.peace.net ([64.112.178.59]:35682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogvTK-0001i3-VM for 57788@debbugs.gnu.org; Fri, 07 Oct 2022 18:05:35 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ogvTD-0003r1-HA; Fri, 07 Oct 2022 18:05:27 -0400 From: Mark H Weaver In-Reply-To: References: <874jxahlpi.fsf@netris.org> Date: Fri, 07 Oct 2022 18:04:24 -0400 Message-ID: <877d1buw70.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Efraim, Efraim Flashner writes: > On Tue, Sep 13, 2022 at 07:56:46PM -0400, Mark H Weaver wrote: >> The following patch, which I've tested only on my private branch of >> Guix, dramatically reduces the amount of memory and time required to >> build Rust. >> >> With this patch applied, I'm able to build Rust on a Thinkpad X200 with >> only 4 GB of RAM using both cores. Without it, I'm unable to build Rust >> at all, even with parallel builds disabled, running in a bare text-only >> terminal, and with every nonessential daemon stopped. When I tried, a >> single compiler process used more than 9 GB of virtual memory with heavy >> thrashing before the OOM killer finally put it out of its misery. > > Your x200 is an x86_64? Yes, with only 4 GB of RAM. > How much RAM+swap did you end up using with this patch? During the times when I was monitoring it, the build process with parallel build enabled (2 parallel jobs) fit entirely within my 4 GB of RAM, while also running a modest X session with Emacs. >> Moreover, with this patch the builds are dramatically faster than I've >> previously observed. In my earlier bootstraps of Rust (up to >> rust-1.51), it took about 5 hours to build each compiler on my machine. >> Now it takes only about 2 hours per compiler, except for the initial >> bootstrap (1.54) which takes about 4 hours. > > I tested it out on my machine, it brought the build time down from 101 > minutes to 71 minutes. Not the same improvement, but still noticeable. I'm glad to hear it! I guess the improvement was more dramatic on my system because it was previously thrashing (lots of swapping due to insufficient RAM), whereas your system probably has enough RAM :-) >> The following patch is meant to be applied to the 'staging' branch, but >> I've only tested it on my own private branch, which is based on very old >> 'master' (April 2021) and is thus quite different by now. >> >> I offer it here in case it might be of interest, although it hasn't been >> tested on contemporary Guix. I'm not subscribed to this mailing list, >> so please make sure to CC me on any replies you'd like me to see. >> >> Regards, >> Mark > > I'm building out to librsvg on staging right now with this patch > applied, so hopefully we'll see that it's good. > > I'm assuming that setting CARGO_PROFILE_DEV_DEBUG to false won't cause > any problems. After writing my previous message, I ended up adding another hunk to my patch, to disable debugging in the final 'rust' compiler: --8<---------------cut here---------------start------------->8--- diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 25295a283e..cf2c66f334 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -704,6 +704,13 @@ (define-public rust (("^python =.*" all) (string-append all "gdb = \"" gdb "/bin/gdb\"\n")))))) + (add-before 'build 'disable-debug + (lambda _ + ;; reduce memory requirements during the build + (setenv "CARGO_PROFILE_DEV_DEBUG" "false") + (substitute* "config.toml" + (("\\[rust\\].*" all) + (string-append all "debug = false\n"))))) (replace 'build ;; Phase overridden to also build rustfmt. (lambda* (#:key parallel-build? #:allow-other-keys) --8<---------------cut here---------------end--------------->8--- In retrospect, for the post-mrustc compilers, it might have been sufficient to add "debug = false" to the [rust] section of config.toml in the 'rust-1.55' variable. This might also eliminate the need to set CARGO_PROFILE_DEV_DEBUG. However, I haven't tried it. Thanks for working on it, Efraim! Regards, Mark -- Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about . From unknown Sat Jun 14 19:20:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 09 Oct 2022 12:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mark H Weaver , 57788@debbugs.gnu.org Received: via spool by 57788-submit@debbugs.gnu.org id=B57788.166531913412976 (code B ref 57788); Sun, 09 Oct 2022 12:39:01 +0000 Received: (at 57788) by debbugs.gnu.org; 9 Oct 2022 12:38:54 +0000 Received: from localhost ([127.0.0.1]:42304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohVa1-0003NE-Mp for submit@debbugs.gnu.org; Sun, 09 Oct 2022 08:38:53 -0400 Received: from mail-ed1-f48.google.com ([209.85.208.48]:44818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohVZz-0003N2-Rz for 57788@debbugs.gnu.org; Sun, 09 Oct 2022 08:38:52 -0400 Received: by mail-ed1-f48.google.com with SMTP id g27so12582796edf.11 for <57788@debbugs.gnu.org>; Sun, 09 Oct 2022 05:38:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=SbRIfT5QgcvKBoxfFO6FNYdx5FgOXdlJss7GIOnoIyk=; b=Q+VMmLwVr05xswFy9MKMb3T1CwDonVEm6uqO4S3BVnoxcEmRKaaZpCLslIjg6V1bti 1eaDcMVFUHNxepADdwaNK9xmu7nNKe+2QR41NJ17rBL6UmyVJ7dftYBdsQ4oHl/3LD0l SZRoBn/6+elKHDTHdaQw4fyXR/s0/Ub/kE5vW+yi4RzJs4mGFD8VtzrlmhepGUCTEPWZ enLLMls8nEhsx6zJDNBqTFpZu0P0hUjx7usQQaBwLVx2DuQGpo6KpMjKAd719msHUc8W 27f/iF4J+Of/RLpvFAXGKGMQdIJ3LerI4+3L5Sz6zp7YVydHU0on596qlrC1t421viaQ eFtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SbRIfT5QgcvKBoxfFO6FNYdx5FgOXdlJss7GIOnoIyk=; b=4wZsTU8ZWzpUjx8YUIVt9JKBFUNbzjoxX34LDCGLH9L9mCu9FH89LIygifgNuSieTY zUM4upzRlzHAu2h1ZH8WGZwCdhPQd22ljRY/XxOx8Cm9pJ0s39+YOPhkayvJBsx9da2O TaNqgbK+Fvo8DvLMc9o+6ZR2gUJTGtHUb9/4Bc5Nf2SbGO4Ns65PYceV8GsgXf8ssPNd vT41Eg4EflYXLkdteBZtKs6B/kBrIx5/jTx7YhhBOb56pfJkNOh3Ik9VP1v3iC0KG6sR xA7AbK/HZTt63dhMJZROWrk6w/lq8nvggriG2O6/Y0N8ANClreW7P9MMfWW2vPfDaDE0 Y1oQ== X-Gm-Message-State: ACrzQf0qDjWxfL+vLotBXPZzjAySRQ6yi7sswzoxXJDYk417MTBdWs7Z NVJWZouzLQggwueSZcMTlvM= X-Google-Smtp-Source: AMsMyM4vEO+kHO5XS95XB/8hQS0Ez3Jq8gIBG1WGKSE03qfl7k6WYm/WKZVE18bOk13q3rG8rUvW4g== X-Received: by 2002:a50:fe85:0:b0:458:5562:bf1e with SMTP id d5-20020a50fe85000000b004585562bf1emr12853848edt.167.1665319125878; Sun, 09 Oct 2022 05:38:45 -0700 (PDT) Received: from localhost ([141.226.13.62]) by smtp.gmail.com with ESMTPSA id d22-20020aa7d5d6000000b0044dbecdcd29sm5112760eds.12.2022.10.09.05.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Oct 2022 05:38:44 -0700 (PDT) Date: Sun, 9 Oct 2022 15:38:40 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Mark H Weaver , 57788@debbugs.gnu.org References: <874jxahlpi.fsf@netris.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tODd7IqNwRG+ikBs" Content-Disposition: inline In-Reply-To: X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --tODd7IqNwRG+ikBs Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 07, 2022 at 01:36:08PM +0300, Efraim Flashner wrote: > On Tue, Sep 13, 2022 at 07:56:46PM -0400, Mark H Weaver wrote: >=20 > > Moreover, with this patch the builds are dramatically faster than I've > > previously observed. In my earlier bootstraps of Rust (up to > > rust-1.51), it took about 5 hours to build each compiler on my machine. > > Now it takes only about 2 hours per compiler, except for the initial > > bootstrap (1.54) which takes about 4 hours. >=20 > I tested it out on my machine, it brought the build time down from 101 > minutes to 71 minutes. Not the same improvement, but still noticeable. To follow up, it brought the time to build rust-bootstrap aka 1.54, on riscv64-linux down from ~56 hours to 13 hours. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --tODd7IqNwRG+ikBs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmNCwM0ACgkQQarn3Mo9 g1HuEw//XX0Rewq7lL/fqrEbyjOuru8ll07W//EFQ7TWMTzmPBzm2gu+liy3FsST AYyXGph9cNC6n+z1MK5rLFTFWzxhDQrVSzc+dqYHD+DJJ4Bdgai5UljStGTUfVQX fa6t3+dxmMOm/JPd1EdlAJ7ADTVpAOZBO4mu7JaO9Ep0w9lk/Js8d5J2CvfAjYWp wwtHV8Lf3kH4ByDG0h7HQUt2CqkOgfPL6iE9PDb8oZFwYcgLzFaT2eadSbbY56r0 7TQbk+z2bUalA+cwl/NYjnWqYM3TBXVr15siD4QEn1bG4HPPfrEWYqEnFGsstaX6 Z/AIpka/3E+iE2etl+nskvyVBj0G2IDV5tNqqSp+12cAjjuDGbZTgWIgMkPw6ZBV v6pMinZiTrJINutJ6+Uy3LazlKSaJmnU6XGABX/rOfnRWFZY1KHJ46/NFQTacOKJ DdJBZI9v/URyJVZ0KvYPJWIf2r4o7DE+oO4uR3G/JYKkgQB5RV3A3A91Vcr8p4oG QeubeYmndJJJTJ2YDFh+hBBNxyVIXnKRk2po22kvxJHLWEkQmhD2FtZXpkjAHTS8 MdXVth8ph1PtWOSDC2lgIvlJyqtC1tMDUE8KRCvHV+uqkHBUdT/lu0hVptDS1L0z LBsV086I1P+XsDWcg5vbUrftpPWLPN93yuTEPjHn16vuE+TmgN0= =2t+W -----END PGP SIGNATURE----- --tODd7IqNwRG+ikBs-- From unknown Sat Jun 14 19:20:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 12 Oct 2022 10:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mark H Weaver Cc: 57788@debbugs.gnu.org Received: via spool by 57788-submit@debbugs.gnu.org id=B57788.166557174029893 (code B ref 57788); Wed, 12 Oct 2022 10:49:02 +0000 Received: (at 57788) by debbugs.gnu.org; 12 Oct 2022 10:49:00 +0000 Received: from localhost ([127.0.0.1]:55826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiZIJ-0007m4-OZ for submit@debbugs.gnu.org; Wed, 12 Oct 2022 06:49:00 -0400 Received: from mail-ej1-f49.google.com ([209.85.218.49]:41764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiZII-0007ls-6X for 57788@debbugs.gnu.org; Wed, 12 Oct 2022 06:48:58 -0400 Received: by mail-ej1-f49.google.com with SMTP id qw20so36528967ejc.8 for <57788@debbugs.gnu.org>; Wed, 12 Oct 2022 03:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=mOSIG64SoXj/na7N8Q+oeR3dnh83EAM8owAWTRvyaks=; b=Fp2MzGPGIaGxSOban+aac7IdgCvJvJdEtRFR4Uuhlw2xBfiyTGysBM0EWDH6kPuFa1 URbnaZMVbQ76j1EPU19cvNoAtvCH/rse9Hf9FmTuS85tNNJE2OKw8owuiX1QUPWev380 9uTnBnlpuQNCLFdECf8h4hypJeUxNgzW0cJU8hqnP+RmwfZfDA2ylMqjA04itJfFBWXm qxPBD5B3mUnzdGqqTs6x8HHK2MP1sZWm+q9NWZiLSfhOyiPA5SR3/9r4uTEUIhjgNxSi GRPdpabYtZt/Wu3uos1+f3wBg5qd7SwK+1W5EsY6eNt/twuiKXc4nYWdvFOhi12CXDBY ysaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mOSIG64SoXj/na7N8Q+oeR3dnh83EAM8owAWTRvyaks=; b=zqSzhYmMPrL9GITRRApbiZc6jAVB42F9GOhZk4hVi1mbiQHiaEJgv26sIQKPvzsLnq El5kqqvXo9BJg/FHEXwa9YWNhxVJGJk13XRYEbBTxbest2LGYkUloRosAloJUx3cxxub rMlnosJf0AP1Hzqmsk6m8ND5i9H+b8JJsBrq2p1qC9cK8Z4ZDj0sZAMWVBTJpQdB8NjB rVCvECiYrblylSxH7nen/txkMeV4xtXd2WKZpheN4XtBgc/XoliIWz+VoXvzFd5z8d+o WqU8ZnyZKb4qdcL/nLF2sn/ol7NroX5Clfd7TTrjLBoTH4uEy+clvg39ptv4mDVr2nhL L2PQ== X-Gm-Message-State: ACrzQf3OoEy/PZMbmLwCB179H2UaVslELx7mW8J/ZT4u4XwWEl4QBtGr 3/PngkabppjdLY/Z1gcH1V8= X-Google-Smtp-Source: AMsMyM6/k4ms9P2j8dsiDjqvxhYOc9qrIAXNZKBLFW5Ap+GPfqKeA3ZHFRUF540KBMNWOyA8qgxjBw== X-Received: by 2002:a17:907:d8e:b0:783:a4f0:1052 with SMTP id go14-20020a1709070d8e00b00783a4f01052mr22119449ejc.41.1665571731898; Wed, 12 Oct 2022 03:48:51 -0700 (PDT) Received: from localhost ([141.226.13.62]) by smtp.gmail.com with ESMTPSA id w5-20020a056402128500b004589da5e5cesm10977815edv.41.2022.10.12.03.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 03:48:51 -0700 (PDT) Date: Wed, 12 Oct 2022 13:45:40 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Mark H Weaver , 57788@debbugs.gnu.org References: <874jxahlpi.fsf@netris.org> <877d1buw70.fsf@netris.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9WpP0ae1Yb/fFjUB" Content-Disposition: inline In-Reply-To: <877d1buw70.fsf@netris.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --9WpP0ae1Yb/fFjUB Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 07, 2022 at 06:04:24PM -0400, Mark H Weaver wrote: > Hi Efraim, >=20 > Efraim Flashner writes: >=20 > > On Tue, Sep 13, 2022 at 07:56:46PM -0400, Mark H Weaver wrote: > >> The following patch, which I've tested only on my private branch of > >> Guix, dramatically reduces the amount of memory and time required to > >> build Rust. > >>=20 > >> With this patch applied, I'm able to build Rust on a Thinkpad X200 with > >> only 4 GB of RAM using both cores. Without it, I'm unable to build Ru= st > >> at all, even with parallel builds disabled, running in a bare text-only > >> terminal, and with every nonessential daemon stopped. When I tried, a > >> single compiler process used more than 9 GB of virtual memory with hea= vy > >> thrashing before the OOM killer finally put it out of its misery. > > > > Your x200 is an x86_64? >=20 > Yes, with only 4 GB of RAM. >=20 > > How much RAM+swap did you end up using with this patch? >=20 > During the times when I was monitoring it, the build process with > parallel build enabled (2 parallel jobs) fit entirely within my 4 GB of > RAM, while also running a modest X session with Emacs. >=20 > >> Moreover, with this patch the builds are dramatically faster than I've > >> previously observed. In my earlier bootstraps of Rust (up to > >> rust-1.51), it took about 5 hours to build each compiler on my machine. > >> Now it takes only about 2 hours per compiler, except for the initial > >> bootstrap (1.54) which takes about 4 hours. > > > > I tested it out on my machine, it brought the build time down from 101 > > minutes to 71 minutes. Not the same improvement, but still noticeable. >=20 > I'm glad to hear it! I guess the improvement was more dramatic on my > system because it was previously thrashing (lots of swapping due to > insufficient RAM), whereas your system probably has enough RAM :-) >=20 > >> The following patch is meant to be applied to the 'staging' branch, but > >> I've only tested it on my own private branch, which is based on very o= ld > >> 'master' (April 2021) and is thus quite different by now. > >>=20 > >> I offer it here in case it might be of interest, although it hasn't be= en > >> tested on contemporary Guix. I'm not subscribed to this mailing list, > >> so please make sure to CC me on any replies you'd like me to see. > >>=20 > >> Regards, > >> Mark > > > > I'm building out to librsvg on staging right now with this patch > > applied, so hopefully we'll see that it's good. > > > > I'm assuming that setting CARGO_PROFILE_DEV_DEBUG to false won't cause > > any problems. >=20 > After writing my previous message, I ended up adding another hunk to my > patch, to disable debugging in the final 'rust' compiler: >=20 > --8<---------------cut here---------------start------------->8--- > diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm > index 25295a283e..cf2c66f334 100644 > --- a/gnu/packages/rust.scm > +++ b/gnu/packages/rust.scm > @@ -704,6 +704,13 @@ (define-public rust > (("^python =3D.*" all) > (string-append all > "gdb =3D \"" gdb "/bin/gdb\"\n"))))= )) > + (add-before 'build 'disable-debug > + (lambda _ > + ;; reduce memory requirements during the build > + (setenv "CARGO_PROFILE_DEV_DEBUG" "false") > + (substitute* "config.toml" > + (("\\[rust\\].*" all) > + (string-append all "debug =3D false\n"))))) > (replace 'build > ;; Phase overridden to also build rustfmt. > (lambda* (#:key parallel-build? #:allow-other-keys) > --8<---------------cut here---------------end--------------->8--- >=20 > In retrospect, for the post-mrustc compilers, it might have been > sufficient to add "debug =3D false" to the [rust] section of config.toml > in the 'rust-1.55' variable. This might also eliminate the need to set > CARGO_PROFILE_DEV_DEBUG. However, I haven't tried it. In my testing I didn't see a significant difference between using CARGO_PROFILE_DEV_DEBUG, debug =3D false or both. My personal preference would be to use CARGO_PROFILE_DEV_DEBUG for rust-bootstrap and then use debug =3D false for the rest, since it keeps the config options together in the config.toml file. I did also experiment with parallel-compiler =3D true to build a multithreaded rustc but I wasn't able to prevent the test suite for rust-1.60 to not error out. I also tried skipping the tests for rust itself and compiling librsvg with it, but they were serious when they said it wasn't ready. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --9WpP0ae1Yb/fFjUB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmNGmtAACgkQQarn3Mo9 g1Hp1RAAwfjunekYmjfWwhGmym09jN9dfFFCBeIKAoLSgtG1nXPTnK6Q9F5uL/wf DJYnu376yK2H5XPm3Fy5bEMDcDOEqeRu2g+YGGECkZP9Mv7/f/4X0mScXRJMZxoo vEQeUJxd45FIE5L8UouOUdH09ZLE2/QBD9a6WELKD0XvHR5jn3h6H7KOT4uNe4fI HEFE+0ZCxQrAyv50noR5Ij6XMyJmPq4iPdBaeIVFW80Y9ol604kQcF0yweMigL5G m6/JIhFny9Apn5rT0eFzlYXkmfhyIdlx2snmS3rBn9hsHaLP9g3knrnzEzNjbQaU t2APePK6wnQdCq9n2zfAGpz2S6lEGLgySrhXsRsxIzquuPcbo26B5BUMvMU9D5ys odqhp0bhhcUIvsz5yQT4eBScv5W5VlJu0e8TQ25G14hZhuiii6caOi+GiWv/63Uc 5PpWkRntJCZFEcSu95CXo9vUttaWBVgEZU2M9En7wU23fgU2e5mPMmr6LQX5yx6s V29YengcoD+qelK4HdN55lhxPmga+jaZIDB3n1koniKeeOFg/RBuW3u5lc1+ufbo PeMfAEmbOToeUN7N6rL/5w7IFXU/w6RNbXPmLzHr0os3KeYmbNa4TCVY+FdQ8R+6 WNRNIT5eOvGWo+OWYOhlCpA/QKfSgD1veXHpF5dHpm2KyXsRYpw= =+BVo -----END PGP SIGNATURE----- --9WpP0ae1Yb/fFjUB-- From unknown Sat Jun 14 19:20:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 28 Oct 2022 10:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 57788@debbugs.gnu.org Received: via spool by 57788-submit@debbugs.gnu.org id=B57788.166695370427833 (code B ref 57788); Fri, 28 Oct 2022 10:42:02 +0000 Received: (at 57788) by debbugs.gnu.org; 28 Oct 2022 10:41:44 +0000 Received: from localhost ([127.0.0.1]:60476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooMo4-0007Er-AF for submit@debbugs.gnu.org; Fri, 28 Oct 2022 06:41:44 -0400 Received: from world.peace.net ([64.112.178.59]:56492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooMo1-0007EZ-5y for 57788@debbugs.gnu.org; Fri, 28 Oct 2022 06:41:42 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ooMns-0006b8-1P; Fri, 28 Oct 2022 06:41:32 -0400 From: Mark H Weaver In-Reply-To: References: <874jxahlpi.fsf@netris.org> <877d1buw70.fsf@netris.org> Date: Fri, 28 Oct 2022 06:40:27 -0400 Message-ID: <87wn8kfcy1.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Efraim, I was surprised to see commit 01be1973f464cb81cdece54f7858f0dee46abb50 attributed solely to me, although I did not actually author that commit. In the future, please do not attribute commits to me that I did not write or approve of. At minimum, if you modify a commit that I proposed, please add a "Modified-by" line in the commit log. If you made radical changes to a commit that I proposed, better to list yourself as author and maybe say "based on a proposal by Mark H Weaver" in the commit log. One important modification that got lost in your simplified commit was the change I made to mrustc/tools/minicargo/build.cpp, which I evidently found necessary. Without that change, I do not know if Rust can still be bootstrapped on a small machine such as mine. Anyway, thanks for working on it, and for the other important work you've done on dramatically shortening the Rust bootstrap. Regards, Mark -- Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about . From unknown Sat Jun 14 19:20:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 29 Oct 2022 19:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mark H Weaver Cc: 57788@debbugs.gnu.org Received: via spool by 57788-submit@debbugs.gnu.org id=B57788.166707241325603 (code B ref 57788); Sat, 29 Oct 2022 19:41:01 +0000 Received: (at 57788) by debbugs.gnu.org; 29 Oct 2022 19:40:13 +0000 Received: from localhost ([127.0.0.1]:36739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oorgj-0006et-2L for submit@debbugs.gnu.org; Sat, 29 Oct 2022 15:40:13 -0400 Received: from mail-ej1-f54.google.com ([209.85.218.54]:36846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oorge-0006eV-EY for 57788@debbugs.gnu.org; Sat, 29 Oct 2022 15:40:12 -0400 Received: by mail-ej1-f54.google.com with SMTP id 13so20478319ejn.3 for <57788@debbugs.gnu.org>; Sat, 29 Oct 2022 12:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=srNmkdpzSthTNqrSTxOsVLcnrZFDdWrwElmuEet7yQM=; b=CZ46znbWWWYRja257pYNPCfVhkLv+NpBwQz53b5mJVjJK5KN3O0SUz02F0qcaOPMbH VlHvHi7ppIFZQqdy9MfKVUIiRQcpjD0wmPUWV68Bmjv6L+kPnGCpzvyEHN6yORkjhVOc i0e140P7qC87Z/pjhHHgZI2Fc5WV658kwQa4wgii7bXLpr+U8egaiOkt3GCUg+R0oc+a +3yFk2cBHXFjm2pJjN0DM5nF4cL3rDXsDMwxXqL/QqEFS8wMbNDdxuIaTAuBPHs8rhWG vDliLhRUcAMnD2SWVYup9h045g4CenZtfckrZgFB9G/A5oIUriI8250lKwGEx5ypjUjh rKmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=srNmkdpzSthTNqrSTxOsVLcnrZFDdWrwElmuEet7yQM=; b=ZS3AgQ2k2Y0MJY++CM0zuZcbcnuBOoWSeojNT/3kIMrENFUAjvbHHFzL9zpQBCuhpz Km8JbRHkkslhSOaBqlNEqBPy2pjZ4hVZocTLuDqp0aLxtwHgVsU8Izy5muJQHyvBKpg7 HtVlQwJfiLiLR/LXX2Qd1+XUZudt3GtqY/y4M1JwySt+CcitD/O66JRleeBC0F9N0xXR z8rjKwCJWBTiLDOAnNG7jIuReCnxHPwH5/BzBGY/I05b0ErYw+RgfmFu5oFZhg4DVvvm 03U8p5YwGch1cumbvaz7lLf1bUTrkog+hMT6rBfV6c4HLVPb930Xq5Al2cf8UmOyA9go +S9Q== X-Gm-Message-State: ACrzQf2yhM89b3Ap3f/Xu+FTfH98QWROAgYgvpiHjv9UUyg4iq+UXALP iI9nf+SIXmoODmH4wK6Sq6wIaNhS5yuA85Qm X-Google-Smtp-Source: AMsMyM7teVTUd+m5bgl5bUiBWmP77fTf7wSSXzNCK5AVETPccyCIs39aAtAx6kV7+E8qi5ieCZr7vw== X-Received: by 2002:a17:907:7e9a:b0:796:7a21:1520 with SMTP id qb26-20020a1709077e9a00b007967a211520mr5174155ejc.236.1667072402292; Sat, 29 Oct 2022 12:40:02 -0700 (PDT) Received: from localhost ([141.226.15.67]) by smtp.gmail.com with ESMTPSA id i6-20020a1709063c4600b007adbeca22fasm205709ejg.47.2022.10.29.12.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 12:40:01 -0700 (PDT) Date: Sat, 29 Oct 2022 22:39:59 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Mark H Weaver , 57788@debbugs.gnu.org References: <874jxahlpi.fsf@netris.org> <877d1buw70.fsf@netris.org> <87wn8kfcy1.fsf@netris.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="d7g4lNHXORQLSSr5" Content-Disposition: inline In-Reply-To: <87wn8kfcy1.fsf@netris.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --d7g4lNHXORQLSSr5 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 28, 2022 at 06:40:27AM -0400, Mark H Weaver wrote: > Hi Efraim, >=20 > I was surprised to see commit 01be1973f464cb81cdece54f7858f0dee46abb50 > attributed solely to me, although I did not actually author that commit. >=20 > In the future, please do not attribute commits to me that I did not > write or approve of. At minimum, if you modify a commit that I > proposed, please add a "Modified-by" line in the commit log. If you > made radical changes to a commit that I proposed, better to list > yourself as author and maybe say "based on a proposal by Mark H Weaver" > in the commit log. >=20 > One important modification that got lost in your simplified commit was > the change I made to mrustc/tools/minicargo/build.cpp, which I evidently > found necessary. Without that change, I do not know if Rust can still > be bootstrapped on a small machine such as mine. >=20 > Anyway, thanks for working on it, and for the other important work > you've done on dramatically shortening the Rust bootstrap. >=20 > Regards, > Mark Sorry about that, I was modifying as I went and after updating mrustc to a later commit the "if (true) add '-g'" spots in mrustc got changed to depend on enabling debug, and I found that after removing -g from the makefiles it wasn't being added anymore. I'll make sure to be more careful in the future about commit attribution. About mrustc/tools/minicargo/build.cpp, it looked to me like that was specifically about building mrustc using the codeblocks IDE. I've tried to rebuild rust-1.54 on my pine64, which has 2GB of ram and 4GB of swap and that didn't seem to be enough so I'm retrying that with just 1 core. I'm also trying on my pinebook pro, with 4GB of ram and 6GB of swap and I'll see if it works there or if it needs more tuning. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --d7g4lNHXORQLSSr5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmNdgYsACgkQQarn3Mo9 g1GW9hAAnQ1B9N0qtK3GNgwNXPeKmazLMX5KG3YxlpYg1O8I2d4MmMz8IWZrJwby WYiEEuG1XpX49EYFbC/tO/nLi8Xs+w6ukGclh+cTsfuj0j5DbGzqbexXE/KSVgU9 2fc/lNUvc7tRqkT4TepRxqz4mEjKJplCvMdq/Xu6joIPcLyOqF+sLgjjsmQA9xkz X84JVSa50BBho6ig8cfre7Ldkz2MGQBtqqghYoBh9uwfmDk+K1wgbODmnpnIcB6L 4BhCRDdkcI5wzmKXofqV4dXVHdaxTxEBBpo9S0en6szUxfkOtncno/iJ83FZDY52 0eb8oBBBqvQnCiUIxuIA5J0z8QOXA9pDAi3xyPRSFMl3CgNpmjRXvlpNLtxG//eK UEq9Vyjss5sjWcgHIZwpkyto//x3M8vBn+lBc3dk4DUz70XPEIigIRVN1O0I5tAD 4OnTUxtpA+mtS/Pc4DoiSZEDilKt7F3iMBazfUkr9esjylMCdR2su+sKBdkw0K6X 5YFuOftwwR1ixDNtHTm3/arZO5CWo71z4t5yoXK9PYdur7fI3a+hrdjB9UKiSI99 Uud6bnF6ocaP1UkidTMDrCiXLTX/aJtTDG4r6sI3luHo/P1PImVpSBDObr7U21Lg X5j06yp0l8niCDqaY5oSUyKX/bmvtmMFQYwsrzCA7LjTvTmtpRY= =4zOB -----END PGP SIGNATURE----- --d7g4lNHXORQLSSr5-- From unknown Sat Jun 14 19:20:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 01 Nov 2022 05:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57788 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 57788@debbugs.gnu.org Received: via spool by 57788-submit@debbugs.gnu.org id=B57788.166727953224104 (code B ref 57788); Tue, 01 Nov 2022 05:13:02 +0000 Received: (at 57788) by debbugs.gnu.org; 1 Nov 2022 05:12:12 +0000 Received: from localhost ([127.0.0.1]:42425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opjZL-0006Gi-V0 for submit@debbugs.gnu.org; Tue, 01 Nov 2022 01:12:12 -0400 Received: from world.peace.net ([64.112.178.59]:52730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opjZK-0006GU-5q for 57788@debbugs.gnu.org; Tue, 01 Nov 2022 01:12:10 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opjZC-0004Xi-Je; Tue, 01 Nov 2022 01:12:02 -0400 From: Mark H Weaver In-Reply-To: References: <874jxahlpi.fsf@netris.org> <877d1buw70.fsf@netris.org> <87wn8kfcy1.fsf@netris.org> Date: Tue, 01 Nov 2022 01:11:02 -0400 Message-ID: <87iljzfeda.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Efraim, Efraim Flashner writes: > Sorry about that, I was modifying as I went and after updating mrustc to > a later commit the "if (true) add '-g'" spots in mrustc got changed to > depend on enabling debug, and I found that after removing -g from the > makefiles it wasn't being added anymore. Ah, so perhaps there's no longer any need to modify mrustc/tools/minicargo/build.cpp. So much the better! > I'll make sure to be more careful in the future about commit > attribution. Thank you, Efraim. I'm grateful to you for your work on this. Mark -- Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about . From unknown Sat Jun 14 19:20:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mark H Weaver Subject: bug#57788: closed (Re: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements) Message-ID: References: <87edunfe9r.fsf@netris.org> <874jxahlpi.fsf@netris.org> X-Gnu-PR-Message: they-closed 57788 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 57788@debbugs.gnu.org Date: Tue, 01 Nov 2022 05:15:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1667279701-24355-1" This is a multi-part message in MIME format... ------------=_1667279701-24355-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #57788: [PATCH] gnu: rust: Disable debug info to reduce build requirements which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 57788@debbugs.gnu.org. --=20 57788: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D57788 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1667279701-24355-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 57788-done) by debbugs.gnu.org; 1 Nov 2022 05:14:16 +0000 Received: from localhost ([127.0.0.1]:42429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opjbM-0006Jn-EG for submit@debbugs.gnu.org; Tue, 01 Nov 2022 01:14:16 -0400 Received: from world.peace.net ([64.112.178.59]:52736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opjbL-0006Ja-02 for 57788-done@debbugs.gnu.org; Tue, 01 Nov 2022 01:14:15 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opjbE-0004cZ-6q; Tue, 01 Nov 2022 01:14:08 -0400 From: Mark H Weaver To: 57788-done@debbugs.gnu.org Subject: Re: [bug#57788] [PATCH] gnu: rust: Disable debug info to reduce build requirements In-Reply-To: References: <874jxahlpi.fsf@netris.org> <877d1buw70.fsf@netris.org> <87wn8kfcy1.fsf@netris.org> Date: Tue, 01 Nov 2022 01:13:09 -0400 Message-ID: <87edunfe9r.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57788-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I'm closing this ticket now. Mark -- Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about . ------------=_1667279701-24355-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Sep 2022 23:57:59 +0000 Received: from localhost ([127.0.0.1]:53150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYFmw-0007DY-8k for submit@debbugs.gnu.org; Tue, 13 Sep 2022 19:57:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:35442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYFmr-0007DL-LO for submit@debbugs.gnu.org; Tue, 13 Sep 2022 19:57:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYFmr-0008UB-Cj for guix-patches@gnu.org; Tue, 13 Sep 2022 19:57:53 -0400 Received: from world.peace.net ([64.112.178.59]:55026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYFmp-0007gH-69 for guix-patches@gnu.org; Tue, 13 Sep 2022 19:57:53 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYFmm-0000Jj-DP; Tue, 13 Sep 2022 19:57:48 -0400 From: Mark H Weaver To: guix-patches@gnu.org Subject: [PATCH] gnu: rust: Disable debug info to reduce build requirements Date: Tue, 13 Sep 2022 19:56:46 -0400 Message-ID: <874jxahlpi.fsf@netris.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=64.112.178.59; envelope-from=mhw@netris.org; helo=world.peace.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain The following patch, which I've tested only on my private branch of Guix, dramatically reduces the amount of memory and time required to build Rust. With this patch applied, I'm able to build Rust on a Thinkpad X200 with only 4 GB of RAM using both cores. Without it, I'm unable to build Rust at all, even with parallel builds disabled, running in a bare text-only terminal, and with every nonessential daemon stopped. When I tried, a single compiler process used more than 9 GB of virtual memory with heavy thrashing before the OOM killer finally put it out of its misery. Moreover, with this patch the builds are dramatically faster than I've previously observed. In my earlier bootstraps of Rust (up to rust-1.51), it took about 5 hours to build each compiler on my machine. Now it takes only about 2 hours per compiler, except for the initial bootstrap (1.54) which takes about 4 hours. The following patch is meant to be applied to the 'staging' branch, but I've only tested it on my own private branch, which is based on very old 'master' (April 2021) and is thus quite different by now. I offer it here in case it might be of interest, although it hasn't been tested on contemporary Guix. I'm not subscribed to this mailing list, so please make sure to CC me on any replies you'd like me to see. Regards, Mark --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-rust-Disable-debug-info-to-reduce-build-memory-r.patch Content-Description: [PATCH] gnu: rust: Disable debug info to reduce build memory requirements >From 74a004295dc7bb6bdb20172aaf4778435bdf5832 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 13 Sep 2022 19:28:03 -0400 Subject: [PATCH] gnu: rust: Disable debug info to reduce build memory requirements. This dramatically reduces the memory required to build Rust, and also speeds up the build. * gnu/packages/patches/mrustc-disable-debug.patch: New file * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/rust.scm (%mrustc-source): Apply patch. (rust-bootstrap, rust-1.55)[arguments]: In 'build' phase, set CARGO_PROFILE_DEV_DEBUG environment variable to "false". --- gnu/local.mk | 1 + .../patches/mrustc-disable-debug.patch | 110 ++++++++++++++++++ gnu/packages/rust.scm | 7 +- 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/mrustc-disable-debug.patch diff --git a/gnu/local.mk b/gnu/local.mk index cc96b77e03..a7f81ceda5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1521,6 +1521,7 @@ dist_patch_DATA = \ %D%/packages/patches/monero-use-system-miniupnpc.patch \ %D%/packages/patches/mosaicatcher-unbundle-htslib.patch \ %D%/packages/patches/mrrescue-support-love-11.patch \ + %D%/packages/patches/mrustc-disable-debug.patch \ %D%/packages/patches/mrustc-riscv64-support.patch \ %D%/packages/patches/mtools-mformat-uninitialized.patch \ %D%/packages/patches/mupen64plus-ui-console-notice.patch \ diff --git a/gnu/packages/patches/mrustc-disable-debug.patch b/gnu/packages/patches/mrustc-disable-debug.patch new file mode 100644 index 0000000000..6458cecb31 --- /dev/null +++ b/gnu/packages/patches/mrustc-disable-debug.patch @@ -0,0 +1,110 @@ +diff -ru mrustc-0.10-orig/Makefile mrustc-0.10/Makefile +--- mrustc-0.10-orig/Makefile 2022-09-13 07:49:26.299978699 -0400 ++++ mrustc-0.10/Makefile 2022-09-13 07:52:19.243970927 -0400 +@@ -38,9 +38,9 @@ + # - Disable deleting intermediate files + .SECONDARY: + +-LINKFLAGS := -g ++LINKFLAGS := + LIBS := -lz +-CXXFLAGS := -g -Wall ++CXXFLAGS := -Wall + CXXFLAGS += -std=c++14 + #CXXFLAGS += -Wextra + CXXFLAGS += -O2 +diff -ru mrustc-0.10-orig/tools/common/Makefile mrustc-0.10/tools/common/Makefile +--- mrustc-0.10-orig/tools/common/Makefile 2022-09-13 07:49:26.335978698 -0400 ++++ mrustc-0.10/tools/common/Makefile 2022-09-13 07:50:58.243974567 -0400 +@@ -11,7 +11,7 @@ + BIN := ../../bin/common_lib.a + OBJS = toml.o path.o debug.o + +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + + CXXFLAGS += $(CXXFLAGS_EXTRA) + +diff -ru mrustc-0.10-orig/tools/dump_hirfile/Makefile mrustc-0.10/tools/dump_hirfile/Makefile +--- mrustc-0.10-orig/tools/dump_hirfile/Makefile 2022-09-13 07:49:26.335978698 -0400 ++++ mrustc-0.10/tools/dump_hirfile/Makefile 2022-09-13 07:51:02.723974366 -0400 +@@ -15,7 +15,7 @@ + OBJS := main.o + + LINKFLAGS := -g -lpthread -lz +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + CXXFLAGS += -I ../common -I ../../src -I ../../src/include + + CXXFLAGS += $(CXXFLAGS_EXTRA) +diff -ru mrustc-0.10-orig/tools/minicargo/build.cpp mrustc-0.10/tools/minicargo/build.cpp +--- mrustc-0.10-orig/tools/minicargo/build.cpp 2022-09-13 07:49:26.335978698 -0400 ++++ mrustc-0.10/tools/minicargo/build.cpp 2022-09-13 07:47:19.567984395 -0400 +@@ -956,7 +956,7 @@ + } + } + } +- if( true /*this->enable_debug*/ ) { ++ if( false /*this->enable_debug*/ ) { + args.push_back("-g"); + args.push_back("--cfg"); args.push_back("debug_assertions"); + } +@@ -1106,7 +1106,7 @@ + args.push_back("--crate-type"); args.push_back("bin"); + args.push_back("-o"); args.push_back(outfile); + args.push_back("-L"); args.push_back(this->get_output_dir(true).str()); // NOTE: Forces `is_for_host` to true here. +- if( true ) ++ if( false ) + { + args.push_back("-g"); + } +diff -ru mrustc-0.10-orig/tools/minicargo/Makefile mrustc-0.10/tools/minicargo/Makefile +--- mrustc-0.10-orig/tools/minicargo/Makefile 2022-09-13 07:49:26.335978698 -0400 ++++ mrustc-0.10/tools/minicargo/Makefile 2022-09-13 07:51:07.011974173 -0400 +@@ -16,7 +16,7 @@ + OBJS := main.o build.o manifest.o repository.o cfg.o + + LINKFLAGS := -g -lpthread +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + CXXFLAGS += -I ../common + + CXXFLAGS += $(CXXFLAGS_EXTRA) +diff -ru mrustc-0.10-orig/tools/mir_opt_test/Makefile mrustc-0.10/tools/mir_opt_test/Makefile +--- mrustc-0.10-orig/tools/mir_opt_test/Makefile 2022-09-13 07:49:26.339978698 -0400 ++++ mrustc-0.10/tools/mir_opt_test/Makefile 2022-09-13 07:51:10.555974014 -0400 +@@ -15,7 +15,7 @@ + LIBS := ../../bin/mrustc.a ../../bin/common_lib.a + + LINKFLAGS := -g -lpthread -lz +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + CXXFLAGS += -I ../common -I ../../src/include -I ../../src -I . + CXXFLAGS += -Wno-misleading-indentation # Gets REALLY confused by the TU_ARM macro + +diff -ru mrustc-0.10-orig/tools/standalone_miri/Makefile mrustc-0.10/tools/standalone_miri/Makefile +--- mrustc-0.10-orig/tools/standalone_miri/Makefile 2022-09-13 07:49:26.339978698 -0400 ++++ mrustc-0.10/tools/standalone_miri/Makefile 2022-09-13 07:51:14.731973826 -0400 +@@ -15,7 +15,7 @@ + OBJS += miri.o miri_extern.o miri_intrinsic.o + + LINKFLAGS := -g -lpthread +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++CXXFLAGS := -Wall -std=c++14 -O2 + CXXFLAGS += -I ../common -I ../../src/include -I . + CXXFLAGS += -Wno-misleading-indentation # Gets REALLY confused by the TU_ARM macro + +diff -ru mrustc-0.10-orig/tools/testrunner/Makefile mrustc-0.10/tools/testrunner/Makefile +--- mrustc-0.10-orig/tools/testrunner/Makefile 2022-09-13 07:49:26.339978698 -0400 ++++ mrustc-0.10/tools/testrunner/Makefile 2022-09-13 07:51:24.819973373 -0400 +@@ -5,8 +5,8 @@ + BIN := ../../bin/testrunner + OBJS := main.o path.o + +-LINKFLAGS := -g +-CXXFLAGS := -Wall -std=c++14 -g -O2 ++LINKFLAGS := ++CXXFLAGS := -Wall -std=c++14 -O2 + + CXXFLAGS += $(CXXFLAGS_EXTRA) + LINKFLAGS += $(LINKFLAGS_EXTRA) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 25295a283e..7d1b17ad5f 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -139,7 +139,8 @@ (define %mrustc-source (sha256 (base32 "0f7kh4n2663sn0z3xib8gzw0s97qpvwag40g2vs3bfjlrbpgi9z0")) - (patches (search-patches "mrustc-riscv64-support.patch"))))) + (patches (search-patches "mrustc-riscv64-support.patch" + "mrustc-disable-debug.patch"))))) ;;; Rust 1.54 is special in that it is built with mrustc, which shortens the ;;; bootstrap path. @@ -297,6 +298,8 @@ (define rust-bootstrap ;; to set the level of parallelism. (setenv "PARLEVEL" (number->string job-count)) (setenv "CARGO_BUILD_JOBS" (number->string job-count)) + ;; reduce memory requirements during the build + (setenv "CARGO_PROFILE_DEV_DEBUG" "false") (display "Building mrustc...\n") (apply invoke "make" make-flags) @@ -453,6 +456,8 @@ (define rust-1.55 (replace 'build ;; The standard library source location moved in this release. (lambda* (#:key parallel-build? #:allow-other-keys) + ;; reduce memory requirements during the build + (setenv "CARGO_PROFILE_DEV_DEBUG" "false") (let ((job-spec (string-append "-j" (if parallel-build? (number->string (parallel-job-count)) -- 2.37.1 --=-=-= Content-Type: text/plain -- Disinformation flourishes because many people care deeply about injustice but very few check the facts. Ask me about . --=-=-=-- ------------=_1667279701-24355-1--