def create_build_context(self, variant, build_type, build_path):
request = variant.get_requires(build_requires=True,<EOL>private_build_requires=True)<EOL>req_strs = list(map(str, request))<EOL>quoted_req_strs = list(map(quote, req_strs))<EOL>self._print("<STR_LIT>", '<STR_LIT:U+0020>'.join(quoted_req_strs))<EOL>if build_type == BuildType.local:<EOL><INDENT>packages_path = self.package.config.packages_path<EOL><DEDENT>else:<EOL><INDENT>packages_path = self.package.config.nonlocal_packages_path<EOL><DEDENT>if self.package.config.is_overridden("<STR_LIT>"):<EOL><INDENT>from rez.package_filter import PackageFilterList<EOL>data = self.package.config.package_filter<EOL>package_filter = PackageFilterList.from_pod(data)<EOL><DEDENT>else:<EOL><INDENT>package_filter = None<EOL><DEDENT>context = ResolvedContext(request,<EOL>package_paths=packages_path,<EOL>package_filter=package_filter,<EOL>building=True)<EOL>if self.verbose:<EOL><INDENT>context.print_info()<EOL><DEDENT>rxt_filepath = os.path.join(build_path, "<STR_LIT>")<EOL>context.save(rxt_filepath)<EOL>if context.status != ResolverStatus.solved:<EOL><INDENT>raise BuildContextResolveError(context)<EOL><DEDENT>return context, rxt_filepath<EOL>
Create a context to build the variant within.