Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging Entitlements are disabled on macOS #2535

Open
jiawen opened this issue Sep 16, 2024 · 1 comment
Open

Debugging Entitlements are disabled on macOS #2535

jiawen opened this issue Sep 16, 2024 · 1 comment

Comments

@jiawen
Copy link

jiawen commented Sep 16, 2024

common_info.md lists under Debugging Entitlement Support that one can enable the debugging entitlement via a --define. However, it does not say on which platforms it is enabled.

After some digging, at "top level", it only referenced by:

Notably, macos_command_line_application is not on that list.

Digging further, these rules call _process_entitlements, which in turn calls _include_debug_entitlements, and skips macOS entirely.

The comment in _include_debug_entitlements clearly says that it is not used in macOS but does not indicate why. There is one concrete use case for it: Instruments profiling. Without the get-task-allow entitlement, you get binaries that throw mysterious "Failed to gain Authorization" (or occasionally the even weirder "Required kernel recording resources are in use by another document.") errors.

I have confirmed that the workaround works with both macos_command_line_application and even cc_binary.

@keith
Copy link
Member

keith commented Sep 16, 2024

nice investigation! seems like we should add it there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants