From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SD9IJsxs52TqBwAASxT56A (envelope-from ) for ; Thu, 24 Aug 2023 16:44:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4DFUJsxs52T9DQEA9RJhRA (envelope-from ) for ; Thu, 24 Aug 2023 16:44:28 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2867A5F9EF for ; Thu, 24 Aug 2023 16:44:28 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nUhHZsiF; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692888268; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=EX22l2OaN++J/SLX8onjGIXWXbfdoEt0jw2uW6vgA4s=; b=bM/3WquhDHUjdEw73mG/1IiSzd6X+xP041V5PnBXXkaQxh0sBf9wJvlhdoQX0FJdIiFT0S aps4I1NmkCCl6+6j6cfuSNIK5u8ctXmY7Oesl5hrkNfZNjN2vh6AF/PF1QAVgvxUr6PJ0U 8xzzCZC28qT5rw5Wr2rxbKV2T3SuEKZ/r3Is7x1LgnHe4uilQyF1sV4MP6BesvQluGybWv FReUiMlgnOUI7A9+kKlwwHzhC8fLAKBaZnT00AwUle+GnQ34VpaCQCeTZPBdIF3E0Si3PR x4VBinpxcrBwUb6RT/HsmphFmeWb2BMNO8AB1JzKPlPBwhS/O/BEzO5oacWzaA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692888268; a=rsa-sha256; cv=none; b=UxEa9S9K38OikKlQV0y1twVKUgk93TBa3reUUj5smSQS0FOqHwp5PxadKTHAcM/g/qvsT7 wKyM8qupJSyi4me8Vef70Bkxdgqby9UcUa/Hl7whTJhgtd3aG/SBesbofc1n+AyJJC49vx UU+WpsEWo18VWpCtqoPElsRWs2g77GTu8ESJIzHUNdar9JLiJ2tq08WAkKHgHkg2a+TmNP FkBlbXIMutTPOSsPL3AdZ+YaO2z/Eietq/xJNfm45l2ILWcAe7ylSDsP3Il4f4CoTzhVHq 1aXpk3Z9VlkFJxuF0EfUulAwzOhpI7K8Um6gqd2m7Z/sD1wFi+gm7AOxK8ECLw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=nUhHZsiF; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZBZ6-0000Xo-MG; Thu, 24 Aug 2023 10:44:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZBZ0-0000UP-QN for bug-guix@gnu.org; Thu, 24 Aug 2023 10:43:58 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZBZ0-00033I-I6 for bug-guix@gnu.org; Thu, 24 Aug 2023 10:43:58 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZBZ4-0008FB-AY for bug-guix@gnu.org; Thu, 24 Aug 2023 10:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65456: [PATCH 0/2] Split guix build into more steps for 32bit hosts. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 24 Aug 2023 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65456 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Janneke Nieuwenhuizen Cc: Josselin Poiret , 65456@debbugs.gnu.org, Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , Christopher Baines Received: via spool by 65456-submit@debbugs.gnu.org id=B65456.169288818231611 (code B ref 65456); Thu, 24 Aug 2023 14:44:02 +0000 Received: (at 65456) by debbugs.gnu.org; 24 Aug 2023 14:43:02 +0000 Received: from localhost ([127.0.0.1]:38372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZBY5-0008Da-V0 for submit@debbugs.gnu.org; Thu, 24 Aug 2023 10:43:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZBY4-0008DJ-Pb for 65456@debbugs.gnu.org; Thu, 24 Aug 2023 10:43:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZBXt-0002pX-7b; Thu, 24 Aug 2023 10:42:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=EX22l2OaN++J/SLX8onjGIXWXbfdoEt0jw2uW6vgA4s=; b=nUhHZsiFxRBaOU04sWVO Jne3nfvHz/W+5KZgM0eZwYt3jdmX1wCBFv+VXOA2xzjOYWn7im2SWARKABUJ5uO6SXvqJAsSzzqge SBKjHPeHNbfkIzpiQn7HL1v0Qvj2BHQNvaCFKnpBRlfL4nAaoXN2WcbIBsVRnfugAuK10W81j2Dwy lvFINPR+NjisPQ72yEU5Fwk5++LVRx7QkB8fw33qObrGRxkbcAql6P1k40+qel68kld7CvPcEWM0c B9T6Hz8wCboWYEKiEql9RSOYgClwckNo5lW3/G3w7TFhS5HeuXooLkJOyUX5m3/TngVxpi9QEKU/Z Owl5xcTp6QNhbw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <887d53ad5bee76b33d765e744c50e94e063b1ab8.1692723764.git.janneke@gnu.org> <87pm3e3fuu.fsf_-_@gnu.org> <871qfu8erx.fsf_-_@gnu.org> <87h6oq6qpg.fsf_-_@gnu.org> Date: Thu, 24 Aug 2023 16:42:32 +0200 In-Reply-To: <87h6oq6qpg.fsf_-_@gnu.org> (Janneke Nieuwenhuizen's message of "Wed, 23 Aug 2023 11:41:31 +0200") Message-ID: <87zg2gy013.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.41 X-Spam-Score: -5.41 X-Migadu-Queue-Id: 2867A5F9EF X-Migadu-Scanner: mx1.migadu.com X-TUID: 3vp26waKt13B Hi! Janneke Nieuwenhuizen skribis: >>>From ad94f06620e53fcc1495a2e2479dfc627177047c Mon Sep 17 00:00:00 2001 > Message-ID: > From: Janneke Nieuwenhuizen > Date: Thu, 22 Jun 2023 08:30:25 +0200 > Subject: [PATCH v4] self: Build directories in chunks of max 25 files at a > time. > > Similar to split build of make-go in Makefile.am, this breaks-up building > directories into chunks of max 25 files. Also force garbage collection. The big difference with =E2=80=98make-go=E2=80=99 is that =E2=80=98make-go= =E2=80=99 spawns a new process for each chunk of files: each process starts with an empty heap, which is not the case here as we reuse the same process. However, (guix self) is already splitting gnu/packages/*.scm in two pieces: =E2=80=98guix-packages-base=E2=80=99 and =E2=80=98guix-packages=E2= =80=99. The former is the closure of (gnu packages base), and the latter contains the remaining files. Unfortunately this is uneven: --8<---------------cut here---------------start------------->8--- $ readlink -f $(type -P guix) /gnu/store/12p5axbr4gjrghlrqa4ikmhsxwq2wgw3-guix-command $ guix gc -R /gnu/store/12p5axbr4gjrghlrqa4ikmhsxwq2wgw3-guix-command|grep = packages-base /gnu/store/ivprgy9b2lv8wmkm10wkypf7k24cdifb-guix-packages-base /gnu/store/05pjlcfcfa0k9y833nnxxxjcn5mqr8zj-guix-packages-base-source /gnu/store/gnxjbyfwfmb216krz2x0cf1z5k1lla9x-guix-packages-base-modules $ find /gnu/store/ivprgy9b2lv8wmkm10wkypf7k24cdifb-guix-packages-base -typ= e f |wc -l 361 $ guix gc -R /gnu/store/12p5axbr4gjrghlrqa4ikmhsxwq2wgw3-guix-command|grep = packages$ /gnu/store/8cda50hsayydrlw0qrhcy8q4dr9f1avx-guix-locale-guix-packages ludo@ribbon ~/src/guix [env]$ find /gnu/store/8cda50hsayydrlw0qrhcy8q4dr9f1= avx-guix-locale-guix-packages | wc -l 64 $ guix describe Generation 271 Aug 20 2023 23:48:59 (current) guix a0f5885 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: a0f5885fefd93a3859b6e4b82b18a6db9faeee05 --8<---------------cut here---------------end--------------->8--- Maxime Devos looked into this a while back: https://issues.guix.gnu.org/54539 > * guix/self.scm (compiled-modules)[process-directory]: Split building of > directories into chunks of max 25 files. [...] > (define (process-directory directory files output) > - ;; Hide compilation warnings. > - (parameterize ((current-warning-port (%make-void-port "w"))) > - (compile-files directory #$output files > - #:workers (parallel-job-count) > - #:report-load report-load > - #:report-compilation report-compilation))) > + (let* ((size 25) ;compile max 25 files = a time > + (chunks (unfold > + (lambda (seed) (< (length seed) size)) ;p > + (cute take <> size) ;f > + (cute drop <> size) ;g > + files ;seed > + list))) ;tail > + (for-each > + (lambda (chunck) s/chunck/chunk/ Can you confirm that this reduces memory usage observably? One way to check that would be to print (gc-stats) from =E2=80=98process-directory=E2= =80=99, with and without the change. Could you give it a try? Intuitively, I don=E2=80=99t see why it would eat less memory; maybe peak m= emory usage is lower because we do less at once? Also, I think we should remove the explicit (gc) call: it should not be necessary, and if we depend on that, something=E2=80=99s wrong. Anyhow, thanks for tackling this issue! Ludo=E2=80=99.