def build_filename(
    name: str, suffix: str = "", prefix: str = "", max_length: int = 128
) -> str:
    """
    >>> build_filename("name")
    'name'
    >>> build_filename("name", "suffix", "prefix")
    'prefix-name-suffix'
    >>> build_filename("loooooooong_nameeeeee", "suffix", max_length=20)
    'loooooooo-suffix'
    """
    return "-".join(
        filter(
            None, [prefix, name[: max_length - len(suffix) - len(prefix) - 5], suffix]
        )
    )