ruvnet/RuView · error · RuntimeError
swiftc is not installed. Please install Xcode Command Line T
Error message
swiftc is not installed. Please install Xcode Command Line Tools to use native macOS WiFi sensing.
What it means
MacosWifiCollector.start() tried to run swiftc and the OS returned FileNotFoundError: the Swift compiler is not on PATH. On macOS, swiftc comes from the Xcode Command Line Tools (or full Xcode), so this machine simply lacks the toolchain. Unlike a compile failure, nothing was attempted yet; installing the tools fixes it.
Source
Thrown at archive/v1/src/sensing/rssi_collector.py:678
@property
def sample_rate_hz(self) -> float:
return self._rate
def start(self) -> None:
if self._running:
return
# Ensure binary exists
import os
if not os.path.exists(self.swift_bin):
logger.info("Compiling mac_wifi.swift to %s", self.swift_bin)
try:
subprocess.run(["swiftc", "-O", "-o", self.swift_bin, self.swift_src], check=True, capture_output=True)
except subprocess.CalledProcessError as e:
raise RuntimeError(f"Failed to compile macOS WiFi utility: {e.stderr.decode('utf-8')}")
except FileNotFoundError:
raise RuntimeError("swiftc is not installed. Please install Xcode Command Line Tools to use native macOS WiFi sensing.")
self._running = True
self._thread = threading.Thread(
target=self._sample_loop, daemon=True, name="mac-rssi-collector"
)
self._thread.start()
logger.info("MacosWifiCollector started at %.1f Hz", self._rate)
def stop(self) -> None:
self._running = False
if self._process:
self._process.terminate()
try:
self._process.wait(timeout=1.0)
except subprocess.TimeoutExpired:
self._process.kill()
self._process = None
View on GitHub (pinned to 4685618388)
Solutions
- Install the toolchain: 'xcode-select --install' and complete the GUI prompt.
- Verify afterwards: 'xcode-select -p' prints a valid path and 'which swiftc' resolves.
- Accept the license if needed: 'sudo xcodebuild -license accept'.
- If xcode-select points at a stale directory, run 'sudo xcode-select --reset' or point it at the installed Xcode.
Example fix
# before
collector = MacosWifiCollector(rate=2.0)
collector.start() # RuntimeError: swiftc is not installed
# after
import shutil
if shutil.which('swiftc') is None:
raise SystemExit('Run: xcode-select --install, then retry')
collector = MacosWifiCollector(rate=2.0)
collector.start() Defensive patterns
Strategy: validation
Validate before calling
import shutil
if shutil.which('swiftc') is None:
raise SystemExit('swiftc missing; run: xcode-select --install') Prevention
- Check shutil.which('swiftc') in macOS deployment preflight before enabling the RSSI collector.
- Automate 'xcode-select --install' (or bake CLT into CI images) so fresh Macs are provisioning-complete.
- After installing tools, verify with 'xcode-select -p' and 'swiftc --version' before first run.
When it happens
Trigger: First run of MacosWifiCollector on a fresh Mac without Xcode Command Line Tools; Xcode/CLT uninstalled or its path stripped from PATH; xcode-select points at a deleted developer directory.
Common situations: New Macs or freshly wiped machines; CI macOS images where CLT installation was skipped; users who removed Xcode; xcode-select pointing to '/Library/Developer/CommandLineTools' that no longer exists.
Related errors
- Failed to compile macOS WiFi utility: {e.stderr.decode('utf-
- Missing required configuration: {missing_fields}
- sampling_rate must be positive
- buffer_size must be positive
- timeout must be positive
AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16).
Data as JSON: /api/errors/075945053e6414da.
Report an issue: GitHub.