]> git.proxmox.com Git - proxmox-perl-rs.git/commitdiff
undo rust workspace change in preparation for .dsc builds
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 17 May 2023 07:03:49 +0000 (09:03 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 17 May 2023 09:02:00 +0000 (11:02 +0200)
The library ending up a level above the actual code just
makes .dsc/sbuild building very inconvenient, and pve-rs and
pmg-rs often grow independently from one another.

All we need is the common code available.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Cargo.toml [deleted file]
Makefile
pmg-rs/Cargo.toml
pve-rs/Cargo.toml

diff --git a/Cargo.toml b/Cargo.toml
deleted file mode 100644 (file)
index 85af95d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-[workspace]
-exclude = [ "build", "common-src", "perl", "scripts" ]
-members = [
-    "pve-rs",
-    "pmg-rs",
-]
-
-[workspace.package]
-authors = ["Proxmox Support Team <support@proxmox.com>"]
-edition = "2021"
-license = "AGPL-3"
-repository = "https://git.proxmox.com/?p=proxmox.git"
-
-[workspace.dependencies]
-anyhow = "1.0"
-base32 = "0.4"
-base64 = "0.13"
-env_logger = "0.9"
-hex = "0.4"
-http = "0.2.7"
-libc = "0.2"
-nix = "0.26"
-openssl = "0.10.40"
-serde = "1.0"
-serde_bytes = "0.11"
-serde_json = "1.0"
-url = "2"
-
-perlmod = { version = "0.13", features = [ "exporter" ] }
-
-proxmox-acme-rs = { version = "0.4", features = ["client"] }
-proxmox-apt = "0.9"
-proxmox-http = { version = "0.8", features = ["client-sync", "client-trait"] }
-proxmox-openid = "0.9.8"
-proxmox-resource-scheduling = "0.2.1"
-proxmox-subscription = "0.3"
-proxmox-sys = "0.4.2"
-proxmox-tfa = { version = "4", features = ["api"] }
-proxmox-time = "1.1.3"
-
-[patch.crates-io]
-# proxmox-tfa requires -time and -uuid as well, so enable *all* or *none* of them
-#proxmox-tfa = { path = "../proxmox/proxmox-tfa" }
-#proxmox-time = { path = "../proxmox/proxmox-time" }
-#proxmox-uuid = { path = "../proxmox/proxmox-uuid" }
index a1ed278e450622f4d788169625690509a3e9b602..bffe2c995cc17ff653bc566eebd367a3afca1ece 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,19 +2,9 @@ CARGO ?= cargo
 
 ifeq ($(BUILD_MODE), release)
 CARGO_BUILD_ARGS += --release
-DEBUG_LIBPATH :=
 else
-DEBUG_LIBPATH := "-L./target/debug", 
 endif
 
-define upload_template
-       cd build; \
-           dcmd --deb lib$(1)-rs-perl*.changes \
-           | grep -v '.changes$$' \
-           | tar -cf "$@.tar" -T-; \
-           cat "$@.tar" | ssh -X repoman@repo.proxmox.com upload --product $(2) --dist bullseye
-endef
-
 .PHONY: all
 all:
 ifeq ($(BUILD_TARGET), pve)
@@ -27,10 +17,6 @@ else
        @echo "  - make pmg"
 endif
 
-.PHONY: pve pmg
-pve pmg:
-       $(CARGO) build $(CARGO_BUILD_ARGS) -p $@-rs
-
 build:
        rm -rf build
        mkdir build
@@ -47,30 +33,13 @@ build:
        done
 # So the common packages end up in ./build, rather than ./build/common
        mv ./build/common/pkg ./build/common-pkg
-
-pve-deb: build
-       cd ./build/pve-rs && dpkg-buildpackage -b -uc -us
-       touch $@
-
-pmg-deb: build
-       cd ./build/pmg-rs && dpkg-buildpackage -b -uc -us
-       touch $@
-
-common-deb: build
-       cd ./build/common-pkg && dpkg-buildpackage -b -uc -us
-       touch $@
-
-pve-upload: pve-deb
-       $(call upload_template,pve,pve)
-pmg-upload: pmg-deb
-       $(call upload_template,pmg,pmg)
-
-# need to put into variable to ensure comma isn't interpreted as param separator on call
-common_target=pve,pmg
-common-upload: common-deb
-       $(call upload_template,proxmox,$(common_target))
-
-.PHONY: clean
-clean:
-       cargo clean
-       rm -rf ./build ./PVE ./PMG ./pve-deb ./pmg-deb ./common-deb
+# Copy the workspace root into the sources
+       mkdir build/pve-rs/.workspace
+       cp -t build/pve-rs/.workspace Cargo.toml
+       sed -i -e '/\[package\]/a\workspace = ".workspace"' build/pve-rs/Cargo.toml
+# Clear the member array and replace it with ".."
+       sed -i -e '/^members = \[/,/^]$$/d' build/pve-rs/.workspace/Cargo.toml
+       sed -i -e '/^\[workspace\]/a\members = [ ".." ]' build/pve-rs/.workspace/Cargo.toml
+# Copy the cargo config
+       mkdir build/pve-rs/.cargo
+       cp -t build/pve-rs/.cargo .cargo/config
index 4e176af996d0c97e8de7f9105a8363a759acdf1a..e3e2a6b9cc51e0c4d7e1cff0fa97f2a21e8ba435 100644 (file)
@@ -2,10 +2,11 @@
 name = "pmg-rs"
 version = "0.6.2"
 description = "PMG parts which have been ported to rust"
-authors.workspace = true
-edition.workspace = true
-license.workspace = true
-repository.workspace = true
+homepage = "https://www.proxmox.com"
+authors = ["Proxmox Support Team <support@proxmox.com>"]
+edition = "2021"
+license = "AGPL-3"
+repository = "https://git.proxmox.com/?p=proxmox.git"
 
 exclude = [
     "build",
@@ -17,24 +18,24 @@ exclude = [
 crate-type = [ "cdylib" ]
 
 [dependencies]
-anyhow.workspace = true
-env_logger.workspace = true
-hex.workspace = true
-http.workspace = true
-libc.workspace = true
-nix.workspace = true
-openssl.workspace = true
-serde.workspace = true
-serde_bytes.workspace = true
-serde_json.workspace = true
-url.workspace = true
+anyhow = "1.0"
+env_logger = "0.9"
+hex = "0.4"
+http = "0.2.7"
+libc = "0.2"
+nix = "0.26"
+openssl = "0.10.40"
+serde = "1.0"
+serde_bytes = "0.11"
+serde_json = "1.0"
+url = "2"
 
-perlmod.workspace = true
+perlmod = { version = "0.13", features = [ "exporter" ] }
 
-proxmox-acme-rs.workspace = true
-proxmox-apt.workspace = true
-proxmox-http.workspace = true
-proxmox-subscription.workspace = true
-proxmox-sys.workspace = true
-proxmox-tfa.workspace = true
-proxmox-time.workspace = true
+proxmox-acme-rs = { version = "0.4", features = ["client"] }
+proxmox-apt = "0.9"
+proxmox-http = { version = "0.8", features = ["client-sync", "client-trait"] }
+proxmox-subscription = "0.3"
+proxmox-sys = "0.4.2"
+proxmox-tfa = { version = "4", features = ["api"] }
+proxmox-time = "1.1.3"
index 4b47c60e8903068a77b89b0428c1ed8ba949c19b..a6ec5780b11841d26547114a91d233c54a910306 100644 (file)
@@ -3,10 +3,10 @@ name = "pve-rs"
 version = "0.7.6"
 description = "PVE parts which have been ported to Rust"
 homepage = "https://www.proxmox.com"
-authors.workspace = true
-edition.workspace = true
-license.workspace = true
-repository.workspace = true
+authors = ["Proxmox Support Team <support@proxmox.com>"]
+edition = "2021"
+license = "AGPL-3"
+repository = "https://git.proxmox.com/?p=proxmox.git"
 
 exclude = [
     "debian",
@@ -16,27 +16,27 @@ exclude = [
 crate-type = [ "cdylib" ]
 
 [dependencies]
-anyhow.workspace = true
-base32.workspace = true
-base64.workspace = true
-env_logger.workspace = true
-hex.workspace = true
-http.workspace = true
-libc.workspace = true
-nix.workspace = true
-openssl.workspace = true
-serde.workspace = true
-serde_bytes.workspace = true
-serde_json.workspace = true
-url.workspace = true
+anyhow = "1.0"
+base32 = "0.4"
+base64 = "0.13"
+env_logger = "0.9"
+hex = "0.4"
+http = "0.2.7"
+libc = "0.2"
+nix = "0.26"
+openssl = "0.10.40"
+serde = "1.0"
+serde_bytes = "0.11"
+serde_json = "1.0"
+url = "2"
 
-perlmod.workspace = true
+perlmod = { version = "0.13", features = [ "exporter" ] }
 
-proxmox-apt.workspace = true
-proxmox-http.workspace = true
-proxmox-openid.workspace = true
-proxmox-resource-scheduling.workspace = true
-proxmox-subscription.workspace = true
-proxmox-sys.workspace = true
-proxmox-tfa.workspace = true
-proxmox-time.workspace = true
+proxmox-apt = "0.9"
+proxmox-http = { version = "0.8", features = ["client-sync", "client-trait"] }
+proxmox-openid = "0.9.8"
+proxmox-resource-scheduling = "0.3.0"
+proxmox-subscription = "0.3"
+proxmox-sys = "0.4.2"
+proxmox-tfa = { version = "4", features = ["api"] }
+proxmox-time = "1.1.3"