MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / copy

Method copy

misc/python/materialize/mzbuild.py:772–804  ·  view source on GitHub ↗
(src: Path, relative_dst: Path)

Source from the content-addressed store, hash-verified

770 )
771
772 def copy(src: Path, relative_dst: Path) -> None:
773 exe_path = self.path / relative_dst
774 exe_path.parent.mkdir(parents=True, exist_ok=True)
775 shutil.copy(src, exe_path)
776
777 if self.strip:
778 # The debug information is large enough that it slows down CI,
779 # since we're packaging these binaries up into Docker images and
780 # shipping them around.
781 spawn.runv(
782 [*self.rd.tool("strip"), "--strip-debug", exe_path],
783 cwd=self.rd.root,
784 )
785 else:
786 # Even if we've been asked not to strip the binary, remove the
787 # `.debug_pubnames` and `.debug_pubtypes` sections. These are just
788 # indexes that speed up launching a debugger against the binary,
789 # and we're happy to have slower debugger start up in exchange for
790 # smaller binaries. Plus the sections have been obsoleted by a
791 # `.debug_names` section in DWARF 5, and so debugger support for
792 # `.debug_pubnames`/`.debug_pubtypes` is minimal anyway.
793 # See: https://github.com/rust-lang/rust/issues/46034
794 spawn.runv(
795 [
796 *self.rd.tool("objcopy"),
797 "-R",
798 ".debug_pubnames",
799 "-R",
800 ".debug_pubtypes",
801 exe_path,
802 ],
803 cwd=self.rd.root,
804 )
805
806 for bin in self.bins:
807 src_path = self.rd.cargo_target_dir() / cargo_profile / bin

Callers 1

runMethod · 0.45

Calls 1

toolMethod · 0.80

Tested by

no test coverage detected