From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 7527C1FF138 for ; Mon, 20 Jul 2026 14:09:16 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BF0CD214AD; Mon, 20 Jul 2026 14:09:15 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer] assistant: generate locale-info.json as needed in build script Date: Mon, 20 Jul 2026 14:06:28 +0200 Message-ID: <20260720120638.784614-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784549312110 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.001 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: LIHLESKOPJAUOCQU25DOL4QKFNBNPRUY X-Message-ID-Hash: LIHLESKOPJAUOCQU25DOL4QKFNBNPRUY X-MailFrom: c.heiss@proxmox.com 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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Improve the developer experience a bit by generating locale-info.json as needed in a build script. Currently, when using e.g. cargo {build,run} -p proxmox-auto-install-assistant locale-info.json must be generated beforehand manually using the make target. proxmox-auto-install-assistant hard-depends on locale-info.json being present during build-time, as it is included via include_str!(). No functional changes. Signed-off-by: Christoph Heiss --- Just something that has annoyed me for quite some time now. Could also invoke `country.pl` directly and save it to $OUT_DIR (which would be a bit more idiomatic), but would also cause generating locale-info.json twice - not sure if that's really worth it. proxmox-auto-install-assistant/build.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 proxmox-auto-install-assistant/build.rs diff --git a/proxmox-auto-install-assistant/build.rs b/proxmox-auto-install-assistant/build.rs new file mode 100644 index 0000000..3c88d9d --- /dev/null +++ b/proxmox-auto-install-assistant/build.rs @@ -0,0 +1,20 @@ +use std::{io, process::Command}; + +fn main() -> Result<(), io::Error> { + let cmd = Command::new("make") + .args([ + "-C", + concat!(env!("CARGO_MANIFEST_DIR"), "/.."), + "locale-info.json", + ]) + .status(); + + match cmd { + Ok(ec) if !ec.success() => Err(io::Error::other(format!( + "make locale-info.json failed with code {}", + ec.code().unwrap_or(-1) + ))), + Ok(_) => Ok(()), + Err(err) => Err(err), + } +} -- 2.54.0