diff --git a/installer/test-light.ps1 b/installer/test-light.ps1 index 3db9c999..c7089fd5 100644 --- a/installer/test-light.ps1 +++ b/installer/test-light.ps1 @@ -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 diff --git a/installer/test.ps1 b/installer/test.ps1 index aefe6569..c3144fa2 100644 --- a/installer/test.ps1 +++ b/installer/test.ps1 @@ -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') diff --git a/scripts/ci/probe-server.ps1 b/scripts/ci/probe-server.ps1 index 36800da4..c481031f 100644 --- a/scripts/ci/probe-server.ps1 +++ b/scripts/ci/probe-server.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" diff --git a/tests/pipe-probe/CMakeLists.txt b/tests/pipe-probe/CMakeLists.txt index 28c35e5c..9ac39505 100644 --- a/tests/pipe-probe/CMakeLists.txt +++ b/tests/pipe-probe/CMakeLists.txt @@ -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)