Skip to content

Commit f3fe5da

Browse files
committed
The vcpkg fixtures install under target/ and the criteria write their logs there: the fixtures live inside the package they depend on by path, whose host tool mcpp keys by a stamp of its tree (mcpp#705); the second build is planned on every host
1 parent b9cca95 commit f3fe5da

6 files changed

Lines changed: 80 additions & 39 deletions

File tree

‎.agents/docs/2026-09-26-deps-vcpkg-rules-qt-plan.md‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 实施计划:`deps-vcpkg`、`rules-qt`、`deps-cmake` 的跨仓库交付
22

3-
状态:执行中 · 2026-09-26 · 设计见 `2026-09-26-deps-vcpkg-rules-qt-design.md`(第 4 版)。
3+
状态:执行中 · 2026-09-26(引擎下界 2026.9.26.2) · 设计见 `2026-09-26-deps-vcpkg-rules-qt-design.md`(第 4 版)。
44

55
## 1. 第 3 轮决定(设计第 4 版据此修改)
66

@@ -56,8 +56,16 @@ T1 mcpp#702 实现并发布(mcpp 侧)─────────┴──►
5656

5757
| 任务 | 状态 |
5858
|---|---|
59-
| T0 设计第 4 版、本计划 | 进行中 |
60-
| T1 引擎 | 未开始 |
61-
| T2 xim 包 | Qt 归档 sha256 计算中 |
62-
| T3 插件 | 未开始 |
63-
| T4 / T5 | 未开始 |
59+
| T0 设计第 4 版、本计划 | 完成 |
60+
| T1 引擎 | mcpp#702 由 mcpp 侧合入,随 2026.9.26.2 发布 |
61+
| T2 xim 包 | xim-pkgindex#878、#879 已合入;`xlings-res/vcpkg` 双端资源已校验 |
62+
| T3 插件 | PR #29;Linux 各 fixture 在 2026.9.26.2 上通过;Windows、macOS 由 CI 验证 |
63+
| T3r / T4 / T5 | 等待 T3c |
64+
65+
实测发现两项引擎缺口,均已报告:
66+
67+
- 主机构建不读取主机三元组的 `[target.<triple>]` 段(mcpp#704),因此 Qt fixture 在 `[build]` 中声明
68+
`cxx_runtime = "toolchain-coupled"`。
69+
- `path` 包的宿主工具以整棵目录树的 stamp 为键,嵌套其中的消费方写出的文件改变该键(mcpp#705)。fixture
70+
位于插件仓库之内,因此其安装位于 `target/` 之下,检查脚本的日志写入 `target/ci/`,第二次构建以
71+
`--profile dev` 绕过快路径,使 Linux 与 Windows、macOS 走同一条规划路径。从索引取得插件的项目不受影响。

‎.github/scripts/check-deps-and-qt.sh‎

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ assert_not_rerun() {
3838
mkdir -p target/ci
3939
touch -r "$stamp" target/ci/before-second-build
4040
sleep 1
41-
"$MCPP" build > target/ci/second-build.log 2>&1 || { cat target/ci/second-build.log; fail "the second build failed"; }
41+
# `--profile dev` names the default profile and declines mcpp's fast path,
42+
# so the second build is planned on every host, as it is on Windows and
43+
# macOS without the flag, and a host tool whose key moved is rebuilt.
44+
"$MCPP" build --profile dev > target/ci/second-build.log 2>&1 ||
45+
{ cat target/ci/second-build.log; fail "the second build failed"; }
4246
[ -z "$(find "$stamp" -newer target/ci/before-second-build)" ] ||
4347
fail "the second build re-ran the installation ($stamp is newer)"
4448
echo "ok: a second build with nothing changed did not re-run the installation"
@@ -54,21 +58,21 @@ vcpkg_consumer() {
5458
"$MCPP" emit build-database --format json > target/ci/db.json 2> target/ci/emit.log ||
5559
{ cat target/ci/emit.log; fail "emit build-database failed before any installation"; }
5660
grep -q 'vcpkg_installed' target/ci/db.json || fail "the database names no vcpkg_installed include directory"
57-
[ ! -d vcpkg_installed ] || fail "emit build-database installed something"
61+
[ ! -d target/vcpkg_installed ] || fail "emit build-database installed something"
5862
echo "ok: emit succeeded before the installation and named its include directory"
5963

60-
"$MCPP" build 2>&1 | tee build.log
61-
"$MCPP" run | tee run.log
62-
grep -qE '^vcpkg-consumer: fmt [0-9]+ says 42$' run.log || fail "the program did not print through fmt"
64+
"$MCPP" build 2>&1 | tee target/ci/build.log
65+
"$MCPP" run | tee target/ci/run.log
66+
grep -qE '^vcpkg-consumer: fmt [0-9]+ says 42$' target/ci/run.log || fail "the program did not print through fmt"
6367
assert_not_rerun "$(stamp_of deps-vcpkg)"
6468

6569
if is_windows; then
6670
# The pack collects it from the runtime search directory.
67-
ls vcpkg_installed/x64-windows/bin/fmt.dll > /dev/null || fail "x64-windows built no fmt.dll"
68-
run_directly vcpkg-consumer | tee direct.log
69-
grep -qE '^vcpkg-consumer: fmt [0-9]+ says 42$' direct.log ||
71+
ls target/vcpkg_installed/x64-windows/bin/fmt.dll > /dev/null || fail "x64-windows built no fmt.dll"
72+
run_directly vcpkg-consumer | tee target/ci/direct.log
73+
grep -qE '^vcpkg-consumer: fmt [0-9]+ says 42$' target/ci/direct.log ||
7074
fail "started from the build directory, the program did not find fmt.dll"
71-
"$MCPP" pack --format dir | tee pack.log
75+
"$MCPP" pack --format dir | tee target/ci/pack.log
7276
find target/dist -iname 'fmt.dll' | grep -q . || fail "the packed tree carries no fmt.dll"
7377
echo "ok: the packed tree carries fmt.dll"
7478
fi
@@ -77,11 +81,12 @@ vcpkg_consumer() {
7781
vcpkg_workspace() {
7882
cd "$ROOT/tests/vcpkg-workspace"
7983
rm -rf target app-a/target app-b/target vcpkg_installed
80-
"$MCPP" build 2>&1 | tee build.log
81-
"$MCPP" run -p app-a | tee run-a.log
82-
"$MCPP" run -p app-b | tee run-b.log
83-
grep -qE '^app-a: fmt [0-9]+$' run-a.log || fail "app-a did not run"
84-
grep -qE '^app-b: fmt [0-9]+$' run-b.log || fail "app-b did not run"
84+
mkdir -p target/ci
85+
"$MCPP" build 2>&1 | tee target/ci/build.log
86+
"$MCPP" run -p app-a | tee target/ci/run-a.log
87+
"$MCPP" run -p app-b | tee target/ci/run-b.log
88+
grep -qE '^app-a: fmt [0-9]+$' target/ci/run-a.log || fail "app-a did not run"
89+
grep -qE '^app-b: fmt [0-9]+$' target/ci/run-b.log || fail "app-b did not run"
8590
# Each member builds into its own target/ and declares its own installation.
8691
[ "$(find . -path '*/target/*' -path '*deps-vcpkg*' -name '*.stamp' | wc -l)" -ge 2 ] ||
8792
fail "each member did not declare its own installation"
@@ -91,12 +96,17 @@ vcpkg_workspace() {
9196
cmake_consumer() {
9297
cd "$ROOT/tests/cmake-consumer"
9398
rm -rf target
94-
"$MCPP" build 2>&1 | tee build.log
95-
"$MCPP" run | tee run.log
96-
grep -q '^cmake-consumer: greet says 42$' run.log || fail "the program did not call the subproject's library"
99+
mkdir -p target/ci
100+
"$MCPP" build 2>&1 | tee target/ci/build.log
101+
"$MCPP" run | tee target/ci/run.log
102+
grep -q '^cmake-consumer: greet says 42$' target/ci/run.log || fail "the program did not call the subproject's library"
97103
assert_not_rerun "$(stamp_of deps-cmake)"
104+
# The builds after an edit are planned as well. The subproject lies inside
105+
# this repository, the tree mcpp stamps for the plugins' host tool
106+
# (mcpp#705), so an edit also rebuilds `mcpp-deps`; the build that is
107+
# expected to re-run the installation absorbs that rebuild.
98108
touch greet/greet.c
99-
"$MCPP" build > target/ci/third-build.log 2>&1 || { cat target/ci/third-build.log; fail "the rebuild failed"; }
109+
"$MCPP" build --profile dev > target/ci/third-build.log 2>&1 || { cat target/ci/third-build.log; fail "the rebuild failed"; }
100110
# The installed library is the product of the rebuild, whatever the engine
101111
# does with the action's stamp.
102112
[ -n "$(find target -path '*deps-cmake*/install/*' -name '*greet*' -newer target/ci/before-second-build)" ] ||
@@ -112,7 +122,7 @@ cmake_consumer() {
112122
touch -r "$(stamp_of deps-cmake)" target/ci/before-added-file
113123
sleep 1
114124
echo added > greet/added.txt
115-
"$MCPP" build > target/ci/added-build.log 2>&1 || { cat target/ci/added-build.log; fail "the build after adding a file failed"; }
125+
"$MCPP" build --profile dev > target/ci/added-build.log 2>&1 || { cat target/ci/added-build.log; fail "the build after adding a file failed"; }
116126
[ -n "$(find "$(stamp_of deps-cmake)" -newer target/ci/before-added-file)" ] ||
117127
fail "a file added to the subproject did not re-run its installation"
118128
echo "ok: a file added to the subproject re-ran its installation"
@@ -121,9 +131,10 @@ cmake_consumer() {
121131
qt_consumer() {
122132
cd "$ROOT/tests/qt-consumer"
123133
rm -rf target
124-
"$MCPP" build 2>&1 | tee build.log
125-
"$MCPP" run | tee run.log
126-
grep -qE "^qt-consumer: signal 42, resource 'greetings from rcc', translation 'hallo', Qt 6\." run.log ||
134+
mkdir -p target/ci
135+
"$MCPP" build 2>&1 | tee target/ci/build.log
136+
"$MCPP" run | tee target/ci/run.log
137+
grep -qE "^qt-consumer: signal 42, resource 'greetings from rcc', translation 'hallo', Qt 6\." target/ci/run.log ||
127138
fail "moc, rcc or lrelease did not reach the program"
128139
find target -name 'qt_consumer_de.qm' | grep -q . || fail "no .qm was produced"
129140
echo "ok: moc (header and inline), rcc and lrelease reached the program"
@@ -132,19 +143,20 @@ qt_consumer() {
132143
qt_widgets_consumer() {
133144
cd "$ROOT/tests/qt-widgets-consumer"
134145
rm -rf target
135-
"$MCPP" build 2>&1 | tee build.log
136-
QT_QPA_PLATFORM=offscreen "$MCPP" run | tee run.log
137-
grep -q "^qt-widgets-consumer: platform offscreen, label 'made by uic'$" run.log ||
146+
mkdir -p target/ci
147+
"$MCPP" build 2>&1 | tee target/ci/build.log
148+
QT_QPA_PLATFORM=offscreen "$MCPP" run | tee target/ci/run.log
149+
grep -q "^qt-widgets-consumer: platform offscreen, label 'made by uic'$" target/ci/run.log ||
138150
fail "the platform plugin or the uic form did not reach the program"
139151
if is_macos; then
140152
find target -path '*/bin/platforms/libqoffscreen.dylib' | grep -q . ||
141153
fail "no platforms/libqoffscreen.dylib was deployed beside the program"
142154
fi
143155
if is_windows; then
144-
QT_QPA_PLATFORM=offscreen run_directly qt-widgets-consumer | tee direct.log
145-
grep -q "^qt-widgets-consumer: platform offscreen" direct.log ||
156+
QT_QPA_PLATFORM=offscreen run_directly qt-widgets-consumer | tee target/ci/direct.log
157+
grep -q "^qt-widgets-consumer: platform offscreen" target/ci/direct.log ||
146158
fail "started from the build directory, the program did not find the Qt DLLs"
147-
"$MCPP" pack --format dir | tee pack.log
159+
"$MCPP" pack --format dir | tee target/ci/pack.log
148160
find target/dist -iname 'Qt6Widgets.dll' | grep -q . || fail "the packed tree carries no Qt6Widgets.dll"
149161
find target/dist -ipath '*platforms/qoffscreen.dll' | grep -q . ||
150162
fail "the packed tree carries no platforms/qoffscreen.dll"

‎tests/vcpkg-consumer/build.mcpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@ import mcpp.deps.vcpkg;
77
int main() {
88
mcpp::deps::vcpkg::options o;
99
o.libraries = { "fmt" };
10+
// This fixture lives inside the package it depends on by path, and mcpp keys
11+
// that package's host tool by a stamp of its tree, `target/` excepted
12+
// (mcpp#705). An installation beside the manifest would change the stamp,
13+
// rebuild `mcpp-deps` and run again, so it goes under `target/`. A project
14+
// that takes `mcpp:plugins` from the index keeps vcpkg's default.
15+
o.install_root = "target/vcpkg_installed";
1016
return mcpp::deps::vcpkg::use(o) ? 0 : 1;
1117
}

‎tests/vcpkg-workspace/app-a/build.mcpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@ import mcpp.deps.vcpkg;
66
int main() {
77
mcpp::deps::vcpkg::options o;
88
o.libraries = { "fmt" };
9+
// This fixture lives inside the package it depends on by path, and mcpp keys
10+
// that package's host tool by a stamp of its tree, `target/` excepted
11+
// (mcpp#705). An installation beside the manifest would change the stamp,
12+
// rebuild `mcpp-deps` and run again, so it goes under the workspace's
13+
// `target/`. A project that takes `mcpp:plugins` from the index keeps
14+
// vcpkg's default.
15+
o.install_root = "../target/vcpkg_installed";
916
return mcpp::deps::vcpkg::use(o) ? 0 : 1;
1017
}

‎tests/vcpkg-workspace/app-b/build.mcpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@ import mcpp.deps.vcpkg;
66
int main() {
77
mcpp::deps::vcpkg::options o;
88
o.libraries = { "fmt" };
9+
// This fixture lives inside the package it depends on by path, and mcpp keys
10+
// that package's host tool by a stamp of its tree, `target/` excepted
11+
// (mcpp#705). An installation beside the manifest would change the stamp,
12+
// rebuild `mcpp-deps` and run again, so it goes under the workspace's
13+
// `target/`. A project that takes `mcpp:plugins` from the index keeps
14+
// vcpkg's default.
15+
o.install_root = "../target/vcpkg_installed";
916
return mcpp::deps::vcpkg::use(o) ? 0 : 1;
1017
}

‎tests/vcpkg-workspace/mcpp.toml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Fixture: two workspace members that link one vcpkg prefix and depend on
22
# neither each other nor a common member.
33
#
4-
# mcpp orders a `blocking` action before the compile edges of the package that
5-
# declares it and of no other, so each member declares the installation
6-
# itself. The two actions run the same `vcpkg install` against the root's one
7-
# manifest; `mcpp-deps` holds a lock on the installation root, so they run one
8-
# after the other and the second finds everything installed.
4+
# The compile edges of the package that declares a `prepare` action wait for
5+
# it, and those of no other package do, so each member declares the
6+
# installation itself. The two actions run the same `vcpkg install` against the
7+
# root's one manifest into one installation root; `mcpp-deps` holds a lock on
8+
# that root, so they run one after the other and the second finds everything
9+
# installed.
910
[workspace]
1011
members = ["app-a", "app-b"]
1112

0 commit comments

Comments
 (0)