Skip to content

Commit 50cfed8

Browse files
committed
configure: remove --with-git= option
The scenario for which --with-git= was introduced was to use a SOCKS proxy such as tsocks. However, this was back in 2017 when QEMU's submodules used the git:// protocol, and it is not as important when using the "smart HTTP" backend; for example, neither "meson subprojects download" nor scripts/checkpatch.pl obey the GIT environment variable. So remove the knob, but test for the presence of git in the configure and git-submodule.sh scripts, and suggest using --with-git-submodules=validate + a manual invocation of git-submodule.sh when git does not work. Hopefully in the future the GIT environment variable will be supported by Meson. Reviewed-by: Thomas Huth <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 47a90a5 commit 50cfed8

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Makefile: .git-submodule-status
5353
git-submodule-update:
5454
ifneq ($(GIT_SUBMODULES_ACTION),ignore)
5555
$(call quiet-command, \
56-
(GIT="$(GIT)" "$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
56+
(GIT=git "$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
5757
"GIT","$(GIT_SUBMODULES)")
5858
endif
5959

configure

+2-6
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,6 @@ for opt do
751751
;;
752752
--enable-fdt=*) fdt="$optarg"
753753
;;
754-
--with-git=*) git="$optarg"
755-
;;
756754
--with-git-submodules=*)
757755
git_submodules_action="$optarg"
758756
;;
@@ -791,7 +789,7 @@ fi
791789

792790
case $git_submodules_action in
793791
update|validate)
794-
if test ! -e "$source_path/.git"; then
792+
if test ! -e "$source_path/.git" || ! has git; then
795793
echo "ERROR: cannot $git_submodules_action git submodules without .git"
796794
exit 1
797795
fi
@@ -892,7 +890,6 @@ Advanced options (experts only):
892890
--python=PYTHON use specified python [$python]
893891
--ninja=NINJA use specified ninja [$ninja]
894892
--smbd=SMBD use specified smbd [$smbd]
895-
--with-git=GIT use specified git [$git]
896893
--with-git-submodules=update update git submodules (default if .git dir exists)
897894
--with-git-submodules=validate fail if git submodules are not up to date
898895
--with-git-submodules=ignore do not update or check git submodules (default if no .git dir)
@@ -1699,7 +1696,7 @@ fi
16991696
#######################################
17001697
# generate config-host.mak
17011698

1702-
if ! (GIT="$git" "$source_path/scripts/git-submodule.sh" "$git_submodules_action" "$git_submodules"); then
1699+
if ! (GIT=git "$source_path/scripts/git-submodule.sh" "$git_submodules_action" "$git_submodules"); then
17031700
exit 1
17041701
fi
17051702

@@ -1709,7 +1706,6 @@ echo "# Automatically generated by configure - do not modify" > $config_host_mak
17091706
echo >> $config_host_mak
17101707

17111708
echo all: >> $config_host_mak
1712-
echo "GIT=$git" >> $config_host_mak
17131709
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
17141710
echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak
17151711

meson.build

-1
Original file line numberDiff line numberDiff line change
@@ -4011,7 +4011,6 @@ summary(summary_info, bool_yn: true, section: 'Directories')
40114011

40124012
# Host binaries
40134013
summary_info = {}
4014-
summary_info += {'git': config_host['GIT']}
40154014
summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
40164015
summary_info += {'sphinx-build': sphinx_build}
40174016
if config_host.has_key('HAVE_GDB_BIN')

scripts/ci/org.centos/stream/8/x86_64/configure

-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@
2929
--extra-cflags="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection" \
3030
--with-suffix="qemu-kvm" \
3131
--firmwarepath=/usr/share/qemu-firmware \
32-
--with-git=meson \
3332
--with-git-submodules=update \
3433
--target-list="x86_64-softmmu" \
3534
--block-drv-rw-whitelist="qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle,gluster" \
3635
--audio-drv-list="" \
3736
--block-drv-ro-whitelist="vmdk,vhdx,vpc,https,ssh" \
3837
--with-coroutine=ucontext \
39-
--with-git=git \
4038
--tls-priority=@QEMU,SYSTEM \
4139
--disable-attr \
4240
--disable-auth-pam \

scripts/git-submodule.sh

+10-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ maybe_modules="$@"
1212
# if --with-git-submodules=ignore, do nothing
1313
test "$command" = "ignore" && exit 0
1414

15-
test -z "$GIT" && GIT=git
15+
test -z "$GIT" && GIT=$(command -v git)
1616

1717
cd "$(dirname "$0")/.."
1818

@@ -21,19 +21,14 @@ update_error() {
2121
echo
2222
echo "Unable to automatically checkout GIT submodules '$modules'."
2323
echo "If you require use of an alternative GIT binary (for example to"
24-
echo "enable use of a transparent proxy), then please specify it by"
25-
echo "running configure by with the '--with-git' argument. e.g."
26-
echo
27-
echo " $ ./configure --with-git='tsocks git'"
28-
echo
29-
echo "Alternatively you may disable automatic GIT submodule checkout"
30-
echo "with:"
24+
echo "enable use of a transparent proxy), please disable automatic"
25+
echo "GIT submodule checkout with:"
3126
echo
3227
echo " $ ./configure --with-git-submodules=validate"
3328
echo
3429
echo "and then manually update submodules prior to running make, with:"
3530
echo
36-
echo " $ scripts/git-submodule.sh update $modules"
31+
echo " $ GIT='tsocks git' scripts/git-submodule.sh update $modules"
3732
echo
3833
exit 1
3934
}
@@ -57,6 +52,12 @@ then
5752
exit 1
5853
fi
5954

55+
if test -n "$maybe_modules" && test -z "$GIT"
56+
then
57+
echo "$0: unexpectedly called with submodules but git binary not found"
58+
exit 1
59+
fi
60+
6061
modules=""
6162
for m in $maybe_modules
6263
do

0 commit comments

Comments
 (0)