Skip to content

Commit 84ce124

Browse files
author
Tinywan
committed
fix(package): record every AOT generated source group in the manifest
build-manifest.json 只登记了平铺守卫、静态属性与可变参数闭包三组生成源, 新增的顶层引导剥离、switch 终结与类型化引用补丁产物不在输入摘要里, “可追溯构建”因此失真:改动这些补丁不会反映到 manifest。改为按标签驱动 六组源常量统一收集哈希并写入同名 <label>_hashes 键,原有键名保持不变。
1 parent e439a65 commit 84ce124

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

‎src/Commands/PackageCommand.php‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int
156156
copy($projectYmlPath, $stageBuildDir . DIRECTORY_SEPARATOR . 'project.linux.yml');
157157
$output->writeln('<comment>[2/3] Generated compiler config: project.linux.yml</comment>');
158158

159-
// 汇总各类 AOT 生成源(平铺守卫源、静态属性补丁源、可变参数闭包补丁源)
160-
$flattenedHashes = $this->collectGeneratedHashes($basePath, ProjectGenerator::GUARDED_SOURCES);
161-
$patchedHashes = $this->collectGeneratedHashes($basePath, ProjectGenerator::NULLABLE_STATIC_SOURCES);
162-
$variadicHashes = $this->collectGeneratedHashes($basePath, ProjectGenerator::VARIADIC_HANDLER_SOURCES);
163-
$this->reportGeneratedSources($output, 'flattened', $flattenedHashes);
164-
$this->reportGeneratedSources($output, 'nullable-static', $patchedHashes);
165-
$this->reportGeneratedSources($output, 'variadic-handler', $variadicHashes);
159+
// 汇总各类 AOT 生成源的输入摘要:标签用于终端提示,同名 <label>_hashes 键写入 manifest
160+
$generatedSourceGroups = [
161+
'flattened' => ProjectGenerator::GUARDED_SOURCES,
162+
'nullable-static' => ProjectGenerator::NULLABLE_STATIC_SOURCES,
163+
'stray-bootstrap' => ProjectGenerator::STRAY_BOOTSTRAP_SOURCES,
164+
'variadic-handler' => ProjectGenerator::VARIADIC_HANDLER_SOURCES,
165+
'switch-terminal' => ProjectGenerator::SWITCH_TERMINAL_SOURCES,
166+
'ref-capture' => ProjectGenerator::REF_CAPTURE_SOURCES,
167+
];
168+
$generatedHashes = [];
169+
foreach ($generatedSourceGroups as $label => $targets) {
170+
$hashes = $this->collectGeneratedHashes($basePath, $targets);
171+
$this->reportGeneratedSources($output, $label, $hashes);
172+
$generatedHashes[str_replace('-', '_', $label) . '_hashes'] = $hashes;
173+
}
166174

167175
// 生成 build-manifest.json 记录元数据
168176
$manifest = [
@@ -175,9 +183,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
175183
'inputs' => [
176184
'main_hash' => file_exists($basePath . '/main.php') ? sha1_file($basePath . '/main.php') : '',
177185
'config_hash' => sha1_file($projectYmlPath),
178-
'flattened_hashes' => $flattenedHashes,
179-
'nullable_static_hashes' => $patchedHashes,
180-
'variadic_handler_hashes' => $variadicHashes,
186+
...$generatedHashes,
181187
],
182188
];
183189
file_put_contents($stageBuildDir . DIRECTORY_SEPARATOR . 'build-manifest.json', json_encode(

0 commit comments

Comments
 (0)