Apple code signing isn't working when building with nix
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
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của elastic/devfiler
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
-
Dependency DashboardĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
Tất cả issue của elastic/devfiler
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feat: New firmware supportĐang mởfeature
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
dsx-ai-factory/infra-controller#8145 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: workspace access hint suggests a --subject command that fails for hyphen-leading OIDC subjectsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`last_error_thread_local_then_global` fails when it runs beside the `lumen_event_detail` testĐang mởA-FFI C-Testing D-Straightforward S-Ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày