Add macOS compatibility for Unix socket credential passing #29

Open
goodboy wants to merge 1 commits from macos_dnks_fixes into piker_pin

Original branch is from @dnks and rebased by moi to get it onto latest upstream.


Original commit-msg content summary

Make socket credential imports platform-conditional in .ipc._uds. - Linux: use SO_PASSCRED/SO_PEERCRED from socket module - macOS: use LOCAL_PEERCRED (0x0001) instead, no need for SO_PASSCRED - Conditionally call setsockopt(SO_PASSCRED) only on Linux

Fixes AttributeError on macOS where SO_PASSCRED doesn’t exist.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com


ToDo for multi-platform support

  • add some minor docs about the current $XDG_ hackaround needed to avoid breaking things on piker ??

    • XDG_RUNTIME_DIR=/tmp uv run piker chart btcusdt.spot.binance
  • take the related windows fixes from GH pr, unify with these to make us work OTB on macos as well!

  • change our defaults (params to tractor.open_root_actor() mostly) to ensure any fancy .ipc related stuff is only flipped on for linux!

Original branch is from @dnks and rebased by moi to get it onto latest upstream. --- #### Original commit-msg content summary Make socket credential imports platform-conditional in `.ipc._uds`. - Linux: use `SO_PASSCRED`/`SO_PEERCRED` from socket module - macOS: use `LOCAL_PEERCRED` (0x0001) instead, no need for `SO_PASSCRED` - Conditionally call `setsockopt(SO_PASSCRED)` only on Linux Fixes AttributeError on macOS where SO_PASSCRED doesn't exist. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --- #### ToDo for multi-platform support - [ ] add some minor docs about the current `$XDG_` hackaround needed to avoid breaking things on `piker` ?? - `XDG_RUNTIME_DIR=/tmp uv run piker chart btcusdt.spot.binance` - [ ] take the related windows fixes from GH pr, unify with these to make us work OTB on macos as well! * https://github.com/goodboy/tractor/pull/408 - [ ] change our defaults (params to `tractor.open_root_actor()` mostly) to ensure any fancy `.ipc` related stuff is only flipped on for `linux`!
goodboy added 1 commit 2026-01-25 22:12:02 +00:00
481eb98cfd Add macOS compatibility for Unix socket credential passing
Make socket credential imports platform-conditional in `.ipc._uds`.
- Linux: use `SO_PASSCRED`/`SO_PEERCRED` from socket module
- macOS: use `LOCAL_PEERCRED` (0x0001) instead, no need for `SO_PASSCRED`
- Conditionally call `setsockopt(SO_PASSCRED)` only on Linux

Fixes AttributeError on macOS where SO_PASSCRED doesn't exist.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b macos_dnks_fixes piker_pin
git pull origin macos_dnks_fixes

Step 2:

Merge the changes and update on Gitea.
git checkout piker_pin
git merge --no-ff macos_dnks_fixes
git push origin piker_pin
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: goodboy/tractor#29
There is no content yet.