{"record":{"id":"da6020db4ad00eb7","repo":"oraios/serena","slug":"unsupported-platform-system","errorCode":null,"errorMessage":"Unsupported platform: {system}","messagePattern":"Unsupported platform: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/al_language_server.py","lineNumber":310,"sourceCode":"        \"\"\"\n        Build platform-specific executable path.\n\n        Args:\n            extension_path: Path to AL extension directory\n            system: Operating system name\n\n        Returns:\n            Full path to executable\n\n        \"\"\"\n        if system == \"Windows\":\n            return os.path.join(extension_path, \"bin\", \"win32\", \"Microsoft.Dynamics.Nav.EditorServices.Host.exe\")\n        elif system == \"Linux\":\n            return os.path.join(extension_path, \"bin\", \"linux\", \"Microsoft.Dynamics.Nav.EditorServices.Host\")\n        elif system == \"Darwin\":\n            return os.path.join(extension_path, \"bin\", \"darwin\", \"Microsoft.Dynamics.Nav.EditorServices.Host\")\n        else:\n            raise RuntimeError(f\"Unsupported platform: {system}\")\n\n    @classmethod\n    def _prepare_executable(cls, executable_path: str, system: str) -> str:\n        \"\"\"\n        Prepare the executable by setting permissions and handling path quoting.\n\n        Args:\n            executable_path: Path to the executable\n            system: Operating system name\n            logger: Logger instance\n\n        Returns:\n            Properly formatted command string\n\n        \"\"\"\n        # Make sure executable has proper permissions on Unix-like systems\n        if system in [\"Linux\", \"Darwin\"]:\n            st = os.stat(executable_path)","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/al_language_server.py#L292-L328","documentation":"_get_executable_path maps the OS name returned by platform.system() to the AL extension's bin subdirectory (win32/linux/darwin). Any other value — e.g. FreeBSD, CYGWIN, AIX — hits the else branch and raises RuntimeError, because the AL extension only ships binaries for those three platforms.","triggerScenarios":"Instantiating the AL language server on an OS whose platform.system() value is not exactly 'Windows', 'Linux', or 'Darwin' (checked upstream in _setup_runtime_dependencies).","commonSituations":"Running on FreeBSD/OpenBSD servers; Windows under Cygwin or MSYS where system() may report 'CYGWIN_NT-...' if that value is passed through; unsupported musl-based setups relying on unusual OS strings.","solutions":["Run the language server on a supported OS (Windows, Linux, or macOS), e.g. inside a Linux container.","If on Cygwin/MSYS, run under native Windows Python so platform.system() returns 'Windows'.","Check the platform branch logic in al_language_server.py and confirm the exact accepted system strings before workarounds."],"exampleFix":"// before (FreeBSD host)\n./serena --language al\n// after (supported)\ndocker run -v $PWD:/work -it python:3.12  # then run serena inside Linux","handlingStrategy":"validation","validationCode":"import platform\n\nSUPPORTED = {'Windows', 'Linux', 'Darwin'}\n\ndef assert_supported_platform() -> None:\n    system = platform.system()\n    if system not in SUPPORTED:\n        raise EnvironmentError(\n            f\"AL language server supports only {sorted(SUPPORTED)}; got {system}. \"\n            \"Run inside a Linux container instead.\"\n        )","typeGuard":"def is_supported_platform(system: str) -> bool:\n    return system in ('Windows', 'Linux', 'Darwin')","tryCatchPattern":"try:\n    server = ALLanguageServer(...)\nexcept RuntimeError as e:\n    if str(e).startswith('Unsupported platform'):\n        raise RuntimeError(\n            f\"{e} — AL server requires Windows/Linux/macOS. Use a supported host or container.\"\n        ) from e\n    raise","preventionTips":["Check platform.system() in environment setup and fail fast with a clear message before starting language servers.","On FreeBSD/Cygwin/other Unix, run the tool inside a Linux or macOS container/VM.","Use native Windows Python (not Cygwin/MSYS) when working on Windows."],"tags":["platform","language-server","compatibility"],"backgroundTag":"unsupported-platform","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}