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

243 lines
6.7 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")
# 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
2020-07-10 22:56:58 +03:00
http_archive(
2020-06-09 20:52:39 +03:00
name = "rules_haskell",
2020-07-10 22:56:58 +03:00
sha256 = "78d017aa732b430c0681fff4514503af78a8d8c44df165e603a9433745b16e5e",
strip_prefix = "rules_haskell-abaec6502a4474f10b3c367fb5e90173ee0e349c",
urls = ["https://github.com/tweag/rules_haskell/archive/abaec6502a4474f10b3c367fb5e90173ee0e349c.tar.gz"],
)
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",
2020-07-23 17:24:31 +03:00
version = "8.10.1",
)
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()
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-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",
"fused-syntax",
2020-07-01 09:17:39 +03:00
"gauge",
2020-05-19 20:07:33 +03:00
"generic-lens",
"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",
"proto-lens-jsonpb",
2020-05-19 20:07:33 +03:00
"lens",
"lingo",
2020-06-09 21:31:29 +03:00
"network",
"network-uri",
2020-05-19 19:52:01 +03:00
"optparse-applicative",
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",
"proto-lens-runtime",
"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-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 = "72a1d3bdb2883ace3f2de3a0f754c680908489e984503f1a66243ad74dc2887e",
version = "0.5.0.2",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-python",
sha256 = "f028c88eabbda9b9bb67895922d753a12ddda83fb917748e0e407e50616b51ae",
version = "0.9.0.3",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-php",
sha256 = "70fd9f5cc429fa2b59adaa86853fb111f733889f0b2996328efd885903d7ce16",
version = "0.5.0.1",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-java",
sha256 = "569fa1240cdb7db8436201962933c97dd2c502ed65bd4788880238201c67a1c6",
version = "0.7.0.2",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-json",
sha256 = "8fbc478268849c16bc7ff85dd6634bb849400bda98575fe26681224a640b9e0a",
version = "0.7.0.2",
)
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 = "d1cd258e5c83d557ab3481e08c2e8c29ee689e2a9de89b6f72c12080f48c9c62",
version = "0.5.0.2",
)
tree_sitter_node_types_hackage(
name = "tree-sitter-tsx",
node_types_path = ":vendor/tree-sitter-typescript/tsx/src/node-types.json",
sha256 = "20115194b7e87d53e8ad42a9d5ef212186040e543ccf295135b1342ec6b12447",
version = "0.5.0.2",
)
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",
sha256 = "b6bb1fcb23e283f28af2d1ac9444ed63bb7b9f396034d13db62553d998cefc24",
version = "0.5.0.3",
2020-06-27 23:21:20 +03:00
)
tree_sitter_node_types_hackage(
name = "tree-sitter-ql",
sha256 = "d15eff87a292ec4559295676afbf0e5a763f5f7e7636411933109880c3fd5c5d",
version = "0.1.0.4",
)
2020-07-08 23:04:12 +03:00
tree_sitter_node_types_hackage(
name = "tree-sitter-rust",
sha256 = "00bc04a31b5c9b0f9b419074238996ee4aadba342e68071ec516077b495e0d41",
version = "0.1.0.1",
)
2020-06-30 20:12:11 +03:00
load("//:build/example_repos.bzl", "declare_example_repos")
declare_example_repos()