|
|
|
|
|
|
|
|
else: |
|
|
else: |
|
|
assert False, 'impossible' |
|
|
assert False, 'impossible' |
|
|
|
|
|
|
|
|
cat_path = paths.BUILD_DIR / 'catalog.db' |
|
|
|
|
|
if cat_path.is_file(): |
|
|
|
|
|
cat_path.unlink() |
|
|
|
|
|
|
|
|
old_cat_path = paths.PREBUILT_DIR / 'catalog.db' |
|
|
|
|
|
if old_cat_path.is_file(): |
|
|
|
|
|
old_cat_path.unlink() |
|
|
|
|
|
|
|
|
ci_repo_dir = paths.BUILD_DIR / '_ci-repo' |
|
|
|
|
|
|
|
|
ci_repo_dir = paths.PREBUILT_DIR / '_ci-repo' |
|
|
if ci_repo_dir.exists(): |
|
|
if ci_repo_dir.exists(): |
|
|
shutil.rmtree(ci_repo_dir) |
|
|
shutil.rmtree(ci_repo_dir) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
paths.PREBUILT_DDS, |
|
|
paths.PREBUILT_DDS, |
|
|
'catalog', |
|
|
'catalog', |
|
|
'import', |
|
|
'import', |
|
|
('--catalog', cat_path), |
|
|
|
|
|
|
|
|
('--catalog', old_cat_path), |
|
|
('--json', paths.PROJECT_ROOT / 'catalog.json'), |
|
|
('--json', paths.PROJECT_ROOT / 'catalog.json'), |
|
|
]) |
|
|
]) |
|
|
self_build( |
|
|
|
|
|
paths.PREBUILT_DDS, |
|
|
|
|
|
toolchain=opts.toolchain, |
|
|
|
|
|
dds_flags=[ |
|
|
|
|
|
('--catalog', cat_path), |
|
|
|
|
|
('--repo-dir', ci_repo_dir), |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
self_build(paths.PREBUILT_DDS, |
|
|
|
|
|
toolchain=opts.toolchain, |
|
|
|
|
|
cat_path=old_cat_path, |
|
|
|
|
|
dds_flags=[('--repo-dir', ci_repo_dir)]) |
|
|
print('Main build PASSED!') |
|
|
print('Main build PASSED!') |
|
|
print(f'A `dds` executable has been generated: {paths.CUR_BUILT_DDS}') |
|
|
print(f'A `dds` executable has been generated: {paths.CUR_BUILT_DDS}') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Delete the catalog database, since there may be schema changes since the |
|
|
# Delete the catalog database, since there may be schema changes since the |
|
|
# bootstrap executable was built |
|
|
# bootstrap executable was built |
|
|
cat_path.unlink() |
|
|
|
|
|
|
|
|
new_cat_path = paths.BUILD_DIR / 'catalog.db' |
|
|
|
|
|
if new_cat_path.exists(): |
|
|
|
|
|
new_cat_path.unlink() |
|
|
|
|
|
|
|
|
proc.check_run([ |
|
|
proc.check_run([ |
|
|
paths.CUR_BUILT_DDS, |
|
|
paths.CUR_BUILT_DDS, |
|
|
'catalog', |
|
|
'catalog', |
|
|
'import', |
|
|
'import', |
|
|
('--catalog', cat_path), |
|
|
|
|
|
|
|
|
('--catalog', new_cat_path), |
|
|
('--json', paths.PROJECT_ROOT / 'catalog.json'), |
|
|
('--json', paths.PROJECT_ROOT / 'catalog.json'), |
|
|
]) |
|
|
]) |
|
|
self_build( |
|
|
|
|
|
paths.CUR_BUILT_DDS, |
|
|
|
|
|
toolchain=opts.toolchain, |
|
|
|
|
|
dds_flags=[f'--repo-dir={ci_repo_dir}', f'--catalog={cat_path}']) |
|
|
|
|
|
|
|
|
self_build(paths.CUR_BUILT_DDS, |
|
|
|
|
|
toolchain=opts.toolchain, |
|
|
|
|
|
cat_path=new_cat_path, |
|
|
|
|
|
dds_flags=[f'--repo-dir={ci_repo_dir}']) |
|
|
print('Bootstrap test PASSED!') |
|
|
print('Bootstrap test PASSED!') |
|
|
|
|
|
|
|
|
return pytest.main([ |
|
|
return pytest.main([ |