Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/dslings-ref-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions .xlings.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
10 changes: 10 additions & 0 deletions d2x/buildtools/src/runner.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Loading