From patchwork Mon Mar 16 15:47:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2008 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773676142; bh=r9RFa0MuX3k42nxIkw7Q0+t6hpZ/OTWziBWXszSOI5Q=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pNC2MZmBh8l6sxVLS/lG/CGcnTJ+1Znfj5RjmPLezL3JeVhVWTKM1ma5koX7lCwbT ZNahiCX7r2r3BeDP+UbgT9GObM3lU6ASQXVIBHFK0qfOihnBPYsAhjuTKLEVJVuVm7 cIgZbugRY/i9r7Nqog3GgakqwlvMBWWb8xy5J7znt94Z063ncwGfUaMUecPvLu2gIs +TuZ75na8BshtyTrIkPnpDVPF3GwINV+aCtCpNdZd1g1cT+Auo7GSLZgFnE9hrqE// sow2xDx/pXxF1GmsHk1L7n3XoqcjBeuUxWFRLSpxo6QF3HY6qYlT+u81B/8b/aIruu fvGJvx5WFQLTQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EADFB6A097 for ; Mon, 16 Mar 2026 09:49:02 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 24Bp2kLPS71D for ; Mon, 16 Mar 2026 09:49:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773676142; bh=r9RFa0MuX3k42nxIkw7Q0+t6hpZ/OTWziBWXszSOI5Q=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pNC2MZmBh8l6sxVLS/lG/CGcnTJ+1Znfj5RjmPLezL3JeVhVWTKM1ma5koX7lCwbT ZNahiCX7r2r3BeDP+UbgT9GObM3lU6ASQXVIBHFK0qfOihnBPYsAhjuTKLEVJVuVm7 cIgZbugRY/i9r7Nqog3GgakqwlvMBWWb8xy5J7znt94Z063ncwGfUaMUecPvLu2gIs +TuZ75na8BshtyTrIkPnpDVPF3GwINV+aCtCpNdZd1g1cT+Auo7GSLZgFnE9hrqE// sow2xDx/pXxF1GmsHk1L7n3XoqcjBeuUxWFRLSpxo6QF3HY6qYlT+u81B/8b/aIruu fvGJvx5WFQLTQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CE94E6A07C for ; Mon, 16 Mar 2026 09:49:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773676140; bh=Z6Mj82hHwRRM2e4LZ9s+v0bsdzuBXDsuqCANE90nj6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dv9r7mMdPu9rddUsSXzsaGudYhxFQP9TnEMSs2tTd+1jv6KwoGrYSwylLUrSvalCg FJVuP03zNfdyCG8/tgwePMAXQiqBUoze7h4ISadrEcKpTswBrSgHCz34+7y+OhgR0+ kJfvBAmMmdxM1TaD2c2RSSBcOvBaWD/cFu4uwrylfKqW2EckfYQU7ZKOL+Bso+xrjh p1jmFRSenk6l73l0U8PHko2VxJqjtdndblBbUMlrvgKszGw5Qv+4G/knx+dbi0lGbr rYz7NmmHzVlqgycHFmQsqvvEkOpsNGe6+1gXKuM2Ze8zo89Hc5Mdrj4w99hY7kVKau b7bjLs7R/dXkw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4C2AA6A07C; Mon, 16 Mar 2026 09:49:00 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id hfh02ZKPJyg4; Mon, 16 Mar 2026 09:49:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1773676137; bh=wYqHlgJuKLigg3JfbeyTgfh0Kcv+srM3+V8UObkh5sc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VoBhSySTZcIQTYl6JRDEFJ4FSut3RpmzypLHOoz8UggGP1aRvYK2MsNh4yM7uDDGO ZjxW64HuyB73j1HxR2Q081otrzjYDMe5oBFSKgt6x5v6NNLnDsskg7XTSaslDynbdo Oj2dlzm0m/vqNkWK2WiOr+QcYub8JNHWtC0ExOajx+1HFY6Q2Ov9hgBok3V+PegjWR kLNiNcsR2Z4hZzwdimTYiBrbGF4jKWVu/jEsew9SpWuI/xY4gtRCQkZHr2Fg/qJF7v MBuuS9eFSB7+57iv9kamOeTbbZ+xEQF44yGHMAgVj2DBGq+WlNyYhk9aIqK3SWzXq5 jCZwzZmToktLQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3E8DC6A061; Mon, 16 Mar 2026 09:48:57 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 16 Mar 2026 09:47:21 -0600 Message-ID: <20260316154733.1587261-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260316154733.1587261-1-sjg@u-boot.org> References: <20260316154733.1587261-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FORG75CYNWN7JDWIJVX7H75NMB42I722 X-Message-ID-Hash: FORG75CYNWN7JDWIJVX7H75NMB42I722 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/20] buildman: Install toolchains on remote machines List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add the ability to fetch missing toolchains on remote machines when probing with the --machines option. When --machines-fetch-arch is passed alongside --machines, any toolchain architectures available locally but missing on a remote machine are fetched via 'buildman --fetch-arch' over SSH. Pass the local toolchain set as needed_archs to check_toolchains() so that missing toolchains can be identified by comparison with the local host. Signed-off-by: Simon Glass --- tools/buildman/cmdline.py | 4 ++++ tools/buildman/control.py | 5 +++-- tools/buildman/test_machine.py | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py index b284b2cbbfa..a85da069d24 100644 --- a/tools/buildman/cmdline.py +++ b/tools/buildman/cmdline.py @@ -109,6 +109,10 @@ def add_upto_m(parser): default=False, dest='machines', help='Probe all remote machines from [machines] config and show ' 'their status and available toolchains') + parser.add_argument('--machines-fetch-arch', action='store_true', + default=False, + help='Fetch missing toolchains on remote machines (implies ' + '--machines)') parser.add_argument('--machines-buildman-path', type=str, default='buildman', help='Path to buildman on remote machines (default: %(default)s)') diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 97f6ffcbfd2..7515932a2e4 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -760,9 +760,10 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None, col = terminal.Color() # Handle --machines: probe remote machines and show status - if args.machines: + if args.machines or args.machines_fetch_arch: return machine.do_probe_machines( - col, buildman_path=args.machines_buildman_path) + col, fetch=args.machines_fetch_arch, + buildman_path=args.machines_buildman_path) git_dir = os.path.join(args.git, '.git') diff --git a/tools/buildman/test_machine.py b/tools/buildman/test_machine.py index 1397a4a76c0..b635d1afb6f 100644 --- a/tools/buildman/test_machine.py +++ b/tools/buildman/test_machine.py @@ -172,6 +172,20 @@ sandbox : /usr/bin/gcc 'sandbox': '/usr/bin/gcc', }) + @mock.patch('buildman.machine._run_ssh') + def test_fetch_toolchain_success(self, mock_ssh): + """Test successful toolchain fetch""" + mock_ssh.return_value = 'Downloading...\nDone' + m = machine.Machine('server1') + self.assertTrue(m.fetch_toolchain('buildman', 'arm')) + + @mock.patch('buildman.machine._run_ssh') + def test_fetch_toolchain_failure(self, mock_ssh): + """Test failed toolchain fetch""" + mock_ssh.side_effect = machine.MachineError('fetch failed') + m = machine.Machine('server1') + self.assertFalse(m.fetch_toolchain('buildman', 'arm')) + @mock.patch('buildman.machine._run_ssh') def test_weight_calculation(self, mock_ssh): """Test weight calculation based on load"""