Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Apple code signing isn't working when building with nix

Đang mở
#42 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
macos, rust
Lĩnh vực
build-system, desktop, security

Hướng nghiên cứu

Bắt đầu với các lệnh Nix trong README và theo dõi đầu ra build qua signing, fixupPhase và cảnh báo của install_name_tool. Xác nhận bước nào sửa đổi devfiler.app/Contents/MacOS/devfiler sau signing, sau đó kiểm tra rằng ứng dụng được build lại khởi chạy trên macOS và không còn báo chữ ký mã không hợp lệ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Shortly after devfiler was initially open-sourced, I was able to build and run it locally on an M1 mac using the nix commands in the README.
More recently, I wanted to re-build it to catch up with recent protocol changes in opentelemetry-ebpf-profiler, but I ran into an issue where it won't launch after building. The app icon flashes but the app never opens or displays an error.

If I try to run the executable from a shell instead, it reported:

% ./devfiler.app/Contents/MacOS/devfiler
zsh: killed     ./devfiler.app/Contents/MacOS/devfiler

After some troubleshooting, I was able to use the Console app to find a "Crash Report" like the following:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               ReportCrash [70198]
Path:                  /System/Library/CoreServices/ReportCrash
Identifier:            ReportCrash
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2025-08-09 11:33:42.8358 -0400
OS Version:            macOS 15.6 (24G84)
Report Version:        12
Anonymous UUID:        3B6A222A-F595-8AE9-0C62-BC866F9E1776


Time Awake Since Boot: 2500 seconds

System Integrity Protection: enabled

Crashed Thread:        1

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x0000000802400000
Exception Codes:       0x0000000000000032, 0x000000080240000

...

which led me to believe it's probably related to code signing. When building with nix, the end of the output looks like this, which makes me think that at some point in the process, the executable is getting signed, but then modified without being re-signed:

devfiler> Running phase: installPhase
...
devfiler> stripping references done
devfiler> signing files:
devfiler> signing: /nix/store/6n1lapf1yxp0565ip9q9syszwsivvi6h-devfiler-0.14.0/bin/devfiler
devfiler> signing: /nix/store/6n1lapf1yxp0565ip9q9syszwsivvi6h-devfiler-0.14.0/share/icons/hicolor/512x512/apps/devfiler.png
devfiler> signing: /nix/store/6n1lapf1yxp0565ip9q9syszwsivvi6h-devfiler-0.14.0/share/applications/devfiler.desktop
devfiler> signing done
devfiler> Running phase: fixupPhase
...
devfiler> install_name_tool: warning: changes being made to the file will invalidate the code signature in: /nix/store/6n1lapf1yxp0565ip9q9syszwsivvi6h-devfiler-0.14.0/Applications/devfiler.app/Contents/MacOS//devfiler
devfiler-mac-app>   adding: devfiler.app/ (stored 0%)
devfiler-mac-app>   adding: devfiler.app/Contents/ (stored 0%)
devfiler-mac-app>   adding: devfiler.app/Contents/MacOS/ (stored 0%)
devfiler-mac-app>   adding: devfiler.app/Contents/MacOS/devfiler (deflated 65%)
devfiler-mac-app>   adding: devfiler.app/Contents/MacOS/libc++.1.0.dylib (deflated 70%)
devfiler-mac-app>   adding: devfiler.app/Contents/MacOS/libc++abi.1.dylib (deflated 74%)
devfiler-mac-app>   adding: devfiler.app/Contents/Resources/ (stored 0%)
devfiler-mac-app>   adding: devfiler.app/Contents/Resources/devfiler.icns (deflated 26%)
devfiler-mac-app>   adding: devfiler.app/Contents/Info.plist (deflated 57%)

So I think the issue is probably that install_name_tool is modifying the executable after it's signed, but I'm not familiar enough with nix or cargo to figure out what to change to make it re-sign or reorder the steps so that it signs after the modification.

Ngôn ngữ chính
Rust
Star
132
Fork
20
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của elastic/devfiler

Tất cả issue của elastic/devfiler

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.