* [PATCH] make-release: don't rely on $CWD when excluding subproject directories
@ 2025-02-13 23:53 Michael Roth
2025-02-14 5:16 ` Michael Tokarev
0 siblings, 1 reply; 3+ messages in thread
From: Michael Roth @ 2025-02-13 23:53 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Michael Tokarev, qemu-stable
The current logic scans qemu.git/subprojects/ from *.wrap files to
determine whether or not to include the associated directories in the
release tarballs. However, the script assumes that it is being run from
the top-level of the source directory, which may not always be the case.
In particular, when generating releases via, e.g.:
make qemu-9.2.1.tar.xz
the $CWD will either be an arbitrary external build directory, or
qemu.git/build, and the exclusions will not be processed as expected.
Fix this by using the $src parameter passed to the script as the root
directory for the various subproject/ paths referenced by this logic.
Also, the error case at the beginning of the subproject_dir() will not
result in the error message being printed, and will instead produce an
error message about "error" not being a valid command. Fix this by using
basic shell commands.
Fixes: be27b5149c86 ("make-release: only leave tarball of wrap-file subprojects")
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Roth <michael.roth@amd.com>
---
scripts/make-release | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/scripts/make-release b/scripts/make-release
index 2885e87210..1b89b3423a 100755
--- a/scripts/make-release
+++ b/scripts/make-release
@@ -11,8 +11,9 @@
# See the COPYING file in the top-level directory.
function subproject_dir() {
- if test ! -f "subprojects/$1.wrap"; then
- error "scripts/archive-source.sh should only process wrap subprojects"
+ if test ! -f "$src/subprojects/$1.wrap"; then
+ echo "scripts/archive-source.sh should only process wrap subprojects"
+ exit 1
fi
# Print the directory key of the wrap file, defaulting to the
@@ -26,7 +27,7 @@ function subproject_dir() {
-e 's///p' \
-e 'q' \
-e '}' \
- "subprojects/$1.wrap")
+ "$src/subprojects/$1.wrap")
echo "${dir:-$1}"
}
@@ -76,7 +77,7 @@ popd
exclude=(--exclude=.git)
# include the tarballs in subprojects/packagecache but not their expansion
for sp in $SUBPROJECTS; do
- if grep -xqF "[wrap-file]" subprojects/$sp.wrap; then
+ if grep -xqF "[wrap-file]" $src/subprojects/$sp.wrap; then
exclude+=(--exclude=subprojects/"$(subproject_dir $sp)")
fi
done
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] make-release: don't rely on $CWD when excluding subproject directories
2025-02-13 23:53 [PATCH] make-release: don't rely on $CWD when excluding subproject directories Michael Roth
@ 2025-02-14 5:16 ` Michael Tokarev
2025-02-14 13:20 ` Stefan Hajnoczi
0 siblings, 1 reply; 3+ messages in thread
From: Michael Tokarev @ 2025-02-14 5:16 UTC (permalink / raw)
To: Michael Roth, qemu-devel; +Cc: Paolo Bonzini, qemu-stable, Stefan Hajnoczi
14.02.2025 02:53, Michael Roth пишет:
> The current logic scans qemu.git/subprojects/ from *.wrap files to
> determine whether or not to include the associated directories in the
> release tarballs. However, the script assumes that it is being run from
> the top-level of the source directory, which may not always be the case.
> In particular, when generating releases via, e.g.:
>
> make qemu-9.2.1.tar.xz
>
> the $CWD will either be an arbitrary external build directory, or
> qemu.git/build, and the exclusions will not be processed as expected.
> Fix this by using the $src parameter passed to the script as the root
> directory for the various subproject/ paths referenced by this logic.
>
> Also, the error case at the beginning of the subproject_dir() will not
> result in the error message being printed, and will instead produce an
> error message about "error" not being a valid command. Fix this by using
> basic shell commands.
>
> Fixes: be27b5149c86 ("make-release: only leave tarball of wrap-file subprojects")
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Michael Tokarev <mjt@tls.msk.ru>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Michael Roth <michael.roth@amd.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
It would be best if this change is applied to master as a quick fix
(it does not affect anything in master at all, including CI), so we
can resolve an issue on download.qemu.org (wrong 9.2.1 tarballs).
BTW, I always invoked ./scripts/make-release directly, I didn't know
there's a make rule for it. And I always did this by staying in the
qemu/master worktree :)
Thanks!
/mjt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] make-release: don't rely on $CWD when excluding subproject directories
2025-02-14 5:16 ` Michael Tokarev
@ 2025-02-14 13:20 ` Stefan Hajnoczi
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2025-02-14 13:20 UTC (permalink / raw)
To: Michael Tokarev
Cc: Michael Roth, qemu-devel, Paolo Bonzini, qemu-stable,
Stefan Hajnoczi
On Fri, Feb 14, 2025 at 12:17 AM Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> 14.02.2025 02:53, Michael Roth пишет:
> > The current logic scans qemu.git/subprojects/ from *.wrap files to
> > determine whether or not to include the associated directories in the
> > release tarballs. However, the script assumes that it is being run from
> > the top-level of the source directory, which may not always be the case.
> > In particular, when generating releases via, e.g.:
> >
> > make qemu-9.2.1.tar.xz
> >
> > the $CWD will either be an arbitrary external build directory, or
> > qemu.git/build, and the exclusions will not be processed as expected.
> > Fix this by using the $src parameter passed to the script as the root
> > directory for the various subproject/ paths referenced by this logic.
> >
> > Also, the error case at the beginning of the subproject_dir() will not
> > result in the error message being printed, and will instead produce an
> > error message about "error" not being a valid command. Fix this by using
> > basic shell commands.
> >
> > Fixes: be27b5149c86 ("make-release: only leave tarball of wrap-file subprojects")
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Michael Tokarev <mjt@tls.msk.ru>
> > Cc: qemu-stable@nongnu.org
> > Signed-off-by: Michael Roth <michael.roth@amd.com>
>
> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
> Tested-by: Michael Tokarev <mjt@tls.msk.ru>
>
> It would be best if this change is applied to master as a quick fix
> (it does not affect anything in master at all, including CI), so we
> can resolve an issue on download.qemu.org (wrong 9.2.1 tarballs).
Thanks for including this patch in your pull request. It's running
through CI right now.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-14 13:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-13 23:53 [PATCH] make-release: don't rely on $CWD when excluding subproject directories Michael Roth
2025-02-14 5:16 ` Michael Tokarev
2025-02-14 13:20 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).