Return a full path to the build file of `build_module`.

        The returned path will always be OS-native, regardless of the format
        of project_root (native) and build_module (with '/').
511649
def get_build_file_path(self, build_module) -> str:
        
        project_root = Path(self.project_root)
        build_module = norm_proj_path(build_module, '')
        return str(project_root / build_module /
                   (BUILD_PROJ_FILE if '' == build_module
                    else self.build_file_name))
54150
function getLogPath(rootPath, buildPath, logPath) {
    let result = logPath || path.join(buildPath, 'logs');

    if (!path.isAbsolute(result)) {
        result = path.resolve(rootPath, result);
    }

    return result;
}
85299
private function get_absolute_path( $path, $module_type = false ) {
            $module_root_dir = $this->get_module_root_dir_path( $module_type );
            if ( 0 !== strpos( $path, $module_root_dir ) ) {
                $path = fs_normalize_path( $module_root_dir . $path );
            }

            return $path;
        }
1102604
def build_from_path(package, path, dry_run=False, env='default', outfilename=DEFAULT_BUILDFILE):
    
    team, owner, pkg, subpath = parse_package(package, allow_subpath=True)

    if not os.path.exists(path):
        raise CommandException("%s does not exist." % path)

    try:
        if os.path.isdir(path):
            buildpath = os.path.join(path, outfilename)
            if os.path.exists(buildpath):
                raise CommandException(
                    "Build file already exists. Run `quilt build %r` instead." % buildpath
                )

            contents = generate_contents(path, outfilename)
            build_package_from_contents(team, owner, pkg, subpath, path, contents, dry_run=dry_run, env=env)
        else:
            build_package(team, owner, pkg, subpath, path, dry_run=dry_run, env=env)

        if not dry_run:
            print("Built %s successfully." % package)
    except BuildException as ex:
        raise CommandException("Failed to build the package: %s" % ex)
1339217
def find_module(self, fullname, path=None):
        
        # path points to the top-level package path if any
        # and we can only import sub-modules/-packages
        if path is None:
            return
        if fullname.startswith(self.module_prefix):
            return self
        else:
            return None
1196110
def _get_distutils_build_directory():
    
    pattern = "lib.{platform}-{major}.{minor}"
    return os.path.join('build', pattern.format(platform=sysconfig.get_platform(),
                                                major=sys.version_info[0],
                                                minor=sys.version_info[1]))
238660
def path(cls, ref):
        
        return osp.join(ref.repo.git_dir, "logs", to_native_path(ref.path))
981684
def path(self):
        
        return "/".join([
            part
            for part in [
                self.version,
                self.qualifier,
            ]
            if part
        ])
1013713
def create_tmp_module_path(module_path)
      fail 'ModulePathNotFound' unless module_path
      path = File.join(tmp_modules_dir, module_dir_name)
      unless File.exist?(path) # only create if it doesn't already exist
        # create a link where source is the current repo and dest is /tmp/modules/module_name
        FileUtils.ln_s(module_path, path)
      end
      path
    end
394019
def local_path(path):
    
    current = os.path.dirname(__file__)
    root = current
    return os.path.abspath(os.path.join(root, path))
1093241
def setup_build_path(build_path):
    
    if os.path.isdir(build_path):
        fname = os.path.join(build_path, 'CMakeCache.txt')
        if os.path.exists(fname):
            sys.stderr.write('aborting setup\n')
            sys.stderr.write(
                'build directory {0} which contains CMakeCache.txt already exists\n'.
                format(build_path))
            sys.stderr.write(
                'remove the build directory and then rerun setup\n')
            sys.exit(1)
    else:
        os.makedirs(build_path, 0o755)
1163589
def full_path(self):
        """"""

        if self.parent:
            return os.path.join(self.parent.full_path, self.name)
        return self.name
1104819
def path (self):
        
        if not self.path_:
            if self.action_:
                p = self.action_.properties ()
                (target_path, relative_to_build_dir) = p.target_path ()

                if relative_to_build_dir:
                    # Indicates that the path is relative to
                    # build dir.
                    target_path = os.path.join (self.project_.build_dir (), target_path)

                # Store the computed path, so that it's not recomputed
                # any more
                self.path_ = target_path

        return os.path.normpath(self.path_)
486364
def local_build(native, *args, **kwargs):
    
    method = 'native_build' if native else 'build'
    logging.debug(_('build type: %s'), method)
    return getattr(Builder(), method)(*args, **kwargs)
1130950
def generate_build_file(startpath, outfilename=DEFAULT_BUILDFILE):
    
    buildfilepath = os.path.join(startpath, outfilename)
    if os.path.exists(buildfilepath):
        raise BuildException("Build file %s already exists." % buildfilepath)

    contents = generate_contents(startpath, outfilename)

    with open(buildfilepath, 'w') as outfile:
        yaml.dump(contents, outfile, default_flow_style=False)
    return buildfilepath
447556
def _get_module_path(name, fail=False, install_path=None):
    
    import imp

    module = imp.find_module(name)
    if not module and fail:
        raise RuntimeError("can't find module '" + name + "'")
    path = module[1]
    if not path and fail:
        raise RuntimeError("module '" + name + "' is missing a file path")
    
    if install_path:
        return os.path.join(install_path, os.path.split(path)[1])

    return path
563558
def to_build_module(build_file_path: str, conf: Config) -> str:
    """"""
    build_file = Path(build_file_path)
    root = Path(conf.project_root)
    return build_file.resolve().relative_to(root).parent.as_posix().strip('.')