Deletes all the build information of the recipe. If arch is not None, only this arch dir is deleted. Otherwise (the default) all builds for all archs are deleted. By default, this just deletes the main build dir. If the recipe has e.g. object files biglinked, or .so
(self, arch=None)
| 637 | self.unpack(arch) |
| 638 | |
| 639 | def clean_build(self, arch=None): |
| 640 | '''Deletes all the build information of the recipe. |
| 641 | |
| 642 | If arch is not None, only this arch dir is deleted. Otherwise |
| 643 | (the default) all builds for all archs are deleted. |
| 644 | |
| 645 | By default, this just deletes the main build dir. If the |
| 646 | recipe has e.g. object files biglinked, or .so files stored |
| 647 | elsewhere, you should override this method. |
| 648 | |
| 649 | This method is intended for testing purposes, it may have |
| 650 | strange results. Rebuild everything if this seems to happen. |
| 651 | |
| 652 | ''' |
| 653 | if arch is None: |
| 654 | base_dir = join(self.ctx.build_dir, 'other_builds', self.name) |
| 655 | else: |
| 656 | base_dir = self.get_build_container_dir(arch) |
| 657 | dirs = glob.glob(base_dir + '-*') |
| 658 | if exists(base_dir): |
| 659 | dirs.append(base_dir) |
| 660 | if not dirs: |
| 661 | warning('Attempted to clean build for {} but found no existing ' |
| 662 | 'build dirs'.format(self.name)) |
| 663 | |
| 664 | for directory in dirs: |
| 665 | rmdir(directory) |
| 666 | |
| 667 | # Delete any Python distributions to ensure the recipe build |
| 668 | # doesn't persist in site-packages |
| 669 | rmdir(self.ctx.python_installs_dir) |
| 670 | |
| 671 | def install_libs(self, arch, *libs): |
| 672 | libs_dir = self.ctx.get_libs_dir(arch.arch) |
no test coverage detected