| macos-ci: | macos-ci: | ||||
| python3 -u tools/ci.py \ | python3 -u tools/ci.py \ | ||||
| -B download \ | -B download \ | ||||
| -T tools/gcc-9.jsonc \ | |||||
| -T2 tools/gcc-9.next.jsonc | |||||
| -T tools/gcc-9.jsonc | |||||
| mv _build/dds _build/dds-macos-x64 | mv _build/dds _build/dds-macos-x64 | ||||
| linux-ci: | linux-ci: | ||||
| python3 -u tools/ci.py \ | python3 -u tools/ci.py \ | ||||
| -B download \ | -B download \ | ||||
| -T tools/gcc-9.jsonc \ | |||||
| -T2 tools/gcc-9-static.jsonc | |||||
| -T tools/gcc-9.jsonc | |||||
| mv _build/dds _build/dds-linux-x64 | mv _build/dds _build/dds-linux-x64 | ||||
| nix-ci: | nix-ci: |
| echo Executing Build and Tests | echo Executing Build and Tests | ||||
| reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f || exit 1 | reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f || exit 1 | ||||
| python -m pip install pytest pytest-xdist || exit 1 | python -m pip install pytest pytest-xdist || exit 1 | ||||
| python -u tools/ci.py -B download -T tools\msvc.jsonc -T2 tools\msvc.next.jsonc || exit 1 | |||||
| python -u tools/ci.py -B download -T tools\msvc.jsonc || exit 1 | |||||
| move _build\dds.exe _build\dds-win-x64.exe || exit 1 | move _build\dds.exe _build\dds-win-x64.exe || exit 1 | ||||
| displayName: Build and Test | displayName: Build and Test | ||||
| - publish: _build\dds-win-x64.exe | - publish: _build\dds-win-x64.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'), | BootstrapPhase('0.1.0-alpha.3', 'g++-9', 'cl.exe'), | ||||
| BootstrapPhase('0.1.0-alpha.4', 'g++-9', 'cl.exe'), | |||||
| ] | ] | ||||
| HERE = Path(__file__).parent.absolute() | HERE = Path(__file__).parent.absolute() |
| class CIOptions(NamedTuple): | class CIOptions(NamedTuple): | ||||
| toolchain: str | toolchain: str | ||||
| toolchain_2: str | |||||
| def _do_bootstrap_build(opts: CIOptions) -> None: | def _do_bootstrap_build(opts: CIOptions) -> None: | ||||
| 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.1.0-alpha.3/{filename}' | |||||
| url = f'https://github.com/vector-of-bool/dds/releases/download/0.1.0-alpha.4/{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) | ||||
| help='The toolchain to use for the CI process', | help='The toolchain to use for the CI process', | ||||
| required=True, | required=True, | ||||
| ) | ) | ||||
| parser.add_argument( | |||||
| '--toolchain-2', | |||||
| '-T2', | |||||
| help='The toolchain to use for the self-build', | |||||
| required=True, | |||||
| ) | |||||
| parser.add_argument( | parser.add_argument( | ||||
| '--build-only', | '--build-only', | ||||
| action='store_true', | action='store_true', | ||||
| 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) | ||||
| opts = CIOptions(toolchain=args.toolchain, toolchain_2=args.toolchain_2) | |||||
| opts = CIOptions(toolchain=args.toolchain) | |||||
| if args.bootstrap_with == 'build': | if args.bootstrap_with == 'build': | ||||
| _do_bootstrap_build(opts) | _do_bootstrap_build(opts) | ||||
| paths.PREBUILT_DDS, | paths.PREBUILT_DDS, | ||||
| toolchain=opts.toolchain, | toolchain=opts.toolchain, | ||||
| cat_path=old_cat_path, | cat_path=old_cat_path, | ||||
| cat_json_path=Path('catalog.old.json'), | |||||
| cat_json_path=Path('catalog.json'), | |||||
| dds_flags=[('--repo-dir', ci_repo_dir)]) | 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}') | ||||
| new_repo_dir = paths.BUILD_DIR / 'ci-repo' | new_repo_dir = paths.BUILD_DIR / 'ci-repo' | ||||
| self_build( | self_build( | ||||
| paths.CUR_BUILT_DDS, | paths.CUR_BUILT_DDS, | ||||
| toolchain=opts.toolchain_2, | |||||
| toolchain=opts.toolchain, | |||||
| cat_path=new_cat_path, | cat_path=new_cat_path, | ||||
| dds_flags=[f'--repo-dir={new_repo_dir}']) | dds_flags=[f'--repo-dir={new_repo_dir}']) | ||||
| print('Bootstrap test PASSED!') | print('Bootstrap test PASSED!') |
| "compiler_id": "gnu", | "compiler_id": "gnu", | ||||
| "c_compiler": "gcc9", | "c_compiler": "gcc9", | ||||
| "cxx_compiler": "g++9", | "cxx_compiler": "g++9", | ||||
| "flags": [ | |||||
| "-DSPDLOG_COMPILED_LIB", // Required to use a compiled spdlog | |||||
| "-Werror=return-type", | |||||
| "warning_flags": [ | |||||
| "-Werror", | |||||
| ], | ], | ||||
| "cxx_flags": [ | "cxx_flags": [ | ||||
| "-fconcepts", | "-fconcepts", |
| { | |||||
| "$schema": "../res/toolchain-schema.json", | |||||
| "compiler_id": "gnu", | |||||
| "c_compiler": "gcc9", | |||||
| "cxx_compiler": "g++9", | |||||
| "warning_flags": [ | |||||
| "-Werror", | |||||
| ], | |||||
| "cxx_flags": [ | |||||
| "-fconcepts", | |||||
| "-std=c++2a", | |||||
| ], | |||||
| "link_flags": [ | |||||
| "-static-libgcc", | |||||
| "-static-libstdc++", | |||||
| ], | |||||
| // "debug": true, | |||||
| "optimize": true, | |||||
| "compiler_launcher": "ccache" | |||||
| } |
| "compiler_id": "gnu", | "compiler_id": "gnu", | ||||
| "c_compiler": "gcc-9", | "c_compiler": "gcc-9", | ||||
| "cxx_compiler": "g++-9", | "cxx_compiler": "g++-9", | ||||
| "flags": [ | |||||
| "-DSPDLOG_COMPILED_LIB", // Required to use a compiled spdlog | |||||
| "-Werror=return-type", | |||||
| // "-fsanitize=address", | |||||
| "warning_flags": [ | |||||
| "-Werror", | |||||
| ], | ], | ||||
| "cxx_flags": [ | "cxx_flags": [ | ||||
| "-fconcepts", | "-fconcepts", | ||||
| "link_flags": [ | "link_flags": [ | ||||
| "-static-libgcc", | "-static-libgcc", | ||||
| "-static-libstdc++" | "-static-libstdc++" | ||||
| // "-fsanitize=address", | |||||
| // "-fuse-ld=lld", | |||||
| ], | ], | ||||
| // "debug": true, | // "debug": true, | ||||
| "optimize": true, | "optimize": true, |
| { | |||||
| "$schema": "../res/toolchain-schema.json", | |||||
| "compiler_id": "gnu", | |||||
| "c_compiler": "gcc-9", | |||||
| "cxx_compiler": "g++-9", | |||||
| "warning_flags": [ | |||||
| "-Werror", | |||||
| ], | |||||
| "cxx_flags": [ | |||||
| "-fconcepts", | |||||
| "-std=c++2a", | |||||
| ], | |||||
| "link_flags": [ | |||||
| "-static-libgcc", | |||||
| "-static-libstdc++" | |||||
| ], | |||||
| // "debug": true, | |||||
| "optimize": true, | |||||
| "compiler_launcher": "ccache" | |||||
| } |
| "$schema": "../res/toolchain-schema.json", | "$schema": "../res/toolchain-schema.json", | ||||
| "compiler_id": "msvc", | "compiler_id": "msvc", | ||||
| "flags": [ | "flags": [ | ||||
| "/Zc:preprocessor", // Required for range-v3 | |||||
| "/DSPDLOG_COMPILED_LIB", // Required to use spdlog as a compiled lib | |||||
| "/Zc:preprocessor", | |||||
| "/std:c++latest", | "/std:c++latest", | ||||
| ], | ], | ||||
| "link_flags": [ | "link_flags": [ |
| { | |||||
| "$schema": "../res/toolchain-schema.json", | |||||
| "compiler_id": "msvc", | |||||
| "flags": [ | |||||
| "/Zc:preprocessor", | |||||
| "/std:c++latest", | |||||
| ], | |||||
| "link_flags": [ | |||||
| "rpcrt4.lib", | |||||
| ], | |||||
| // "debug": true, | |||||
| "optimize": true | |||||
| } |