Skip to content

Commit ca08aa2

Browse files
authored
Merge pull request #416 from nix-community/effects-bind
buildbot_effects: bind /bin/sh
2 parents 7b9470b + de4b940 commit ca08aa2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

buildbot_effects/buildbot_effects/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ def run_effects(
240240
"--bind",
241241
"/nix/var/nix/daemon-socket/socket",
242242
"/nix/var/nix/daemon-socket/socket",
243+
"--ro-bind",
244+
"/bin/sh",
245+
"/bin/sh",
243246
]
244247

245248
with NamedTemporaryFile() as tmp:

buildbot_nix/buildbot_nix/worker.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ class WorkerConfig:
2525
worker_name: str = field(
2626
default_factory=lambda: os.environ.get("WORKER_NAME", socket.gethostname())
2727
)
28-
worker_count_str: str | None = os.environ.get("WORKER_COUNT")
29-
if worker_count_str is not None:
30-
worker_count = int(worker_count_str)
31-
else:
28+
worker_count_str: str = os.environ.get("WORKER_COUNT", "0")
29+
worker_count = int(worker_count_str)
30+
31+
if worker_count == 0:
3232
worker_count = multiprocessing.cpu_count()
33+
3334
buildbot_dir: Path = field(
3435
default_factory=lambda: Path(require_env("BUILDBOT_DIR"))
3536
)

0 commit comments

Comments
 (0)