Sync VCC Plus 3.7.1 build 67 source
Refresh reviewed MCP output export, four-drive owned playtests, bounded BASIC readiness, and pinned CMOC 0.1.101 source/patches. Preserve independent source-edition identity, empty libraries, notices and privacy boundaries. Validated 74 export/privacy checks, pinned dependency sources, and an independent unsigned universal Release build. A subsequent documentation-only correction removes an excluded qualification link; all build inputs remain identical.
This commit is contained in:
1 parent
4abc194001
commit
5534005799
54 files changed
+2950
-435
No files matched your search
@@ -53,6 +53,22 @@ static NSArray<NSDictionary *> *MCPProjectTools(BOOL assembly, BOOL interactive,
|
||||
@{@"run_id":identifier, @"request_id":keyRequestID, @"keys":MCPGuestKeySchema(NO)}, NO)]];
|
||||
}
|
||||
|
||||
// Destination permission is granted natively and never inferred from Make access.
|
||||
static NSArray<NSDictionary *> *MCPBuildExportTools() {
|
||||
NSDictionary *id = @{@"type":@"string",@"minLength":@1,@"maxLength":@128};
|
||||
NSDictionary *properties = @{@"project_id":id,@"build_id":id,@"artifact_id":id,
|
||||
@"revision":@{@"type":@"integer",@"minimum":@0},@"destination_id":id,@"request_id":id,
|
||||
@"output_ids":@{@"type":@"array",@"items":id,@"minItems":@1,@"maxItems":@64,@"uniqueItems":@YES}};
|
||||
return @[
|
||||
@{@"name":@"export_build_outputs",@"description":@"Deliver selected exportable_outputs from an exact successful build to its natively approved destination_id. Supply the original build revision and artifact_id, including for an earlier Release after building Debug. Creates a new exclusive delivery set; never replaces files. Returns export_id/status immediately; poll get_build_export. Retry the identical request_id to reuse and verify the original delivery. Changed selections conflict; changed source/destination bytes fail. No paths or arbitrary workspace files are accepted. Limits: 64 files, 64 MiB/file, 128 MiB/set, 512 MiB and 64 requests per connection, one active export.",
|
||||
@"inputSchema":@{@"type":@"object",@"properties":properties,@"required":[properties.allKeys sortedArrayUsingSelector:@selector(compare:)],@"additionalProperties":@NO},
|
||||
@"annotations":@{@"readOnlyHint":@NO,@"openWorldHint":@NO}},
|
||||
@{@"name":@"get_build_export",@"description":@"Poll one owned export_id. A completed receipt preserves original project/build/artifact/revision/configuration identities and reports delivered relative filenames, original sizes and SHA-256 hashes. Independently verify these bytes; an identical export retry verifies the existing delivery rather than silently repairing changes.",
|
||||
@"inputSchema":@{@"type":@"object",@"properties":@{@"project_id":id,@"export_id":id},@"required":@[@"project_id",@"export_id"],@"additionalProperties":@NO},
|
||||
@"annotations":@{@"readOnlyHint":@YES,@"openWorldHint":@NO}}
|
||||
];
|
||||
}
|
||||
|
||||
// Added only when the running app explicitly advertises project refresh.
|
||||
static NSArray<NSDictionary *> *MCPProjectRefreshTools() {
|
||||
NSDictionary *identifier = @{@"type":@"string", @"minLength":@1, @"maxLength":@128};
|
||||
@@ -129,7 +145,7 @@ static NSArray<NSDictionary *> *MCPPlaytestCallContextTools() {
|
||||
|
||||
// Fresh reviewed media-aware C playtest grants only. The two insertion fields
|
||||
// are action-specific in discovery as well as helper/host validation.
|
||||
static NSArray<NSDictionary *> *MCPPlaytestMediaTools() {
|
||||
static NSArray<NSDictionary *> *MCPPlaytestMediaTools(BOOL multiDrive = NO) {
|
||||
NSDictionary *identifier = @{ @"type":@"string", @"minLength":@1, @"maxLength":@64 };
|
||||
NSDictionary *mediaID = @{ @"type":@"string", @"minLength":@1, @"maxLength":@64,
|
||||
@"pattern":@"^[A-Za-z0-9_-]{1,64}$", @"description":@"Opaque ID from list_playtest_media; never a host path." };
|
||||
@@ -141,6 +157,14 @@ static NSArray<NSDictionary *> *MCPPlaytestMediaTools() {
|
||||
@"action":@{ @"type":@"string", @"enum":@[ @"insert" ] }, @"media_id":mediaID, @"media_sha256":sha };
|
||||
NSDictionary *ejectProperties = @{ @"run_id":identifier, @"request_id":identifier,
|
||||
@"action":@{ @"type":@"string", @"enum":@[ @"eject" ] } };
|
||||
if (multiDrive) {
|
||||
NSDictionary *drive = @{@"type":@"integer",@"minimum":@0,@"maximum":@3,@"default":@0,
|
||||
@"description":@"Target FD0–FD3. Omission means FD0; never wraps."};
|
||||
NSMutableDictionary *insert = [insertProperties mutableCopy]; insert[@"drive"] = drive;
|
||||
insert[@"write_protected"] = @{@"type":@"boolean",@"description":@"Optional owned-copy write protection. Omission preserves its setting; false cannot override format-imposed protection."};
|
||||
insertProperties = insert;
|
||||
NSMutableDictionary *eject = [ejectProperties mutableCopy]; eject[@"drive"] = drive; ejectProperties = eject;
|
||||
}
|
||||
NSMutableDictionary *exchangeProperties = [insertProperties mutableCopy];
|
||||
exchangeProperties[@"action"] = @{ @"type":@"string", @"enum":@[ @"insert", @"eject" ] };
|
||||
return @[
|
||||
@@ -148,7 +172,7 @@ static NSArray<NSDictionary *> *MCPPlaytestMediaTools() {
|
||||
@"inputSchema":@{ @"type":@"object", @"properties":listProperties,
|
||||
@"required":@[ @"project_id", @"revision", @"artifact_id" ], @"additionalProperties":@NO },
|
||||
@"annotations":@{ @"readOnlyHint":@YES, @"openWorldHint":@NO } },
|
||||
@{ @"name":@"exchange_playtest_media", @"description":@"Insert or eject FD0 in a paused owned disposable run while its floppy controller is idle. Insert requires media_id and exact media_sha256 from that run's listing; eject forbids both. Uses only reviewed artifact-bound private writable disks, preserving every disk across swaps and restart and retaining all disks when the run stops. A successful exchange neither resets nor advances the guest; receipts identify old/new media, hashes, dirty/retained state and clock. Failed exchange preserves the mounted disk and data. Reuse request_id only for the identical action and selection; changed plans conflict. No arbitrary paths, personal media, memory or register writes.",
|
||||
@{ @"name":@"exchange_playtest_media", @"description":multiDrive ? @"Insert/eject only the selected drive FD0–FD3 (optional drive defaults to 0) in a paused owned run with the shared floppy controller idle. Insert requires reviewed media_id and exact current hash; optional boolean write_protected changes only that owned copy. Eject forbids media/hash/protection fields. Reject duplicate mounting of one writable copy. Old FD0 fields retain their meaning; drives lists all four placements, current/original hashes, generations, write protection and actual read/write byte transfers. Preserve all copies independently through exchange, cold restart, stop and retention. No reset, guest time advance, default-drive change or personal-session access. Reuse request_id only for the identical normalized drive/action/selection/protection plan." : @"Insert or eject FD0 in a paused owned disposable run while its floppy controller is idle. Insert requires media_id and exact media_sha256 from that run's listing; eject forbids both. Uses only reviewed artifact-bound private writable disks, preserving every disk across swaps and restart and retaining all disks when the run stops. A successful exchange neither resets nor advances the guest; receipts identify old/new media, hashes, dirty/retained state and clock. Failed exchange preserves the mounted disk and data. Reuse request_id only for the identical action and selection; changed plans conflict. No arbitrary paths, personal media, memory or register writes.",
|
||||
@"inputSchema":@{ @"type":@"object", @"properties":exchangeProperties,
|
||||
@"required":@[ @"run_id", @"request_id", @"action" ], @"additionalProperties":@NO,
|
||||
@"oneOf":@[
|
||||
|
||||
@@ -495,8 +495,13 @@ int main(int argc, char **argv) {
|
||||
const bool mediaExchange = [grant[@"kind"] isEqual:@"cmoc"] && toolset >= 11 &&
|
||||
[grant[@"playtest"] isEqual:@YES] && CFGetTypeID((__bridge CFTypeRef)grant[@"playtest"]) == CFBooleanGetTypeID() &&
|
||||
[grant[@"playtestMedia"] isEqual:@YES] && CFGetTypeID((__bridge CFTypeRef)grant[@"playtestMedia"]) == CFBooleanGetTypeID();
|
||||
const bool multiDrive = mediaExchange && toolset >= 13 &&
|
||||
[grant[@"playtestMultiDrive"] isEqual:@YES] && CFGetTypeID((__bridge CFTypeRef)grant[@"playtestMultiDrive"]) == CFBooleanGetTypeID();
|
||||
tools = [MCPProjectTools([grant[@"kind"] isEqual:@"assembly"], toolset >= 3,
|
||||
customMake) arrayByAddingObjectsFromArray:manualTools];
|
||||
if ([grant[@"kind"] isEqual:@"cmoc"] && toolset >= 13 &&
|
||||
[grant[@"buildExport"] isEqual:@YES] && CFGetTypeID((__bridge CFTypeRef)grant[@"buildExport"]) == CFBooleanGetTypeID())
|
||||
tools = [tools arrayByAddingObjectsFromArray:MCPBuildExportTools()];
|
||||
if ([grant[@"kind"] isEqual:@"cmoc"] && toolset >= 6 && [grant[@"projectRefresh"] isEqual:@YES])
|
||||
tools = [tools arrayByAddingObjectsFromArray:MCPProjectRefreshTools()];
|
||||
if ([grant[@"kind"] isEqual:@"cmoc"] && toolset >= 7 && [grant[@"projectDiagnostics"] isEqual:@YES])
|
||||
@@ -519,7 +524,7 @@ int main(int argc, char **argv) {
|
||||
CFGetTypeID((__bridge CFTypeRef)grant[@"playtestCallContext"]) == CFBooleanGetTypeID())
|
||||
tools = [tools arrayByAddingObjectsFromArray:MCPPlaytestCallContextTools()];
|
||||
if (mediaExchange)
|
||||
tools = [tools arrayByAddingObjectsFromArray:MCPPlaytestMediaTools()];
|
||||
tools = [tools arrayByAddingObjectsFromArray:MCPPlaytestMediaTools(multiDrive)];
|
||||
} else {
|
||||
tools = [@[tool(@"get_capabilities", @"Identify the connected VCC Plus session and selected BASIC document.", nil),
|
||||
tool(@"read_source", @"Read the selected BASIC draft using its document_id from get_capabilities.", @"document_id")]
|
||||
|
||||
@@ -281,7 +281,10 @@ class Playtest {
|
||||
}
|
||||
void armStop() { armEvidence(stops, stopModule); }
|
||||
void armInspection() { armEvidence({}, {}); }
|
||||
uint64_t consumed = 0, fieldClock = 0, bootNumber = 0, mediaGeneration = 0;
|
||||
uint64_t consumed = 0, fieldClock = 0, bootNumber = 0;
|
||||
std::array<uint64_t, 4> mediaGenerations{}, mountReadBases{}, mountWriteBases{};
|
||||
bool multiDrive = false, frozenForRetention = false;
|
||||
unsigned drainedDrives = 0;
|
||||
VCCPlaytestVideoWriter *videoWriter = nil;
|
||||
NSMutableDictionary *videoInfo = nil;
|
||||
NSURL *videoDirectory = nil;
|
||||
@@ -332,54 +335,80 @@ class Playtest {
|
||||
else if (fieldClock - videoFirstField >= videoMaximumFields) finishVideo(@"field_limit");
|
||||
}
|
||||
Processor processor = Processor::MC6809;
|
||||
NSString *originalDiskHash = nil, *currentMediaID = nil;
|
||||
NSString *diskHash() const {
|
||||
const auto *image = floppy ? floppy->image(0) : nullptr;
|
||||
NSMutableArray *originalDiskHashes = [NSMutableArray arrayWithObjects:@"", @"", @"", @"", nil];
|
||||
NSMutableArray *currentMediaIDs = [NSMutableArray arrayWithObjects:NSNull.null, NSNull.null, NSNull.null, NSNull.null, nil];
|
||||
NSString *mediaID(unsigned drive) const {
|
||||
id value = currentMediaIDs[drive];
|
||||
return [value isKindOfClass:NSString.class] ? value : nil;
|
||||
}
|
||||
NSString *diskHash(unsigned drive = 0) const {
|
||||
const auto *image = floppy ? floppy->image(drive) : nullptr;
|
||||
return image ? sha256(image->bytes()) : @"";
|
||||
}
|
||||
NSDictionary *driveStatus(unsigned drive) const {
|
||||
const auto *image = floppy->image(drive);
|
||||
return @{@"drive": @(drive), @"label": [NSString stringWithFormat:@"FD%u", drive],
|
||||
@"inserted": @(image != nullptr), @"disk_present": @(image != nullptr),
|
||||
@"media_id": mediaID(drive) ?: (id)NSNull.null,
|
||||
@"disk_original_sha256": originalDiskHashes[drive], @"disk_sha256": diskHash(drive),
|
||||
@"media_generation": @(mediaGenerations[drive]), @"byte_count": @(image ? image->bytes().size() : 0),
|
||||
@"disk_dirty": @(image && image->dirty()), @"write_protected": @(image && image->writeProtected()),
|
||||
@"disk_reads": @(floppy->readEvents(drive)), @"disk_writes": @(floppy->writeEvents(drive)),
|
||||
@"mount_read_bytes": @(floppy->readEvents(drive) - mountReadBases[drive]),
|
||||
@"mount_write_bytes": @(floppy->writeEvents(drive) - mountWriteBases[drive])};
|
||||
}
|
||||
void requireMediaExchangeState() const {
|
||||
if (machine->snapshot().state != RunState::Paused) throw std::runtime_error("playtest_not_stopped");
|
||||
// Motor activity or previously written bytes do not mean a transfer is
|
||||
// pending. Only the actual FDC busy state prevents a disk exchange.
|
||||
// A pending command on ANY drive protects the shared controller.
|
||||
if (floppy->snapshot().busy) throw std::runtime_error("playtest_media_busy");
|
||||
}
|
||||
NSDictionary *exportMedia() const {
|
||||
requireMediaExchangeState();
|
||||
NSDictionary *exportMedia(unsigned drive = 0) {
|
||||
if (!frozenForRetention) requireMediaExchangeState();
|
||||
NSMutableDictionary *out = [status() mutableCopy];
|
||||
if (const auto *image = floppy->image(0)) {
|
||||
if (multiDrive) out[@"exported_drive"] = driveStatus(drive);
|
||||
if (const auto *image = floppy->image(drive)) {
|
||||
const auto& data = image->bytes();
|
||||
out[@"disk_base64"] = [[NSData dataWithBytes:data.data() length:data.size()] base64EncodedStringWithOptions:0];
|
||||
}
|
||||
if (frozenForRetention) drainedDrives |= 1u << drive;
|
||||
return out;
|
||||
}
|
||||
NSDictionary *exchangeMedia(NSDictionary *request) {
|
||||
const unsigned drive = request[@"drive"] ? number(request[@"drive"], 0, 3) : 0;
|
||||
for (NSString *key in request)
|
||||
if (![@[@"op", @"expected_media_generation", @"expected_disk_sha256", @"media_id", @"disk_base64"] containsObject:key])
|
||||
throw std::invalid_argument("invalid_arguments");
|
||||
if (![@[@"op", @"expected_media_generation", @"expected_disk_sha256", @"media_id", @"disk_base64",
|
||||
@"drive", @"write_protected"] containsObject:key]) throw std::invalid_argument("invalid_arguments");
|
||||
if (!multiDrive && request[@"drive"]) throw std::invalid_argument("invalid_arguments");
|
||||
const bool inserting = request[@"media_id"] != nil;
|
||||
if ((request[@"disk_base64"] != nil) != inserting || request.count != (inserting ? 5u : 3u))
|
||||
const NSUInteger optional = (request[@"drive"] ? 1 : 0) + (request[@"write_protected"] ? 1 : 0);
|
||||
if ((request[@"disk_base64"] != nil) != inserting || request.count != (inserting ? 5u : 3u) + optional ||
|
||||
(!inserting && request[@"write_protected"])) throw std::invalid_argument("invalid_arguments");
|
||||
if (request[@"write_protected"] && CFGetTypeID((__bridge CFTypeRef)request[@"write_protected"]) != CFBooleanGetTypeID())
|
||||
throw std::invalid_argument("invalid_arguments");
|
||||
const auto expected = number(request[@"expected_media_generation"], 0, INT32_MAX);
|
||||
if (![request[@"expected_disk_sha256"] isKindOfClass:NSString.class]) throw std::invalid_argument("invalid_arguments");
|
||||
NSString *nextID = nil;
|
||||
std::optional<VCC::Devices::DiskImage> replacement;
|
||||
// Complete container validation and allocation precede any change to
|
||||
// mounted media. Invalid images cannot eject or replace the old disk.
|
||||
// Validate container and effective protection before changing any drive.
|
||||
if (inserting) {
|
||||
nextID = mediaIdentifier(request[@"media_id"]);
|
||||
replacement.emplace(VCC::Devices::DiskImage::load(bytes(request[@"disk_base64"], maximumDiskBytes)));
|
||||
for (unsigned other = 0; other < 4; ++other)
|
||||
if (other != drive && [nextID isEqual:mediaID(other)]) throw std::invalid_argument("playtest_media_already_inserted");
|
||||
replacement.emplace(VCC::Devices::DiskImage::load(bytes(request[@"disk_base64"], maximumDiskBytes),
|
||||
[request[@"write_protected"] boolValue]));
|
||||
}
|
||||
requireMediaExchangeState();
|
||||
NSString *oldHash = diskHash(), *oldID = currentMediaID;
|
||||
if (uint64_t(expected) != mediaGeneration || ![request[@"expected_disk_sha256"] isEqual:oldHash])
|
||||
NSString *oldHash = diskHash(drive), *oldID = mediaID(drive);
|
||||
if (uint64_t(expected) != mediaGenerations[drive] || ![request[@"expected_disk_sha256"] isEqual:oldHash])
|
||||
throw std::runtime_error("stale_media_exchange");
|
||||
if (mediaGeneration == INT32_MAX) throw std::runtime_error("playtest_media_limit");
|
||||
// The parent exports and durably retains the old image first. Explicit
|
||||
// discard only releases this worker's already-retained mounted copy.
|
||||
if (replacement) floppy->mount(0, std::move(*replacement), true);
|
||||
else floppy->eject(0, true);
|
||||
currentMediaID = nextID; originalDiskHash = diskHash(); ++mediaGeneration;
|
||||
if (mediaGenerations[drive] == INT32_MAX) throw std::runtime_error("playtest_media_limit");
|
||||
if (replacement) floppy->mount(drive, std::move(*replacement), true);
|
||||
else floppy->eject(drive, true);
|
||||
currentMediaIDs[drive] = nextID ?: (id)NSNull.null;
|
||||
originalDiskHashes[drive] = diskHash(drive); ++mediaGenerations[drive];
|
||||
mountReadBases[drive] = floppy->readEvents(drive); mountWriteBases[drive] = floppy->writeEvents(drive);
|
||||
NSMutableDictionary *out = [status() mutableCopy];
|
||||
out[@"target_drive"] = @(drive);
|
||||
out[@"previous_media_id"] = oldID ?: (id)NSNull.null;
|
||||
out[@"previous_disk_sha256"] = oldHash;
|
||||
out[@"advances_execution"] = @NO;
|
||||
@@ -420,11 +449,18 @@ class Playtest {
|
||||
@"remaining_boots": @(bootNumber < 16 ? 16 - bootNumber : 0),
|
||||
@"cycles": @(s.cycles), @"generation": @(s.generation), @"pc": @(s.cpu.PC),
|
||||
@"state": s.state == RunState::Paused ? @"paused" : @"running",
|
||||
@"disk_original_sha256": originalDiskHash ?: @"", @"disk_sha256": diskHash(),
|
||||
@"disk_present": @(image != nullptr), @"media_id": currentMediaID ?: (id)NSNull.null,
|
||||
@"media_generation": @(mediaGeneration), @"floppy_busy": @(floppy->snapshot().busy),
|
||||
@"disk_dirty": @(image && image->dirty()), @"disk_reads": @(floppy->readEvents(0)),
|
||||
@"disk_original_sha256": originalDiskHashes[0], @"disk_sha256": diskHash(),
|
||||
@"disk_present": @(image != nullptr), @"media_id": mediaID(0) ?: (id)NSNull.null,
|
||||
@"media_generation": @(mediaGenerations[0]), @"floppy_busy": @(floppy->snapshot().busy),
|
||||
@"disk_dirty": @(image && image->dirty()), @"disk_write_protected": @(image && image->writeProtected()), @"disk_reads": @(floppy->readEvents(0)),
|
||||
@"disk_writes": @(floppy->writeEvents(0)), @"isolated": @YES, @"input":inputMetadata(s) } mutableCopy];
|
||||
if (multiDrive) {
|
||||
NSMutableArray *drives = [NSMutableArray array];
|
||||
for (unsigned drive = 0; drive < 4; ++drive) [drives addObject:driveStatus(drive)];
|
||||
out[@"drives"] = drives; out[@"media_contract_version"] = @2;
|
||||
out[@"drive_activity_units"] = @"transferred_data_bytes";
|
||||
out[@"drive_activity_lifetime"] = @"worker lifetime; mount_* fields reset on each media generation";
|
||||
}
|
||||
if (videoInfo) out[@"video_recording"] = [videoInfo copy];
|
||||
return out;
|
||||
}
|
||||
@@ -499,6 +535,11 @@ public:
|
||||
rom = bytes(r[@"system_rom"], 32768, 32768);
|
||||
auto diskROM = bytes(r[@"disk_rom"], 8192, 8192), disk = bytes(r[@"disk"], maximumDiskBytes);
|
||||
NSString *initialMediaID = mediaIdentifier(r[@"media_id"] ?: @"primary");
|
||||
if (r[@"multi_drive"] && CFGetTypeID((__bridge CFTypeRef)r[@"multi_drive"]) != CFBooleanGetTypeID())
|
||||
throw std::invalid_argument("invalid_arguments");
|
||||
multiDrive = [r[@"multi_drive"] boolValue];
|
||||
if (r[@"write_protected"] && CFGetTypeID((__bridge CFTypeRef)r[@"write_protected"]) != CFBooleanGetTypeID())
|
||||
throw std::invalid_argument("invalid_arguments");
|
||||
NSArray *keys = r[@"boot_keys"];
|
||||
if (![keys isKindOfClass:NSArray.class] || keys.count == 0 || keys.count > 256) throw std::invalid_argument("invalid_boot_keys");
|
||||
for (NSNumber *n in keys) {
|
||||
@@ -598,8 +639,8 @@ public:
|
||||
MachineConfiguration config; config.processor = processor; config.ram = 1; config.frameInterval = 1;
|
||||
machine->configure(config);
|
||||
floppy = std::make_shared<VCC::Devices::Fd502Device>(diskROM);
|
||||
floppy->mount(0,VCC::Devices::DiskImage::load(disk));
|
||||
originalDiskHash = diskHash(); currentMediaID = initialMediaID;
|
||||
floppy->mount(0,VCC::Devices::DiskImage::load(disk, [r[@"write_protected"] boolValue]));
|
||||
originalDiskHashes[0] = diskHash(); currentMediaIDs[0] = initialMediaID;
|
||||
machine->cartridges().configure({nullptr,nullptr,nullptr,nullptr,floppy},true,4);
|
||||
machine->load(rom,processor);
|
||||
for (const auto& buffer : graphicsBuffers)
|
||||
@@ -608,13 +649,21 @@ public:
|
||||
boot(); return status();
|
||||
}
|
||||
if (!machine || stopped) throw std::runtime_error("stale_run");
|
||||
if (frozenForRetention && ![@[@"media_status", @"export_media", @"finish_stop"] containsObject:op])
|
||||
throw std::runtime_error("playtest_retention_pending");
|
||||
if ([op isEqual:@"finish_stop"]) {
|
||||
if (!multiDrive || !frozenForRetention || r.count != 1 || drainedDrives != 15)
|
||||
throw std::runtime_error("playtest_disk_export_incomplete");
|
||||
stopped = true; return status();
|
||||
}
|
||||
if ([op isEqual:@"media_status"]) {
|
||||
if (r.count != 1) throw std::invalid_argument("invalid_arguments");
|
||||
return status();
|
||||
}
|
||||
if ([op isEqual:@"export_media"]) {
|
||||
if (r.count != 1) throw std::invalid_argument("invalid_arguments");
|
||||
return exportMedia();
|
||||
if (r.count != 1 + (r[@"drive"] ? 1u : 0u) || (!multiDrive && r[@"drive"])) throw std::invalid_argument("invalid_arguments");
|
||||
const unsigned drive = r[@"drive"] ? number(r[@"drive"], 0, 3) : 0;
|
||||
return exportMedia(drive);
|
||||
}
|
||||
if ([op isEqual:@"exchange_media"]) return exchangeMedia(r);
|
||||
if ([op isEqual:@"video_start"]) {
|
||||
@@ -791,6 +840,11 @@ public:
|
||||
finishVideo(@"run_stopped");
|
||||
NSMutableDictionary *out = [status() mutableCopy];
|
||||
if (videoInfo) out[@"video"] = [videoInfo copy];
|
||||
if (multiDrive) {
|
||||
frozenForRetention = true; drainedDrives = 0;
|
||||
out[@"media_frozen"] = @YES;
|
||||
return out; // Drain four bounded per-drive replies before finish_stop.
|
||||
}
|
||||
if (const auto *image = floppy->image(0)) {
|
||||
const auto& disk = image->bytes();
|
||||
out[@"disk_base64"] = [[NSData dataWithBytes:disk.data() length:disk.size()] base64EncodedStringWithOptions:0];
|
||||
|
||||
@@ -24,9 +24,14 @@ def main():
|
||||
parser.add_argument('--destination', type=Path)
|
||||
args = parser.parse_args()
|
||||
profile = content_profile()
|
||||
source = args.source or (Path(os.environ.get('VCC_SOURCE_TOOLCHAIN_DIR') or
|
||||
str(Path(os.environ['SRCROOT']) / 'LocalResources/SourceToolchainBundle'))
|
||||
if profile == 'source' else Path(os.environ['SRCROOT']) / 'LocalResources/ToolchainBundle')
|
||||
if args.source:
|
||||
source = args.source
|
||||
elif profile == 'source':
|
||||
source = Path(os.environ.get('VCC_SOURCE_TOOLCHAIN_DIR') or
|
||||
str(Path(os.environ['SRCROOT']) / 'LocalResources/SourceToolchainBundle'))
|
||||
else:
|
||||
source = Path(os.environ.get('VCC_TOOLCHAIN_DIR') or
|
||||
str(Path(os.environ['SRCROOT']) / 'LocalResources/ToolchainBundle'))
|
||||
destination = args.destination or (Path(os.environ['TARGET_BUILD_DIR']) /
|
||||
os.environ['UNLOCALIZED_RESOURCES_FOLDER_PATH'] / 'Toolchain')
|
||||
# Restrict cleanup to this build phase's app resource directory.
|
||||
|
||||
Reference in new issue
Block a user