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")
|
2020-05-19 19:16:16 +03:00
|
|
|
|
|
|
|
# Load the repository rule to download an http archive.
|
2020-05-22 02:24:56 +03:00
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
2020-05-19 19:16:16 +03:00
|
|
|
|
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",
|
|
|
|
)
|
|
|
|
|
2020-05-19 19:16:16 +03:00
|
|
|
# Download rules_haskell and make it accessible as "@rules_haskell".
|
|
|
|
http_archive(
|
2020-06-09 20:52:39 +03:00
|
|
|
name = "rules_haskell",
|
|
|
|
sha256 = "56a8e6337df8802f1e0e7d2b3d12d12d5d96c929c8daecccc5738a0f41d9c1e4",
|
|
|
|
strip_prefix = "rules_haskell-0.12",
|
|
|
|
urls = ["https://github.com/tweag/rules_haskell/archive/v0.12.tar.gz"],
|
2020-05-19 19:16:16 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
load(
|
2020-06-09 20:52:39 +03:00
|
|
|
"@rules_haskell//haskell:repositories.bzl",
|
|
|
|
"rules_haskell_dependencies",
|
2020-05-19 19:16:16 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# 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",
|
2020-05-19 19:16:16 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# Download a GHC binary distribution from haskell.org and register it as a toolchain.
|
2020-06-23 23:25:38 +03:00
|
|
|
rules_haskell_toolchains(version = "8.8.3")
|
2020-05-19 19:16:16 +03:00
|
|
|
|
|
|
|
load(
|
|
|
|
"@rules_haskell//haskell:cabal.bzl",
|
2020-06-09 20:52:39 +03:00
|
|
|
"stack_snapshot",
|
2020-05-19 19:16:16 +03:00
|
|
|
)
|
2020-05-22 02:24:56 +03:00
|
|
|
|
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.
|
2020-05-19 19:16:16 +03:00
|
|
|
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",
|
2020-05-19 19:16:16 +03:00
|
|
|
"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",
|
2020-06-09 21:31:29 +03:00
|
|
|
"fused-effects-resumable",
|
2020-05-19 19:52:01 +03:00
|
|
|
"fused-syntax",
|
2020-07-01 09:17:39 +03:00
|
|
|
"gauge",
|
2020-05-19 20:07:33 +03:00
|
|
|
"generic-lens",
|
2020-05-19 19:16:16 +03:00
|
|
|
"generic-monoid",
|
|
|
|
"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",
|
|
|
|
"leancheck",
|
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",
|
2020-06-26 23:24:47 +03:00
|
|
|
"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",
|
2020-05-19 19:16:16 +03:00
|
|
|
"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",
|
2020-05-19 19:16:16 +03:00
|
|
|
"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",
|
2020-06-26 23:24:47 +03:00
|
|
|
"yaml",
|
2020-05-19 19:16:16 +03:00
|
|
|
],
|
2020-06-26 20:39:04 +03:00
|
|
|
tools = ["@happy"],
|
2020-07-08 22:35:30 +03:00
|
|
|
vendored_packages = {
|
2020-07-09 00:30:11 +03:00
|
|
|
"tree-sitter-{}".format(name): "@tree-sitter-{name}//:tree-sitter-{name}".format(name = name)
|
|
|
|
for name in [
|
|
|
|
"json",
|
|
|
|
"ql",
|
|
|
|
"tsx",
|
|
|
|
"typescript",
|
|
|
|
"php",
|
|
|
|
"ruby",
|
|
|
|
"rust",
|
|
|
|
"java",
|
|
|
|
"python",
|
|
|
|
]
|
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-05-22 02:24:56 +03:00
|
|
|
)
|
|
|
|
|
2020-06-27 23:21:20 +03:00
|
|
|
# Pin the various tree-sitter packages so that we can access their
|
|
|
|
# node-types.json files.
|
|
|
|
|
2020-06-26 20:07:24 +03:00
|
|
|
load(
|
|
|
|
"//:build/common.bzl",
|
2020-07-08 22:35:30 +03:00
|
|
|
"tree_sitter_node_types_hackage",
|
2020-06-26 20:07:24 +03:00
|
|
|
)
|
|
|
|
|
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(
|
2020-06-26 20:07:24 +03:00
|
|
|
name = "tree-sitter-python",
|
2020-07-08 23:04:12 +03:00
|
|
|
sha256 = "36aca4989a9f8b52d6af1586e6eecc8c3a8db2b5643f64ef13ab3d284c266522",
|
|
|
|
version = "0.9.0.2",
|
2020-06-26 20:07:24 +03:00
|
|
|
)
|
|
|
|
|
2020-07-08 23:04:12 +03:00
|
|
|
tree_sitter_node_types_hackage(
|
2020-06-26 20:07:24 +03:00
|
|
|
name = "tree-sitter-php",
|
2020-07-08 23:04:12 +03:00
|
|
|
sha256 = "d7a050948fcea3b740924520c5d0e00e9b239949eff831527a736c5421c912a3",
|
|
|
|
version = "0.5.0.0",
|
2020-06-26 20:07:24 +03:00
|
|
|
)
|
|
|
|
|
2020-07-08 23:04:12 +03:00
|
|
|
tree_sitter_node_types_hackage(
|
2020-06-26 20:07:24 +03:00
|
|
|
name = "tree-sitter-java",
|
2020-07-08 23:04:12 +03:00
|
|
|
sha256 = "9978b56af40c0c66688c17a193761e9c21f7cbbb7e2e299cb7b99f42bd355dfc",
|
|
|
|
version = "0.7.0.1",
|
2020-06-26 20:07:24 +03:00
|
|
|
)
|
|
|
|
|
2020-07-08 23:04:12 +03:00
|
|
|
tree_sitter_node_types_hackage(
|
2020-06-26 20:07:24 +03:00
|
|
|
name = "tree-sitter-json",
|
2020-07-08 23:04:12 +03:00
|
|
|
sha256 = "2b16e68afdc8c56bfac81b88dcd495fc8da6ba9df89347249f1785f1077965e5",
|
|
|
|
version = "0.7.0.1",
|
2020-06-26 20:07:24 +03:00
|
|
|
)
|
|
|
|
|
2020-07-08 23:04:12 +03:00
|
|
|
tree_sitter_node_types_hackage(
|
2020-06-26 20:07:24 +03:00
|
|
|
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",
|
2020-06-26 20:07:24 +03:00
|
|
|
)
|
|
|
|
|
2020-07-08 23:58:30 +03:00
|
|
|
tree_sitter_node_types_hackage(
|
|
|
|
name = "tree-sitter-tsx",
|
|
|
|
node_types_path = ":vendor/tree-sitter-typescript/tsx/src/node-types.json",
|
|
|
|
sha256 = "",
|
|
|
|
version = "0.5.0.1",
|
2020-06-26 23:24:47 +03:00
|
|
|
)
|
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
|
|
|
)
|
2020-06-30 18:17:47 +03:00
|
|
|
|
2020-07-08 23:58:30 +03:00
|
|
|
tree_sitter_node_types_hackage(
|
2020-06-30 18:17:47 +03:00
|
|
|
name = "tree-sitter-ql",
|
2020-07-08 23:58:30 +03:00
|
|
|
sha256 = "fdc3ad5351318fcfeebd7ecb0099a5e3eeac030ec5037f71c1634ab5da94ae6b",
|
|
|
|
version = "0.1.0.3",
|
2020-06-30 18:17:47 +03:00
|
|
|
)
|
2020-06-30 18:28:46 +03:00
|
|
|
|
2020-07-08 23:04:12 +03:00
|
|
|
tree_sitter_node_types_hackage(
|
2020-07-02 03:52:06 +03:00
|
|
|
name = "tree-sitter-rust",
|
2020-07-08 23:58:30 +03:00
|
|
|
sha256 = "522968fa22ad2e9720012b74487e77c91693572d81b157acdb0e116c535848ad",
|
2020-07-08 23:04:12 +03:00
|
|
|
version = "0.1.0.0",
|
2020-07-02 03:52:06 +03:00
|
|
|
)
|
|
|
|
|
2020-07-08 23:58:30 +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()
|