FedericoPonzi / Horust

Horust is a supervisor / init system written in rust and designed to run inside containers.
https://federicoponzi.github.io/Horust/
MIT License
183 stars 18 forks source link

Compilation fixes for macOS #206

Closed hanshuebner closed 1 year ago

hanshuebner commented 1 year ago

Motivation and Context

We're evaluating Horust as process supervisor for a multi-service application. While most of our deployments are container based, many of our developers work with macOS and local compilation.

Description

When compiling for macOS, skip Linux specific calls and signals. In particular, the sub-reaper functionality is not available on macOS, which could cause issues in situations where a process controlled by Horust dies and leaves behind children. For development purposes, however, this does not seem to be a major issue.

See #37 for a previous conversation on the topic.

How Has This Been Tested?

All tests pass on macOS Ventura 13.5.2 / Apple Silicon

Types of changes

Checklist:

FedericoPonzi commented 1 year ago

Thanks for this pr! Can you run a cargo fmt? Also as a nice to have, the CI can be updated to compile the mac binary.

hanshuebner commented 1 year ago

I've run cargo fmt and added macOS targets to the binary release list - Not sure if the latter works, as I've decided to split the on-line array into a multi-line array. Will fix if needed.