diff --git a/.github/workflows/dslings-ref-ci.yml b/.github/workflows/dslings-ref-ci.yml index 37279cc..7cbd45b 100644 --- a/.github/workflows/dslings-ref-ci.yml +++ b/.github/workflows/dslings-ref-ci.yml @@ -8,7 +8,11 @@ name: Validate exercises and reference solutions # 链路,所以 CI 绿灯等价于学习者本地能跑通,而不是另一条平行的构建路径。 # # 依赖 mcpp >= 0.0.104(测试能力批次:逐测试隔离 / 过滤 / --list / --timeout / -# --message-format json / tests 吃 [build].flags)。pin 见 .xlings.json。 +# --message-format json / tests 吃 [build].flags)。 +# +# 但真正的下限已被上游抬高:mcpplibs 依赖索引现在要求 mcpp >= 0.0.109,更低的 +# 版本一律 E0006「index requires mcpp >= 0.0.109」而拒绝解析依赖 —— 原先钉的 +# 0.0.104 自此装不出来。pin 见 .xlings.json,当前为 2026.8.1.1。 on: push: diff --git a/.xlings.json b/.xlings.json index 8e71f7c..83b5d00 100644 --- a/.xlings.json +++ b/.xlings.json @@ -1,12 +1,12 @@ { "workspace": { - "d2x": "2026.07.24.1", + "d2x": "2026.08.02.1", "mdbook": "0.4.43", "code": "", "mcpp": { - "linux": "0.0.104", - "macosx": "0.0.104", - "windows": "0.0.104" + "linux": "2026.8.1.1", + "macosx": "2026.8.1.1", + "windows": "2026.8.1.1" } } } diff --git a/d2x/buildtools/src/runner.cppm b/d2x/buildtools/src/runner.cppm index 1af14f7..74c2aec 100644 --- a/d2x/buildtools/src/runner.cppm +++ b/d2x/buildtools/src/runner.cppm @@ -33,7 +33,17 @@ export struct Captured { // workaround 随之删除。 export Captured capture_stdout(const std::string& cmd) { Captured result; + // 丢弃 stderr 的写法必须分平台:_popen 走的是 cmd.exe,那里没有 + // /dev/null —— `2>/dev/null` 会被当成「重定向到 \dev\null 这个路径」, + // 而 \dev 不存在,cmd 直接报 "The system cannot find the path specified." + // 并且整条命令根本不执行。于是 mcpp test 一条 JSON 都吐不出来,判定链 + // 退化成「没有该测试的记录」,Windows 上每道题都卡在这里(d2x 的 + // Win10/Win11 checker 冒烟实测)。空设备在 cmd 下叫 NUL。 +#ifdef _WIN32 + std::string full = cmd + " 2>NUL"; +#else std::string full = cmd + " 2>/dev/null"; +#endif #ifdef _WIN32 FILE* pipe = ::_popen(full.c_str(), "r");