From 3b653176dc25d795e0c68958f446cc0bf4a6f6af Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 13 Sep 2026 09:10:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(build):=20=E6=8C=89=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20Rust=20=E9=93=BE=E6=8E=A5=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/extensions/community/build_packages.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/extensions/community/build_packages.py b/backend/extensions/community/build_packages.py index 462ef72..d6d9f5e 100644 --- a/backend/extensions/community/build_packages.py +++ b/backend/extensions/community/build_packages.py @@ -3,6 +3,7 @@ import hashlib import json import re import subprocess +import sys import tempfile import zipfile from pathlib import Path @@ -24,12 +25,15 @@ def build(output: Path | None = None) -> dict: if identity == 'markdown-workbench': with tempfile.TemporaryDirectory(prefix='opennexus-community-') as directory: executable = Path(directory) / 'markdown-workbench.exe' - subprocess.run([ + rustc_command = [ 'rustc', '--edition=2021', '--crate-name', 'markdown_workbench', '-C', 'metadata=opennexus-community-v1', '-C', 'opt-level=s', - '-C', 'strip=symbols', '-C', 'link-arg=-Wl,--no-insert-timestamp', - str(source / 'server.rs'), '-o', str(executable), - ], check=True) + '-C', 'strip=symbols', + ] + if sys.platform == 'win32': + rustc_command.extend(['-C', 'link-arg=-Wl,--no-insert-timestamp']) + rustc_command.extend([str(source / 'server.rs'), '-o', str(executable)]) + subprocess.run(rustc_command, check=True) generated[executable.name] = executable.read_bytes() manifest = (source / f'{kind}.yaml').read_text(encoding='utf-8') version = re.search(r'^version: (\d+\.\d+\.\d+)$', manifest, re.M)[1]