Skip to content

Commit a0aad3b

Browse files
authored
0.14.0: deps-archive, a prefix's files deployed, Qt's own translations, and rules-qt-xim-base (#31)
1 parent 25e5c11 commit a0aad3b

23 files changed

Lines changed: 657 additions & 30 deletions

File tree

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,19 @@ T1 mcpp#702 实现并发布(mcpp 侧)─────────┴──►
6969
- `path` 包的宿主工具以整棵目录树的 stamp 为键,嵌套其中的消费方写出的文件改变该键(mcpp#705)。fixture
7070
位于插件仓库之内,因此其安装位于 `target/` 之下,检查脚本的日志写入 `target/ci/`,第二次构建以
7171
`--profile dev` 绕过快路径,使 Linux 与 Windows、macOS 走同一条规划路径。从索引取得插件的项目不受影响。
72+
73+
## 6. 0.14.0:运行时数据与精简 Qt(GalTranslPP 验证后的第二轮)
74+
75+
GalTranslPP 在 0.13.1 上构建成功后仍有两个手动步骤(解压嵌入式 Python、运行 `Release.py`),Qt 下载量为
76+
完整基础包。第二轮把固定步骤程序化,并补齐 windeployqt 的 Qt 翻译:
77+
78+
| 交付 | 仓库 | 机制 |
79+
|---|---|---|
80+
| `deps-archive` | mcpp-plugins | 配置期读 zip 中央目录,一个 `artifact` action 解压并逐一命名输出(SPEC-007 R3.2),每个输出 `mcpp::deploy`;`mcpp run` 与 `mcpp pack` 均可见 |
81+
| `deps-vcpkg` / `deps-cmake` 的 `deploy` | mcpp-plugins | 前缀中的文件由命名输出的复制 action 取出再部署;不依赖引擎「deploy 等待 prepare」 |
82+
| `translations::qt_languages` | mcpp-plugins | `lconvert` 合并所链接模块的目录为 `qt_<lang>.qm`,即 windeployqt 的产物 |
83+
| `rules-qt-xim-base` / `xim:qt-base` | mcpp-plugins、xim-pkgindex、xlings-res | qtbase + qttools + qttranslations + 单独重发布的 QtQml 库;下载量约为 `xim:qt` 的三分之一 |
84+
| `libs/qtsdk.lua` | xim-pkgindex | qt、qt-base、qt-addons 共享的下载、镜像、解压与标记逻辑 |
85+
86+
实测:库包中的 `artifact` 输出经 `mcpp::deploy` 传播到依赖它的程序的 `bin/` 与 `mcpp pack` 目录;依赖包中无下游
87+
消费者的 `artifact` action 随下游构建执行。

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

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ vcpkg_consumer() {
6565
"$MCPP" run | tee target/ci/run.log
6666
grep -qE '^vcpkg-consumer: fmt [0-9]+ says 42$' target/ci/run.log || fail "the program did not print through fmt"
6767
assert_not_rerun "$(stamp_of deps-vcpkg)"
68+
# A file of the prefix the build program named in options::deploy.
69+
find target -path '*/bin/licenses/fmt/copyright' | grep -q . ||
70+
fail "share/fmt/copyright was not deployed beside the program"
71+
echo "ok: a file of the prefix is deployed beside the program"
6872

6973
if is_windows; then
7074
# The pack collects it from the runtime search directory.
@@ -74,6 +78,7 @@ vcpkg_consumer() {
7478
fail "started from the build directory, the program did not find fmt.dll"
7579
"$MCPP" pack --format dir | tee target/ci/pack.log
7680
find target/dist -iname 'fmt.dll' | grep -q . || fail "the packed tree carries no fmt.dll"
81+
find target/dist -path '*/licenses/fmt/copyright' | grep -q . || fail "the packed tree carries no deployed copyright"
7782
echo "ok: the packed tree carries fmt.dll"
7883
fi
7984
}
@@ -128,6 +133,58 @@ cmake_consumer() {
128133
echo "ok: a file added to the subproject re-ran its installation"
129134
}
130135

136+
archive_consumer() {
137+
cd "$ROOT/tests/archive-consumer"
138+
rm -rf target
139+
mkdir -p target/ci
140+
# PLANNING EXTRACTS NOTHING. The listing is read from the archive's central
141+
# directory; the extraction is an action.
142+
"$MCPP" emit build-database --format json > target/ci/db.json 2> target/ci/emit.log ||
143+
{ cat target/ci/emit.log; fail "emit build-database failed before any extraction"; }
144+
[ -z "$(find target -path '*deps-archive*' -type f)" ] || fail "emit build-database extracted something"
145+
echo "ok: emit planned the archive and extracted nothing"
146+
147+
"$MCPP" build 2>&1 | tee target/ci/build.log
148+
"$MCPP" run | tee target/ci/run.log
149+
grep -q "^archive-consumer: 'greetings from the archive', 'a file two levels down'$" target/ci/run.log ||
150+
fail "the program did not read the archive's files from beside itself"
151+
# The C++ file among the data `#error`s if compiled; the build succeeded,
152+
# and the file is beside the program as data.
153+
find target -path '*/bin/runtime/bundle/not-compiled.cpp' | grep -q . ||
154+
fail "an archive member was not deployed beside the program"
155+
echo "ok: the archive's tree is beside the program, a C++ member included, as data"
156+
157+
local copy
158+
copy=$(find target -path '*deps-archive/bundle/bundle/greeting.txt' | head -1)
159+
[ -n "$copy" ] || fail "no extracted copy under target/"
160+
touch -r "$copy" target/ci/before-second-build
161+
sleep 1
162+
"$MCPP" build --profile dev > target/ci/second-build.log 2>&1 ||
163+
{ cat target/ci/second-build.log; fail "the second build failed"; }
164+
[ -z "$(find "$copy" -newer target/ci/before-second-build)" ] ||
165+
fail "a second build with nothing changed extracted the archive again"
166+
echo "ok: a second build with nothing changed did not extract the archive again"
167+
168+
touch assets/bundle.zip
169+
"$MCPP" build --profile dev > target/ci/third-build.log 2>&1 ||
170+
{ cat target/ci/third-build.log; fail "the build after touching the archive failed"; }
171+
[ -n "$(find "$copy" -newer target/ci/before-second-build)" ] ||
172+
fail "a changed archive was not extracted again"
173+
echo "ok: a changed archive was extracted again"
174+
175+
"$MCPP" pack --format dir > target/ci/pack.log 2>&1 || { cat target/ci/pack.log; fail "mcpp pack failed"; }
176+
find target/dist -path '*/runtime/bundle/nested/deep.txt' | grep -q . ||
177+
fail "the packed tree does not carry the archive's files"
178+
# A PE program sits at the root of the packed tree, an ELF or Mach-O one
179+
# under bin/; the deployed files are beside it either way.
180+
local packed
181+
packed=$(find target/dist -type f \( -name archive-consumer -o -name archive-consumer.exe \) | head -1 || true)
182+
[ -n "$packed" ] || fail "no packed program under target/dist"
183+
"$packed" | grep -q "^archive-consumer: 'greetings from the archive'" ||
184+
fail "the packed program did not read the archive's files"
185+
echo "ok: the packed tree carries the archive's files, and the packed program reads them"
186+
}
187+
131188
qt_consumer() {
132189
cd "$ROOT/tests/qt-consumer"
133190
rm -rf target
@@ -146,6 +203,9 @@ qt_consumer() {
146203
fail "moc, rcc or lrelease did not reach the program"
147204
find target -name 'qt_consumer_de.qm' | grep -q . || fail "no .qm was produced"
148205
echo "ok: moc (header and inline), rcc and lrelease reached the program"
206+
grep -q "Qt's own 'Abbrechen'$" target/ci/run.log ||
207+
fail "Qt's own strings were not translated from the combined qt_de.qm"
208+
echo "ok: lconvert combined Qt's catalogs into qt_de.qm, and the program loads it"
149209
"$MCPP" build --profile dev -v > target/ci/second-build.log 2>&1 ||
150210
{ cat target/ci/second-build.log; fail "the second build failed"; }
151211
! grep -qE '/(lupdate|lrelease)[^ ]* ' target/ci/second-build.log ||
@@ -179,9 +239,10 @@ qt_widgets_consumer() {
179239

180240
case "${1:-}" in
181241
vcpkg-consumer) vcpkg_consumer ;;
242+
archive-consumer) archive_consumer ;;
182243
vcpkg-workspace) vcpkg_workspace ;;
183244
cmake-consumer) cmake_consumer ;;
184245
qt-consumer) qt_consumer ;;
185246
qt-widgets-consumer) qt_widgets_consumer ;;
186-
*) echo "usage: $0 vcpkg-consumer|vcpkg-workspace|cmake-consumer|qt-consumer|qt-widgets-consumer"; exit 2 ;;
247+
*) echo "usage: $0 vcpkg-consumer|archive-consumer|vcpkg-workspace|cmake-consumer|qt-consumer|qt-widgets-consumer"; exit 2 ;;
187248
esac

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,9 @@ jobs:
16501650
- name: deps-vcpkg installs a manifest as an action, and planning installs nothing
16511651
run: bash .github/scripts/check-deps-and-qt.sh vcpkg-consumer
16521652

1653+
- name: deps-archive extracts a zip the project keeps and deploys its tree beside the program
1654+
run: bash .github/scripts/check-deps-and-qt.sh archive-consumer
1655+
16531656
- name: deps-vcpkg in two workspace members that share no dependency
16541657
run: bash .github/scripts/check-deps-and-qt.sh vcpkg-workspace
16551658

@@ -1659,7 +1662,7 @@ jobs:
16591662
# A console program: QtCore, which is what Linux is served for. QtGui
16601663
# loads libdbus, which the ecosystem does not publish, so the Widgets
16611664
# fixture runs on Windows only.
1662-
- name: rules-qt runs moc, rcc and lrelease, with the SDK from xim:qt
1665+
- name: rules-qt runs moc, rcc, lupdate and lrelease, with the SDK from xim:qt-base
16631666
run: bash .github/scripts/check-deps-and-qt.sh qt-consumer
16641667

16651668
# ── THE SAME RULE ON THE OTHER TWO PLATFORMS ────────────────────────────────
@@ -2325,13 +2328,16 @@ jobs:
23252328
- name: deps-vcpkg installs a manifest as an action, and planning installs nothing
23262329
run: bash .github/scripts/check-deps-and-qt.sh vcpkg-consumer
23272330

2331+
- name: deps-archive extracts a zip the project keeps and deploys its tree beside the program
2332+
run: bash .github/scripts/check-deps-and-qt.sh archive-consumer
2333+
23282334
- name: deps-vcpkg in two workspace members that share no dependency
23292335
run: bash .github/scripts/check-deps-and-qt.sh vcpkg-workspace
23302336

23312337
- name: deps-cmake builds a CMake subproject as an action and links it
23322338
run: bash .github/scripts/check-deps-and-qt.sh cmake-consumer
23332339

2334-
- name: rules-qt runs moc, rcc and lrelease, with the SDK from xim:qt
2340+
- name: rules-qt runs moc, rcc, lupdate and lrelease, with the SDK from xim:qt-base
23352341
run: bash .github/scripts/check-deps-and-qt.sh qt-consumer
23362342

23372343
# Windows and macOS: QtGui's dependencies are the system's there. On Linux

0 commit comments

Comments
 (0)