Changeset 259863 in webkit
- Timestamp:
- Apr 10, 2020, 4:04:47 AM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
flatpak/flatpakutils.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r259862 r259863 1 2020-04-10 Philippe Normand <pnormand@igalia.com> 2 3 [Flatpak SDK] Generate one IceCC archive per toolchain 4 https://bugs.webkit.org/show_bug.cgi?id=210189 5 6 Reviewed by Žan Doberšek. 7 8 Add a utility option to webkit-flatpak so it regenerated 9 toolchains without needing a full SDK reinstall. Also we now 10 generate a self-contained toolchain archive embedding GCC and one 11 embedding CLang. 12 13 * flatpak/flatpakutils.py: 14 (WebkitFlatpak.load_from_args): 15 (WebkitFlatpak.__init__): 16 (WebkitFlatpak.run_in_sandbox): 17 (WebkitFlatpak.setup_icecc): 18 (WebkitFlatpak.setup_dev_env): 19 1 20 2020-04-10 Philippe Normand <pnormand@igalia.com> 2 21 -
trunk/Tools/flatpak/flatpakutils.py
r259862 r259863 394 394 general.add_argument('--available', action='store_true', dest="check_available", help='Check if required dependencies are available.'), 395 395 general.add_argument("--use-icecream", dest="use_icecream", help="Use the distributed icecream (icecc) compiler.", action="store_true") 396 general.add_argument("-r", "--regenerate-toolchains", dest="regenerate_toolchains", action="store_true", 397 help="Regenerate IceCC distribuable toolchain archives") 396 398 397 399 debugoptions = parser.add_argument_group("Debugging") … … 445 447 446 448 self.use_icecream = False 447 self.icc_version = None 449 self.icc_version = {} 450 self.regenerate_toolchains = False 448 451 449 452 def execute_command(self, args, stdout=None, stderr=None): … … 486 489 self.flatpak_build_path = os.environ["FLATPAK_USER_DIR"] 487 490 488 build_root = os.path.join(self.source_root, 'WebKitBuild')489 self.build_path = os.path.join( build_root, self.platform, self.build_type)491 self.build_root = os.path.join(self.source_root, 'WebKitBuild') 492 self.build_path = os.path.join(self.build_root, self.platform, self.build_type) 490 493 self.config_file = os.path.join(self.flatpak_build_path, 'webkit_flatpak_config.json') 491 494 … … 536 539 537 540 gst_builddir = os.path.join(self.sandbox_source_root, "WebKitBuild", 'gst-build') 538 if not os.path.exists(os.path.join(self. source_root, 'WebKitBuild', 'gst-build', 'build.ninja')):541 if not os.path.exists(os.path.join(self.build_root, 'gst-build', 'build.ninja')): 539 542 if not building: 540 543 raise RuntimeError('Trying to enter gst-build env from %s but it is not built, make sure to rebuild webkit.' % gst_dir) … … 688 691 flatpak_command.append(share_network_option) 689 692 690 if self.use_icecream :693 if self.use_icecream and not self.regenerate_toolchains: 691 694 _log.debug('Enabling the icecream compiler') 692 695 if share_network_option not in flatpak_command: … … 696 699 n_cores = multiprocessing.cpu_count() * 3 697 700 _log.debug('Following icecream recommendation for the number of cores to use: %d' % n_cores) 701 toolchain_name = os.environ.get("CC", "gcc") 702 toolchain_path = self.icc_version[toolchain_name] 703 if not os.path.isfile(toolchain_path): 704 Console.error_message("%s is not a valid IceCC toolchain. Please run webkit-flatpak -r") 705 return 1 698 706 forwarded.update({ 699 707 "CCACHE_PREFIX": "icecc", 700 "ICECC_VERSION": self.icc_version,708 "ICECC_VERSION": toolchain_path, 701 709 "NUMBER_OF_PROCESSORS": n_cores, 702 710 }) … … 758 766 json.dump(json_config, config) 759 767 760 def setup_icecc(self ):768 def setup_icecc(self, name): 761 769 with tempfile.NamedTemporaryFile() as tmpfile: 762 self.run_in_sandbox('icecc', '--build-native', stdout=tmpfile, cwd=self.source_root) 770 toolchain_path = "/usr/bin/%s" % name 771 self.run_in_sandbox('icecc', '--build-native', toolchain_path, stdout=tmpfile, cwd=self.source_root) 763 772 tmpfile.flush() 764 773 tmpfile.seek(0) 765 774 icc_version_filename, = re.findall(r'.*creating (.*)', tmpfile.read()) 766 self.icc_version = os.path.join(self.source_root, icc_version_filename) 775 toolchains_directory = os.path.join(self.build_root, "Toolchains") 776 if not os.path.isdir(toolchains_directory): 777 os.makedirs(toolchains_directory) 778 archive_filename = os.path.join(toolchains_directory, "webkit-sdk-%s-%s" % (name, icc_version_filename)) 779 os.rename(icc_version_filename, archive_filename) 780 self.icc_version[name] = archive_filename 781 Console.message("Created %s self-contained toolchain archive", archive_filename) 767 782 768 783 def setup_dev_env(self): 769 784 if not os.path.exists(os.path.join(self.flatpak_build_path, "runtime", "org.webkit.Sdk")) or self.update: 770 785 self.install_all() 771 if self.use_icecream: 772 self.setup_icecc() 786 regenerate_toolchains = True 787 else: 788 regenerate_toolchains = self.regenerate_toolchains 789 790 if regenerate_toolchains: 791 self.icc_version = {} 792 self.setup_icecc("gcc") 793 self.setup_icecc("clang") 773 794 self.save_config() 774 795
Note:
See TracChangeset
for help on using the changeset viewer.