avoid git.qemu.org (#876)

git.qemu.org seems to be down or under heavy load. Latest qemu
seems to have changed it's .gitmodules to use gitlab.  Since we're
using a github.com mirror, when cloning qemu use rewrite rules to
use github instead of git.qemu.org.  Also install the rewrite rules
recursively into the local config of qemu and it's submodules so
that any further git commands done interactively by the user
will also use github.

Co-authored-by: Tim Snyder <snyder.tim@gmail.com>
This commit is contained in:
Tim Snyder
2021-05-04 08:06:18 -05:00
committed by GitHub
parent 3fbd1efb36
commit c4e2e1246d

View File

@@ -155,7 +155,17 @@ module_all riscv-tests --prefix="${RISCV}/riscv${XLEN}-unknown-elf" --with-xlen=
CC= CXX= SRCDIR="$(pwd)/toolchains" module_all libgloss --prefix="${RISCV}/riscv${XLEN}-unknown-elf" --host=riscv${XLEN}-unknown-elf
if [ -z "$IGNOREQEMU" ] ; then
SRCDIR="$(pwd)/toolchains" module_all qemu --prefix="${RISCV}" --target-list=riscv${XLEN}-softmmu
echo "=> Starting qemu build"
dir="$(pwd)/toolchains/qemu"
echo "==> Initializing qemu submodule"
#since we don't want to use the global config we init passing rewrite config in to the command
git -c url.https://github.com/qemu.insteadOf=https://git.qemu.org/git submodule update --init --recursive "$dir"
echo "==> Applying url-rewriting to avoid git.qemu.org"
# and once the clones exist, we recurse through them and set the rewrite
# in the local config so that any further commands by the user have the rewrite. uggh. git, why you so ugly?
git -C "$dir" config --local url.https://github.com/qemu.insteadOf https://git.qemu.org/git
git -C "$dir" submodule foreach --recursive 'git config --local url.https://github.com/qemu.insteadOf https://git.qemu.org/git'
SRCDIR="$(pwd)/toolchains" module_build qemu --prefix="${RISCV}" --target-list=riscv${XLEN}-softmmu
fi
# make Dromajo