public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH installer] assistant: generate locale-info.json as needed in build script
@ 2026-07-20 12:06 Christoph Heiss
  0 siblings, 0 replies; only message in thread
From: Christoph Heiss @ 2026-07-20 12:06 UTC (permalink / raw)
  To: pve-devel

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 <c.heiss@proxmox.com>
---
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





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-20 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 12:06 [PATCH installer] assistant: generate locale-info.json as needed in build script Christoph Heiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal