def METHOD_NAME(src):
    if not os.path.isdir(src):
        raise BuildError("Cannot import '{}': not a directory!".format(src))
    try:
        f = io.BytesIO()
        with tarfile.open(fileobj=f, mode="w:xz") as tar:
            # Special handling for MSYS. Symlinks fail if the target does not
            # exist and Python will fall back to create a copy on extraction.
            # To prevent this first everything *except* symlinks is archived
            # and then the symlinks are added.
            symlinks = []
            def filterSymlinks(ti):
                if ti.issym():
                    symlinks.append(ti)
                    return None
                else:
                    return ti
            tar.add(src, arcname=".", filter=filterSymlinks)
            for ti in symlinks:
                tar.addfile(ti)
    except OSError as e:
        raise BuildError("Error gathering files: {}".format(str(e)))
    return base64.b85encode(f.getvalue()).decode('ascii')