Changeset 261607 in webkit
- Timestamp:
- May 13, 2020 1:57:55 AM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r261605 r261607 1 2020-05-13 Philippe Normand <pnormand@igalia.com> 2 3 [Flatpak SDK] Craft a custom sccache config file from SDK toolchains 4 https://bugs.webkit.org/show_bug.cgi?id=211781 5 6 Reviewed by Carlos Alberto Lopez Perez. 7 8 Optionally generate a sccache config file and use it when building WebKit. 9 10 * Scripts/webkitpy/thirdparty/__init__.py: 11 (AutoinstallImportHook.find_module): 12 (AutoinstallImportHook._install_toml): 13 * flatpak/flatpakutils.py: 14 (WebkitFlatpak.load_from_args): 15 (WebkitFlatpak.__init__): 16 (WebkitFlatpak.clean_args): 17 (WebkitFlatpak.host_path_to_sandbox_path): 18 (WebkitFlatpak.run_in_sandbox): 19 (WebkitFlatpak.main): 20 (WebkitFlatpak.save_config): 21 (WebkitFlatpak): 22 (WebkitFlatpak.pack_toolchain): 23 (WebkitFlatpak.setup_icecc): Deleted. 24 1 25 2020-05-13 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> 2 26 -
trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py
r260657 r261607 129 129 elif '.html5lib' in fullname: 130 130 self._install_html5lib() 131 elif '.toml' in fullname: 132 self._install_toml() 131 133 132 134 def _install_six(self): … … 324 326 self.install_binary(full_firefox_url, 'geckodriver') 325 327 328 def _install_toml(self): 329 toml_dir = self._fs.join(_AUTOINSTALLED_DIR, "toml") 330 installer = AutoInstaller(prepend_to_search_path=True, target_dir=toml_dir) 331 installer.install(url="https://files.pythonhosted.org/packages/b9/19/5cbd78eac8b1783671c40e34bb0fa83133a06d340a38b55c645076d40094/toml-0.10.0.tar.gz", url_subpath="toml-0.10.0/toml") 332 326 333 def _install(self, url, url_subpath=None, target_name=None): 327 334 installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR) -
trunk/Tools/flatpak/flatpakutils.py
r261605 r261607 38 38 from webkitpy.port.factory import PortFactory 39 39 from webkitpy.common.system.logutils import configure_logging 40 import webkitpy.thirdparty.autoinstalled.toml 41 import toml 40 42 41 43 try: … … 418 420 dest="user_command") 419 421 general.add_argument('--available', action='store_true', dest="check_available", help='Check if required dependencies are available.'), 420 general.add_argument("--use-icecream", dest="use_icecream", help="Use the distributed icecream (icecc) compiler.", action="store_true") 421 general.add_argument("-r", "--regenerate-toolchains", dest="regenerate_toolchains", action="store_true", 422 general.add_argument("--repo", help="Filesystem absolute path to the Flatpak repository to use", dest="user_repo") 423 424 distributed_build_options = parser.add_argument_group("Distributed building") 425 distributed_build_options.add_argument("--use-icecream", dest="use_icecream", help="Use the distributed icecream (icecc) compiler.", action="store_true") 426 distributed_build_options.add_argument("-r", "--regenerate-toolchains", dest="regenerate_toolchains", action="store_true", 422 427 help="Regenerate IceCC distribuable toolchain archives") 423 general.add_argument("--repo", help="Filesystem absolute path to the Flatpak repository to use", dest="user_repo") 428 distributed_build_options.add_argument("-t", "--sccache-token", dest="sccache_token", 429 help="sccache authentication token") 430 distributed_build_options.add_argument("-s", "--sccache-scheduler", dest="sccache_scheduler", default='https://sccache.igalia.com', 431 help="sccache scheduler URL") 424 432 425 433 debugoptions = parser.add_argument_group("Debugging") … … 476 484 self.icc_version = {} 477 485 self.regenerate_toolchains = False 486 self.sccache_token = "" 487 self.sccache_scheduler = "" 478 488 479 489 def execute_command(self, args, stdout=None, stderr=None): … … 521 531 self.build_path = os.path.join(self.build_root, self.platform, self.build_type) 522 532 self.config_file = os.path.join(self.flatpak_build_path, 'webkit_flatpak_config.json') 533 self.sccache_config_file = os.path.join(self.flatpak_build_path, 'sccache.toml') 523 534 524 535 Console.quiet = self.quiet … … 607 618 return True 608 619 return False 620 621 def host_path_to_sandbox_path(self, host_path): 622 # For now this supports only files in the WebKit path 623 return host_path.replace(self.source_root, self.sandbox_source_root) 609 624 610 625 def run_in_sandbox(self, *args, **kwargs): … … 769 784 flatpak_command.append(share_network_option) 770 785 786 if os.path.isfile(self.sccache_config_file) and not self.regenerate_toolchains and "SCCACHE_CONF" not in os.environ.keys(): 787 sandbox_environment["SCCACHE_CONF"] = self.host_path_to_sandbox_path(self.sccache_config_file) 788 771 789 override_sccache_server_port = os.environ.get("WEBKIT_SCCACHE_SERVER_PORT") 772 790 if override_sccache_server_port: … … 837 855 if regenerate_toolchains: 838 856 self.icc_version = {} 839 self.setup_icecc("gcc", "g++")840 self.setup_icecc("clang", "clang++")841 self.save_config( )857 toolchains = self.pack_toolchain(("gcc", "g++"), {"/usr/bin/c++": "/usr/bin/g++"}) 858 toolchains.extend(self.pack_toolchain(("clang", "clang++"), {"/usr/bin/clang++": "/usr/bin/clang++"})) 859 self.save_config(toolchains) 842 860 843 861 return self.setup_dev_env() … … 855 873 return os.path.exists(self.flatpak_build_path) 856 874 857 def save_config(self ):875 def save_config(self, toolchains): 858 876 with open(self.config_file, 'w') as config: 859 877 json_config = {'icecc_version': self.icc_version} 860 878 json.dump(json_config, config) 861 879 862 def setup_icecc(self, *compilers): 880 if not self.sccache_token: 881 Console.message("No authentication token provided. Re-run this with the -t option if an sccache token was provided to you. Skipping sccache configuration for now.") 882 return 883 884 with open(self.sccache_config_file, 'w') as config: 885 sccache_config = {'dist': {'scheduler_url': self.sccache_scheduler, 886 'auth': {'type': 'token', 887 'token': self.sccache_token}, 888 'toolchains': toolchains}} 889 toml.dump(sccache_config, config) 890 Console.message("Created %s sccache config file. It will automatically be used when building WebKit", self.sccache_config_file) 891 892 def pack_toolchain(self, compilers, path_mapping): 863 893 with tempfile.NamedTemporaryFile() as tmpfile: 864 894 command = ['icecc', '--build-native'] … … 876 906 Console.message("Created %s self-contained toolchain archive", archive_filename) 877 907 908 sccache_toolchains = [] 909 for (compiler_executable, archive_compiler_executable) in path_mapping.iteritems(): 910 item = {'type': 'path_override', 911 'compiler_executable': compiler_executable, 912 'archive': archive_filename, 913 'archive_compiler_executable': archive_compiler_executable} 914 sccache_toolchains.append(item) 915 return sccache_toolchains 916 878 917 def setup_dev_env(self): 879 918 if not os.path.exists(os.path.join(self.flatpak_build_path, "runtime", "org.webkit.Sdk")) or self.update:
Note: See TracChangeset
for help on using the changeset viewer.