Lines Matching +full:- +full:- +full:repo
4 # Copyright (c) 2018-2023 Valve Corporation
5 # Copyright (c) 2018-2023 LunarG, Inc.
6 # Copyright (c) 2023-2023 RasterGrid Kft.
12 # http://www.apache.org/licenses/LICENSE-2.0
24 Get and build dependent repositories using known-good commits.
27 -------
32 repository at a "known-good" commit in order to provide stability in
35 Known-Good JSON Database
36 ------------------------
38 This program expects to find a file named "known-good.json" in the
43 ---------------
45 See the help text (update_deps.py --help) for a complete list of options.
48 -----------------
52 repositories. The user can override this by using the "--dir" option.
60 $ cd My-Repo
65 or, to do the same thing, but using the --dir option:
67 $ cd My-Repo
69 $ scripts/update_deps.py --dir=build
78 $ cd My-Repo
79 $ scripts/update_deps.py --dir=/tmp/deps
85 ------------------------
95 $ git clone git@github.com:My-Group/My-Repo.git
96 $ cd My-Repo
100 $ cmake -C helper.cmake ..
101 $ cmake --build .
104 ----------------
106 There's no formal schema for the "known-good" JSON file, but here is
111 - name
116 - api
120 - url
123 Example: https://github.com/KhronosGroup/Vulkan-Loader.git
125 - sub_dir
130 - build_dir
135 - install_dir
140 - commit
142 The commit used to checkout the repository. This can be a SHA-1
145 - deps (optional)
148 repository name to specify a dependent repo and a "link" to
149 that repo's install artifacts. For example:
154 "repo_name" : "Vulkan-Headers"
158 which represents that this repository depends on the Vulkan-Headers
160 specify the location where it expects to find the Vulkan-Headers install
165 - prebuild (optional)
166 - prebuild_linux (optional) (For Linux and MacOS)
167 - prebuild_windows (optional)
177 - custom_build (optional)
193 {2} returns the CONFIG_MAP value of config e.g. debug -> Debug
195 {0}[Vulkan-Headers][repo_root] returns the repo_root variable from
196 the Vulkan-Headers GoodRepo object.
198 - cmake_options (optional)
202 - ci_only (optional)
205 (case-insensitive) in order for this repo to be fetched and built.
208 - build_step (optional)
214 - build_platforms (optional)
226 ----
230 supported. However, the "top" directory specified with the "--dir"
265 shutil.rmtree function can fail on Windows due to read-only files.
297 # and prints them properly in case there is a non-zero exit code.
316 """Represents a repository at a known-good commit."""
319 """Initializes this good repo object.
322 'json': A fully populated JSON object describing the repo.
353 # Absolute paths for a repo's directories
363 # However, we need to account for cross-compiling.
436 """Execute any prebuild steps from the repo root"""
447 """Execute any custom_build steps from the repo root"""
452 exit(-1)
473 '-DCMAKE_INSTALL_PREFIX=' + self.install_dir
479 cmake_cmd.append('-D{}={}'.format(pieces[0], pieces[1]))
481 # For each repo this repo depends on, generate a CMake variable
483 # repo's install dir.
487 cmake_cmd.append('-D{var_name}={install_dir}'.format(
495 …# Set build config for single-configuration generators (this is a no-op on multi-config generators)
496 cmake_cmd.append(f'-D CMAKE_BUILD_TYPE={CONFIG_MAP[self._args.config]}')
499 # CMAKE_OSX_ARCHITECTURES must be a semi-colon seperated list
501 cmake_cmd.append(f'-D CMAKE_OSX_ARCHITECTURES={cmake_osx_archs}')
503 # Use the CMake -A option to select the platform architecture
507 cmake_cmd.append('-A')
510 cmake_cmd.append('-A')
517 cmake_cmd.extend(['-G', self._args.generator])
522 cmake_cmd.append("--no-warn-unused-cli")
528 …cmake_cmd = ['cmake', '--build', self.build_dir, '--target', 'install', '--config', CONFIG_MAP[sel…
530 cmake_cmd.append('--clean-first')
534 cmake_cmd.append('--parallel')
540 """Build the dependent repo and time how long it took"""
556 total_time = time.time() - start
566 The known-good file is expected to be in the same
578 GoodRepo(repo, args)
579 for repo in json.loads(known_good.read())['repos']
586 The known-good file is expected to be in the same
607 The helper file is intended to be used with 'cmake -C <file>'
608 to build this home repo using the dependencies built by this script.
611 home repo to locate the install dirs of the dependent repos.
612 This information is baked into the CMake files of the home repo and so
613 this dictionary is kept with the repo via the json file.
617 for repo in repos:
618 # If the repo has an API tag and that does not match
620 if repo.api is not None and repo.api != args.api:
622 if install_names and repo.name in install_names and repo.on_build_platform:
625 var=install_names[repo.name],
626 dir=escape(repo.install_dir)))
631 description='Get and build dependent repos at known-good commits')
633 '--known_good_dir',
637 '--dir',
642 '--ref',
647 '--no-build',
654 '--clean',
660 '--clean-repo',
666 '--clean-build',
672 '--clean-install',
678 '--skip-existing-install',
684 '--arch',
691 '--config',
698 '--api',
704 '--generator',
709 '--optional',
712 …help="Comma-separated list of 'optional' resources that may be skipped. Only 'tests' is currently …
715 '--cmake_var',
719 …help="Add CMake command line option -D'VAR'='VALUE' to the CMake generation command line; may be u…
722 '--osx-archs',
742 for repo in repos:
743 # If the repo has an API tag and that does not match
745 if repo.api is not None and repo.api != args.api:
748 # If the repo has a platform whitelist, skip the repo
750 if not repo.on_build_platform:
753 # Skip building the repo if its install directory already exists
757 if args.skip_existing_install and os.path.isdir(repo.install_dir):
758 … print('Skipping build for repo {n} due to existing install directory'.format(n=repo.name))
761 # Skip test-only repos if the --tests option was not passed in
762 if repo.IsOptional(args.optional):
781 repo_dict[repo.name] = {field: getattr(repo, field) for field in field_list}
783 # If the repo has a CI whitelist, skip the repo unless
785 if len(repo.ci_only):
787 for env in repo.ci_only:
797 repo.Checkout()
800 if args.do_build and repo.build_step != 'skip':
801 repo.Build(repos, repo_dict)