Merge ~ddstreet/ubuntu/+source/qemu:lp1887535-g into ubuntu/+source/qemu:ubuntu/groovy-devel

Proposed by Dan Streetman
Status: Approved
Approved by: Christian Ehrhardt 
Approved revision: 3a77c0aa178522c336c80a4a10e36bd1e8630b7c
Proposed branch: ~ddstreet/ubuntu/+source/qemu:lp1887535-g
Merge into: ubuntu/+source/qemu:ubuntu/groovy-devel
Diff against target: 320 lines (+287/-0)
4 files modified
debian/changelog (+9/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch (+276/-0)
debian/rules (+1/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  Pending
Review via email: mp+397987@code.launchpad.net
To post a comment you must log in.

Unmerged commits

3a77c0a... by Dan Streetman

update changelog

4109add... by Dan Streetman

Backport configure param --with-git-submodules and set to 'ignore'

As we don't want to update to the latest git submodules since we need a
stable reproducable build, and the submodules are included in the
deb package source, this prevents updating or validating the git submodules.

This allows having a consistent build with or without a local .git directory.

LP: #1887535

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 5999217..84280d7 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+qemu (1:5.0-5ubuntu9.6) UNRELEASED; urgency=medium
7+
8+ * d/p/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch,
9+ d/rules:
10+ Backport --with-git-submodules param so building from git repo
11+ doesn't fail (LP: #1887535)
12+
13+ -- Dan Streetman <ddstreet@canonical.com> Fri, 12 Feb 2021 06:45:08 -0500
14+
15 qemu (1:5.0-5ubuntu9.5) groovy; urgency=medium
16
17 * d/p/u/lp-1903864-tpm_emulator-Report-an-error-if-chardev-is-missing.patch:
18diff --git a/debian/patches/series b/debian/patches/series
19index b2aabd2..ac0b78c 100644
20--- a/debian/patches/series
21+++ b/debian/patches/series
22@@ -112,3 +112,4 @@ ubuntu/lp-1913395-3-vfio-Find-DMA-available-capability.patch
23 ubuntu/lp-1913395-4-0004-s390x-pci-Add-routine-to-get-the-vfio-dma-available.patch
24 ubuntu/lp-1913395-5-s390x-pci-Honor-DMA-limits-set-by-vfio.patch
25 ubuntu/lp-1913395-6-s390x-fix-build-for-without-default-devices.patch
26+ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch
27diff --git a/debian/patches/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch b/debian/patches/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch
28new file mode 100644
29index 0000000..f9fd317
30--- /dev/null
31+++ b/debian/patches/ubuntu/lp-1887535-configure-replace-enable-disable-git-update-with-wit.patch
32@@ -0,0 +1,276 @@
33+From 7d7dbf9dc15be6e1465c756c2c5ae7f1ab104fc8 Mon Sep 17 00:00:00 2001
34+From: Dan Streetman <ddstreet@canonical.com>
35+Date: Tue, 19 Jan 2021 12:20:46 -0500
36+Subject: [PATCH] configure: replace --enable/disable-git-update with
37+ --with-git-submodules
38+MIME-Version: 1.0
39+Content-Type: text/plain; charset=UTF-8
40+Content-Transfer-Encoding: 8bit
41+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1887535
42+Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=7d7dbf9dc15be6e1465c756c2c5ae7f1ab104fc8
43+
44+Replace the --enable-git-update and --disable-git-update configure params
45+with the param --with-git-submodules=(update|validate|ignore) to
46+allow 3 options for building from a git repo.
47+
48+This is needed because downstream packagers, e.g. Debian, Ubuntu, etc,
49+also keep the source code in git, but do not want to enable the
50+'git_update' mode; with the current code, that's not possible even
51+if the downstream package specifies --disable-git-update.
52+
53+The previous parameters are deprecated but still available; the
54+--enable-git-update parameter maps to --with-git-submodules=update and
55+--disable-git-update parameter maps to --with-git-submodules=validate.
56+
57+The configure script behavior is slightly modified, where previously
58+the dtc, capstone, and slirp submodules were not validated when
59+--disable-git-update was specified (but were updated with git-update
60+enabled), now they are validated when using --with-git-submodules=validate
61+and are only ignored when using --with-git-submodules=ignore.
62+
63+Signed-off-by: Dan Streetman <ddstreet@canonical.com>
64+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
65+---
66+ Makefile | 24 ++-----------------
67+ configure | 51 ++++++++++++++++++++++++++++++----------
68+ scripts/git-submodule.sh | 34 ++++++++++++++++++++-------
69+ 3 files changed, 66 insertions(+), 43 deletions(-)
70+
71+--- a/Makefile
72++++ b/Makefile
73+@@ -21,33 +21,11 @@ ifneq ($(wildcard config-host.mak),)
74+ all:
75+ include config-host.mak
76+
77+-git-submodule-update:
78+-
79+ .PHONY: git-submodule-update
80+-
81+-git_module_status := $(shell \
82+- cd '$(SRC_PATH)' && \
83+- GIT="$(GIT)" ./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
84+- echo $$?; \
85+-)
86+-
87+-ifeq (1,$(git_module_status))
88+-ifeq (no,$(GIT_UPDATE))
89+-git-submodule-update:
90+- $(call quiet-command, \
91+- echo && \
92+- echo "GIT submodule checkout is out of date. Please run" && \
93+- echo " scripts/git-submodule.sh update $(GIT_SUBMODULES)" && \
94+- echo "from the source directory checkout $(SRC_PATH)" && \
95+- echo && \
96+- exit 1)
97+-else
98+ git-submodule-update:
99+ $(call quiet-command, \
100+- (cd $(SRC_PATH) && GIT="$(GIT)" ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \
101+- "GIT","$(GIT_SUBMODULES)")
102+-endif
103+-endif
104++ (GIT="$(GIT)" "$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
105++ "GIT","$(GIT_SUBMODULES)")
106+
107+ .git-submodule-status: git-submodule-update config-host.mak
108+
109+--- a/configure
110++++ b/configure
111+@@ -307,12 +307,12 @@ gdb_bin=$(command -v "gdb")
112+
113+ if test -e "$source_path/.git"
114+ then
115+- git_update=yes
116++ git_submodules_action="update"
117+ git_submodules="ui/keycodemapdb"
118+ git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
119+ git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
120+ else
121+- git_update=no
122++ git_submodules_action="ignore"
123+ git_submodules=""
124+
125+ if ! test -f "$source_path/ui/keycodemapdb/README"
126+@@ -1571,9 +1571,16 @@ for opt do
127+ ;;
128+ --with-git=*) git="$optarg"
129+ ;;
130+- --enable-git-update) git_update=yes
131++ --enable-git-update)
132++ git_submodules_action="update"
133++ echo "--enable-git-update deprecated, use --with-git-submodules=update"
134++ ;;
135++ --disable-git-update)
136++ git_submodules_action="validate"
137++ echo "--disable-git-update deprecated, use --with-git-submodules=validate"
138+ ;;
139+- --disable-git-update) git_update=no
140++ --with-git-submodules=*)
141++ git_submodules_action="$optarg"
142+ ;;
143+ --enable-debug-mutex) debug_mutex=yes
144+ ;;
145+@@ -1609,6 +1616,21 @@ for opt do
146+ esac
147+ done
148+
149++case $git_submodules_action in
150++ update|validate)
151++ if test ! -e "$source_path/.git"; then
152++ echo "ERROR: cannot $git_submodules_action git submodules without .git"
153++ exit 1
154++ fi
155++ ;;
156++ ignore)
157++ ;;
158++ *)
159++ echo "ERROR: invalid --with-git-submodules= value '$git_submodules_action'"
160++ exit 1
161++ ;;
162++esac
163++
164+ case "$cpu" in
165+ ppc)
166+ CPU_CFLAGS="-m32"
167+@@ -1736,6 +1758,9 @@ Advanced options (experts only):
168+ --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build]
169+ --smbd=SMBD use specified smbd [$smbd]
170+ --with-git=GIT use specified git [$git]
171++ --with-git-submodules=update update git submodules (default if .git dir exists)
172++ --with-git-submodules=validate fail if git submodules are not up to date
173++ --with-git-submodules=ignore do not update or check git submodules (default if no .git dir)
174+ --static enable static build [$static]
175+ --mandir=PATH install man pages in PATH
176+ --datadir=PATH install firmware in PATH$confsuffix
177+@@ -1962,7 +1987,7 @@ fi
178+ # Consult white-list to determine whether to enable werror
179+ # by default. Only enable by default for git builds
180+ if test -z "$werror" ; then
181+- if test -e "$source_path/.git" && \
182++ if test $git_submodules_action != 'ignore' && \
183+ { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then
184+ werror="yes"
185+ else
186+@@ -4273,10 +4298,10 @@ EOF
187+ fdt=system
188+ else
189+ # have GIT checkout, so activate dtc submodule
190+- if test -e "${source_path}/.git" ; then
191++ if test $git_submodules_action != 'ignore' ; then
192+ git_submodules="${git_submodules} dtc"
193+ fi
194+- if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then
195++ if test -d "${source_path}/dtc/libfdt" || test $git_submodules_action != 'ignore' ; then
196+ fdt=git
197+ mkdir -p dtc
198+ if [ "$pwd_is_source_path" != "y" ] ; then
199+@@ -5231,7 +5256,7 @@ case "$capstone" in
200+ "" | yes)
201+ if $pkg_config capstone; then
202+ capstone=system
203+- elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
204++ elif test $git_submodules_action != 'ignore' ; then
205+ capstone=git
206+ elif test -e "${source_path}/capstone/Makefile" ; then
207+ capstone=internal
208+@@ -6206,7 +6231,7 @@ case "$slirp" in
209+ "" | yes)
210+ if $pkg_config slirp; then
211+ slirp=system
212+- elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
213++ elif test $git_submodules_action != 'ignore' ; then
214+ slirp=git
215+ elif test -e "${source_path}/slirp/Makefile" ; then
216+ slirp=internal
217+@@ -6791,7 +6816,7 @@ echo "libs_cpu=$libs_cpu" >> $config_hos
218+ echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
219+ echo "GIT=$git" >> $config_host_mak
220+ echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
221+-echo "GIT_UPDATE=$git_update" >> $config_host_mak
222++echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak
223+
224+ echo "ARCH=$ARCH" >> $config_host_mak
225+
226+--- a/scripts/git-submodule.sh
227++++ b/scripts/git-submodule.sh
228+@@ -9,9 +9,14 @@ command=$1
229+ shift
230+ maybe_modules="$@"
231+
232++# if --with-git-submodules=ignore, do nothing
233++test "$command" = "ignore" && exit 0
234++
235+ test -z "$GIT" && GIT=git
236+
237+-error() {
238++cd "$(dirname "$0")/.."
239++
240++update_error() {
241+ echo "$0: $*"
242+ echo
243+ echo "Unable to automatically checkout GIT submodules '$modules'."
244+@@ -24,7 +29,7 @@ error() {
245+ echo "Alternatively you may disable automatic GIT submodule checkout"
246+ echo "with:"
247+ echo
248+- echo " $ ./configure --disable-git-update"
249++ echo " $ ./configure --with-git-submodules=validate"
250+ echo
251+ echo "and then manually update submodules prior to running make, with:"
252+ echo
253+@@ -33,6 +38,19 @@ error() {
254+ exit 1
255+ }
256+
257++validate_error() {
258++ if test "$1" = "validate"; then
259++ echo "GIT submodules checkout is out of date, and submodules"
260++ echo "configured for validate only. Please run"
261++ echo " scripts/git-submodule.sh update $maybe_modules"
262++ echo "from the source directory or call configure with"
263++ echo " --with-git-submodules=update"
264++ echo "To disable GIT submodules validation, use"
265++ echo " --with-git-submodules=ignore"
266++ fi
267++ exit 1
268++}
269++
270+ modules=""
271+ for m in $maybe_modules
272+ do
273+@@ -52,18 +70,18 @@ then
274+ fi
275+
276+ case "$command" in
277+-status)
278++status|validate)
279+ if test -z "$maybe_modules"
280+ then
281+- test -s ${substat} && exit 1 || exit 0
282++ test -s ${substat} && validate_error "$command" || exit 0
283+ fi
284+
285+- test -f "$substat" || exit 1
286++ test -f "$substat" || validate_error "$command"
287+ for module in $modules; do
288+ CURSTATUS=$($GIT submodule status $module)
289+ OLDSTATUS=$(cat $substat | grep $module)
290+ if test "$CURSTATUS" != "$OLDSTATUS"; then
291+- exit 1
292++ validate_error "$command"
293+ fi
294+ done
295+ exit 0
296+@@ -76,10 +94,10 @@ update)
297+ fi
298+
299+ $GIT submodule update --init $modules 1>/dev/null
300+- test $? -ne 0 && error "failed to update modules"
301++ test $? -ne 0 && update_error "failed to update modules"
302+
303+ $GIT submodule status $modules > "${substat}"
304+- test $? -ne 0 && error "failed to save git submodule status" >&2
305++ test $? -ne 0 && update_error "failed to save git submodule status" >&2
306+ ;;
307+ esac
308+
309diff --git a/debian/rules b/debian/rules
310index 2d1fa4e..c794d8f 100755
311--- a/debian/rules
312+++ b/debian/rules
313@@ -59,6 +59,7 @@ common_configure_opts = \
314 --disable-strip \
315 --interp-prefix=/etc/qemu-binfmt/%M \
316 --localstatedir=/var \
317+ --with-git-submodules=ignore \
318
319 # Cross compiling support
320 ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))

Subscribers

People subscribed via source and target branches