Prepare Linux delivery and correct lifecycle rendering build types
This commit is contained in:
@@ -237,7 +237,7 @@ def make_archive(stage, archive, package_name):
|
||||
for relative, path in files.items():
|
||||
info = tarfile.TarInfo(f'{package_name}/{relative}')
|
||||
info.size = path.stat().st_size
|
||||
info.mode = 0o755 if relative in ('arcadia-studio', 'arcadia-server') else 0o644
|
||||
info.mode = 0o755 if relative in ('arcadia-studio', 'arcadia-server', 'arcadia') else 0o644
|
||||
info.mtime = 0
|
||||
with path.open('rb') as source:
|
||||
tar.addfile(info, source)
|
||||
@@ -254,7 +254,7 @@ def make_archive(stage, archive, package_name):
|
||||
stream = tar.extractfile(entry)
|
||||
if hashlib.file_digest(stream, 'sha256').hexdigest() != expected[relative]:
|
||||
raise ValueError(f'Archive readback mismatch: {relative}')
|
||||
mode = 0o755 if relative in ('arcadia-studio', 'arcadia-server') else 0o644
|
||||
mode = 0o755 if relative in ('arcadia-studio', 'arcadia-server', 'arcadia') else 0o644
|
||||
if entry.mode != mode or entry.uid or entry.gid or entry.mtime:
|
||||
raise ValueError('Archive permissions/metadata mismatch')
|
||||
if seen != set(expected) or set(stage_files(stage)) != set(expected) or any(digest(path) != expected[name] for name, path in files.items()):
|
||||
|
||||
@@ -29,7 +29,7 @@ $imports = [ordered]@{}
|
||||
$evidence = $null
|
||||
if (-not $ServerNoticesOnly) {
|
||||
$binaryHashes = [ordered]@{}
|
||||
foreach ($name in @('arcadia-studio', 'arcadia-server')) {
|
||||
foreach ($name in @('arcadia-studio', 'arcadia-server', 'arcadia')) {
|
||||
$path = [IO.Path]::GetFullPath((Join-Path $BinaryDirectory $name))
|
||||
$elf = Invoke-PackageHelper $Python @('elf', $path)
|
||||
$inputs[$name] = $path
|
||||
@@ -40,7 +40,7 @@ if (-not $ServerNoticesOnly) {
|
||||
$evidence = Read-PackageBuildEvidence $BuildEvidence $Target $binaryHashes
|
||||
$documentation = Get-PackageDocumentation $repository 'linux' $Python
|
||||
foreach ($name in $documentation.Keys) { $inputs[$name] = $documentation[$name] }
|
||||
$notices = Get-ArcadiaNotices $repository $Target $NoticeManifest ''
|
||||
$notices = Get-ArcadiaNotices $repository $Target $NoticeManifest '' @('oa-desktop', 'oa-server', 'oa-cli')
|
||||
} else {
|
||||
if ($BuildEvidence) { throw '-BuildEvidence applies to a binary package, not a notice-only bundle.' }
|
||||
$notices = Get-ArcadiaNotices $repository $Target $NoticeManifest '' @('oa-server')
|
||||
@@ -77,10 +77,10 @@ try {
|
||||
acceptance = 'Packaging integrity only; current-tree native Linux acceptance required.'
|
||||
build = 'Prebuilt inputs; no build profile, source identity or compiler inferred.'
|
||||
build_evidence = $evidence; imports = $imports; input_sha256 = $inputHashes
|
||||
runtime = 'Ubuntu 24.04 x86-64 is the validation baseline. Direct ELF dependencies only are inspected; graphics/window/portal dynamic loads must be verified on the actual runtime.'
|
||||
runtime = 'Ubuntu 24.04 x86-64 is the validation baseline. Direct ELF dependencies only are inspected; graphics/window dynamic loads must be verified on the actual runtime. Linux Open/Save uses application path entry.'
|
||||
}
|
||||
[IO.File]::WriteAllText((Join-Path $stage 'package.json'), ($metadata | ConvertTo-Json -Depth 14) + "`n", $encoding)
|
||||
[IO.File]::WriteAllText((Join-Path $stage 'START-HERE.txt'), "Arcadia Studio portable Linux bundle`nRun ./arcadia-studio. Keep examples/release1 beside the executable.`nRead README.md and docs/linux-packaging.md. The optional server is ./arcadia-server.`nSource checkout required for Cargo/Docker instructions. Packaging is not runtime acceptance.`n", $encoding)
|
||||
[IO.File]::WriteAllText((Join-Path $stage 'START-HERE.txt'), "Arcadia Studio portable Linux bundle`nRun ./arcadia-studio. Keep examples/release1 beside the executable.`nRead README.md and docs/linux-packaging.md. The optional server is ./arcadia-server.`nThe source authoring CLI is ./arcadia; run ./arcadia --help for check, stabilization and alias rename commands.`nSource checkout required for Cargo/Docker instructions. Packaging is not runtime acceptance.`n", $encoding)
|
||||
$documentCheck = Invoke-PackageHelper $Python @('check-docs', '--stage', $stage)
|
||||
[IO.File]::WriteAllText((Join-Path $stage 'documentation-check.json'), ($documentCheck | ConvertTo-Json) + "`n", $encoding)
|
||||
}
|
||||
|
||||
@@ -52,14 +52,20 @@ class PackageContracts(unittest.TestCase):
|
||||
def test_tar_is_deterministic_with_executable_modes_and_unicode_paths(self):
|
||||
self.file('stage/arcadia-studio', b'not executable in this test')
|
||||
self.file('stage/arcadia-server', b'another inert fixture')
|
||||
self.file('stage/arcadia', b'inert source CLI fixture')
|
||||
self.file('stage/examples/arcadia', b'ordinary data with the same basename')
|
||||
self.file('stage/examples/temperature delta.txt', 'Δ\n'.encode())
|
||||
first = packaging.make_archive(self.root / 'stage', self.root / 'a.tar.gz', 'fixture')
|
||||
second = packaging.make_archive(self.root / 'stage', self.root / 'b.tar.gz', 'fixture')
|
||||
self.assertEqual(first['sha256'], second['sha256'])
|
||||
with tarfile.open(self.root / 'a.tar.gz') as archive:
|
||||
self.assertEqual(archive.getmember('fixture/arcadia-studio').mode, 0o755)
|
||||
self.assertEqual(archive.getmember('fixture/arcadia-server').mode, 0o755)
|
||||
self.assertEqual(archive.getmember('fixture/arcadia').mode, 0o755)
|
||||
self.assertEqual(archive.getmember('fixture/examples/arcadia').mode, 0o644)
|
||||
self.assertEqual(archive.extractfile('fixture/arcadia').read(), b'inert source CLI fixture')
|
||||
self.assertEqual(archive.getmember('fixture/examples/temperature delta.txt').mode, 0o644)
|
||||
self.assertEqual(len(archive.getmembers()), 3)
|
||||
self.assertEqual(len(archive.getmembers()), 5)
|
||||
|
||||
def test_archive_refuses_overwrite_and_case_collisions(self):
|
||||
self.file('stage/a', b'first')
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#Requires -Version 5.1
|
||||
# Read-only dependency preflight. Does not build, download, or change a Cargo target.
|
||||
function Get-ArcadiaNotices([string]$Repository, [string]$Target, [string]$NoticeManifest, [string]$LlvmMinGWRoot, [string[]]$RootPackages = @('oa-desktop', 'oa-server')) {
|
||||
if ($RootPackages.Count -eq 0 -or @($RootPackages | Where-Object { $_ -notin @('oa-desktop', 'oa-server') }).Count -gt 0) { throw 'Notice roots must be oa-desktop and/or oa-server.' }
|
||||
if ($RootPackages.Count -eq 0 -or @($RootPackages | Where-Object { $_ -notin @('oa-desktop', 'oa-server', 'oa-cli') }).Count -gt 0) { throw 'Notice roots must be selected from oa-desktop, oa-server and oa-cli.' }
|
||||
if ($LlvmMinGWRoot -and $Target -ne 'x86_64-pc-windows-gnullvm') { throw 'LLVM-MinGW runtime notices apply only to the gnullvm target.' }
|
||||
function Hash-File([string]$Path) {
|
||||
$stream = [IO.File]::OpenRead($Path)
|
||||
|
||||
Reference in New Issue
Block a user