Ver código fonte

Use separate catalog/repo for prebuilt dds

default_compile_flags
vector-of-bool 4 anos atrás
pai
commit
1196a8500d
2 arquivos alterados com 20 adições e 20 exclusões
  1. +17
    -18
      tools/ci.py
  2. +3
    -2
      tools/self_build.py

+ 17
- 18
tools/ci.py Ver arquivo

@@ -87,11 +87,11 @@ def main(argv: Sequence[str]) -> int:
else:
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():
shutil.rmtree(ci_repo_dir)

@@ -99,16 +99,13 @@ def main(argv: Sequence[str]) -> int:
paths.PREBUILT_DDS,
'catalog',
'import',
('--catalog', cat_path),
('--catalog', old_cat_path),
('--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(f'A `dds` executable has been generated: {paths.CUR_BUILT_DDS}')

@@ -120,19 +117,21 @@ def main(argv: Sequence[str]) -> int:

# Delete the catalog database, since there may be schema changes since the
# 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([
paths.CUR_BUILT_DDS,
'catalog',
'import',
('--catalog', cat_path),
('--catalog', new_cat_path),
('--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!')

return pytest.main([

+ 3
- 2
tools/self_build.py Ver arquivo

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

Carregando…
Cancelar
Salvar