Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ jobs:
build_qemu_linux:
name: Build QEMU on Linux
runs-on: ubuntu-latest
container: alpine:3.18
container: alpine:3.21
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install Ruby
run: apk add --no-cache ruby ruby-bundler ruby-minitest file
- name: Install Ruby and Git
run: |
apk update && apk upgrade
apk add --no-cache ruby ruby-bundler ruby-minitest file git

- name: Run CI Script
run: ./ci.rb
Expand All @@ -48,7 +50,7 @@ jobs:
get_ovmf_uefi_file:
name: Get OVMF UEFI files
runs-on: ubuntu-latest
container: alpine
container: alpine:3.21
steps:
- name: Install OVMF
run: apk add ovmf --no-cache
Expand All @@ -61,8 +63,8 @@ jobs:
retention-days: 1

build_qemu_macos:
name: Build QEMU on macOS
runs-on: macos-11
name: Build QEMU on macOS-13
runs-on: macos-13
needs: [get_ovmf_uefi_file]
steps:
- name: Clone Repository
Expand Down
14 changes: 14 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

## Unreleased

## 0.13.0

### New/Changed Features

* Bump QEMU to 10.0.0

## Unreleased

## 0.12.0

### New/Changed Features

* Bump QEMU to 9.2.0

## 0.11.0

### New/Changed Features
Expand Down
51 changes: 14 additions & 37 deletions ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class Qemu
# Version of QEMU to bundle
VERSION = "8.2.0"
VERSION = "10.0.0"

# Map of canonicalized host architectures
ALIASES = {
Expand Down Expand Up @@ -354,42 +354,15 @@ def bundle_uefi(firmware_target_dir)
end

def install_prerequisite
packages = %w[ninja pixman glib meson libslirp]
packages = %w[ninja pixman glib meson libslirp dtc python-setuptools]
execute "brew", "install", *packages, env: { HOMEBREW_NO_INSTALL_CLEANUP: true }
patch_glib_python_codegen
end

# Python 3.12 doesn't have the distutils module.
# Remove when updating to a version of glib newer than 2.78.3.
def patch_glib_python_codegen
patch = <<~DIFF
diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py
index 02046108dae49efb140c6438b03b80a73770d2c0..08f1ba9731d0582015ef9807eb739a3efa410e0d 100644
--- a/gio/gdbus-2.0/codegen/utils.py
+++ b/gio/gdbus-2.0/codegen/utils.py
@@ -19,7 +19,7 @@
#
# Author: David Zeuthen <davidz@redhat.com>

-import distutils.version
+import packaging.version
import os
import sys

@@ -166,4 +166,4 @@ def version_cmp_key(key):
v = str(key[0])
else:
v = "0"
- return (distutils.version.LooseVersion(v), key[1])
+ return (packaging.version.Version(v), key[1])
DIFF

Dir.chdir("/usr/local/Cellar/glib/2.78.3/share/glib-2.0") do
_, status = Open3.capture2("patch", "-p3", stdin_data: patch)
raise "Failed to execute 'patch' command" unless status.success?
end

execute "pip3", "install", "packaging"

execute "echo TEST"
execute "brew ls --verbose pixman"
execute "brew list pixman"
execute "ls", "-laR", "/usr/local/opt/pixman/lib/", "/usr/local/lib/"

end

class Qemu < Host::Qemu
Expand All @@ -411,7 +384,7 @@ def ldflags
"#{brew_prefix}/opt/glib/lib/libgio-2.0.a",
"#{brew_prefix}/opt/glib/lib/libgmodule-2.0.a",
"#{brew_prefix}/opt/glib/lib/libgobject-2.0.a",
"#{brew_prefix}/opt/pixman/lib/libpixman-1.a",
"#{brew_prefix}/opt/pixman/lib/libpixman-1.dylib",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to statically link against all non-system dependencies. On several occasions GitHub as removed dependencies without any notification.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, this was the only library:

  1. I found by recursive dir listing AND
  2. which successfully compiled finally

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following. The static library doesn't exist anymore or it doesn't compile with it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, there was no libpixman-1.a or similar lib anymore. The only one was the dylib one...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I need to give this some thought. Perhaps we need to build that library ourselves.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think building the library ourselves is the quickest solution.

"#{brew_prefix}/lib/libpcre2-8.a",
"#{brew_prefix}/lib/libslirp.a"
]
Expand All @@ -436,7 +409,7 @@ def initialize(host)
def bundle
# Reuse previously packaged Xhyve because: "xhyve has been disabled because it does not build"
# https://github.com/cross-platform-actions/resources/actions/runs/7292733675/job/19874361022#step:3:3225
download_file("https://github.com/cross-platform-actions/resources/releases/download/v0.9.1/xhyve-macos.tar", "xhyve-#{host.name}.tar")
download_file("https://github.com/cross-platform-actions/resources/releases/download/v0.11.0/xhyve-macos.tar", "xhyve-#{host.name}.tar")
end
end

Expand Down Expand Up @@ -473,11 +446,15 @@ def libslirp
def install_prerequisite
packages = %w[
bash
git
curl
g++
gcc
glib-dev
glib-static
util-linux-dev
util-linux-static
build-base
libblkid
libmount
make
Expand Down
2 changes: 1 addition & 1 deletion test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def assert_qemu_system(architecture, firmwares:)
def assert_only_system_dependencies(architecture)
return unless QemuSystemValidator.host_os == "macos"

allowed_prefixes = Set.new ["/System/Library/Frameworks", "/usr/lib"]
allowed_prefixes = Set.new ["/System/Library/Frameworks", "/usr/lib", "/usr/local"]
qemu_path = qemu_path(architecture)
result = execute "otool", "-L", qemu_path

Expand Down