Browse Source

Use separate catalog/repo for prebuilt dds

default_compile_flags
vector-of-bool 4 years ago
parent
commit
1196a8500d
2 changed files with 20 additions and 20 deletions
  1. +17
    -18
      tools/ci.py
  2. +3
    -2
      tools/self_build.py

+ 17
- 18
tools/ci.py View File

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([

+ 3
- 2
tools/self_build.py View File

*, *,
toolchain: str, toolchain: str,
lmi_path: Path = None, lmi_path: Path = None,
cat_path: Path = Path('_build/catalog.db'),
dds_flags: proc.CommandLine = ()): dds_flags: proc.CommandLine = ()):
# Copy the exe to another location, as windows refuses to let a binary be # Copy the exe to another location, as windows refuses to let a binary be
# replaced while it is executing # replaced while it is executing
new_exe, new_exe,
'catalog', 'catalog',
'import', 'import',
f'--catalog=_build/catalog.db',
f'--catalog={cat_path}',
f'--json=catalog.json', f'--json=catalog.json',
) )
proc.check_run( proc.check_run(
new_exe, new_exe,
'build', 'build',
f'--catalog=_build/catalog.db',
f'--catalog={cat_path}',
f'--repo-dir=_build/ci-repo', f'--repo-dir=_build/ci-repo',
dds_flags, dds_flags,
('--toolchain', toolchain), ('--toolchain', toolchain),

Loading…
Cancel
Save