From: Christoph Heiss <c.heiss@proxmox.com>
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 [thread overview]
Message-ID: <20260720120638.784614-2-c.heiss@proxmox.com> (raw)
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
reply other threads:[~2026-07-20 12:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260720120638.784614-2-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.