1
1
mirror of https://github.com/github/semantic.git synced 2024-11-22 23:29:37 +03:00
semantic/WORKSPACE

262 lines
7.0 KiB
Python
Raw Normal View History

2020-06-27 23:21:20 +03:00
# This file defines the workspace for the Semantic monorepo.
# It loads the Haskell compilation rules, describes the packages
# that we use from Stackage, and pins the tree-sitter packages
# so that we can access their node-types.json files.
2020-06-09 20:52:39 +03:00
workspace(name = "semantic")
# Load the repository rule to download an http archive.
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2020-06-27 23:21:20 +03:00
# Load the ability to check out a git repository.
load(
"@bazel_tools//tools/build_defs/repo:git.bzl",
"git_repository",
"new_git_repository",
)
# Download rules_haskell and make it accessible as "@rules_haskell".
#
# Note: the git_repository clause is a workaround until rules_haskell#1349 [1]
# is released. One it's released, revert back to the http_archive clause with
# an updated version.
#
# [1] https://github.com/tweag/rules_haskell/issues/1349
#
# http_archive(
# name = "rules_haskell",
# sha256 = "56a8e6337df8802f1e0e7d2b3d12d12d5d96c929c8daecccc5738a0f41d9c1e4",
# strip_prefix = "rules_haskell-0.12",
# urls = ["https://github.com/tweag/rules_haskell/archive/v0.12.tar.gz"],
# )
git_repository(
2020-06-09 20:52:39 +03:00
name = "rules_haskell",
remote = "https://github.com/tweag/rules_haskell",
commit = "abaec6502a4474f10b3c367fb5e90173ee0e349c",
)
load(
2020-06-09 20:52:39 +03:00
"@rules_haskell//haskell:repositories.bzl",
"rules_haskell_dependencies",
)
# Setup all Bazel dependencies required by rules_haskell.
rules_haskell_dependencies()
load(
2020-06-09 20:52:39 +03:00
"@rules_haskell//haskell:toolchain.bzl",
"rules_haskell_toolchains",
)
# Download a GHC binary distribution from haskell.org and register it as a toolchain.
rules_haskell_toolchains(
locale = "en_US.UTF-8",
version = "8.8.3",
)
load(
"@rules_haskell//haskell:cabal.bzl",
2020-06-09 20:52:39 +03:00
"stack_snapshot",
)
2020-06-27 23:21:20 +03:00
# This call establishes a @stackage repository, and describes what packages
# we use from Stackage. The resolver, as well as the non-Stackage packages
# on which we depend, are specified in stack-snapshot.yaml.
stack_snapshot(
2020-06-09 20:52:39 +03:00
name = "stackage",
local_snapshot = "//:stack-snapshot.yaml",
packages = [
2020-05-19 19:52:01 +03:00
"Glob",
2020-06-10 07:18:25 +03:00
"HUnit",
2020-05-21 22:45:54 +03:00
"QuickCheck",
"aeson",
2020-05-19 19:52:01 +03:00
"aeson-pretty",
"algebraic-graphs",
2020-06-09 21:31:29 +03:00
"ansi-terminal",
2020-06-09 22:03:27 +03:00
"async",
2020-05-19 19:52:01 +03:00
"attoparsec",
2020-07-08 22:35:30 +03:00
"base",
2020-06-10 18:11:33 +03:00
"bazel-runfiles",
2020-06-09 21:31:29 +03:00
"bifunctors",
2020-07-08 22:35:30 +03:00
"bytestring",
"containers",
"deepseq",
2020-05-19 19:52:01 +03:00
"directory",
2020-06-09 21:31:29 +03:00
"directory-tree",
2020-05-21 22:24:16 +03:00
"doctest",
2020-07-08 22:35:30 +03:00
"filepath",
2020-06-27 20:42:43 +03:00
"foldl",
2020-05-19 19:52:01 +03:00
"fused-effects",
2020-06-09 21:31:29 +03:00
"fused-effects-exceptions",
2020-05-19 19:52:01 +03:00
"fused-effects-readline",
"fused-syntax",
2020-07-01 09:17:39 +03:00
"gauge",
2020-05-19 20:07:33 +03:00
"generic-lens",
"generic-monoid",
"haskeline",
"hashable",
2020-07-08 22:35:30 +03:00
"haskeline",
2020-05-19 19:52:01 +03:00
"hedgehog",
2020-06-09 21:31:29 +03:00
"hostname",
"hscolour",
2020-06-10 07:18:25 +03:00
"hspec",
"hspec-core",
"hspec-expectations",
2020-05-19 20:07:33 +03:00
"lens",
2020-06-09 21:31:29 +03:00
"network",
"network-uri",
2020-05-19 19:52:01 +03:00
"optparse-applicative",
2020-06-09 21:31:29 +03:00
"parallel",
2020-05-19 20:00:56 +03:00
"parsers",
2020-06-09 20:52:39 +03:00
"pathtype",
2020-06-09 21:31:29 +03:00
"pretty-show",
2020-05-19 19:52:01 +03:00
"pretty-simple",
"prettyprinter",
"prettyprinter-ansi-terminal",
2020-07-08 22:35:30 +03:00
"process",
2020-06-09 21:31:29 +03:00
"proto-lens",
2020-06-09 21:56:19 +03:00
"proto-lens-jsonpb",
2020-06-09 21:31:29 +03:00
"proto-lens-runtime",
"raw-strings-qq",
2020-06-09 21:31:29 +03:00
"recursion-schemes",
"reducers",
2020-06-27 20:42:43 +03:00
"resourcet",
2020-06-09 21:31:29 +03:00
"safe-exceptions",
"scientific",
"semigroupoids",
"semilattices",
2020-06-09 21:31:29 +03:00
"split",
2020-06-09 22:20:08 +03:00
"stm-chans",
2020-06-09 21:31:29 +03:00
"streaming",
2020-05-19 19:52:01 +03:00
"tasty",
2020-06-10 07:18:25 +03:00
"tasty-golden",
2020-05-19 19:52:01 +03:00
"tasty-hedgehog",
2020-06-10 07:18:25 +03:00
"tasty-hspec",
2020-05-19 19:52:01 +03:00
"tasty-hunit",
2020-07-08 22:35:30 +03:00
"template-haskell",
2020-06-10 07:18:25 +03:00
"temporary",
2020-05-19 19:52:01 +03:00
"terminal-size",
2020-07-08 22:35:30 +03:00
"text",
2020-06-09 21:31:29 +03:00
"time",
"transformers",
2020-05-19 19:52:01 +03:00
"tree-sitter",
2020-06-09 20:52:39 +03:00
"trifecta",
2020-06-09 21:31:29 +03:00
"unix",
2020-06-09 22:20:08 +03:00
"unliftio-core",
2020-05-19 19:52:01 +03:00
"unordered-containers",
2020-06-09 21:31:29 +03:00
"vector",
"yaml",
],
2020-06-26 20:39:04 +03:00
tools = ["@happy"],
2020-07-08 22:35:30 +03:00
vendored_packages = {
"tree-sitter-{}".format(name): "@tree-sitter-{name}//:tree-sitter-{name}".format(name = name)
for name in [
2020-07-09 00:33:08 +03:00
"go",
"java",
"json",
"php",
2020-07-09 00:33:08 +03:00
"python",
"ql",
"ruby",
"rust",
2020-07-09 00:33:08 +03:00
"tsx",
"typescript",
]
2020-07-08 22:35:30 +03:00
},
2020-05-19 19:52:01 +03:00
)
2020-06-27 23:21:20 +03:00
# Download Happy and make it accessible to the build process.
2020-05-19 19:52:01 +03:00
http_archive(
2020-06-09 20:52:39 +03:00
name = "happy",
build_file_content = """
2020-05-19 19:52:01 +03:00
load("@rules_haskell//haskell:cabal.bzl", "haskell_cabal_binary")
haskell_cabal_binary(name = "happy", srcs = glob(["**"]), visibility = ["//visibility:public"])
""",
2020-06-09 20:52:39 +03:00
sha256 = "fb9a23e41401711a3b288f93cf0a66db9f97da1ce32ec4fffea4b78a0daeb40f",
strip_prefix = "happy-1.19.12",
urls = ["http://hackage.haskell.org/package/happy-1.19.12/happy-1.19.12.tar.gz"],
)
2020-06-27 23:21:20 +03:00
# Pin the various tree-sitter packages so that we can access their
# node-types.json files.
load(
"//:build/common.bzl",
2020-07-08 22:35:30 +03:00
"tree_sitter_node_types_hackage",
)
2020-07-08 22:35:30 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-go",
sha256 = "364a0ae4e683bda1e348fa85c6828cad72122af155560b680f6052852d98db6c",
version = "0.5.0.1",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-python",
2020-07-08 23:04:12 +03:00
sha256 = "36aca4989a9f8b52d6af1586e6eecc8c3a8db2b5643f64ef13ab3d284c266522",
version = "0.9.0.2",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-php",
2020-07-08 23:04:12 +03:00
sha256 = "d7a050948fcea3b740924520c5d0e00e9b239949eff831527a736c5421c912a3",
version = "0.5.0.0",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-java",
2020-07-08 23:04:12 +03:00
sha256 = "9978b56af40c0c66688c17a193761e9c21f7cbbb7e2e299cb7b99f42bd355dfc",
version = "0.7.0.1",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-json",
2020-07-08 23:04:12 +03:00
sha256 = "2b16e68afdc8c56bfac81b88dcd495fc8da6ba9df89347249f1785f1077965e5",
version = "0.7.0.1",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-typescript",
2020-07-08 23:04:12 +03:00
node_types_path = ":vendor/tree-sitter-typescript/typescript/src/node-types.json",
sha256 = "19a036ed413c9da66de8fc3826a413c30278d8490603aeb9465caf3707553d19",
version = "0.5.0.1",
)
tree_sitter_node_types_hackage(
name = "tree-sitter-tsx",
node_types_path = ":vendor/tree-sitter-typescript/tsx/src/node-types.json",
2020-07-09 00:33:08 +03:00
sha256 = "56060c8d12acda0218cc3185c041b8bc7e0a13a0863ab4f1ca133a54078630de",
version = "0.5.0.1",
)
2020-06-27 23:21:20 +03:00
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
2020-06-27 23:21:20 +03:00
name = "tree-sitter-ruby",
2020-07-08 23:04:12 +03:00
sha256 = "d7e9cb06d37b5ee3be500a7f19ce09b6e846958195eff465d2b03d3218807690",
version = "0.5.0.2",
2020-06-27 23:21:20 +03:00
)
tree_sitter_node_types_hackage(
name = "tree-sitter-ql",
sha256 = "fdc3ad5351318fcfeebd7ecb0099a5e3eeac030ec5037f71c1634ab5da94ae6b",
version = "0.1.0.3",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-rust",
sha256 = "522968fa22ad2e9720012b74487e77c91693572d81b157acdb0e116c535848ad",
2020-07-08 23:04:12 +03:00
version = "0.1.0.0",
)
2020-06-30 20:12:11 +03:00
# Download lingo (which has its own Bazel build instructions).
git_repository(
name = "lingo",
commit = "6614b9afe1a519364491c170d6b06ff5cd96153a",
remote = "https://github.com/tclem/lingo-haskell.git",
shallow_since = "1593202797 -0400",
)
2020-06-30 20:12:11 +03:00
load("//:build/example_repos.bzl", "declare_example_repos")
declare_example_repos()