Files

36 lines
2.8 KiB
Python

from pathlib import Path
import sys,json,fcntl,os,hashlib
root=Path('/home/jakub/devel/escapistsrereintroduced');sys.path.insert(0,str(root/'tools'))
import native_package as pack
s=Path('/tmp/erri-playtest-packages-20260919');compat=Path('/tmp/erri-headless-compat');steam=Path('/home/jakub/.local/share/Steam')
original_bytes=(s/'package-report.json').read_bytes();original=json.loads(original_bytes)
assert original['stopped_reason']=='native completion not safely observed' and original['skipped_projects']==['ai','intel','map','chat']
reports=original['projects'];assert len(reports)==1 and reports[0]['project']=='core'
authored=json.loads((s/'authored-before.json').read_text())
def cleaned_native_exit(r):
return r['native_exit_code']==0 and r['cleanup_confirmed'] is True and r['copied_authored_unchanged'] is True and r['runner_error'] is None
assert cleaned_native_exit(reports[0])
fd=os.open(compat/'.erri-workbench.lock',os.O_RDWR|os.O_NOFOLLOW)
with os.fdopen(fd,'a') as lock:
fcntl.flock(lock,fcntl.LOCK_EX|fcntl.LOCK_NB)
pack.assert_no_game();pack.assert_prefix_idle(compat)
assert pack.inventory(root)==authored and pack.copied_authored_snapshot(s/'source',authored)==authored
review={'kind':'SEPARATE DEVELOPMENT PACKAGE CONTINUATION','original_report_sha256':hashlib.sha256(original_bytes).hexdigest(),'reason':'Original Core native process recorded exit0; its remaining owned Wine helper was cleaned and strict prefix idle was reverified before these separate remaining addon jobs. Original failure remains unchanged.','build_qualified':False,'release_qualified':False,'projects':list(reports),'stopped_reason':None}
out=s/'playtest-continuation.json';assert not out.exists()
for name in ['ai','intel','map','chat']:
pack.assert_no_game();pack.assert_prefix_idle(compat)
assert pack.inventory(root)==authored and pack.copied_authored_snapshot(s/'source',authored)==authored
assert all(not(s/part/name).exists() for part in ['profiles','packages','cache','evidence'])
r=pack.run_project(steam,compat,s,name,300,authored,True,False)
review['projects'].append(r)
if not cleaned_native_exit(r):review['stopped_reason']='Native exit, cleanup or source check refused continuation at '+name
pack.save(out,review)
print(name, 'native exit',r['native_exit_code'],'cleanup',r['cleanup_confirmed'],'original result',r['result'],flush=True)
if review['stopped_reason']:break
pack.assert_prefix_idle(compat)
assert (s/'package-report.json').read_bytes()==original_bytes
review['source_repository_unchanged']=pack.inventory(root)==authored
pack.save(out,review)
assert len(review['projects'])==5 and review['source_repository_unchanged'] and review['stopped_reason'] is None
print('Remaining package jobs finished; original build failures retained; payload/startup inspection still required.')