daml/compatibility/bazel-haskell-deps.bzl
Moritz Kiefer 0c90844184
Update SDK versions in compatibility tests (#5844)
* Update SDK versions in compatibility tests

This adds a Haskell script to generate a versions.bzl file that
contains the list of versions as well as their hashes. This should
make it a bit easier to keep things up2date going forward.

The script is a bit slow since downloading all the SDKs takes quite a
while but for now it should be good enough and is much more pleasant
than having to figure this out manually.

changelog_begin
changelog_end

* Address review comments

changelog_begin
changelog_end

* Fix excluded tests

changelog_begin
changelog_end
2020-05-05 19:40:03 +02:00

83 lines
2.6 KiB
Python

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# Defines external Haskell dependencies.
#
# Add Stackage dependencies to the `packages` attribute of the `@stackage`
# `stack_snapshot` in the very bottom of this file. If a package or version is
# not available on Stackage, add it to the custom stack snapshot in
# `stack-snapshot.yaml`. If a library requires patching, then add it as an
# `http_archive` and add it to the `vendored_packages` attribute of
# `stack_snapshot`. Executables are defined in an `http_archive` using
# `haskell_cabal_binary`.
load("@bazel_skylib//lib:dicts.bzl", "dicts")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@os_info//:os_info.bzl", "is_windows")
load("@rules_haskell//haskell:cabal.bzl", "stack_snapshot")
load("@dadew//:dadew.bzl", "dadew_tool_home")
def daml_haskell_deps():
"""Load all Haskell dependencies of the DAML repository."""
use_integer_simple = not is_windows
stack_snapshot(
name = "stackage",
extra_deps = {
"zlib": ["@com_github_madler_zlib//:libz"],
},
flags = dicts.add(
{
"cryptonite": ["-integer-gmp"],
"hashable": ["-integer-gmp"],
"integer-logarithms": ["-integer-gmp"],
"text": ["integer-simple"],
"scientific": ["integer-simple"],
} if use_integer_simple else {},
),
haddock = False,
local_snapshot = "//:stack-snapshot.yaml",
packages = [
"aeson",
"async",
"base",
"bytestring",
"containers",
"cryptonite",
"directory",
"extra",
"filepath",
"http-conduit",
"jwt",
"lens",
"memory",
"monad-loops",
"network",
"optparse-applicative",
"process",
"safe",
"safe-exceptions",
"semver",
"split",
"tagged",
"tasty",
"tasty-hunit",
"text",
"optparse-applicative",
"unordered-containers",
] + (["unix"] if not is_windows else ["Win32"]),
stack = "@stack_windows//:stack.exe" if is_windows else None,
tools = [
],
)
if is_windows:
native.new_local_repository(
name = "stack_windows",
build_file_content = """
exports_files(["stack.exe"], visibility = ["//visibility:public"])
""",
path = dadew_tool_home("stack"),
)