Browse Source

New bootstrap phase based on alpha.3

default_compile_flags
vector-of-bool 4 years ago
parent
commit
d0248b2c80
4 changed files with 15 additions and 24 deletions
  1. +5
    -6
      Makefile
  2. +1
    -0
      tools/bootstrap.py
  3. +3
    -3
      tools/build.py
  4. +6
    -15
      tools/ci.py

+ 5
- 6
Makefile View File



nix-ci: nix-ci:
python3 -u tools/ci.py \ python3 -u tools/ci.py \
-B build \
-T tools/gcc-9.dds \
-T2 tools/gcc-9.jsonc
-B download \
-T tools/gcc-9.jsonc


vagrant-freebsd-ci: vagrant-freebsd-ci:
vagrant up freebsd11 vagrant up freebsd11
vagrant rsync
vagrant ssh freebsd11 -c '\ vagrant ssh freebsd11 -c '\
cd /vagrant && \ cd /vagrant && \
python3.7 tools/ci.py \ python3.7 tools/ci.py \
-B build \
-T tools/freebsd-gcc-9.dds \
-T2 tools/freebsd-gcc-9.jsonc \
-B download \
-T tools/freebsd-gcc-9.jsonc \
' '
vagrant scp freebsd11:/vagrant/_build/dds _build/dds-freebsd-x64 vagrant scp freebsd11:/vagrant/_build/dds _build/dds-freebsd-x64
vagrant halt vagrant halt

+ 1
- 0
tools/bootstrap.py View File

BootstrapPhase('bootstrap-p1.2', 'g++-8', 'cl.exe'), BootstrapPhase('bootstrap-p1.2', 'g++-8', 'cl.exe'),
BootstrapPhase('bootstrap-p4.2', 'g++-8', 'cl.exe'), BootstrapPhase('bootstrap-p4.2', 'g++-8', 'cl.exe'),
BootstrapPhase('bootstrap-p5.2', 'g++-9', 'cl.exe'), BootstrapPhase('bootstrap-p5.2', 'g++-9', 'cl.exe'),
BootstrapPhase('0.1.0-alpha.3', 'g++-9', 'cl.exe'),
] ]


HERE = Path(__file__).parent.absolute() HERE = Path(__file__).parent.absolute()

+ 3
- 3
tools/build.py View File



print(f'Using previously built DDS executable: {dds_exe}') print(f'Using previously built DDS executable: {dds_exe}')
if os.name == 'nt': if os.name == 'nt':
tc_fpath = ROOT / 'tools/msvc.dds'
tc_fpath = ROOT / 'tools/msvc.jsonc'
elif sys.platform.startswith('freebsd'): elif sys.platform.startswith('freebsd'):
tc_fpath = ROOT / 'tools/freebsd-gcc-9.dds'
tc_fpath = ROOT / 'tools/freebsd-gcc-9.jsonc'
else: else:
tc_fpath = ROOT / 'tools/gcc-9.dds'
tc_fpath = ROOT / 'tools/gcc-9.jsonc'


self_build(dds_exe, toolchain=str(tc_fpath)) self_build(dds_exe, toolchain=str(tc_fpath))



+ 6
- 15
tools/ci.py View File



class CIOptions(NamedTuple): class CIOptions(NamedTuple):
toolchain: str toolchain: str
toolchain_json5: str




def _do_bootstrap_build(opts: CIOptions) -> None: def _do_bootstrap_build(opts: CIOptions) -> None:
'win32': 'dds-win-x64.exe', 'win32': 'dds-win-x64.exe',
'linux': 'dds-linux-x64', 'linux': 'dds-linux-x64',
'darwin': 'dds-macos-x64', 'darwin': 'dds-macos-x64',
'freebsd11': 'dds-freebsd-x64',
'freebsd12': 'dds-freebsd-x64',
}.get(sys.platform) }.get(sys.platform)
if filename is None: if filename is None:
raise RuntimeError(f'We do not have a prebuilt DDS binary for ' raise RuntimeError(f'We do not have a prebuilt DDS binary for '
f'the "{sys.platform}" platform') f'the "{sys.platform}" platform')
url = f'https://github.com/vector-of-bool/dds/releases/download/0.0.1/{filename}'
url = f'https://github.com/vector-of-bool/dds/releases/download/0.1.0-alpha.3/{filename}'


print(f'Downloading prebuilt DDS executable: {url}') print(f'Downloading prebuilt DDS executable: {url}')
stream = urllib.request.urlopen(url) stream = urllib.request.urlopen(url)
'--toolchain', '--toolchain',
'-T', '-T',
help='The toolchain to use for the CI process', help='The toolchain to use for the CI process',
required=True)
parser.add_argument(
'--toolchain-json5',
'-T2',
help='The toolchain JSON to use with the bootstrapped executable',
required=True,
) )
parser.add_argument( parser.add_argument(
'--build-only', '--build-only',
help='Only build the `dds` executable. Skip second-phase and tests.') help='Only build the `dds` executable. Skip second-phase and tests.')
args = parser.parse_args(argv) args = parser.parse_args(argv)


if not args.build_only and not args.toolchain_json5:
raise RuntimeError(
'The --toolchain-json5/-T2 argument is required (unless using --build-only)'
)

opts = CIOptions(
toolchain=args.toolchain, toolchain_json5=args.toolchain_json5)
opts = CIOptions(toolchain=args.toolchain)


if args.bootstrap_with == 'build': if args.bootstrap_with == 'build':
_do_bootstrap_build(opts) _do_bootstrap_build(opts)
]) ])
self_build( self_build(
paths.CUR_BUILT_DDS, paths.CUR_BUILT_DDS,
toolchain=opts.toolchain_json5,
toolchain=opts.toolchain,
dds_flags=[f'--repo-dir={ci_repo_dir}', f'--catalog={cat_path}']) dds_flags=[f'--repo-dir={ci_repo_dir}', f'--catalog={cat_path}'])
print('Bootstrap test PASSED!') print('Bootstrap test PASSED!')



Loading…
Cancel
Save