undo rust workspace change in preparation for .dsc builds

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>
This commit is contained in:
Wolfgang Bumiller 2023-05-17 09:03:49 +02:00
parent b56f09dbaa
commit 34a0068618
4 changed files with 60 additions and 135 deletions

View File

@ -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" }

View File

@ -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

View 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"

View 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"