Skip to content

fix(cli): tri ui command fails with FileNotFound - PATH not passed to subprocess #396

@gHashTag

Description

@gHashTag

Bug

tri ui command fails with error:
swift build failed: FileNotFound

Root Cause

In src/tri/tri_commands.zig, the uiBuild function calls std.process.Child.run but does NOT pass the current environment to the subprocess:

zig const result = std.process.Child.run(.{ .allocator = allocator, .argv = &.{ "swift", "build" }, .cwd = "apps/queen", .max_output_bytes = 256 * 1024, // ❌ Missing: .env = ... or .has_env = true })

Expected Behavior

When tri ui is run, it should:

  1. Kill old Trinity.app processes
  2. Run swift build in apps/queen directory
  3. Copy binary to Trinity.app bundle
  4. Open Trinity.app

Actual Behavior

Step 2 fails with FileNotFound because the subprocess doesn't inherit PATH from the parent process.

Workaround

Launch Queen UI directly:
bash ./.build/arm64-apple-macosx/debug/trinity

Fix Required

Add environment inheritance to uiBuild function. In Zig 0.15.x, the correct API needs to be determined (tested: .has_env, .env = std.process.Child.Env.from_current_process, absolute paths - none worked).

Priority: P2 (medium) - workaround exists

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions