[PATCH] D143344: [bazel] Port zstd support

Geoffrey Martin-Noble via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 16:49:55 PDT 2023


GMNGeoffrey added a comment.

I think tomorrow is fine. For people coming here because they don't have zstd, your options are:

1. Copy the stanza from this WORKSPACE file into your own:

  maybe(
      http_archive,
      name = "llvm_zstd",
      build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
      sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
      strip_prefix = "zstd-1.5.2",
      urls = [
          "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz"
      ],
  )



2. Create an empty `@llvm_ztd//:zstd` library

  cc_library(name = "zstd")

and configure it in the WORKSPACE. For instance, use `local_repository` pointing at a directory containing the BUILD.bazel file and an empty WORKSPACE file, or use `new_local_repository` referencing that BUILD.bazel file and empty workspace file content:

  # WORKSPACE
  local_repository(
    name = "llvm_zstd",
    path = "third_party/zstd",
  )

where that build file with the empty `cc_library` is at third_party/zstd/BUILD.bazel and there's an empty file at third_party/zstd/WORKSPACE

OR

  # WORKSPACE
  new_local_repository(
    name = "llvm_zstd",
    build_file_content="""cc_library(name="zstd")""",
    workspace_file_content="",
    path="<some empty directory. Any empty directory>"
  )

Where you have to actually have some empty directory to point it, which is annoying.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143344/new/

https://reviews.llvm.org/D143344



More information about the llvm-commits mailing list