Skip to content

opencode: killed due to invalid signature (aarch64-darwin, macOS 27 Beta 4) #550300

Description

@sudoer777

Nixpkgs version

  • Unstable (26.11)

Describe the bug

OpenCode immediately gets killed when opened. .opencode-wrapped has an invalid signature, and macOS logs shows this as the reason. I suspect this only occurs on the recent beta versions of macOS because it builds/tests pass on hydra, whereas the tests fail when built locally (the binary crashes for the same reason), and the local build also has an invalid signature.

Steps to reproduce

Run:

codesign --verify --strict --verbose=4 /nix/store/cdw43d8v2b6xbmpg2hyzcdrzc5pk2rjh-opencode-1.18.11/bin/.opencode-wrapped

Result:

/nix/store/cdw43d8v2b6xbmpg2hyzcdrzc5pk2rjh-opencode-1.18.11/bin/.opencode-wrapped: invalid signature (code or signature have been modified)
In architecture: arm64

Kernel logs when running OpenCode:

CODE SIGNING: cs_invalid_page(0x10dbc8000): p=10015[.opencode-wrappe] final status 0x23020200, denying page sending SIGKILL
CODE SIGNING: process 10015[.opencode-wrappe]: rejecting invalid page at address 0x10dbc8000 from offset 0x82b4000 in file "/nix/store/cdw43d8v2b6xbmpg2hyzcdrzc5pk2rjh-opencode-1.18.11/bin/.opencode-wrapped" (cs_mtime:1.0 == mtime:1.0) (signed:1 validated:0 tainted:1 nx:1 wpmapped:0 dirty:0 depth:0)

Workaround:

sudo codesign --force --sign - /nix/store/cdw43d8v2b6xbmpg2hyzcdrzc5pk2rjh-opencode-1.18.11/bin/.opencode-wrapped

Expected behaviour

Should have a correct signature, and not get killed when run.

Screenshots

No response

Relevant log output

Additional context

I do not know if this issue revolves around Nixpkgs or something upstream. I do not see any current issues for OpenCode or Bun relating to this. I do know that upstream Bun has had signing issues in the past (anomalyco/opencode#15124), and there is another Bun AI tool that recently had similar problems (cline/cline#12042).

I tried running the official OpenCode binary downloaded from GitHub releases, and that one also has an invalid signature but was able to run after xattr -d com.apple.quarantine opencode.

System metadata

  • system: "aarch64-darwin"
  • host os: Darwin 27.0.0, macOS 27.0
  • multi-user?: yes
  • sandbox: no
    System type: aarch64-darwin
    Additional system types: x86_64-darwin
    Features: gc, signed-caches
    System configuration file: /etc/nix/nix.conf
    User configuration files: /Users/ethanreece/.config/nix/nix.conf:/Users/ethanreece/.nix-profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/ethanreece/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf
    Store directory: /nix/store
    State directory: /nix/var/nix
    Data directory: /nix/store/j2z3ik2pgycjsqflhjyrnzdkgcrk1vn4-lix-2.95.2/share`
  • nixpkgs: /nix/store/p9br0y2kmil5j5k85jczva3kdqy6hmnj-source

Are you using nix-darwin?

Yes, I am using nix-darwin.

Notify maintainers

@delafthi @DuskyElf @graham33


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: darwinRunning or building packages on Darwin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions