Skip to content

[infra/devex] 修复 Windows GNU 构建受空格路径影响的问题 #13

Closed

Description

@Cooper-X-Oak

现象

  • 触发条件:在 Windows 上使用 Rust GNU toolchain 和 MinGW,从仓库当前路径 openless -all/app 执行构建。
  • 当前表现:npm run tauri -- build --target x86_64-pc-windows-gnu 在生成 Windows import library 时失败。
  • 证据:同一份代码复制到无空格路径 openless_all_app_copy 后,GNU 构建成功,并产出 openless.exe、MSI 和 NSIS 安装器。

原路径失败日志摘要:

error: dlltool could not create import library ... kernel32.dll_imports.def
Assembler messages:
Fatal error: invalid listing option `\'
dlltool.exe: ... as exited with status 1
failed to open temporary head file: D:\...\openless -all\app\src-tauri\target\...\kernel32.dllh.o

无空格路径成功产物:

src-tauri\target\x86_64-pc-windows-gnu\release\openless.exe
src-tauri\target\x86_64-pc-windows-gnu\release\bundle\msi\OpenLess_1.1.2_x64_en-US.msi
src-tauri\target\x86_64-pc-windows-gnu\release\bundle\nsis\OpenLess_1.1.2_x64-setup.exe

影响

  • 仓库当前目录名 openless -all 自带空格,会让 Windows GNU/MinGW 构建在工具链层面失败。
  • Windows 贡献者即使安装了 Rust GNU toolchain 和 MinGW,也会被路径问题误导为依赖或代码问题。
  • 如果后续希望支持 GNU/MinGW 作为 MSVC 之外的备选构建路线,当前目录命名会成为稳定复现的阻塞点。

建议接受标准

  • 将 openless -all 重命名为无空格目录,例如 openless-all、all-platform 或 tauri-app。
  • 或者在 Windows 构建文档中明确说明:GNU/MinGW 路线必须从无空格路径构建。
  • 在 Windows 构建说明中加入一条路径检查,发现工作目录包含空格时给出明确提示。
  • 验证 x86_64-pc-windows-gnu 构建在无空格路径下能产出 .exe、MSI 和 NSIS 安装器。

TODO / 不确定项

  • TODO:确认是否正式支持 GNU/MinGW;如果只支持 MSVC,本 issue 可降级为文档说明。
  • TODO:upstream 当前缺少模板要求的 medium 和 area:infra/devex labels,本 issue 只能先使用现有 labels。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions