2020-04-23 13:58:11 +03:00
|
|
|
|
workspace(name = "compatibility")
|
|
|
|
|
|
|
|
|
|
# We import the main workspace for nix stuff and some shared Bazel rules.
|
|
|
|
|
# This is mainly so we don’t have to symlink a bunch of files.
|
|
|
|
|
# Note that you should never depend on targets from @daml.
|
|
|
|
|
local_repository(
|
|
|
|
|
name = "daml",
|
|
|
|
|
path = "..",
|
|
|
|
|
)
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
load("@daml//bazel_tools:os_info.bzl", "os_info")
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
os_info(name = "os_info")
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-28 17:06:36 +03:00
|
|
|
|
load("@os_info//:os_info.bzl", "is_darwin", "is_linux", "is_windows", "os_name")
|
2020-04-24 15:04:14 +03:00
|
|
|
|
load("@daml//bazel_tools:build_environment.bzl", "build_environment")
|
|
|
|
|
|
|
|
|
|
build_environment(name = "build_environment")
|
2020-04-23 13:58:11 +03:00
|
|
|
|
|
2021-03-30 14:02:18 +03:00
|
|
|
|
load("@daml//bazel_tools:scala_version.bzl", "scala_version_configure")
|
2020-12-14 14:42:26 +03:00
|
|
|
|
|
2021-03-30 14:02:18 +03:00
|
|
|
|
scala_version_configure(name = "scala_version")
|
2020-12-14 14:42:26 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
load("//:deps.bzl", "daml_deps")
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
daml_deps()
|
|
|
|
|
|
|
|
|
|
load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies")
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
rules_haskell_dependencies()
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-28 17:06:36 +03:00
|
|
|
|
load("@daml//bazel_tools/dev_env_tool:dev_env_tool.bzl", "dadew", "dev_env_tool")
|
|
|
|
|
|
|
|
|
|
dadew(name = "dadew")
|
|
|
|
|
|
|
|
|
|
load("@daml//bazel_tools/dev_env_tool:dev_env_tool.bzl", "dadew_sh_posix_configure")
|
|
|
|
|
|
|
|
|
|
dadew_sh_posix_configure() if is_windows else None
|
|
|
|
|
|
2020-05-13 11:39:51 +03:00
|
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")
|
2020-04-23 13:58:11 +03:00
|
|
|
|
load(
|
|
|
|
|
"@rules_haskell//haskell:nixpkgs.bzl",
|
|
|
|
|
"haskell_register_ghc_nixpkgs",
|
|
|
|
|
)
|
2020-04-28 17:06:36 +03:00
|
|
|
|
load(
|
|
|
|
|
"@rules_haskell//haskell:ghc_bindist.bzl",
|
|
|
|
|
"haskell_register_ghc_bindists",
|
|
|
|
|
)
|
2020-04-23 13:58:11 +03:00
|
|
|
|
load(
|
|
|
|
|
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
|
2020-11-30 17:36:46 +03:00
|
|
|
|
"nixpkgs_cc_configure",
|
2020-04-23 13:58:11 +03:00
|
|
|
|
"nixpkgs_local_repository",
|
|
|
|
|
"nixpkgs_package",
|
|
|
|
|
"nixpkgs_python_configure",
|
|
|
|
|
)
|
2020-05-28 16:02:54 +03:00
|
|
|
|
load("//:versions.bzl", "latest_stable_version", "sdk_versions", "version_sha256s")
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
common_nix_file_deps = [
|
|
|
|
|
"@daml//nix:bazel.nix",
|
|
|
|
|
"@daml//nix:nixpkgs.nix",
|
|
|
|
|
"@daml//nix:nixpkgs/default.nix",
|
|
|
|
|
"@daml//nix:nixpkgs/default.src.json",
|
|
|
|
|
]
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
dev_env_nix_repos = {
|
|
|
|
|
"nixpkgs": "@nixpkgs",
|
|
|
|
|
}
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
nixpkgs_local_repository(
|
|
|
|
|
name = "nixpkgs",
|
|
|
|
|
nix_file = "@daml//nix:nixpkgs.nix",
|
|
|
|
|
nix_file_deps = [
|
|
|
|
|
"@daml//nix:nixpkgs/default.nix",
|
|
|
|
|
"@daml//nix:nixpkgs/default.src.json",
|
|
|
|
|
],
|
|
|
|
|
)
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-11-30 17:36:46 +03:00
|
|
|
|
nixpkgs_cc_configure(
|
2020-04-23 13:58:11 +03:00
|
|
|
|
nix_file = "@daml//nix:bazel-cc-toolchain.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps + [
|
|
|
|
|
"@daml//nix:tools/bazel-cc-toolchain/default.nix",
|
|
|
|
|
],
|
|
|
|
|
repositories = dev_env_nix_repos,
|
2020-05-18 19:03:51 +03:00
|
|
|
|
) if not is_windows else None
|
2020-04-23 13:58:11 +03:00
|
|
|
|
|
|
|
|
|
nixpkgs_package(
|
|
|
|
|
name = "glibc_locales",
|
|
|
|
|
attribute_path = "glibcLocales",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
filegroup(
|
|
|
|
|
name = "locale-archive",
|
|
|
|
|
srcs = ["lib/locale/locale-archive"],
|
|
|
|
|
)
|
|
|
|
|
""",
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
|
|
|
|
repositories = dev_env_nix_repos,
|
|
|
|
|
) if is_linux else None
|
|
|
|
|
|
2020-04-28 17:06:36 +03:00
|
|
|
|
haskell_register_ghc_bindists(
|
|
|
|
|
compiler_flags = [],
|
2021-11-02 17:52:55 +03:00
|
|
|
|
version = "8.10.7",
|
2020-04-28 17:06:36 +03:00
|
|
|
|
) if is_windows else None
|
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
haskell_register_ghc_nixpkgs(
|
2021-01-25 14:53:53 +03:00
|
|
|
|
attribute_path = "ghc",
|
2020-04-23 13:58:11 +03:00
|
|
|
|
build_file = "@io_tweag_rules_nixpkgs//nixpkgs:BUILD.pkg",
|
|
|
|
|
locale_archive = "@glibc_locales//:locale-archive",
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
2021-02-08 14:12:07 +03:00
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
2020-04-23 13:58:11 +03:00
|
|
|
|
repositories = dev_env_nix_repos,
|
2021-11-02 17:52:55 +03:00
|
|
|
|
version = "8.10.7",
|
2020-04-23 13:58:11 +03:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
nixpkgs_python_configure(repository = "@nixpkgs")
|
|
|
|
|
|
2020-08-05 17:27:14 +03:00
|
|
|
|
nixpkgs_package(
|
|
|
|
|
name = "tar_nix",
|
|
|
|
|
attribute_path = "gnutar",
|
|
|
|
|
fail_not_supported = False,
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
|
|
|
|
repositories = dev_env_nix_repos,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
dev_env_tool(
|
|
|
|
|
name = "tar_dev_env",
|
|
|
|
|
nix_include = ["bin/tar"],
|
|
|
|
|
nix_label = "@tar_nix",
|
|
|
|
|
nix_paths = ["bin/tar"],
|
|
|
|
|
tools = ["tar"],
|
|
|
|
|
win_include = ["usr/bin/tar.exe"],
|
|
|
|
|
win_paths = ["usr/bin/tar.exe"],
|
|
|
|
|
win_tool = "msys2",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
nixpkgs_package(
|
|
|
|
|
name = "gzip_nix",
|
|
|
|
|
attribute_path = "gzip",
|
|
|
|
|
fail_not_supported = False,
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
|
|
|
|
repositories = dev_env_nix_repos,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
dev_env_tool(
|
|
|
|
|
name = "gzip_dev_env",
|
|
|
|
|
nix_include = ["bin/gzip"],
|
|
|
|
|
nix_label = "@gzip_nix",
|
|
|
|
|
nix_paths = ["bin/gzip"],
|
|
|
|
|
tools = ["gzip"],
|
|
|
|
|
win_include = ["usr/bin/gzip.exe"],
|
|
|
|
|
win_paths = ["usr/bin/gzip.exe"],
|
|
|
|
|
win_tool = "msys2",
|
|
|
|
|
)
|
|
|
|
|
|
2020-04-24 13:08:32 +03:00
|
|
|
|
nixpkgs_package(
|
|
|
|
|
name = "postgresql_nix",
|
|
|
|
|
attribute_path = "postgresql_9_6",
|
|
|
|
|
build_file_content = """
|
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
filegroup(
|
|
|
|
|
name = "all",
|
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
|
)
|
2020-04-24 15:04:14 +03:00
|
|
|
|
""",
|
|
|
|
|
fail_not_supported = False,
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
|
|
|
|
repositories = dev_env_nix_repos,
|
|
|
|
|
)
|
|
|
|
|
|
2020-04-27 19:13:16 +03:00
|
|
|
|
nixpkgs_package(
|
|
|
|
|
name = "openssl_nix",
|
|
|
|
|
attribute_path = "openssl",
|
|
|
|
|
fail_not_supported = False,
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
|
|
|
|
repositories = dev_env_nix_repos,
|
|
|
|
|
)
|
|
|
|
|
|
2020-04-28 17:06:36 +03:00
|
|
|
|
dev_env_tool(
|
|
|
|
|
name = "openssl_dev_env",
|
|
|
|
|
nix_include = ["bin/openssl"],
|
|
|
|
|
nix_label = "@openssl_nix",
|
|
|
|
|
nix_paths = ["bin/openssl"],
|
|
|
|
|
tools = ["openssl"],
|
|
|
|
|
win_include = [
|
|
|
|
|
"usr/bin",
|
|
|
|
|
"usr/ssl",
|
|
|
|
|
],
|
|
|
|
|
win_paths = ["usr/bin/openssl.exe"],
|
|
|
|
|
win_tool = "msys2",
|
|
|
|
|
)
|
|
|
|
|
|
2020-04-24 15:04:14 +03:00
|
|
|
|
nixpkgs_package(
|
|
|
|
|
name = "hlint_nix",
|
|
|
|
|
attribute_path = "hlint",
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
2021-02-08 14:12:07 +03:00
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
2020-04-24 15:04:14 +03:00
|
|
|
|
repositories = dev_env_nix_repos,
|
2020-04-24 13:08:32 +03:00
|
|
|
|
)
|
|
|
|
|
|
2020-05-13 11:39:51 +03:00
|
|
|
|
nixpkgs_package(
|
|
|
|
|
name = "node_nix",
|
|
|
|
|
attribute_path = "nodejsNested",
|
|
|
|
|
build_file_content = 'exports_files(glob(["node_nix/**"]))',
|
|
|
|
|
fail_not_supported = False,
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
|
|
|
|
repositories = dev_env_nix_repos,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
dev_env_tool(
|
|
|
|
|
name = "nodejs_dev_env",
|
|
|
|
|
nix_include = [
|
|
|
|
|
"bin",
|
|
|
|
|
"include",
|
|
|
|
|
"lib",
|
|
|
|
|
"share",
|
|
|
|
|
],
|
|
|
|
|
nix_label = "@node_nix",
|
|
|
|
|
nix_paths = [],
|
|
|
|
|
prefix = "nodejs_dev_env",
|
|
|
|
|
tools = [],
|
|
|
|
|
win_include = [
|
|
|
|
|
".",
|
|
|
|
|
],
|
|
|
|
|
win_paths = [],
|
2020-05-28 22:58:52 +03:00
|
|
|
|
win_tool = "nodejs-12.17.0",
|
2020-05-13 11:39:51 +03:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
node_repositories(
|
|
|
|
|
vendored_node = "@nodejs_dev_env" if is_windows else "@node_nix",
|
|
|
|
|
yarn_version = "1.22.4",
|
|
|
|
|
)
|
|
|
|
|
|
2020-05-18 15:37:16 +03:00
|
|
|
|
nixpkgs_package(
|
|
|
|
|
name = "patch_nix",
|
|
|
|
|
attribute_path = "gnupatch",
|
|
|
|
|
fail_not_supported = False,
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
|
|
|
|
repositories = dev_env_nix_repos,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
dev_env_tool(
|
|
|
|
|
name = "patch_dev_env",
|
|
|
|
|
nix_include = ["bin/patch"],
|
|
|
|
|
nix_label = "@patch_nix",
|
|
|
|
|
nix_paths = ["bin/patch"],
|
|
|
|
|
tools = ["patch"],
|
|
|
|
|
win_include = ["usr/bin/patch.exe"],
|
|
|
|
|
win_paths = ["usr/bin/patch.exe"],
|
|
|
|
|
win_tool = "msys2",
|
|
|
|
|
)
|
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
load("//:bazel-haskell-deps.bzl", "daml_haskell_deps")
|
2020-04-24 15:04:14 +03:00
|
|
|
|
|
2020-04-23 13:58:11 +03:00
|
|
|
|
daml_haskell_deps()
|
|
|
|
|
|
2020-04-24 15:43:35 +03:00
|
|
|
|
load("//bazel_tools:daml_sdk.bzl", "daml_sdk", "daml_sdk_head")
|
|
|
|
|
|
|
|
|
|
local_repository(
|
|
|
|
|
name = "head_sdk",
|
|
|
|
|
path = "head_sdk",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
daml_sdk_head(
|
2020-05-18 15:37:16 +03:00
|
|
|
|
create_daml_app_patch = "@head_sdk//:messaging.patch",
|
2020-05-13 11:39:51 +03:00
|
|
|
|
daml_ledger_tarball = "@head_sdk//:daml-ledger-0.0.0.tgz",
|
|
|
|
|
daml_react_tarball = "@head_sdk//:daml-react-0.0.0.tgz",
|
|
|
|
|
daml_types_tarball = "@head_sdk//:daml-types-0.0.0.tgz",
|
2020-04-24 15:43:35 +03:00
|
|
|
|
ledger_api_test_tool = "@head_sdk//:ledger-api-test-tool_deploy.jar",
|
2020-04-27 15:55:16 +03:00
|
|
|
|
os_name = os_name,
|
2021-03-11 18:13:49 +03:00
|
|
|
|
sdk_tarball = "@head_sdk//:sdk-release-tarball-ce.tar.gz",
|
2020-04-24 15:43:35 +03:00
|
|
|
|
)
|
2020-04-23 13:58:11 +03:00
|
|
|
|
|
2020-05-05 20:40:03 +03:00
|
|
|
|
[
|
|
|
|
|
daml_sdk(
|
2020-05-18 15:37:16 +03:00
|
|
|
|
# See the explanation in UpdateVersions.hs
|
2020-06-12 18:03:38 +03:00
|
|
|
|
create_daml_app_patch = None if version_sha256s.get(ver).get("create_daml_app_patch") else "@daml-sdk-1.1.1//:create_daml_app.patch",
|
2020-05-18 15:37:16 +03:00
|
|
|
|
create_daml_app_patch_sha256 = version_sha256s.get(ver).get("create_daml_app_patch"),
|
2020-05-13 11:39:51 +03:00
|
|
|
|
daml_ledger_sha256 = version_sha256s.get(ver).get("daml_ledger"),
|
|
|
|
|
daml_react_sha256 = version_sha256s.get(ver).get("daml_react"),
|
|
|
|
|
daml_types_sha256 = version_sha256s.get(ver).get("daml_types"),
|
2020-05-05 20:40:03 +03:00
|
|
|
|
os_name = os_name,
|
|
|
|
|
sdk_sha256 = version_sha256s.get(ver),
|
|
|
|
|
test_tool_sha256 = version_sha256s.get(ver).get("test_tool"),
|
|
|
|
|
version = ver,
|
|
|
|
|
)
|
|
|
|
|
for ver in sdk_versions
|
|
|
|
|
if ver != "0.0.0"
|
|
|
|
|
]
|
2020-05-28 16:02:54 +03:00
|
|
|
|
|
2021-11-01 20:18:45 +03:00
|
|
|
|
load("@daml//bazel_tools:java.bzl", "dadew_java_configure", "nixpkgs_java_configure")
|
2020-12-08 08:59:23 +03:00
|
|
|
|
|
2021-11-01 20:18:45 +03:00
|
|
|
|
dadew_java_configure(
|
|
|
|
|
name = "dadew_java_runtime",
|
|
|
|
|
dadew_path = "java-openjdk-8u302",
|
|
|
|
|
) if is_windows else None
|
|
|
|
|
|
|
|
|
|
nixpkgs_java_configure(
|
|
|
|
|
attribute_path = "jdk8.home",
|
|
|
|
|
nix_file = "@daml//nix:bazel.nix",
|
|
|
|
|
nix_file_deps = common_nix_file_deps,
|
|
|
|
|
repositories = dev_env_nix_repos,
|
|
|
|
|
) if not is_windows else None
|
2020-12-08 08:59:23 +03:00
|
|
|
|
|
2020-05-28 16:02:54 +03:00
|
|
|
|
load("@rules_jvm_external//:defs.bzl", "maven_install")
|
|
|
|
|
|
2021-06-23 23:12:04 +03:00
|
|
|
|
grpc_version = "1.35.0"
|
|
|
|
|
|
2021-08-12 17:25:53 +03:00
|
|
|
|
load("@scala_version//:index.bzl", "scala_artifacts", "scala_major_version", "scala_version")
|
|
|
|
|
|
2020-05-28 16:02:54 +03:00
|
|
|
|
# We base our Maven artifacts on the latest stable release
|
|
|
|
|
# for now. In principle, we could setup one Maven workspace
|
|
|
|
|
# per SDK version but that is a bit painful to setup and
|
|
|
|
|
# seems to bring little benefit.
|
|
|
|
|
maven_install(
|
|
|
|
|
name = "maven",
|
|
|
|
|
artifacts = [
|
2021-05-17 18:04:53 +03:00
|
|
|
|
"com.daml:bindings-akka_2.13:{}".format(latest_stable_version),
|
|
|
|
|
"com.daml:daml-lf-archive-reader_2.13:{}".format(latest_stable_version),
|
|
|
|
|
"com.daml:daml-lf-transaction_2.13:{}".format(latest_stable_version),
|
|
|
|
|
"com.daml:ledger-api-common_2.13:{}".format(latest_stable_version),
|
|
|
|
|
"com.daml:lf-value-json_2.13:{}".format(latest_stable_version),
|
2021-06-23 23:12:04 +03:00
|
|
|
|
"io.grpc:grpc-api:{}".format(grpc_version),
|
|
|
|
|
"io.grpc:grpc-core:{}".format(grpc_version),
|
|
|
|
|
"io.grpc:grpc-netty:{}".format(grpc_version),
|
|
|
|
|
"io.grpc:grpc-protobuf:{}".format(grpc_version),
|
|
|
|
|
"io.grpc:grpc-services:{}".format(grpc_version),
|
|
|
|
|
"io.grpc:grpc-stub:{}".format(grpc_version),
|
2021-08-12 17:25:53 +03:00
|
|
|
|
"com.github.scopt:scopt_{}:3.7.1".format(scala_major_version),
|
|
|
|
|
"org.wartremover:wartremover_{}:2.4.16".format(scala_version),
|
|
|
|
|
"io.spray:spray-json_{}:1.3.5".format(scala_major_version),
|
2020-05-28 16:02:54 +03:00
|
|
|
|
],
|
|
|
|
|
maven_install_json = "@compatibility//:maven_install.json",
|
|
|
|
|
repositories = [
|
|
|
|
|
"https://repo1.maven.org/maven2",
|
|
|
|
|
],
|
|
|
|
|
version_conflict_policy = "pinned",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
load("@maven//:defs.bzl", "pinned_maven_install")
|
|
|
|
|
|
|
|
|
|
pinned_maven_install()
|
|
|
|
|
|
2020-12-08 08:59:23 +03:00
|
|
|
|
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")
|
|
|
|
|
|
2021-04-26 20:49:43 +03:00
|
|
|
|
scala_config(scala_version)
|
2020-12-08 08:59:23 +03:00
|
|
|
|
|
2020-05-28 16:02:54 +03:00
|
|
|
|
load(
|
|
|
|
|
"@io_bazel_rules_scala//scala:scala.bzl",
|
|
|
|
|
"scala_repositories",
|
|
|
|
|
)
|
|
|
|
|
|
2020-12-08 16:52:41 +03:00
|
|
|
|
scala_repositories(
|
|
|
|
|
fetch_sources = True,
|
2021-04-26 20:49:43 +03:00
|
|
|
|
overriden_artifacts = scala_artifacts,
|
2020-12-08 16:52:41 +03:00
|
|
|
|
)
|
2020-05-28 16:02:54 +03:00
|
|
|
|
|
|
|
|
|
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
|
|
|
|
|
|
|
|
|
|
scala_register_toolchains()
|