Skip to documentation
SLOP

tiny.sandbox.copied

Reference tiny.sandbox copied

Defined in tiny.sandbox.

API (1)

Actions

Public operations.

No direct callersNo direct callstiny.sandboxcopied
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Called byCallsmacosexecuteprivate sourcelib.sandbox.src.runexecuteStagingwindowsexecutescancapturecopiedexecute
Static calls · unresolved targets: 2 · external targets: 10.

Source: lib/sandbox/src/copied.zig

zig
const std = @import("std");const sys = @import("sys");const audit_data = @import("audit.zig");const command = @import("command.zig");const cwd_data = @import("cwd.zig");const layer_data = @import("layer.zig");const plan_data = @import("plan.zig");const result_data = @import("result.zig");const scan = @import("scan.zig");const Allocator = std.mem.Allocator;const fs_io = sys.fs.debugIo();pub fn execute(allocator: Allocator, plan: plan_data.Plan, audit: audit_data.Audit) !result_data.Result {    if (plan.argv.len == 0) return error.EmptyArgv;    try cwd_data.validate(plan.cwd);    var layer = try layer_data.create(allocator, .{        .scratch = plan.scratch,        .source = plan.source,        .prefix = plan.prefix,        .max_file_bytes = plan.max_file_bytes,    });    errdefer layer.deinit();    var before = try scan.capture(layer.root, allocator);    defer before.deinit();    var cwd_dir: ?sys.fs.Dir = null;    defer if (cwd_dir) |dir| dir.close(fs_io);    const cwd = if (std.mem.eql(u8, plan.cwd, "."))        layer.root    else blk: {        cwd_dir = try layer.root.openDir(fs_io, plan.cwd, .{});        try cwd_data.ensureInside(layer.root, cwd_dir.?);        break :blk cwd_dir.?;    };    var executed = try command.run(allocator, .{        .argv = plan.argv,        .cwd = .{ .dir = cwd },        .environ_map = plan.environ_map,        .stdout_limit = plan.stdout_limit,        .stderr_limit = plan.stderr_limit,        .timeout_ms = plan.timeout_ms,        .interrupt = plan.interrupt,    });    errdefer executed.deinit(allocator);    var after = try scan.capture(layer.root, allocator);    defer after.deinit();    var changes = try scan.diff(allocator, &before, &after);    errdefer changes.deinit();    const stdout = executed.stdout;    const stderr = executed.stderr;    executed.stdout = &.{};    executed.stderr = &.{};    var audit_value = audit;    audit_value.environment = if (plan.environ_map == null) .inherited else .replaced;    return .{        .allocator = allocator,        .layer = layer,        .status = .{ .term = executed.term },        .stdout = stdout,        .stderr = stderr,        .changes = changes,        .audit = audit_value,    };}

Source: lib/sandbox/src/root.zig:34

zig
pub const copied = @import("copied.zig");

Audit

Definitions2
Public names2
Members0
Version26.7.0
Revisiondaab053ee433