Commit Graph
257 Commits
Author SHA1 Message Date
osy 3359543d2c ios: run qemu-img in a helper extension on iOS 26
QEMU tools cannot run in the app process on iOS: a process may load QEMU
only once and qemu-img calls exit(). So disk snapshots of a stopped VM,
reclaiming space, compression, resizing and conversion on import were
macOS-only.

iOS 26 brings ExtensionKit, so qemu-img now runs in an ExtensionKit
extension (iOSHelper, and iOSHelper-SE for UTM SE since an extension's
bundle identifier must be prefixed by its host's). The helper speaks the
same QEMUHelperProtocol as the macOS XPC helper but loads the tool into
its own process, one tool per process. UTMProcess accepts an injected
connection so the remote path is shared with macOS, including file
access through bookmarks, whose implicit security scope grants the
resolving process access. UTMHelperProcess launches the helper and,
because the system hands a process that is still exiting to a launch
that comes too soon, tears it down with a handshake on the interruption
callback and runs helpers one at a time.

UTMQemuImage now reads the tool's output until it ends instead of
racing the exit message, resumes its continuations off the XPC reply
queue (a call made from that queue blocks in NSXPC), and stops the
process explicitly since the connection's exported object kept it from
ever being deallocated on macOS. The last stderr line becomes the error
text when the tool gives none.

Assisted-by: Claude:claude-fable-5-1
2026-09-23 23:10:06 -05:00
osy 6d87bf6065 scripts: skip host tools when packing universal sysroots
The Mesa host build now installs a build machine copy of the KosmicKrisp
driver into host/lib. It has the same architecture in every sysroot, so
lipo refuses to combine it.

Assisted-by: Claude:claude-opus-5-5
2026-09-23 23:08:47 -05:00
osy 3adfacfe8d build: disable KosmicKrisp for simulator builds
Simulator does not support Metal 4
2026-09-23 14:21:46 -05:00
osy c066b83069 build: update KosmicKrisp which now requires macOS 26
The new Mesa revision builds KosmicKrisp with the precompiled shader
compiler, and the driver now needs macOS 26 (and the aligned iOS,
tvOS, and visionOS 26 releases) at runtime. Bump the availability
gates on the settings picker and the VM start check to match.

Assisted-by: Claude:claude-fable-5-1
2026-09-23 11:01:44 -05:00
osy dd49e2f51a Merge pull request #7903 from utmapp/agents/utm-release
agents: add /utm-test and /utm-release workflows
2026-09-23 10:29:13 -05:00
osy c18d86dd50 scripts: extract fixup.sh so a single rebuilt dependency can be repackaged
Repackaging one dependency after a change previously meant re-running the
whole build_dependencies.sh. Move the framework fixup into scripts/fixup.sh
so it can be run on its own, and have build_dependencies.sh call it.

Standalone use needed two fixes: re-running no longer nests symlinks
inside an existing Versions/Current (ln -h) and updates Info.plist keys
instead of skipping them, and imports are also matched by file name so
a sysroot built elsewhere (e.g. a CI artifact) is rewritten correctly.
Output for a full build is unchanged.

Assisted-by: Claude:claude-opus-5-5
2026-09-22 14:59:56 -05:00
osy 29a3c1f62b terminal: update SwiftTerm and adopt its new renderer and find bar
SwiftTerm 2 no longer exposes the underlying Terminal from TerminalView, so
move the terminal views to the copied view APIs: terminalDimensions,
resize(cols:rows:), setCursorStyle, softReset and resetToInitialState. The
view's resize also soft resets the terminal now, so only call it when the
saved size differs, otherwise every resume would reset the guest's modes.

Track SwiftTerm from the osy/SwiftTerm fork's fix/visionos-build branch
for now: upstream main reads UIWindow.screen, which does not exist on
visionOS, and the fork reads the display scale from the trait collection
instead so the visionOS build works again.

SwiftTerm now ships a build tool plugin, which needs two changes to
build_utm.sh for CI. Xcode refuses to run a package plugin the machine has
not trusted, so pass -skipPackagePluginValidation. And -sdk also applies
to host tools, so the plugin's generator was built for the target platform
instead of the Mac and the build could not find it; pick the platform
with a generic destination and the architectures with ARCHS instead.
Also match the SDK name macosx when picking the default macOS scheme.

Take advantage of what the update brings:

- Render with Metal on macOS and iOS, falling back to Core Graphics if the
  GPU pipeline cannot be created. visionOS stays on Core Graphics because
  SwiftTerm's Metal path draws at the wrong scale there.
- Release the renderer with updateUiClosed() when the terminal window
  closes or the iOS view is dismantled, as SwiftTerm now requires.
- Feed guest output straight from the serial port thread; feed() is
  thread-safe now, so the hop to the main queue is no longer needed.
- Add the standard Edit > Find menu on macOS, which the terminal's new
  find bar is driven from.
- Open only http(s) links from the terminal. SwiftTerm now also turns host
  file paths printed by the guest into links, and its default handler on
  macOS opens any URL or existing host path, so clicking one could launch
  a host app. On iOS, let the bell use SwiftTerm's default haptic instead
  of an empty override.

Assisted-by: Claude:claude-opus-5
Assisted-by: Claude:claude-opus-5-5
2026-09-22 14:52:14 -05:00
osy 3c7ee99d06 scripts: stop dependencies weak-linking pipe2() and dup3()
pipe2() and dup3() are new in the 27.0 SDKs and carry
__API_AVAILABLE(macos(27.0), ios(27.0), ...). Both meson's has_function()
and autoconf's AC_CHECK_FUNCS declare their own prototype rather than
including the system header, so they never see that annotation and report
the functions present no matter the deployment target. The real call sites
do include <unistd.h>, so clang emits a weak import that is NULL on
anything older than 27 and the first call branches to zero.

That broke every VM start on iOS 26 and below: -[CSMain init] ->
g_main_context_new() -> g_wakeup_new() -> g_unix_open_pipe(), which calls
pipe2() when glib is configured with HAVE_PIPE2. glib, gio, gettext and
libusb all picked it up in every sysroot built with Xcode 27.

Tell both configure systems the functions are missing so the existing
pipe() + fcntl(FD_CLOEXEC) fallbacks are compiled in instead. Nothing
detects dup3() today, but cover it so the next dependency bump cannot
reintroduce the same crash.

Assisted-by: Claude:claude-opus-5
2026-09-20 15:12:05 -05:00
osy a4edd6175f Merge pull request #7860 from LayerTM/fix/utmctl-entitlement-unsigned
package_mac: expand the utmctl scripting target before signing
2026-09-19 09:07:43 -05:00
osy 2a87244278 project: restore legacy app icon on older macOS
Since Xcode 26.1, actool ignores an .appiconset that shares its name with
an Icon Composer .icon and renders the icons for older OS versions from the
.icon instead. The undocumented --enable-icon-stack-fallback-generation flag
that used to turn this off is now parsed and discarded, so building with
Xcode 27 replaced our flat icons with generated ones on macOS 12-15, where we
prefer our own low resolution art.

Replacing AppIcon.icns is not enough because macOS reads the icon from
Assets.car before Tahoe as well. Instead compile AppIcon.appiconset into its
own catalog and merge its renditions into the built Assets.car with CoreUI,
leaving the icon stack renditions that macOS 26 uses in place.

The rendition format is undocumented, so the merge fails the build if the
catalog does not look the way we expect, and checks that the icons still
decode after writing.

Assisted-by: Claude:claude-opus-5[1m]
2026-09-16 04:48:37 +02:00
osy f3645d5018 project: remove code for versions below the new minimum
Now that the deployment targets are iOS 15 and macOS 12, every guard,
fallback and workaround for an older release is dead code that only
obscures what the supported path is. Remove them:

- Drop the `@available` attributes for iOS 15, macOS 11 and macOS 12, and
  unwrap the matching `#available`/`#unavailable` guards in Swift and the
  `@available`/`API_AVAILABLE`/`NS_AVAILABLE_IOS` ones in Objective-C.
- Delete the legacy-only views and helpers left unreachable by that:
  NumberTextFieldOld, VMConfigNetworkPortForwardLegacyView,
  VMContextMenuModifier.bodyBigSur, the nonbrokenSheet, uniqued,
  customBadge, borderedList and legacySettingsToolbar shims, the
  .unsupported BootloaderSelection case, and the iOS 14 sacrificial
  version Section in the QEMU settings list.
- jb_has_cs_execseg_allow_unsigned() has returned false for every host
  since iOS 14.4, so drop it along with the is_device_A12_or_newer()
  helper that only it used. The entitlement parser no longer needs to
  copy the blob either, since that copy existed only so the psychic paper
  needle could be blanked in place.
- VMDisplayTerminalViewController tracked the keyboard frame by hand for
  iOS 14. `useAutoLayout` is a constant that cannot be overridden, so
  nothing ever registered the notification observers and only the
  keyboardLayoutGuide path is reachable.
- VMConfigQEMUView's additionalArguments is now referenced on iOS only,
  which leaves its macOS branch, and the macOS 11 ForEach crash
  workaround inside it, unreachable.
- Raise the Cydia package floor and the postinst/prerm helpers to match
  the new minimum.

Two of the removed guards dropped an error path rather than just a
branch. The shared directory `featureNotSupported` throw covered
VZVirtioFileSystemDeviceConfiguration and friends being macOS 12+, which
no longer applies to any supported host. The macOS guest
`platformUnsupported` throw when decoding a boot config on Intel only
fired on macOS 11; the Apple Silicon requirement it really guards is
enforced unconditionally in
UTMAppleConfigurationSystem.fillVZConfiguration, which both the start and
the save path go through.

Assisted-by: Claude:claude-opus-5
2026-09-16 04:48:37 +02:00
osy c5766065d8 build: raise minimum to iOS 15 and macOS 12 to build with Xcode 27
Xcode 27 no longer supports deploying to iOS 14 or macOS 11, and the
macOS 27 SDK breaks several dependency builds, so raise the minimum
versions and fix the dependency build:

- Bump IOS_SDKMINVER/MAC_SDKMINVER and the project deployment targets.
- Pass our deployment targets to the Hypervisor build, whose project
  still targets iOS 14.
- Build ANGLE without -Werror; new clang warnings break it.
- Update MoltenVK to pick up the upstream minimum target bump and set
  a visionOS minimum so it no longer inherits the SDK version.
- Patch QEMU apple-gfx to use PGCreateDeviceWithDescriptor, since
  PGNewDeviceWithDescriptor is no longer exported by the macOS 27 SDK.
- Skip copying the IOKit headers on macOS where they are already in the
  SDK and a second copy conflicts with the IOKit module.
- Export MACOSX_DEPLOYMENT_TARGET since libtool drops -target when
  linking C++ libraries, which built libasprintf for macOS 27.
- Default CI to the installed Xcode.

Assisted-by: Claude:claude-opus-5
2026-09-15 08:12:39 +02:00
Layer 2e7ac46881 package_mac: expand the utmctl scripting target in every mode
The scripting-targets entitlement names the target app as a dictionary key built from $(PRODUCT_BUNDLE_PREFIX:default=com.utmapp). Xcode expands it only when it signs, and the unsigned package re-signs from the raw file, so utmctl in an unsigned build was allowed to script an app with that literal name and no other: every command failed with "failed to get scripting definition" and an unrecognized selector. Expand the key before signing.
2026-09-11 16:27:55 +02:00
osy f93a7470b6 project: revert minver bump
We can selectively support DXMT on macOS 13, iOS 16 and so we can revert
the minver bump.
2026-08-04 08:27:04 -07:00
osy 5f13bb356a project: add dxmt to iOS builds 2026-08-04 08:26:43 -07:00
osy 4da12ebb79 scripts: retry downloads and clones on transient failures
Concurrent build_dependencies.sh runs on the same CI runner get rate
limited by GitHub, so clones and fetches fail intermittently. Retry each
network operation with exponential backoff, jittered by PID so parallel
builds do not retry in lockstep.

The tree:0 filtered clones lazily fetch objects during checkout and
submodule update, so those hit the network too and are retried as well.
Add -f to curl so that a rate limited response is treated as a failure
instead of being saved as the tarball.

Assisted-by: Claude:claude-opus-5
2026-07-31 16:08:49 -07:00
osy ee04b73402 github: install D3DMetal into universal sysroot
The macOS build embeds D3DMetal.framework when the sysroot ships it, but
the framework is distributed separately and cannot be committed. When
D3DM_DIST_DMG_URL is set, fetch the distribution DMG and stage the
framework into the universal sysroot before it is packed into the
artifact and saved to the cache, so downstream builds pick it up. Builds
without the variable set are unaffected.

We cannot ship a com.apple.* bundle, but D3DMetal loads its own
default.metallib through [NSBundle bundleWithIdentifier:@"com.apple.D3DMetal"]
using that identifier as a literal compiled into the framework binary, so
the rebrand rewrites both the Info.plist and the binary. Rewriting only one
makes the lookup return nil and every D3DMetal process aborts in
-[MTLDevice newLibraryWithFile:nil error:].

Staging lives in scripts/install_d3dmetal.sh so it can also be run by hand.

Assisted-by: Claude:claude-opus-5
2026-07-30 22:15:31 -07:00
osy e6436a83b0 project: add DirectX support
- virglrenderer uses shmem for texture import/export so we need App Group for both iOS and macOS
- Add QEMURenderServer for new process model rendering (both Venus and Neptune)
- macOS: add DXMT and D3DMetal-Native backends
- We require 8G hostmem for Neptune but iOS currently fails > 256M
2026-07-30 18:31:26 -07:00
osy 530fd96f0d build: add Neptune and backends
Bump minimum version to macOS 13.0 and iOS 16.0 due to D3D renderer minimum
requirements.
2026-07-30 18:15:11 -07:00
osy baf362dcde build: remove minver hack for building ANGLE for iOS 2026-02-24 13:57:45 -08:00
osy e89c580ed3 build: define mesa host dependencies 2026-02-21 12:35:15 -08:00
osy 038ff43959 build: update minver to iOS 14 and macOS 11
This is what UTM's minver has been for a while and will reduce
the number of warnings in the build as well as enable possible
runtime optimizations.
2026-01-23 13:29:08 -08:00
osy eed5350459 build: fix Obj-C build flags
We weren't passing in the target tuple for Obj-C which led to
crashes running on an lower iOS version.

Fixes #7593
2026-01-23 13:27:28 -08:00
osy 50764ac68d build: support building with debug symbols 2026-01-10 16:22:12 -08:00
osy 220926d1d7 build: fix Vulkan icd path for iOS 2026-01-10 16:21:55 -08:00
osy 531c4a4fcc build: mesa_clc must be built from the same tree 2026-01-08 01:18:52 -08:00
osy 4c1c0b731c build: fix Vulkan-Loader path 2026-01-07 21:03:12 -08:00
osy 847ad6e425 build: add MoltenVK to dependencies 2026-01-07 21:03:12 -08:00
osy 50283fd05d build: add distlib and mako to dependency check 2026-01-07 21:03:12 -08:00
osy b959d92b32 build: add KosmicKrisp to dependencies 2026-01-07 21:03:12 -08:00
osy e8e7ec7ac8 build: add Vulkan-Loader to dependencies 2026-01-05 20:56:42 -08:00
osy cd7158a0f8 build: update environment checks 2026-01-04 22:38:21 -08:00
osy 2a913cadb0 qemu: enable support for CGL backend
Thanks to @startergo for the changes. This should enable OpenGL 4.1 on Linux

Resolves #4285
2026-01-04 21:54:36 -08:00
osy 434a777c9a build: TCI: add m68k, remove arm, riscv32
There isn't any good use for arm32 and riscv32. Remove them to
reduce the app size.
2025-08-03 19:08:21 -07:00
osy 203f5261dd wizard: create classic Mac OS machine
Also add support for classicvirtio.

Resolves #6520
2025-08-03 09:32:51 -07:00
osy bcb5b0f161 config(qemu): enable UEFI support for RISCV64 and LoongArch64
Resolves #7183
2025-07-23 14:56:51 -07:00
osy d5db1a1d6b build: update QEMU to v10.0.2
Resolves #2353
2025-07-07 01:46:59 -07:00
osy 09f76ca442 build: fix gettext build warning
Fixes #7224
2025-07-06 11:46:37 -07:00
osy 0b981d1693 build: fix Hypervisor build for Simulator on Xcode 26 2025-07-04 21:58:58 -07:00
osy bf72a60e92 build: update ffi source and tweak logging of url 2025-04-07 11:12:05 -07:00
osy 51fda404b8 package: fix DEB build for rootless
Fixes #6667
2024-11-23 00:54:44 -08:00
osy 38521a32e7 build: updated SPICE dependencies 2024-11-13 16:19:45 -08:00
osy 241ab254e6 qemu: update QEMU to v9.1.0-utm 2024-10-01 15:21:01 -07:00
osy a80e089415 package: update DEB control file to support rootless 2024-08-20 14:57:19 -05:00
osy 78304a5589 scripts: update usage to reflect options in build_utm.sh 2024-08-19 18:32:45 -05:00
osy 44acf31d6c project: disable unsupported entitlements for visionOS 2024-04-20 17:38:38 -07:00
osy a426fbd28e build: workaround for libtool does not use LDFLAGS correctly 2024-04-20 13:23:12 -07:00
osy 0347426484 build: set minimum deployment target for visionOS 2024-04-01 10:04:18 -07:00
osy 2fc13ca956 build: update gettext and fix QEMU compiler error
Proper fix for the new compiler errors introduced in Xcode 15.3.
2024-03-30 20:41:38 -07:00
osy 9846260ec8 github: update to Xcode 15.3 and disable new compiler errors 2024-03-30 14:06:33 -07:00