## What does this PR do?
Updates xadi for https://github.com/NixOS/nixpkgs/pull/548520
## How was it tested?
- [ ] CI
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Updates workflows to build with Swift 6.4. Blockers:
- [x] ~~GitHub's macos-26 runners don't yet support Xcode 27~~ They've
moved to a new nomenclature where the runner tracks the Xcode major
version. The new runner is `xcode-27`.
- [x] ~~Linux AppImage builds are failing due to
https://github.com/swiftlang/swift-build/issues/1764 (will be fixed in
6.4.1)~~ Switched to dynamic linking
## How was it tested?
- [x] Built locally with Xcode 27 and confirmed it runs
- [x] Built locally with `swift:6.4.0` docker image and confirmed it
runs
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is swiftlang/swift-package-manager#2. Do not lower
the declared level to get the PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Build & Release**
* macOS and iOS builds and macOS releases now use Xcode 27.
* Swift has been updated to version 6.4.0 for Docker and Netlify builds.
* **Bug Fixes**
* Linux packaging no longer copies `.resources` files into the AppDir,
which may affect packaged app resources.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
We don't really need `--static-swift-stdlib` when building the AppImage,
since we can bundle the stdlib.
Static linking _can_ theoretically save space & squeeze out a little
more perf, but statically linking Swift is buggy (for example
https://github.com/swiftlang/swift-build/issues/1764 wasn't caught until
days after 6.4.0 released, and months after the beta) and prevents using
dynamic Swift libraries.
## How was it tested?
- [x] Ran appimage in docker
- [x] Verified that the appimage contains `libswift[...].so`
- [x] Compared size on disk (<1MB increase)
- [x] Compared performance (no statistically significant change)
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Application packing now sets CFBundleSupportedPlatforms from
Packer.cfBundleSupportedPlatforms(for:). The helper splits the triple on
hyphens, takes the OS token after apple with any numeric version
stripped, and returns iPhoneSimulator for an ios triple that also
contains simulator, iPhoneOS for other ios triples, MacOSX for macos or
macosx, and iPhoneOS when the triple is missing or unrecognized.
PackerTests covers those triples. Package.resolved drops the
swift-issue-reporting pin and adds xctest-dynamic-overlay 1.13.1.
Application builds aimed at the iOS simulator still ship an Info.plist
whose CFBundleSupportedPlatforms value is iPhoneOS. Hosts that read that
key treat the archive as a physical-device build and refuse to launch it
on a simulator. While packing an application, Packer assigns
CFBundleSupportedPlatforms the fixed array iPhoneOS. The build triple is
already available on buildSettings, but that assignment never reads it,
so a simulator triple is packed the same way as a device triple.
Fixes#191
## How was it tested?
The package builds successfully.
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [ ] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
AI was used for assistance.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Application metadata now reports the supported platform based on the
build target, including iOS devices, iOS simulators, and macOS. Unknown
targets retain the iOS device platform as a fallback.
* **Tests**
* Added coverage for platform metadata across supported and unknown
build targets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
## What does this PR do?
Fixes https://github.com/xtool-org/xtool/issues/286 (Package.resolved
changes depending on host OS) by forcing OpenCombine into the dependency
graph even on macOS.
## How was it tested?
Ran `swift package resolve`
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated package resolution configuration. This change does not alter
app features or user-facing behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Configure SourceKit-LSP to use SwiftBuild when working on xtool itself.
The legacy build system has trouble with xcframeworks.
## How was it tested?
Confirmed that it fixes highlighting of error diagnostics
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Bumps pointfree deps and explicitly disables OpenCombine so that we
don't have different dependency graphs when building xtool on Darwin vs
Linux hosts.
## How was it tested?
A bunch of `swift package resolve`s
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated supporting package versions and refreshed command-line and
file-operation handling.
* These changes do not add or remove app features or alter its public
interface. No action is needed to continue using the app.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
We only need `Xcode.app/Contents/{Info.plist,version.plist,Developer}`
for the SDK (and expect that to continue being the case). We already
delete other directories when using `xtool sdk install Xcode.app` but we
weren't doing this on `xtool sdk install Xcode.xip`. Prune on the xip
path as well.
Also prune on update (and bump the SDK epoch) so that existing users
benefit from this.
## How was it tested?
- [x] Install SDK from xip, confirm `Xcode.app/Contents` only contains
those three things
- [x] Install SDK from app, confirm `Xcode.app/Contents` only contains
those three things + we don't modify the original app
- [x] Build SDK from app (`xtool sdk build Xcode.app`), confirm we don't
clobber the input Xcode app
- [x] Update SDK, confirm that extra contents are removed
- [x] SDK auto-updates after updating xtool binary
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* SDK builds from Xcode app and XIP inputs now check for required Xcode
components before installation. Missing components produce an error.
* Extra direct items in Xcode’s `Contents` folder are removed during XIP
builds and app updates. Slim builds remain unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Bumps Darwin deployment targets.
In order to better integrate with SwiftBuild we need to pull in
swift-tools-protocols which
[requires](https://github.com/swiftlang/swift-tools-protocols/blob/4345e69c5572ec3d1f737fba90bca024b32da5cf/Package.swift#L210)
macOS 14 / iOS 17.
## How was it tested?
- [x] CI
- [x] Did a local smoke test to ensure `xtool` still runs
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated minimum supported versions to iOS 17 and macOS 14.
* macOS project configuration now requires macOS 14 or later.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Updates Ruby and gems
## How was it tested?
- [x] `bundle exec fastlane package`
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Chores**
- Updated the macOS environment to use Ruby 4.0.7, keeping local
development and maintenance workflows aligned with the supported runtime
version.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Updates to zsign 1.9.0 which incorporates the latest upstream changes
## How was it tested?
Built and ran an app on my phone
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Adds a `SWIFT_VERSION` arg to the Dockerfile
## How was it tested?
Ran on macOS
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated the build and runtime environments to use Swift 6.3.3
consistently.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Forgot to update one spot that still says Xcode 26
## How was it tested?
N/A
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
When building the SDK, derives the clang resource dir from the installed
Swift toolchain (`swiftc -print-target-info`) instead of `clang
-print-resource-dir`.
Speculatively fixes#273.
## How was it tested?
Validated that I can still build on Linux
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [ ] **0** - No AI was used to write code
- [x] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved detection of the host Clang resource directory by using Swift
compiler target information, helping ensure more reliable compiler setup
across supported environments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Updates docs to recommend Xcode 27 + Swift 6.4
## How was it tested?
Netlify deploy preview
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Documentation**
- Updated Linux installation guidance to require Swift 6.4.
- Refreshed the example toolchain version output.
- Updated the example Xcode archive filename to reflect the newer
release.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Bumps darwin-tools and OpenAppleMacros
- Updates LLD to support arm64e.x1 to fix#269
- Adds FoundationModelsMacros to fix#213
## How was it tested?
- [x] Confirm that we can build with an Xcode 27 release SDK on Linux
- [x] Confirm that FoundationModels APIs work
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved Darwin SDK tool discovery during Swift builds, including
support for locating `dsymutil`.
* **Updates**
* Updated bundled Darwin tool dependencies.
* Added Foundation Models macros support to the OpenAppleMacros library
set.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Updates macOS build to use the fully-local XADI as the Anisette provider
instead of Omnisette. Includes a one-time migration, logging the user
out on macOS when they upgrade.
## How was it tested?
General:
- [x] Log in and confirm that there's no calls to omnisette
- [x] `xtool dev` works
Migration:
- [x] Log into Apple ID using an old version of xtool
- [x] Migrate to new xtool, run `xtool dev build -s` and confirm it
fails due to being logged out
- [x] Log in on new xtool, confirm that we stay logged in
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Authentication now supports tracking the anisette provider used to
create Xcode tokens.
* Xcode authentication tokens are automatically cleared when the
provider changes, helping ensure users sign in again with current
credentials.
* Anisette provider identification is supported across macOS and Linux.
* **Bug Fixes**
* Improved authentication error messages, including clearer messaging
for logout-related errors.
* Prevented outdated Xcode authentication tokens from being reused after
a provider change.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Adds support for SwiftBuild on Swift 6.4.
We now point SwiftBuild to iPhoneOS.platform and rely on the real
[SWBApplePlatform](https://github.com/swiftlang/swift-build/tree/b30ee3c00abf34857084c26bb873c3da06348134/Sources/SWBApplePlatform).
We also do a little futzing to convince SWB to use our Darwin-compatible
toolset (lld, librarian, resource dirs). We explicitly _don't_ pass in a
Swift SDK because that would downgrade SWB to using one of the generic
platform plugins instead of ApplePlatform.
This also gets us a lot closer to parity with Xcode's behavior when
building for Apple platforms; we get the same build flags and
everything. We can probably achieve identical bundling too, if we take
control of the PIF.
One other change: since we need to pass custom env vars and such, we
can't rely on sourcekit-lsp's built-in SwiftPM integration anymore. We
thus create a custom BSP server that trampolines to SwiftPM's build
server with the right flags set. This effectively makes SwiftPM an
implementation detail, so we can start messing with the PIF.
## How was it tested?
- [x] Build with Swift 6.3 on macOS
- [x] Build with Swift 6.4 on macOS
- [x] Build with Swift 6.3 on Linux
- [x] Build with Swift 6.4 on Linux
- [x] BSP/LSP file creation works
- [x] LSP support works in VSCode
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [ ] **0** - No AI was used to write code
- [x] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added a `dev build-server` command for Build Server Protocol
integration.
- Projects automatically select the appropriate Swift build system when
supported.
- Packaging supports output layouts for Swift Package Manager and Swift
Build.
- Added options to skip language-server configuration when needed.
- **Documentation**
- Updated project templates and tutorials to use `.bsp/xtool.json` for
IDE features such as syntax highlighting and documentation lookup.
- **Improvements**
- Enhanced SDK generation and compatibility across supported toolchains
and platforms.
- Improved automatic language-server configuration while preserving
existing configuration files.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Bumps xtool-core et al, switching products to automatic instead of
forcing dynamic libraries. LGPL dependencies (LIMD, XADI) are still
packaged as dynamic.
## How was it tested?
- [x] Ran locally on macOS + Linux and confirmed `xtool dev` works
- [x] Inspected .app bundle to make sure we have the expected dynamic
frameworks
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated underlying package dependencies to newer minimum versions for
improved compatibility and maintenance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Fixes a bug where installation would crash due to `plist_from_bin`
hitting Provision's version of the function which uses D runtime
shenanigans.
## How was it tested?
Locally on macOS
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated the `xadi` package dependency to version 0.4.1.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Adds support for proprietary Apple macros (like SwiftUI's `@Entry` and
`@State`) via
[OpenAppleMacros](https://github.com/xtool-org/OpenAppleMacros).
We have to re-implement these because the macros need to run on the
_host_, and the Apple SDKs include them as macOS-only dylibs.
## How was it tested?
- [x] Extensive integration tests in OpenAppleMacros that compare
Apple's expansions against ours
- [x] Confirmed that `@Entry`, `#Preview`, and `@State` work in Swift
6.3 and 6.4 (State is a PW in the former, macro in the latter)
- [x] Confirmed that OSS toolchain macros continue to work (tested
`@Observable`, `#bundle`)
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Adds integration tests
## How was it tested?
CI
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Added integration smoke tests covering version checks, app creation,
iOS build metadata, and slim SDK update behavior.
* Added validation for locating Xcode and verifying the Swift toolchain.
* **Chores**
* Added automated integration-test execution for pushes and pull
requests.
* Added Docker and Compose support for running integration tests in a
consistent environment.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
Allows xtool to auto-update the Darwin SDK format when there's a new
Darwin toolset, or when we change the SDK format. Downstream this also
allows us to auto-update when there's changes to OpenAppleMacros (#101).
One callout: the disk footprint of `darwin.artifactbundle` is now ~7 GB
instead of ~3 GB.
Reason: `xtool sdk install /path/to/Xcode.[app|xip]` now performs a
"normal" install by default, which preserves the entirety of
`Xcode.app/Contents/Developer` — even the bits we don't currently use,
like `AppleTVOS.platform`. This makes it so if we start using more
components in the future, the user doesn't need to download Xcode again
and rebuild the SDK themselves.
You can still build an old-style SDK (containing just the components we
need) using `xtool sdk install --slim` or the dedicated `xtool sdk
build`.
## How was it tested?
Tested all of the install modes. Confirmed that auto-updating works.
Added integration tests in #252.
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [ ] **0** - No AI was used to write code
- [x] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added SDK flavor reporting for slim, normal, and legacy installations.
- Added `sdk update` support to rebuild and install SDKs from an
installed Xcode bundle.
- Added a `--slim` option for SDK installation.
- SDK status now displays installation path, flavor, and version.
- SDK setup and build operations now ensure a suitable SDK is available
automatically.
- **Bug Fixes**
- Improved temporary SDK bundle handling, validation, replacement, and
cross-filesystem copying.
- Copy failures now provide detailed diagnostic information.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What does this PR do?
The xadi repo (https://github.com/xtool-org/xadi) now vends an
artifactbundle for xadi, so we don't need to separately build/install it
during the xtool build. This also makes it super easy to support macOS
later (#259).
## How was it tested?
- [x] Confirmed I can sign in (including provisioning)
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [ ] **0** - No AI was used to write code
- [x] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Mechanical move of DarwinSDK from XToolSupport -> PackLib. Needed for
https://github.com/xtool-org/xtool/pull/229.
## How was it tested?
Compiled + CI
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Fixes HTTP 503 on GsService… again (followup from #244)
Seems like GSA has stopped accepting `com.apple.dt.Xcode` in the client
info string. Use `akd` instead.
## How was it tested?
- [x] Logging in before failed
- [x] Logging in after succeeds
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Fixes#254 by using `cp -R` instead of `FileManager.copyItem`. The
latter tries to preserve the original owner of files instead of using
the caller, which fails if you're non-root and the original files are
root-owned.
## How was it tested?
I was able to repro the original issue by installing an SDK as a
non-root user in an xtool Docker container.
Applied this patch, tried `xtool sdk install` again, and it worked.
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [ ] **0** - No AI was used to write code
- [x] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Adds more info for contributors, plus AI policy.
## How was it tested?
Read the docs on GitHub
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [x] **0** - No AI was used to write code
- [ ] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
## What does this PR do?
Improves support for HTTP MITM
## How was it tested?
Did some MITMing on macOS + Linux via Docker, using Proxyman and
mitmproxy. Didn't test `XTL_HTTP_PROXY` but Sol pinkie promises me that
it's correct.
## AI tool usage
How much of this PR was AI-assisted? (check one)
- [ ] **0** - No AI was used to write code
- [x] **1** - I was assisted by AI. I reviewed the finished result.
- [ ] **2** - I set the AI going and left it to it; nobody has read the
result - no review, or AI review only
<!-- If an AI agent is filling this in: declare the level honestly, and
open as a draft if it is #2. Do not lower the declared level to get the
PR reviewed. -->
Ref #243. `makeRequest` never inspected `response.status`, so a non-2xx
body was
returned as if it had succeeded. Every caller decodes that body as a
property list
or JSON, so Apple answering with an HTML error page surfaced as:
```
Error: DecodingError.dataCorrupted: Data was corrupted. Debug description: The given
data was not a valid property list.. Underlying error: ... Encountered unknown tag
html on line 1
```
which says nothing about what actually happened. In the case that
prompted #243, GSA
was returning `503 Service Temporarily Unavailable` for the `apptokens`
operation. It
now reads:
```
Error: POST https://gsa.apple.com/grandslam/GsService2 failed: HTTP 503 Service
Unavailable (text/html): <html> <head><title>503 Service Temporarily
Unavailable</title></head> ...
```
### Notes
- The response body is only included in the message for `text/html` and
`text/plain`,
i.e. gateway error pages. Bodies from the auth endpoints can carry
account details
(the 2FA requests use `Accept: application/x-buddyml`), and errors get
printed
verbatim in places such as `DevCommand.swift:164`, so those are left
out. It also
avoids emitting replacement characters for binary bodies.
- The non-2xx path does not report progress, so `XADIProvider`'s
download no longer
prints `100%` immediately before failing.
- Body collection moved to `collect(_:onProgress:)` so there is a single
exit point.
Buffer pre-sizing and progress reporting are unchanged.
- `SDKBuilder` already does this check by hand on `send()`, so it is
unaffected.
### Behaviour changes worth a look
- `XADIProvider` writes the Apple Music APK download straight to disk; a
failed
download now throws instead of leaving a corrupt `applemusic.apk`.
- The 2FA requests (`GrandSlamTrustedDeviceRequest`,
`GrandSlamSMSAuthRequest`,
`GrandSlamValidateRequest`) use no-op decoders, so a rejected request is
currently
discarded and xtool goes on to prompt for a code that was never sent —
the symptom
in #235. Those now fail loudly.
### Two things I left alone
- `GrandSlamTwoFactorAuthenticateOperation.swift:47` catches
`GrandSlamOperationError`
with code `-21669` to report an incorrect verification code, but that
error is only
thrown by `GrandSlamOperationDecoder`, which the validate requests do
not use, so the
catch is unreachable. With this change a wrong code surfaces as a raw
HTTP error
instead. Mapping the status back to `incorrectVerificationCode` seemed
like your call,
since I do not know what GSA returns for a bad code.
- If any endpoint reports errors in a decodable body under a non-2xx
status, this guard
would pre-empt it. I could not find one — `developerservices2` returns
HTTP 200 with
`resultCode`/`userString` in the body, which is untouched here.
Built and linted on Linux (`swift build --product xtool`, `make lint`: 0
violations).
---------
Co-authored-by: Robetronica <noreply@Robetronica.com>
Co-authored-by: Kabir Oberai <oberai.kabir@gmail.com>
Previously, we would clear xtool's temporary directory on startup. This
(practically) meant you couldn't have multiple instances running in
parallel, because the second instance could delete the first instance's
temp resources while the first instance still needed them. Fix this by
having xtool instances declare locks on their temporary directories.