* [pbs-devel] [PATCH proxmox] build.sh: allow building multiple crates
@ 2025-04-15 12:00 Christoph Heiss
2025-04-15 12:09 ` Fabian Grünbichler
2025-04-15 15:45 ` Thomas Lamprecht
0 siblings, 2 replies; 4+ messages in thread
From: Christoph Heiss @ 2025-04-15 12:00 UTC (permalink / raw)
To: pbs-devel
Instead of just looking at the first argument, iterate over all of them
and build them one by one.
Useful if e.g. applying patch series or generally working with multiple
crates in this repo, to then be able to run e.g.
$ ./build.sh proxmox-log proxmox-serde
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
build.sh | 62 +++++++++++++++++++++++++++++---------------------------
1 file changed, 32 insertions(+), 30 deletions(-)
diff --git a/build.sh b/build.sh
index 7aa0a85b..9857905a 100755
--- a/build.sh
+++ b/build.sh
@@ -1,36 +1,38 @@
-#!/bin/sh
+#!/bin/bash
set -e
export CARGO=/usr/bin/cargo
export RUSTC=/usr/bin/rustc
-CRATE=$1
-BUILDCMD=${BUILDCMD:-"dpkg-buildpackage -b -uc -us"}
-BUILDDIR="${BUILDDIR:-"build"}"
-
-mkdir -p "${BUILDDIR}"
-echo system >"${BUILDDIR}"/rust-toolchain
-rm -rf ""${BUILDDIR}"/${CRATE}"
-
-CONTROL="$PWD/${CRATE}/debian/control"
-
-if [ -e "$CONTROL" ]; then
- # check but only warn, debcargo fails anyway if crates are missing
- dpkg-checkbuilddeps $PWD/${CRATE}/debian/control || true
- [ "x$NOCONTROL" = 'x' ] && rm -f "$PWD/${CRATE}/debian/control"
-fi
-
-debcargo package \
- --config "$PWD/${CRATE}/debian/debcargo.toml" \
- --changelog-ready \
- --no-overlay-write-back \
- --directory "$PWD/"${BUILDDIR}"/${CRATE}" \
- "${CRATE}" \
- "$(dpkg-parsechangelog -l "${CRATE}/debian/changelog" -SVersion | sed -e 's/-.*//')"
-
-cd ""${BUILDDIR}"/${CRATE}"
-rm -f debian/source/format.debcargo.hint
-${BUILDCMD}
-
-[ "x$NOCONTROL" = "x" ] && cp debian/control "$CONTROL"
+for CRATE in "$@"; do
+ BUILDCMD=${BUILDCMD:-"dpkg-buildpackage -b -uc -us"}
+ BUILDDIR="${BUILDDIR:-"build"}"
+
+ mkdir -p "${BUILDDIR}"
+ echo system >"${BUILDDIR}"/rust-toolchain
+ rm -rf ""${BUILDDIR}"/${CRATE}"
+
+ CONTROL="$PWD/${CRATE}/debian/control"
+
+ if [ -e "$CONTROL" ]; then
+ # check but only warn, debcargo fails anyway if crates are missing
+ dpkg-checkbuilddeps $PWD/${CRATE}/debian/control || true
+ [ "x$NOCONTROL" = 'x' ] && rm -f "$PWD/${CRATE}/debian/control"
+ fi
+
+ debcargo package \
+ --config "$PWD/${CRATE}/debian/debcargo.toml" \
+ --changelog-ready \
+ --no-overlay-write-back \
+ --directory "$PWD/"${BUILDDIR}"/${CRATE}" \
+ "${CRATE}" \
+ "$(dpkg-parsechangelog -l "${CRATE}/debian/changelog" -SVersion | sed -e 's/-.*//')"
+
+ pushd ""${BUILDDIR}"/${CRATE}"
+ rm -f debian/source/format.debcargo.hint
+ ${BUILDCMD}
+
+ [ "x$NOCONTROL" = "x" ] && cp debian/control "$CONTROL"
+ popd
+done
--
2.48.1
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pbs-devel] [PATCH proxmox] build.sh: allow building multiple crates
2025-04-15 12:00 [pbs-devel] [PATCH proxmox] build.sh: allow building multiple crates Christoph Heiss
@ 2025-04-15 12:09 ` Fabian Grünbichler
2025-04-15 12:40 ` Christoph Heiss
2025-04-15 15:45 ` Thomas Lamprecht
1 sibling, 1 reply; 4+ messages in thread
From: Fabian Grünbichler @ 2025-04-15 12:09 UTC (permalink / raw)
To: Proxmox Backup Server development discussion
On April 15, 2025 2:00 pm, Christoph Heiss wrote:
> Instead of just looking at the first argument, iterate over all of them
> and build them one by one.
>
> Useful if e.g. applying patch series or generally working with multiple
> crates in this repo, to then be able to run e.g.
>
> $ ./build.sh proxmox-log proxmox-serde
does this have any advantage over
`make proxmox-log-deb proxmox-serde-deb`
? that one even supports parallelization if desired ;)
>
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> build.sh | 62 +++++++++++++++++++++++++++++---------------------------
> 1 file changed, 32 insertions(+), 30 deletions(-)
>
> diff --git a/build.sh b/build.sh
> index 7aa0a85b..9857905a 100755
> --- a/build.sh
> +++ b/build.sh
> @@ -1,36 +1,38 @@
> -#!/bin/sh
> +#!/bin/bash
>
> set -e
>
> export CARGO=/usr/bin/cargo
> export RUSTC=/usr/bin/rustc
>
> -CRATE=$1
> -BUILDCMD=${BUILDCMD:-"dpkg-buildpackage -b -uc -us"}
> -BUILDDIR="${BUILDDIR:-"build"}"
> -
> -mkdir -p "${BUILDDIR}"
> -echo system >"${BUILDDIR}"/rust-toolchain
> -rm -rf ""${BUILDDIR}"/${CRATE}"
> -
> -CONTROL="$PWD/${CRATE}/debian/control"
> -
> -if [ -e "$CONTROL" ]; then
> - # check but only warn, debcargo fails anyway if crates are missing
> - dpkg-checkbuilddeps $PWD/${CRATE}/debian/control || true
> - [ "x$NOCONTROL" = 'x' ] && rm -f "$PWD/${CRATE}/debian/control"
> -fi
> -
> -debcargo package \
> - --config "$PWD/${CRATE}/debian/debcargo.toml" \
> - --changelog-ready \
> - --no-overlay-write-back \
> - --directory "$PWD/"${BUILDDIR}"/${CRATE}" \
> - "${CRATE}" \
> - "$(dpkg-parsechangelog -l "${CRATE}/debian/changelog" -SVersion | sed -e 's/-.*//')"
> -
> -cd ""${BUILDDIR}"/${CRATE}"
> -rm -f debian/source/format.debcargo.hint
> -${BUILDCMD}
> -
> -[ "x$NOCONTROL" = "x" ] && cp debian/control "$CONTROL"
> +for CRATE in "$@"; do
> + BUILDCMD=${BUILDCMD:-"dpkg-buildpackage -b -uc -us"}
> + BUILDDIR="${BUILDDIR:-"build"}"
> +
> + mkdir -p "${BUILDDIR}"
> + echo system >"${BUILDDIR}"/rust-toolchain
> + rm -rf ""${BUILDDIR}"/${CRATE}"
> +
> + CONTROL="$PWD/${CRATE}/debian/control"
> +
> + if [ -e "$CONTROL" ]; then
> + # check but only warn, debcargo fails anyway if crates are missing
> + dpkg-checkbuilddeps $PWD/${CRATE}/debian/control || true
> + [ "x$NOCONTROL" = 'x' ] && rm -f "$PWD/${CRATE}/debian/control"
> + fi
> +
> + debcargo package \
> + --config "$PWD/${CRATE}/debian/debcargo.toml" \
> + --changelog-ready \
> + --no-overlay-write-back \
> + --directory "$PWD/"${BUILDDIR}"/${CRATE}" \
> + "${CRATE}" \
> + "$(dpkg-parsechangelog -l "${CRATE}/debian/changelog" -SVersion | sed -e 's/-.*//')"
> +
> + pushd ""${BUILDDIR}"/${CRATE}"
> + rm -f debian/source/format.debcargo.hint
> + ${BUILDCMD}
> +
> + [ "x$NOCONTROL" = "x" ] && cp debian/control "$CONTROL"
> + popd
> +done
> --
> 2.48.1
>
>
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
>
>
>
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pbs-devel] [PATCH proxmox] build.sh: allow building multiple crates
2025-04-15 12:09 ` Fabian Grünbichler
@ 2025-04-15 12:40 ` Christoph Heiss
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Heiss @ 2025-04-15 12:40 UTC (permalink / raw)
To: Fabian Grünbichler; +Cc: Proxmox Backup Server development discussion
On Tue Apr 15, 2025 at 2:09 PM CEST, Fabian Grünbichler wrote:
> On April 15, 2025 2:00 pm, Christoph Heiss wrote:
>> [..]
>> $ ./build.sh proxmox-log proxmox-serde
>
> does this have any advantage over
>
> `make proxmox-log-deb proxmox-serde-deb`
>
> ? that one even supports parallelization if desired ;)
Oh right, didn't see that this command supports multiple crates at the
same time! Thanks!
Just need to retrain my muscle memory from `./build.sh ..` now :^)
So I guess this patch can simply be disregarded.
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pbs-devel] [PATCH proxmox] build.sh: allow building multiple crates
2025-04-15 12:00 [pbs-devel] [PATCH proxmox] build.sh: allow building multiple crates Christoph Heiss
2025-04-15 12:09 ` Fabian Grünbichler
@ 2025-04-15 15:45 ` Thomas Lamprecht
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2025-04-15 15:45 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Christoph Heiss
On 15/04/2025 14:00, Christoph Heiss wrote:
> Instead of just looking at the first argument, iterate over all of them
> and build them one by one.
>
> Useful if e.g. applying patch series or generally working with multiple
> crates in this repo, to then be able to run e.g.
>
> $ ./build.sh proxmox-log proxmox-serde
>
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> build.sh | 62 +++++++++++++++++++++++++++++---------------------------
> 1 file changed, 32 insertions(+), 30 deletions(-)
>
> diff --git a/build.sh b/build.sh
> index 7aa0a85b..9857905a 100755
> --- a/build.sh
> +++ b/build.sh
> @@ -1,36 +1,38 @@
> -#!/bin/sh
> +#!/bin/bash
I would prefer keeping such basic scrips posix shell conform, I do not want
to have to install bash, or any advanced shell for that matter, if doing
minimal bootstrapping.
But I think Fabian got a legit answer here, this is already possible
through the make targets, so lets just keep this slightly more trivial
for now.
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-15 15:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-15 12:00 [pbs-devel] [PATCH proxmox] build.sh: allow building multiple crates Christoph Heiss
2025-04-15 12:09 ` Fabian Grünbichler
2025-04-15 12:40 ` Christoph Heiss
2025-04-15 15:45 ` Thomas Lamprecht
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