fix(ci): resolve the pipe probe contracts from the repository, not the server
The probe took its include directory from $ServerRoot/MetasequoiaImeEngine/contracts, which is where the engine sat when it was a submodule of Server. It is a submodule of the repository now, so the path does not move with -ServerRoot. A missing include directory is not a configure error, so this surfaced minutes later as C1083 on a header nobody had moved; the script now checks and says so before building. The local packaging rehearsals had the same stale assumption, looking for MetasequoiaImeTsf, MetasequoiaImeServer and MetasequoiaImeUiHtml beside the installer. Worse, they skipped the build when a neighbour was absent, which in this layout means every build is skipped and whatever binaries are lying around get packaged into an installer you then run on your own machine. The three components are directories of this repository, so a missing one is now a hard failure, and Prepare-PackageFiles.ps1 is passed the directory names it needs. Both were missed because the sweep that moved the submodules read its own output through head, so a truncated list looked like a complete one. Re-checked by resolving every relative path literal in every tracked file with no filtering.
This commit is contained in:
1 parent
b5d07f11eb
commit
b48dc82652
4 files changed
+45
-50
No files matched your search
+18
-24
@@ -10,35 +10,29 @@ Set-StrictMode -Version Latest
|
||||
Set-Location $PSScriptRoot
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$tsfCompile = Join-Path $repoRoot 'MetasequoiaImeTsf\scripts\lcompile-release-both.ps1'
|
||||
$serverCompile = Join-Path $repoRoot 'MetasequoiaImeServer\scripts\lcompile-release.ps1'
|
||||
$settingsDir = Join-Path $repoRoot 'MetasequoiaImeUiHtml\webview2\settings\ime-settings'
|
||||
$tsfCompile = Join-Path $repoRoot 'windows\scripts\lcompile-release-both.ps1'
|
||||
$serverCompile = Join-Path $repoRoot 'server\scripts\lcompile-release.ps1'
|
||||
$settingsDir = Join-Path $repoRoot 'ui-html\webview2\settings\ime-settings'
|
||||
|
||||
if (Test-Path -LiteralPath $tsfCompile -PathType Leaf) {
|
||||
Push-Location (Join-Path $repoRoot 'MetasequoiaImeTsf')
|
||||
try { & $tsfCompile } finally { Pop-Location }
|
||||
}
|
||||
else {
|
||||
Write-Host '跳过 TSF 编译:未找到相邻的 MetasequoiaImeTsf 仓库。'
|
||||
# All three are directories of this repository now, so a missing one is a broken checkout rather
|
||||
# than a neighbour nobody cloned. Skipping the build and packaging whatever binaries happen to be
|
||||
# lying around would produce an installer you then run on your own machine.
|
||||
foreach ($required in @($tsfCompile, $serverCompile, (Join-Path $settingsDir 'package.json'))) {
|
||||
if (-not (Test-Path -LiteralPath $required -PathType Leaf)) {
|
||||
throw "缺少组件构建入口:$required"
|
||||
}
|
||||
}
|
||||
|
||||
if (Test-Path -LiteralPath $serverCompile -PathType Leaf) {
|
||||
Push-Location (Join-Path $repoRoot 'MetasequoiaImeServer')
|
||||
try { & $serverCompile } finally { Pop-Location }
|
||||
}
|
||||
else {
|
||||
Write-Host '跳过 Server 编译:未找到相邻的 MetasequoiaImeServer 仓库。'
|
||||
}
|
||||
Push-Location (Join-Path $repoRoot 'windows')
|
||||
try { & $tsfCompile } finally { Pop-Location }
|
||||
|
||||
if (Test-Path -LiteralPath (Join-Path $settingsDir 'package.json') -PathType Leaf) {
|
||||
Push-Location $settingsDir
|
||||
try { pnpm run build } finally { Pop-Location }
|
||||
}
|
||||
else {
|
||||
Write-Host '跳过设置页构建:未找到相邻的 MetasequoiaImeUiHtml 仓库。'
|
||||
}
|
||||
Push-Location (Join-Path $repoRoot 'server')
|
||||
try { & $serverCompile } finally { Pop-Location }
|
||||
|
||||
& (Join-Path $PSScriptRoot 'Prepare-PackageFiles.ps1') -Light
|
||||
Push-Location $settingsDir
|
||||
try { pnpm run build } finally { Pop-Location }
|
||||
|
||||
& (Join-Path $PSScriptRoot 'Prepare-PackageFiles.ps1') -Light -RepoRoot $repoRoot -TsfDirectory windows -ServerDirectory server -UiHtmlDirectory ui-html -NoticesDirectory .
|
||||
& (Join-Path $PSScriptRoot 'Sign-PackageBinaries-Local.ps1')
|
||||
& (Join-Path $PSScriptRoot 'Compile-Installer.ps1') -Light
|
||||
& (Join-Path $PSScriptRoot 'Sign-Installer-Local.ps1') -Light
|
||||
|
||||
+18
-24
@@ -9,35 +9,29 @@ Set-StrictMode -Version Latest
|
||||
Set-Location $PSScriptRoot
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$tsfCompile = Join-Path $repoRoot 'MetasequoiaImeTsf\scripts\lcompile-release-both.ps1'
|
||||
$serverCompile = Join-Path $repoRoot 'MetasequoiaImeServer\scripts\lcompile-release.ps1'
|
||||
$settingsDir = Join-Path $repoRoot 'MetasequoiaImeUiHtml\webview2\settings\ime-settings'
|
||||
$tsfCompile = Join-Path $repoRoot 'windows\scripts\lcompile-release-both.ps1'
|
||||
$serverCompile = Join-Path $repoRoot 'server\scripts\lcompile-release.ps1'
|
||||
$settingsDir = Join-Path $repoRoot 'ui-html\webview2\settings\ime-settings'
|
||||
|
||||
if (Test-Path -LiteralPath $tsfCompile -PathType Leaf) {
|
||||
Push-Location (Join-Path $repoRoot 'MetasequoiaImeTsf')
|
||||
try { & $tsfCompile } finally { Pop-Location }
|
||||
}
|
||||
else {
|
||||
Write-Host '跳过 TSF 编译:未找到相邻的 MetasequoiaImeTsf 仓库。'
|
||||
# All three are directories of this repository now, so a missing one is a broken checkout rather
|
||||
# than a neighbour nobody cloned. Skipping the build and packaging whatever binaries happen to be
|
||||
# lying around would produce an installer you then run on your own machine.
|
||||
foreach ($required in @($tsfCompile, $serverCompile, (Join-Path $settingsDir 'package.json'))) {
|
||||
if (-not (Test-Path -LiteralPath $required -PathType Leaf)) {
|
||||
throw "缺少组件构建入口:$required"
|
||||
}
|
||||
}
|
||||
|
||||
if (Test-Path -LiteralPath $serverCompile -PathType Leaf) {
|
||||
Push-Location (Join-Path $repoRoot 'MetasequoiaImeServer')
|
||||
try { & $serverCompile } finally { Pop-Location }
|
||||
}
|
||||
else {
|
||||
Write-Host '跳过 Server 编译:未找到相邻的 MetasequoiaImeServer 仓库。'
|
||||
}
|
||||
Push-Location (Join-Path $repoRoot 'windows')
|
||||
try { & $tsfCompile } finally { Pop-Location }
|
||||
|
||||
if (Test-Path -LiteralPath (Join-Path $settingsDir 'package.json') -PathType Leaf) {
|
||||
Push-Location $settingsDir
|
||||
try { pnpm run build } finally { Pop-Location }
|
||||
}
|
||||
else {
|
||||
Write-Host '跳过设置页构建:未找到相邻的 MetasequoiaImeUiHtml 仓库。'
|
||||
}
|
||||
Push-Location (Join-Path $repoRoot 'server')
|
||||
try { & $serverCompile } finally { Pop-Location }
|
||||
|
||||
& (Join-Path $PSScriptRoot 'Prepare-PackageFiles.ps1')
|
||||
Push-Location $settingsDir
|
||||
try { pnpm run build } finally { Pop-Location }
|
||||
|
||||
& (Join-Path $PSScriptRoot 'Prepare-PackageFiles.ps1') -RepoRoot $repoRoot -TsfDirectory windows -ServerDirectory server -UiHtmlDirectory ui-html -NoticesDirectory .
|
||||
& (Join-Path $PSScriptRoot 'Sign-PackageBinaries-Local.ps1')
|
||||
& (Join-Path $PSScriptRoot 'Compile-Installer.ps1')
|
||||
& (Join-Path $PSScriptRoot 'Sign-Installer-Local.ps1')
|
||||
|
||||
@@ -6,7 +6,14 @@ $ErrorActionPreference = 'Stop'
|
||||
$automationRoot = (Resolve-Path (Join-Path $PSScriptRoot '../..')).Path
|
||||
$server = (Resolve-Path $ServerRoot).Path
|
||||
$binary = Join-Path $server "$BuildDir/bin/Release/MetasequoiaImeServer.exe"
|
||||
$contracts = Join-Path $server 'MetasequoiaImeEngine/contracts'
|
||||
# The engine is a submodule of the repository, not of the server, so the contracts do not move with
|
||||
# -ServerRoot.
|
||||
$contracts = Join-Path $automationRoot 'vendor/MetasequoiaImeEngine/contracts'
|
||||
# An include directory that does not exist is not a configure error; it surfaces minutes later as
|
||||
# C1083 on a header nobody moved. Say what is actually wrong, before building anything.
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $contracts 'ipc_negotiation.h') -PathType Leaf)) {
|
||||
throw "Engine contracts not found at $contracts; run git submodule update --init"
|
||||
}
|
||||
$probes = @()
|
||||
foreach ($architecture in @('Win32', 'x64')) {
|
||||
$output = Join-Path $env:RUNNER_TEMP "msime-pipe-probe-$architecture"
|
||||
|
||||
@@ -3,7 +3,7 @@ project(MsimePipeProbe LANGUAGES CXX)
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "The pipe probe exercises a real Windows Server process")
|
||||
endif()
|
||||
set(MSIME_CONTRACTS_DIR "" CACHE PATH "Contracts from the locked Server Engine gitlink")
|
||||
set(MSIME_CONTRACTS_DIR "" CACHE PATH "Contracts from the repository's engine submodule")
|
||||
add_executable(msime-ipc-probe main.cpp)
|
||||
target_compile_features(msime-ipc-probe PRIVATE cxx_std_17)
|
||||
target_compile_definitions(msime-ipc-probe PRIVATE NOMINMAX UNICODE _UNICODE)
|
||||
|
||||
Reference in new issue
Block a user