Prepare Linux delivery and correct lifecycle rendering build types

This commit is contained in:
2026-09-11 07:53:42 -07:00
parent cb611a71df
commit 29084050a7
41 changed files with 1120 additions and 25 deletions
+12 -3
View File
@@ -20,7 +20,7 @@ $null = Write-Fixture 'rust/share/doc/rust/COPYRIGHT.html' 'Synthetic Rust distr
$null = Write-Fixture 'rust/share/doc/rust/COPYRIGHT-library.html' 'Synthetic Rust library notice'
$null = Write-Fixture 'rust/lib/fake.rlib' 'Synthetic target library'
$packages = @(); $nodes = @(); $lock = @()
foreach ($name in @('oa-desktop', 'oa-server', 'normal', 'build', 'dev-only', 'unreachable')) {
foreach ($name in @('oa-desktop', 'oa-server', 'oa-cli', 'cli-only', 'normal', 'build', 'dev-only', 'unreachable')) {
$external = $name -notlike 'oa-*'
$root = if ($external) { "registry/src/test/$name-1.0.0" } else { "workspace/$name" }
$manifest = Write-Fixture "$root/Cargo.toml" "[package]`nname = `"$name`"`nversion = `"1.0.0`""
@@ -40,10 +40,13 @@ foreach ($name in @('oa-desktop', 'oa-server', 'normal', 'build', 'dev-only', 'u
$deps += [pscustomobject]@{ pkg = $pair[0]; dep_kinds = @([pscustomobject]@{ kind = $pair[1] }) }
}
}
if ($name -eq 'oa-cli') {
$deps += [pscustomobject]@{ pkg = 'cli-only'; dep_kinds = @([pscustomobject]@{ kind = $null }) }
}
$nodes += [pscustomobject]@{ id = $id; deps = $deps; features = @() }
}
$null = Write-Fixture 'Cargo.lock' ($lock -join "`n")
$script:FixtureMetadata = [pscustomobject]@{ packages = $packages; workspace_members = @('oa-desktop', 'oa-server'); resolve = [pscustomobject]@{ nodes = $nodes } }
$script:FixtureMetadata = [pscustomobject]@{ packages = $packages; workspace_members = @('oa-desktop', 'oa-server', 'oa-cli'); resolve = [pscustomobject]@{ nodes = $nodes } }
$script:FixtureTarget = 'x86_64-pc-windows-msvc'
function cargo {
if (($args -join ' ') -notmatch '--locked --offline' -or ($args -join ' ') -notmatch "--filter-platform $script:FixtureTarget") { throw 'Unexpected Cargo command' }
@@ -74,6 +77,12 @@ $script:FixtureTarget = 'x86_64-unknown-linux-gnu'
$linuxNotices = Get-ArcadiaNotices $fixture $script:FixtureTarget $manifestPath '' @('oa-server')
Assert ($linuxNotices.Inventory.packages.Count -eq 1 -and $linuxNotices.Inventory.packages[0].name -eq 'oa-server') 'Server-only Linux notice graph includes desktop roots'
Assert ($linuxNotices.Inventory.root_packages.Count -eq 1 -and $linuxNotices.Inventory.root_packages[0] -eq 'oa-server' -and $null -eq $linuxNotices.Inventory.runtime) 'Linux target/root/runtime identity not retained'
$fullLinuxNotices = Get-ArcadiaNotices $fixture $script:FixtureTarget $manifestPath '' @('oa-desktop', 'oa-server', 'oa-cli')
$fullNames = @($fullLinuxNotices.Inventory.packages | ForEach-Object { $_.name })
Assert ($fullNames.Count -eq 6 -and $fullNames -contains 'oa-cli' -and $fullNames -contains 'cli-only' -and $fullNames -notcontains 'dev-only' -and $fullNames -notcontains 'unreachable') 'Full Linux package omitted CLI dependencies or included unrelated roots'
Assert (($fullLinuxNotices.Inventory.root_packages -join ',') -ceq 'oa-cli,oa-desktop,oa-server') 'Full Linux notice root identity differs'
$cliRecord = $fullLinuxNotices.Inventory.packages | Where-Object name -eq 'oa-cli'
Assert ($cliRecord.local_source_sha256.Contains('src/lib.rs') -and $cliRecord.notices.Count -gt 0) 'CLI source or notice inventory missing'
try { $null = Get-ArcadiaNotices $fixture $script:FixtureTarget $manifestPath 'unexpected-runtime'; throw 'Expected runtime refusal' } catch { if ($_.Exception.Message -notmatch 'only to the gnullvm target') { throw } }
$script:FixtureTarget = 'x86_64-pc-windows-msvc'
$before = ($result.Inventory.packages | Where-Object name -eq normal).local_source_sha256['src/lib.rs']
@@ -109,5 +118,5 @@ $bad.packages[0].notices[0].file = 'NOTICE.txt'
$null = Write-Fixture 'supplements/NOTICE.txt' 'Synthetic supplemental notice'
$null = Write-Fixture 'supplements/manifest.json' ($bad | ConvertTo-Json -Depth 8)
Refuses 'Supplement changed'
Write-Output 'PASS: normal/build and server-only Linux selection, cross-target runtime refusal, Rust reports, actual source hashes, stale archive refusal, doc-comment font exclusion, production font path/mapping refusals, exact font mapping and changed-byte refusal, unsupported source refusal, traversal refusal, altered supplement refusal.'
Write-Output 'PASS: normal/build, server-only and full Linux CLI-root selection, cross-target runtime refusal, Rust reports, actual source hashes, stale archive refusal, doc-comment font exclusion, production font path/mapping refusals, exact font mapping and changed-byte refusal, unsupported source refusal, traversal refusal, altered supplement refusal.'
Write-Output "Synthetic fixture retained for inspection: $fixture"