Skip to content

Commit

Permalink
snapcraft: qemu: Use more of snapcraft's default pull mechanisms
Browse files Browse the repository at this point in the history
 - Switch to source-commit and empty source-submodules.
 - Reduce customisations to override-pull stage.
 - Switch back to gitlab for source.
 - Remove unnecessary submodule replacement.

Signed-off-by: Thomas Parrott <[email protected]>
  • Loading branch information
tomponline committed Nov 7, 2024
1 parent 139d6d6 commit fd74e9b
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,10 @@ parts:
- libusb
- spice-protocol
- spice-server
source: https://github.com/qemu/qemu
source: https://gitlab.com/qemu-project/qemu
source-commit: 6bbce8b464206e6622216b62841cb3e953d56eb8 # v8.0.5
source-depth: 1
source-submodules: []
source-type: git
plugin: autotools
autotools-configure-parameters:
Expand Down Expand Up @@ -816,25 +818,11 @@ parts:
craftctl default
override-pull: |-
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
set -ex
# We have to do this manual git clone because of edk2/subhook submodule URL has changed.
# See https://github.com/tianocore/edk2/commit/95d8a1c255cfb8e063d679930d08ca6426eb5701
# What is interesting is that we don't even need to do:
# git config --global url.https://github.com/tianocore/edk2-subhook.git.insteadOf https://github.com/Zeex/subhook.git
# because QEMU version which we checkout points to that version of edk2 which does not depends on subhook submodule.
# And as we do `git submodule update --init --recursive` *after* `git checkout ..` we have no problems.
# While if we do the same with built-in functionality in snapcraft it fails, because snapcraft does
# `git clone --recurse-submodules ...` and pulls master branch and fails on edk2/subhook before snapcraft does
# `git checkout ...` to the specified commit.
git config --global transfer.fsckobjects true
git clone https://github.com/qemu/qemu .
craftctl default
# FIXME: check if we can get rid of override-pull after the next QEMU version bump
git checkout 6bbce8b464206e6622216b62841cb3e953d56eb8 # v8.0.5
set -ex
# Pull submodules after switching to source-commit
git submodule update --init --recursive
override-build: |-
[ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0
Expand Down

0 comments on commit fd74e9b

Please sign in to comment.