[pbs-devel] [PATCH v2 proxmox-backup 4/5] cargo: add stubs for `ipconfig` windows build dependency

Christian Ebner c.ebner at proxmox.com
Mon Jan 13 15:42:25 CET 2025


`hickeroy-resolver` depends on ipconfig for name resolution on
Windows. Eventhough the build is not configured for windows and the
dependency should be disabled, cargo nevertheless expects the
dependency to be found in the registry.

As a workaround, add a dummy crate and point the registry to it,
in order to build without having to pull in the actually unused
dependency.

In preparation for adding `hickeroy-resolver` as alternative to
`getaddrinfo` based name resolution to be used for the statically
linked proxmox-backup-client.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 1:
- not present in previous version

 Makefile                         | 2 +-
 cargo-stubs/ipconfig/Cargo.toml  | 6 ++++++
 cargo-stubs/ipconfig/src/main.rs | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 cargo-stubs/ipconfig/Cargo.toml
 create mode 100644 cargo-stubs/ipconfig/src/main.rs

diff --git a/Makefile b/Makefile
index 428ef40b9..4fe1201ca 100644
--- a/Makefile
+++ b/Makefile
@@ -98,7 +98,7 @@ build:
 	cp -a debian \
 	  Cargo.toml src \
 	  $(SUBCRATES) \
-	  docs etc examples tests www zsh-completions templates \
+	  docs etc examples tests www zsh-completions templates cargo-stubs \
 	  defines.mk Makefile \
 	  ./build/
 	rm -f build/Cargo.lock
diff --git a/cargo-stubs/ipconfig/Cargo.toml b/cargo-stubs/ipconfig/Cargo.toml
new file mode 100644
index 000000000..3bd3b0a88
--- /dev/null
+++ b/cargo-stubs/ipconfig/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "ipconfig"
+version = "0.3.2"
+edition = "2021"
+
+[dependencies]
diff --git a/cargo-stubs/ipconfig/src/main.rs b/cargo-stubs/ipconfig/src/main.rs
new file mode 100644
index 000000000..f79c691f0
--- /dev/null
+++ b/cargo-stubs/ipconfig/src/main.rs
@@ -0,0 +1,2 @@
+fn main() {
+}
-- 
2.39.5





More information about the pbs-devel mailing list