Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
"""

import argparse
import sys
import textwrap

from ..log import make_log
from .config import load_config

log = make_log("baselayer")

# Cache loading of environment
_cache = {}

Expand Down Expand Up @@ -41,6 +45,10 @@ def load_env(load_services_configs=True):
cfg = load_config(
config_files=env.config or [], load_services_configs=load_services_configs
)
# macOS system libraries crash in a child forked without exec
if sys.platform == "darwin" and cfg["zygote.services"]:
cfg["zygote"]["services"] = []
log("Not forking services from the zygote on macOS")

_cache.update({"file": env.config, "env": env, "cfg": cfg})

Expand Down
3 changes: 2 additions & 1 deletion config.yaml.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ services:

zygote:
# Services (directory names, or '*') whose Python processes are forked from
# the zygote, which imports `preload` once so they share those modules
# the zygote, which imports `preload` once so they share those modules.
# Ignored on macOS, where services are always started on their own.
services: []
# Services to leave out, e.g. when `services` is '*'
exclude: []
Expand Down
Loading