Ejemplo n.º 1
0
Archivo: Build.py Proyecto: aosm/distcc
    def build(self, sum):
        """Actually build the package."""

        build_log = os.path.join(self.log_dir, "bench-build.log")
        prebuild_log = os.path.join(self.log_dir, "bench-prebuild.log")

        distcc_log = os.path.join(self.log_dir, "bench-build-distcc.log")

        rm_files((build_log, distcc_log))

        print "** Building..."
        if self.project.pre_build_cmd:
            cmd = ("cd %s && %s > %s 2>&1" % (self.build_dir,
                                              self.project.pre_build_cmd,
                                              prebuild_log))
            run_cmd(cmd)
            
        cmd = ("cd %s && \\\n%s \\\nDISTCC_LOG='%s' \\\nCC='%s' \\\nCXX='%s' \\\n%s \\\n>%s 2>&1" % 
               (self.build_dir, self.project.build_cmd, distcc_log,
                self.compiler.cc,
                self.compiler.cxx,
                self.compiler.make_opts,
                build_log))
        result, elapsed = run_cmd(cmd)
        return elapsed
Ejemplo n.º 2
0
    def build(self):
        """Actually build the package."""

        build_log = os.path.join(self.log_dir, "bench-build.log")
        prebuild_log = os.path.join(self.log_dir, "bench-prebuild.log")

        distcc_log = os.path.join(self.log_dir, "bench-build-distcc.log")

        rm_files((build_log, distcc_log))

        make_dir(self.build_dir)
        print "** Building..."
        if self.project.pre_build_cmd:
            cmd = ("cd %s && %s > %s 2>&1" %
                   (self.build_dir, self.project.pre_build_cmd, prebuild_log))
            self._run_cmd_with_redirect_farm(cmd)
        distcc_hosts = buildutil.tweak_hosts(os.getenv("DISTCC_HOSTS"),
                                             self.compiler.num_hosts,
                                             self.compiler.host_opts)
        # We use built-in 'time' to measure real, system, and user time.  To
        # allow its stderr to be grabbed, the time command is executed in a
        # subshell.
        cmd = ("cd %s && \\\n"
               "(time -p \\\n"
               "DISTCC_HOSTS='%s' \\\n"
               "INCLUDE_SERVER_ARGS='-t --unsafe_absolute_includes %s' \\\n"
               "%s%s \\\nDISTCC_LOG='%s' \\\nCC='%s' \\\nCXX='%s' "
               "\\\n%s)"
               "\\\n>%s 2>&1" %
               (self.build_dir, distcc_hosts, self.project.include_server_args,
                self.compiler.pump_cmd, self.project.build_cmd, distcc_log,
                self.compiler.cc, self.compiler.cxx, self.compiler.make_opts,
                build_log))
        result, unused_elapsed = self._run_cmd_with_redirect_farm(cmd)
        return (result, Build._extract_time_info(build_log))
Ejemplo n.º 3
0
    def configure(self, compiler):
        """Run configuration command for this tree, if any."""
        self.compiler = compiler

        make_dir(self.log_dir)

        configure_log = os.path.join(self.log_dir, "bench-configure.log")
        distcc_log = os.path.join(self.log_dir, "bench-configure-distcc.log")

        rm_files((configure_log, distcc_log))

        print "** Configuring..."
        run_cmd(
            "cd %s && \\\nDISTCC_LOG='%s' \\\nCC='%s' \\\nCXX='%s' \\\n%s \\\n>%s 2>&1"
            % (self.build_dir, distcc_log, self.compiler.cc, self.compiler.cxx,
               self.project.configure_cmd, configure_log))
Ejemplo n.º 4
0
Archivo: Build.py Proyecto: aosm/distcc
    def configure(self, compiler):
        """Run configuration command for this tree, if any."""
        self.compiler = compiler

        make_dir(self.log_dir)

        configure_log = os.path.join(self.log_dir, "bench-configure.log")
        distcc_log = os.path.join(self.log_dir, "bench-configure-distcc.log")

        rm_files((configure_log, distcc_log))

        print "** Configuring..."
        run_cmd("cd %s && \\\nDISTCC_LOG='%s' \\\nCC='%s' \\\nCXX='%s' \\\n%s \\\n>%s 2>&1" %
                (self.build_dir, distcc_log, self.compiler.cc,
                 self.compiler.cxx,
                 self.project.configure_cmd, configure_log))
Ejemplo n.º 5
0
    def configure(self):
        """Run configuration command for this tree, if any."""
        make_dir(self.log_dir)

        configure_log = os.path.join(self.log_dir, "bench-configure.log")
        distcc_log = os.path.join(self.log_dir, "bench-configure-distcc.log")

        rm_files((configure_log, distcc_log, self.configure_done))

        make_dir(self.build_dir)
        print "** Configuring..."
        cmd = ("cd %s && \\\nDISTCC_LOG='%s' \\\nCC='%s' \\\nCXX='%s' \\\n%s \\\n>%s 2>&1"
               % (self.build_dir, distcc_log,
                  self.compiler.cc, self.compiler.cxx,
                  self.project.configure_cmd, configure_log))
        self._run_cmd_with_redirect_farm(cmd)
        # Touch a file if the configure was successfully done, so we know.
        open(self.configure_done, 'w').close()
Ejemplo n.º 6
0
    def configure(self):
        """Run configuration command for this tree, if any."""
        make_dir(self.log_dir)

        configure_log = os.path.join(self.log_dir, "bench-configure.log")
        distcc_log = os.path.join(self.log_dir, "bench-configure-distcc.log")

        rm_files((configure_log, distcc_log, self.configure_done))

        make_dir(self.build_dir)
        print "** Configuring..."
        cmd = (
            "cd %s && \\\nDISTCC_LOG='%s' \\\nCC='%s' \\\nCXX='%s' \\\n%s \\\n>%s 2>&1"
            % (self.build_dir, distcc_log, self.compiler.cc, self.compiler.cxx,
               self.project.configure_cmd, configure_log))
        self._run_cmd_with_redirect_farm(cmd)
        # Touch a file if the configure was successfully done, so we know.
        open(self.configure_done, 'w').close()
Ejemplo n.º 7
0
    def build(self):
        """Actually build the package."""

        build_log = os.path.join(self.log_dir, "bench-build.log")
        prebuild_log = os.path.join(self.log_dir, "bench-prebuild.log")

        distcc_log = os.path.join(self.log_dir, "bench-build-distcc.log")

        rm_files((build_log, distcc_log))

        make_dir(self.build_dir)
        print "** Building..."
        if self.project.pre_build_cmd:
            cmd = ("cd %s && %s > %s 2>&1" % (self.build_dir,
                                              self.project.pre_build_cmd,
                                              prebuild_log))
            self._run_cmd_with_redirect_farm(cmd)
        distcc_hosts = buildutil.tweak_hosts(os.getenv("DISTCC_HOSTS"),
                                             self.compiler.num_hosts,
                                             self.compiler.host_opts)
        # We use built-in 'time' to measure real, system, and user time.  To
        # allow its stderr to be grabbed, the time command is executed in a
        # subshell.
        cmd = ("cd %s && \\\n"
               "(time -p \\\n"
               "DISTCC_HOSTS='%s' \\\n"
               "INCLUDE_SERVER_ARGS='-t --unsafe_absolute_includes %s' \\\n"
               "%s%s \\\nDISTCC_LOG='%s' \\\nCC='%s' \\\nCXX='%s' "
               "\\\n%s)"
               "\\\n>%s 2>&1"
               %
               (self.build_dir,
                distcc_hosts,
                self.project.include_server_args,
                self.compiler.pump_cmd,
                self.project.build_cmd,
                distcc_log,
                self.compiler.cc,
                self.compiler.cxx,
                self.compiler.make_opts,
                build_log))
        result, unused_elapsed = self._run_cmd_with_redirect_farm(cmd)
        return (result, Build._extract_time_info(build_log))
Ejemplo n.º 8
0
    def build(self, sum):
        """Actually build the package."""

        build_log = os.path.join(self.log_dir, "bench-build.log")
        prebuild_log = os.path.join(self.log_dir, "bench-prebuild.log")

        distcc_log = os.path.join(self.log_dir, "bench-build-distcc.log")

        rm_files((build_log, distcc_log))

        print "** Building..."
        if self.project.pre_build_cmd:
            cmd = ("cd %s && %s > %s 2>&1" %
                   (self.build_dir, self.project.pre_build_cmd, prebuild_log))
            run_cmd(cmd)

        cmd = (
            "cd %s && \\\n%s \\\nDISTCC_LOG='%s' \\\nCC='%s' \\\nCXX='%s' \\\n%s \\\n>%s 2>&1"
            % (self.build_dir, self.project.build_cmd, distcc_log,
               self.compiler.cc, self.compiler.cxx, self.compiler.make_opts,
               build_log))
        result, elapsed = run_cmd(cmd)
        return elapsed
Ejemplo n.º 9
0
 def scrub(self):
     print "** Removing build directory"
     rm_files((self.configure_done, ))
     run_cmd("rm -rf %s" % self.unpacked_dir)
Ejemplo n.º 10
0
 def scrub(self):
     print "** Removing build directory"
     rm_files((self.configure_done, ))
     run_cmd("rm -rf %s" % self.unpacked_dir)