def compile(self): emerge_in_chroot = uchroot.uchroot()["/usr/bin/emerge"] prog = self.DOMAIN + "/" + str(self.NAME)[len(self.DOMAIN) + 1:] with local.env(CONFIG_PROTECT="-*"): emerge_in_chroot("--autounmask-only=y", "--autounmask-write=y", prog, retcode=None) uchroot.uretry(emerge_in_chroot[prog])
def compile(self): emerge_in_chroot = uchroot.uchroot()["/usr/bin/emerge"] prog = self.DOMAIN + "/" + str(self.NAME)[len(self.DOMAIN) + 1:] with local.env(CONFIG_PROTECT="-*"): emerge_in_chroot( "--autounmask-only=y", "--autounmask-write=y", prog, retcode=None) uchroot.uretry(emerge_in_chroot[prog])
def __upgrade_from_source(venv_dir, with_deps=True): LOG.debug("Upgrading from source") uchrt_cmd = uchroot.clean_env(uchroot.uchroot(), ['HOME']) opts = ["--upgrade"] if not with_deps: opts.append("--no-deps") uchrt_cmd = uchrt_cmd[venv_dir / "bin" / "pip3", "install"] uchrt_cmd = uchrt_cmd[opts] uchrt_cmd = uchrt_cmd["/mnt/benchbuild"] uchroot.uretry(uchrt_cmd)
def mkdir_uchroot(dirpath, root="."): """ Create a file inside a uchroot env. You will want to use this when you need to create a file with apropriate rights inside a uchroot container with subuid/subgid handling enabled. Args: dirpath: The dirpath that should be created. Absolute inside the uchroot container. root: The root PATH of the container filesystem as seen outside of the container. """ from benchbuild.utils.uchroot import no_args, uretry uchroot = no_args() uchroot = uchroot["-E", "-A", "-C", "-w", "/", "-r"] uchroot = uchroot[os.path.abspath(root)] uretry(uchroot["--", "/bin/mkdir", "-p", dirpath])
def __upgrade_from_pip(venv_dir): LOG.debug("Upgrading from pip") uchrt_cmd = uchroot.clean_env(uchroot.uchroot(), ['HOME']) uchroot.uretry(uchrt_cmd[venv_dir / "bin" / "pip3", "install", "--upgrade", "benchbuild"])