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
|
|
|
|
|
|
|
# Download rules_haskell and make it accessible as "@rules_haskell".
|
2020-07-09 14:36:11 +03:00
|
|
|
#
|
|
|
|
# Note: the git_repository clause is a workaround until rules_haskell#1349 [1]
|
2020-07-10 15:59:45 +03:00
|
|
|
# is released. One it's released, revert back to the http_archive clause with
|
|
|
|
# an updated version.
|
2020-07-09 14:36:11 +03:00
|
|
|
#
|
|
|
|
# [1] https://github.com/tweag/rules_haskell/issues/1349
|
2020-07-10 22:56:58 +03:00
|
|
|
http_archive(
|
2020-06-09 20:52:39 +03:00
|
|
|
name = "rules_haskell",
|
2020-09-16 15:22:25 +03:00
|
|
|
sha256 = "cd07e421281c3ad286574ae235f39165e294c850fa4cdf03b5683547d8822c34",
|
|
|
|
strip_prefix = "rules_haskell-1254b1d9bee9e82cd70c4f7941cb64b8ec048bac",
|
|
|
|
urls = ["https://github.com/tweag/rules_haskell/archive/1254b1d9bee9e82cd70c4f7941cb64b8ec048bac.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-07-09 14:36:11 +03:00
|
|
|
rules_haskell_toolchains(
|
|
|
|
locale = "en_US.UTF-8",
|
2020-09-17 00:07:54 +03:00
|
|
|
version = "8.10.2",
|
2020-07-09 14:36:11 +03:00
|
|
|
)
|
2020-05-19 19:16:16 +03:00
|
|
|
|
2020-07-23 16:28:36 +03:00
|
|
|
# Enable GHC persistent worker mode, if that's your bag.
|
|
|
|
load("@rules_haskell//tools:repositories.bzl", "rules_haskell_worker_dependencies")
|
|
|
|
|
|
|
|
rules_haskell_worker_dependencies()
|
|
|
|
|
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-07-23 17:24:31 +03:00
|
|
|
"base64-bytestring",
|
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-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",
|
2020-05-19 20:07:33 +03:00
|
|
|
"lens",
|
2020-09-02 21:09:13 +03:00
|
|
|
"lingo",
|
2020-09-09 21:15:33 +03:00
|
|
|
"neat-interpolation",
|
2020-06-09 21:31:29 +03:00
|
|
|
"network",
|
|
|
|
"network-uri",
|
2020-05-19 19:52:01 +03:00
|
|
|
"optparse-applicative",
|
2020-09-09 20:12:51 +03:00
|
|
|
"optparse-generic",
|
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-09-16 15:22:25 +03:00
|
|
|
"proto-lens-jsonpb",
|
2020-06-09 21:31:29 +03:00
|
|
|
"proto-lens-runtime",
|
2020-09-02 21:52:55 +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-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-09-17 02:05:33 +03:00
|
|
|
stack_snapshot_json = "//:stackage_snapshot.json",
|
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 [
|
2020-07-09 00:33:08 +03:00
|
|
|
"go",
|
|
|
|
"java",
|
2020-07-09 00:30:11 +03:00
|
|
|
"json",
|
|
|
|
"php",
|
2020-07-09 00:33:08 +03:00
|
|
|
"python",
|
|
|
|
"ql",
|
2020-07-09 00:30:11 +03:00
|
|
|
"ruby",
|
|
|
|
"rust",
|
2020-07-09 00:33:08 +03:00
|
|
|
"tsx",
|
|
|
|
"typescript",
|
2020-07-09 00:30:11 +03:00
|
|
|
]
|
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",
|
2020-07-16 16:18:47 +03:00
|
|
|
sha256 = "72a1d3bdb2883ace3f2de3a0f754c680908489e984503f1a66243ad74dc2887e",
|
|
|
|
version = "0.5.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-python",
|
2020-07-16 16:18:47 +03:00
|
|
|
sha256 = "f028c88eabbda9b9bb67895922d753a12ddda83fb917748e0e407e50616b51ae",
|
|
|
|
version = "0.9.0.3",
|
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-16 16:18:47 +03:00
|
|
|
sha256 = "70fd9f5cc429fa2b59adaa86853fb111f733889f0b2996328efd885903d7ce16",
|
|
|
|
version = "0.5.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-java",
|
2020-07-16 16:18:47 +03:00
|
|
|
sha256 = "569fa1240cdb7db8436201962933c97dd2c502ed65bd4788880238201c67a1c6",
|
|
|
|
version = "0.7.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-json",
|
2020-07-16 16:18:47 +03:00
|
|
|
sha256 = "8fbc478268849c16bc7ff85dd6634bb849400bda98575fe26681224a640b9e0a",
|
|
|
|
version = "0.7.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-typescript",
|
2020-07-08 23:04:12 +03:00
|
|
|
node_types_path = ":vendor/tree-sitter-typescript/typescript/src/node-types.json",
|
2020-07-16 16:18:47 +03:00
|
|
|
sha256 = "d1cd258e5c83d557ab3481e08c2e8c29ee689e2a9de89b6f72c12080f48c9c62",
|
|
|
|
version = "0.5.0.2",
|
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",
|
2020-07-16 16:18:47 +03:00
|
|
|
sha256 = "20115194b7e87d53e8ad42a9d5ef212186040e543ccf295135b1342ec6b12447",
|
|
|
|
version = "0.5.0.2",
|
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-16 16:18:47 +03:00
|
|
|
sha256 = "b6bb1fcb23e283f28af2d1ac9444ed63bb7b9f396034d13db62553d998cefc24",
|
|
|
|
version = "0.5.0.3",
|
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-16 16:18:47 +03:00
|
|
|
sha256 = "d15eff87a292ec4559295676afbf0e5a763f5f7e7636411933109880c3fd5c5d",
|
|
|
|
version = "0.1.0.4",
|
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-16 16:18:47 +03:00
|
|
|
sha256 = "00bc04a31b5c9b0f9b419074238996ee4aadba342e68071ec516077b495e0d41",
|
|
|
|
version = "0.1.0.1",
|
2020-06-30 18:28:46 +03:00
|
|
|
)
|
2020-06-30 20:12:11 +03:00
|
|
|
|
|
|
|
load("//:build/example_repos.bzl", "declare_example_repos")
|
|
|
|
|
|
|
|
declare_example_repos()
|