Skip to content

[build] src/version/version.cppm: nested export rejected by GCC (MSVC accepts) #1401

Closed

Description

@caomengxuan666

现象

mingw+Wine 本地构建路线在编译 src/version/version.cppm 时失败,唯一 fatal 错误(GCC 16):

src/version/version.cppm:9-17: error: 'export' may only occur once in an export declaration
    export using ::WinuxCmd::VERSION_MAJOR;   (共 9 行同错)

构建停在 version 模块,mini.exe 未链接。

根因

文件写法是 export namespace WinuxCmd { export using ::WinuxCmd::...; } —— 命名空间块已被 export,内部再写 export using 是 C++20 非法嵌套 export,GCC 严格拒绝。项目正式工具链是 MSVC(仓内 AGENTS.md:scripts/build-with-vs.ps1),MSVC 接受此写法,所以官方构建里从不暴露;本地 mingw+Wine harness 路线撞上的是这处存量缺陷。

与 winx3-parser 簇的关系

无。git diff b7c3675 HEAD -- src/version/ 为空,#1301–#1306 的修复未碰该文件;该缺陷在基线即存在,且此前 winx3-parser 的 build0 从未产出 mini.exe 也是同一堵墙。

修复方向(待验证)

删去 9 个冗余的内层 export 关键字,命名空间块的 export 语义不变,MSVC/GCC 双边等价。修复本身极小,但必须以独立 commit 落地、不得混入 #1301–#1306 的修复 commit。

归宿

已授权 winx3-parser 验证线以独立 commit 修此一处、然后重提构建走完 repro 与门验证;本 issue 随该 commit 关闭。

Activity

  1. added
    bug
    noise-platform
    on Oct 26, 2026
  2. caomengxuan666 commented on Oct 27, 2026

    @caomengxuan666
    MemberAuthor

    Status check (2026-10-27 integration sweep): the fix itself is small and well-described (unqualified size_t needs std:: under GCC modules since the global module fragment only imports macros), but no verification path exists right now — the local dev box and CI (build-winuxcmd.yml) are MSVC-only, and MSVC accepts the current code by design. Shipping a blind edit to module code without a GCC compile gate would risk a fourth regression of the same class.

    Recommended path before this gets fixed: stand up a GCC 15+ (mingw-w64 UCRT64, -std=c++23 with import std;) compile job — either a CI matrix entry or a documented local MSYS2 environment — as the verification gate for this whole wall series (#1401 → #1406 → #1407 → #1412). Once the gate exists the code fixes are minutes of work. Keeping open with the blocked-on-toolchain label intent until then.

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

Metadata

Metadata

Labels

bugnoise-platform

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions