| echo "Specify a target name to execute" | echo "Specify a target name to execute" | ||||
| exit 1 | exit 1 | ||||
| clean: | |||||
| rm -f -r -- $(shell find -name __pycache__ -type d) | |||||
| rm -f -r -- _build/ _prebuilt/ | |||||
| docs: | docs: | ||||
| sphinx-build -b html \ | sphinx-build -b html \ | ||||
| docs \ | docs \ | ||||
| --reload-delay 300 \ | --reload-delay 300 \ | ||||
| --watch **/*.html | --watch **/*.html | ||||
| macos-ci: nix-ci | |||||
| linux-ci: nix-ci | |||||
| macos-ci: | |||||
| python3 -u tools/ci.py \ | |||||
| -B download \ | |||||
| -T tools/gcc-9.jsonc \ | |||||
| -T2 tools/gcc-9.next.jsonc \ | |||||
| linux-ci: | |||||
| python3 -u tools/ci.py \ | |||||
| -B download \ | |||||
| -T tools/gcc-9.jsonc \ | |||||
| -T2 tools/gcc-9-static.jsonc | |||||
| nix-ci: | nix-ci: | ||||
| python3 -u tools/ci.py \ | python3 -u tools/ci.py \ | ||||
| cd /vagrant && \ | cd /vagrant && \ | ||||
| python3.7 tools/ci.py \ | python3.7 tools/ci.py \ | ||||
| -B download \ | -B download \ | ||||
| -T tools/freebsd-gcc-9.jsonc \ | |||||
| -T tools/freebsd-gcc-9.jsonc \ | |||||
| -T2 tools/freebsd-gcc-9.next.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 |
| 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 || exit 1 | |||||
| python -u tools/ci.py -B download -T tools\msvc.jsonc -T2 tools\msvc.next.jsonc || exit 1 | |||||
| displayName: Full CI | displayName: Full CI | ||||
| - publish: _build/dds.exe | - publish: _build/dds.exe | ||||
| artifact: DDS Executable - Windows VS2019 | artifact: DDS Executable - Windows VS2019 |
| 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: | ||||
| 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) | |||||
| opts = CIOptions(toolchain=args.toolchain, toolchain_2=args.toolchain_2) | |||||
| if args.bootstrap_with == 'build': | if args.bootstrap_with == 'build': | ||||
| _do_bootstrap_build(opts) | _do_bootstrap_build(opts) | ||||
| print('Bootstrapping myself:') | print('Bootstrapping myself:') | ||||
| new_cat_path = paths.BUILD_DIR / 'catalog.db' | new_cat_path = paths.BUILD_DIR / 'catalog.db' | ||||
| new_repo_dir = paths.BUILD_DIR / 'ci-repo' | |||||
| self_build( | self_build( | ||||
| paths.CUR_BUILT_DDS, | paths.CUR_BUILT_DDS, | ||||
| toolchain=opts.toolchain, | |||||
| toolchain=opts.toolchain_2, | |||||
| cat_path=new_cat_path, | cat_path=new_cat_path, | ||||
| dds_flags=[f'--repo-dir={ci_repo_dir}']) | |||||
| dds_flags=[f'--repo-dir={new_repo_dir}']) | |||||
| print('Bootstrap test PASSED!') | print('Bootstrap test PASSED!') | ||||
| return pytest.main([ | return pytest.main([ |
| "compiler_id": "gnu", | "compiler_id": "gnu", | ||||
| "c_compiler": "gcc9", | "c_compiler": "gcc9", | ||||
| "cxx_compiler": "g++9", | "cxx_compiler": "g++9", | ||||
| // "cxx_version": "c++17", | |||||
| "flags": [ | "flags": [ | ||||
| "-DSPDLOG_COMPILED_LIB", // Required to use a compiled spdlog | "-DSPDLOG_COMPILED_LIB", // Required to use a compiled spdlog | ||||
| "-Werror=return-type", | "-Werror=return-type", |
| { | |||||
| "$schema": "../res/toolchain-schema.json", | |||||
| "compiler_id": "gnu", | |||||
| "c_compiler": "gcc9", | |||||
| "cxx_compiler": "g++9", | |||||
| "flags": [ | |||||
| "-Werror=return-type", | |||||
| ], | |||||
| "cxx_flags": [ | |||||
| "-fconcepts", | |||||
| "-std=c++2a", | |||||
| ], | |||||
| "link_flags": [ | |||||
| "-static-libgcc", | |||||
| "-static-libstdc++", | |||||
| ], | |||||
| // "debug": true, | |||||
| "optimize": true, | |||||
| "compiler_launcher": "ccache" | |||||
| } |
| { | |||||
| "$schema": "../res/toolchain-schema.json", | |||||
| "compiler_id": "gnu", | |||||
| "c_compiler": "gcc-9", | |||||
| "cxx_compiler": "g++-9", | |||||
| "flags": [ | |||||
| "-Werror=return-type", | |||||
| ], | |||||
| "cxx_flags": [ | |||||
| "-fconcepts", | |||||
| "-std=c++2a", | |||||
| ], | |||||
| "link_flags": [ | |||||
| "-static", | |||||
| ], | |||||
| // "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", | ||||
| // "cxx_version": "c++17", | |||||
| "flags": [ | "flags": [ | ||||
| "-DSPDLOG_COMPILED_LIB", // Required to use a compiled spdlog | "-DSPDLOG_COMPILED_LIB", // Required to use a compiled spdlog | ||||
| "-Werror=return-type", | "-Werror=return-type", | ||||
| // "-fsanitize=address", | |||||
| ], | ], | ||||
| "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", | |||||
| "flags": [ | |||||
| "-Werror=return-type", | |||||
| "-fsanitize=address", | |||||
| ], | |||||
| "cxx_flags": [ | |||||
| "-fconcepts", | |||||
| "-std=c++2a", | |||||
| ], | |||||
| "link_flags": [ | |||||
| // "-static-libgcc", | |||||
| // "-static-libstdc++" | |||||
| "-fsanitize=address", | |||||
| "-fuse-ld=lld", | |||||
| ], | |||||
| "debug": true, | |||||
| // "optimize": true, | |||||
| "compiler_launcher": "ccache" | |||||
| } |
| { | |||||
| "$schema": "../res/toolchain-schema.json", | |||||
| "compiler_id": "msvc", | |||||
| "flags": [ | |||||
| "/Zc:preprocessor", // Required for range-v3 | |||||
| "/std:c++latest", | |||||
| ], | |||||
| "link_flags": [ | |||||
| "rpcrt4.lib", | |||||
| ], | |||||
| // "debug": true, | |||||
| "optimize": true | |||||
| } |