Covers two of the file-promise trade-offs (A + B from the review):
A. Progress: poll bytes streamed into the (shared) per-item subdir while
the opaque receivePromisedFiles runs, feeding the toast's live size
readout instead of a dead spinner. Best-effort — providers that write
a temp file and atomically rename only become visible at the end.
B. Cancellation: DropCancellationToken gains an onCancel hook; the
promise path cancels its operation queue and unblocks the wait loop
on ⊗ instead of sitting on the 30 s timeout. Cooperative providers
abort; either way we stop waiting and clean up at once.
C (true determinate % via NSItemProvider.loadFileRepresentation) is
intentionally NOT implemented: macOS AppKit drags don't vend
NSItemProvider, and NSFilePromiseReceiver exposes no Progress/cancel
surface, so a real percentage isn't reachable without an undocumented
hack. The size poller is the honest ceiling.
Also: capture the dispatch group locally in RelocationGate.drain to drop
a Sendable-capture warning. Adds DropCancellationTokenTests.
Introduces DropHandler to own the drop pipeline and addresses every item
from the review:
- Folders / .app bundles / packages: DropProgressCopier.copyTree walks
directories instead of failing with a generic 'Failed to copy'.
- File promises (Photos, Mail, browser image drags) are now accepted and
materialized instead of silently no-opping.
- Multi-file toast race: per-file DropSession id; stale relocation
results for a superseded file are ignored by update/finish/
setFinalDestination.
- Partial files: copyTree removes its partial output on any error, and
the handler drops the now-empty subdir, so the guest never sees a
truncated file.
- Teardown race: in-flight guest relocations register with
RelocationGate; 'tart run' drains it (<=6s) before deleting the drop
zone / exiting.
- Path collisions: each file copies into its own dropRoot/<uuid>/ subdir.
- Reserved name: a user --dir named 'Dropped Files' is now rejected.
- Linux / no agent: relocation is skipped and the toast says 'Copied to
the shared folder' instead of a misleading Finder destination.
- Agent-down timing: success toast holds on a fallback timer that
outlives the 5s RPC deadline so the final destination is always shown.
- Concurrency: relocations run one-at-a-time; copy failures are
coalesced into a single alert instead of a modal storm.
- Zero-byte/unknown size shows just the copied amount, not '0 bytes of ?'.
- Removed dead DropFolderBox + stale doc comment; fixed the
http://-vs-https:// typo in toRemoteOrLocalURL.
Tests: DropProgressCopierTests (replace/cancel/error-cleanup/empty/
directory/size), GuestDropParseTests (stdout parser), and a reserved-name
case in DirectoryShareTests. Product and test target both compile.
Adds the host-side hook for the forthcoming tart-guest-agent DragAndDrop RPC
that will perform a real drag-and-drop at the cursor's position inside the
guest instead of dumping files into a generic share folder.
- DropGeometry.normalize: pure helper turning a view-local drop point into
top-left (0..1) coordinates the guest agent can map onto its screen.
- VMContainerView.performDragOperation: capture draggingLocation on the
main thread (only valid here), compute normalized point, then dispatch
the copy off-main as before.
- synthesizeGuestDrop: documented no-op stub called from the copy completion
path. When the agent RPC lands, this becomes the real call site; until
then it returns false and the existing share-folder copy is the
user-visible result.
No behavior change for users today.
- Hold a FileLock on the dropzone so a concurrent tart command's
Config.gc() can't delete it from under the running VM, and remove
the directory explicitly on VM exit (defer doesn't fire through
Foundation.exit).
- Extract DirectoryShare.collect() and add the drop zone as a named
"Dropped Files" share so the share-builder logic stays simple.
- Copy dropped files on a background queue so large drops don't
freeze the VM framebuffer (the view that handles the drop also
renders the VM).
- Reject unnamed --dir combined with drag-and-drop with a clear
error pointing at both fixes; document the same in --no-drag-and-drop
help.
- Add DirectoryShare.collect() tests covering empty, named, drop-zone-only,
unnamed-conflict, and custom-mount-tag cases.
* Remove disk v1 support
* fix: address PR review feedback
- add explicit error for legacy disk.v1 media type during pull
- include actionable re-push guidance in runtime error
🤖 Generated with [Codex](https://chatgpt.com/codex)
Co-Authored-By: Codex <codex@openai.com>
* Re-use legacyDiskV1MediaType in error message
---------
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
* ASIF is available only starting from macOS 26 (Tahoe)
* Remove testRawFormatIsAlwaysSupported() test
* Fix testASIFFormatSupport() test to check for macOS 26+
* feat: Add disk image format selection with ASIF support
* fixed goreleaser-pro
* Fix ASIF disk format compatibility issues
- Use .uncached caching mode for ASIF disks to avoid Virtualization framework compatibility issues
- Improve caching mode selection logic for better maintainability
- Fix compiler warning by changing var to let for attachment variable
This resolves VM startup failures when using ASIF disk format by ensuring proper disk attachment configuration.
* Update goreleaser installation to use tap-specific formula
Change from 'brew install --cask goreleaser-pro' to 'brew install --cask goreleaser/tap/goreleaser-pro' for proper installation from the official goreleaser tap.
* Remove VS Code configuration and add to gitignore
- Remove .vscode/launch.json from repository
- Add .vscode/ to .gitignore to prevent VS Code settings from being tracked
* Implement ASIF disk resize using diskutil
- Add support for resizing ASIF disk images using diskutil image resize
- Detect disk format from VM config and route to appropriate resize method
- Use diskutil image info to get current ASIF disk size and validate resize
- Remove restriction that prevented ASIF disk resizing in Set command
- Add FailedToResizeDisk error case for proper error handling
- Maintain backward compatibility with raw disk resizing
- Add comprehensive size validation to prevent data loss
* Update Sources/tart/Commands/Create.swift
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
* Update Sources/tart/DiskImageFormat.swift
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
* Update Sources/tart/DiskImageFormat.swift
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
* Fix test naming and remove redundant test cases
- Rename testFormatArgument to testCaseInsensitivity for clarity
- Remove redundant 'raw' and 'invalid' test cases already covered in testFormatFromString
- Remove testFormatDescriptions test as it's not very useful
Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152093510
* Remove canCreate property and simplify DiskImageFormat
- Remove canCreate property since it's the same as isSupported
- Remove description property entirely as it's not used
- Fix displayName for RAW format (remove UDIF reference)
- Remove checkDiskutilASIFSupport helper function
Addresses review comments:
- https://github.com/cirruslabs/tart/pull/1094#discussion_r2152109450
- https://github.com/cirruslabs/tart/pull/1094#discussion_r2152115610
- https://github.com/cirruslabs/tart/pull/1094#discussion_r2152124330
* Update Create command validation and help text
- Simplify ArgumentParser help text to let it show possible values automatically
- Remove canCreate validation since property was removed
- Simplify error message for unsupported disk formats
Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152113480
* Add disk format validation to Run command
- Add validation to ensure ASIF disk format is supported on current system
- Check disk format compatibility before attempting to run VM
Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152109450
* Use proper namespaced constant for OCI label
- Add diskFormatLabelAnnotation constant in Manifest.swift
- Use org.cirruslabs.tart.disk.format namespace for consistency
- Use variable shadowing instead of new variable name for labels
Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152163515
* Remove special ASIF caching mode
- Remove .uncached caching mode for ASIF disks
- Use default caching logic for all disk formats
- Testing shows .cached mode works fine on macOS 26.0
Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152133589
* Improve code structure in VMDirectory
- Use guard let instead of nested if let for better readability
- Reduce nesting in resizeASIFDisk function
- Improve error handling flow
Addresses review comment: https://github.com/cirruslabs/tart/pull/1094#discussion_r2152141916
* diskFormatLabel
* reverted caching mode
* Use PropertyListDecoder
---------
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
* Improved format for fast and efficient pulls from remote OCI-registry
* Tests: introduce fileWithRandomData() helper function
* Remove useless continuation
* --concurrency should be an option, not an argument
* --v2-disk-format → --old-disk-format and use the new V2 by default
* Reduce LZ4 buffer size from 64 to 4 MiB
* --old-disk-format → --disk-format=...
* Support wildcards in `credHelpers`
With #591 `tart pull` fails when for example you have `ecr-login` set as the default `credsStore` but you try to pull our images from `ghcr.io`.
This change reverts #591 and instead supports regex in `credHelpers`. This is not supported by Docker itself but highly demanded in https://github.com/docker/cli/issues/2928
I think it's fine to support it for Tart.
Additionally this change bumps the minimum host macOS version to Ventura in order to bring `Regex`. Yes, `Regex` only supported in Swift for macOS 13+ 🤦♂️I think it's fine in the light of Sonoma release and Tart 2.0.0.
* Removed Monterey mentions from docs
* Allow mounting a single directory without a name
To utilize `VZSingleDirectoryShare` which seems more stable than `VZMultipleDirectoryShare`.
We've been having reports from users that mounted directories occasionally return "no such file" errors when building large projects. I took a stab at reproducing the issue by running https://github.com/devMEremenko/XcodeBenchmark in a mounted directory:
```bash
tart run --dir=workdir-test:~/workspace-temp/XcodeBenchmark ventura-xcode
```
And I was able to reproduce the "no such file" error on the first try! After looking into the issue I decided to try `VZSingleDirectoryShare` as this PR changes and to my pleasant surprise it all worked like a charm the next run. So it seems there is a bug in `VZMultipleDirectoryShare` integration with virtiofs. Since in most cases users only mount a single directory it makes sense to allow doing it wihtout providing a `name`.
So now it will be possible to run the following command:
```bash
tart run --dir=~/workspace-temp/XcodeBenchmark ventura-xcode
```
Which will make `~/workspace-temp/XcodeBenchmark` available under `/Volumes/My Shared Files/` without any intermediate directories.
* Reformat
* Updated description
* Improve RemoteName parser
* Remove Parsing import
* Permit namespace components to contain separators, but no more than one
* Add testNoPathTraversal
* tart clone: clone VM and generate MAC under a file lock
* Lock concurrent "tart pull"'s for the same host
* Config: ensure Tart's home and cache directories always exist
* Improve RemoteName parser
* Remove Parsing import
* Permit namespace components to contain separators, but no more than one
* Add testNoPathTraversal
* tart pull: introduce --populate-cache flag
* VMStorageOCI: introduce cache() method
* Review comments (#107)
* Rename SetCommand back to Set
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* Support pulling/pushing VMs to OCI-compatible registries
* Registry: rename request() to endpointRequest() for clarity
* Registry: include JSON details on HTTP status code mismatch errors
* .cirrus.yml: run tests
* Fix testDigest
* Registry: set Content-{Length,Type} headers when pushing blob
* Refactor Registry.auth() and enrich RegistryError.AuthFailed
* Remove useless comment
* Fix WWWAuthenticate a bit and add tests
* WWWAuthenticate: expect a Bearer scheme
* Registry.auth(): document the passing of ["scope", "service"] parameters
* Clarify unexpected HTTP code error when retrieving auth token
* Make RemoteName parser more relaxed for now
* tart clone: pull the VM if it's OCI-based first
* VMStorageOCI: ensure the old symbolic link is overwritten
* tart push: support multiple remote VM names
* Logging: push/pull progress
* Use 500 MB chunks (instead of 500 MiB) to evenly cut disk
...which also uses powers of 10.
* Credentials: only read credentials labeled "Tart Credentials"