def compress(directory: str, destination: str) -> subprocess.CompletedProcess:
    """Compress the given directory into the tarfile at destination."""
    # Note: we don't use the stdlib's "tarfile" module for performance reasons.
    # While it can handle creating tarfiles, its not as efficient on large
    # numbers of files like the tar command.
    return shell.run(
        [
            "tar",
            "--create",
            f"--directory={directory}",
            f"--file={destination}",
            # Treat a colon in the filename as part of the filename,
            # not an indication of a remote file. This is required in order to
            # handle canonical filenames on Windows.
            "--force-local",
            "--gzip",
            "--verbose",
            ".",
        ],
        hide_output=False,
    )