mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
122 lines
3.3 KiB
Python
122 lines
3.3 KiB
Python
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
load("//bazel_tools:haskell.bzl", "da_haskell_binary", "da_haskell_library", "da_haskell_repl", "da_haskell_test")
|
|
load("//rules_daml:daml.bzl", "daml_compile")
|
|
load("@os_info//:os_info.bzl", "is_darwin")
|
|
|
|
da_haskell_library(
|
|
name = "hs-ledger",
|
|
srcs = glob(["src/**/*.hs"]),
|
|
hackage_deps = [
|
|
"aeson",
|
|
"async",
|
|
"base",
|
|
"bytestring",
|
|
"containers",
|
|
"exceptions",
|
|
"extra",
|
|
"grpc-haskell",
|
|
"grpc-haskell-core",
|
|
"mtl",
|
|
"proto3-suite",
|
|
"retry",
|
|
"sorted-list",
|
|
"text",
|
|
"time",
|
|
"transformers",
|
|
"unliftio",
|
|
"utf8-string",
|
|
"vector",
|
|
"scientific",
|
|
],
|
|
src_strip_prefix = "src",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//canton:ledger-api-haskellpb",
|
|
],
|
|
)
|
|
|
|
daml_compile(
|
|
name = "for-tests",
|
|
srcs = glob(["test/daml/for-tests/*.daml"]),
|
|
# TODO(#17366): remove explicit target once LF2 is the default
|
|
target = "2.1",
|
|
)
|
|
|
|
daml_compile(
|
|
name = "for-upload",
|
|
srcs = ["test/daml/for-upload/ExtraModule.daml"],
|
|
# TODO(#17366): remove explicit target once LF2 is the default
|
|
target = "2.1",
|
|
)
|
|
|
|
da_haskell_test(
|
|
name = "test",
|
|
srcs = glob(["test/**/*.hs"]),
|
|
data = [
|
|
":for-tests.dar",
|
|
":for-upload.dar",
|
|
] + (["@sysctl_nix//:bin/sysctl"] if is_darwin else []),
|
|
# The tests throw flaky timeout errors. It looks like this comes
|
|
# from a fundamental issue in the Haskell bindings: they eagerly pull
|
|
# from streams and those stream receives have a timeout. If we create the
|
|
# stream too early and do a bunch of other stuff in between, this will then timeout.
|
|
# We could increase the timeout to an absurd value but that also seems silly
|
|
# and affects other operations as well so for now, we still keep it flaky
|
|
# and try not to cry.
|
|
flaky = True,
|
|
hackage_deps = [
|
|
"aeson",
|
|
"async",
|
|
"base",
|
|
"bytestring",
|
|
"containers",
|
|
"filepath",
|
|
"directory",
|
|
"extra",
|
|
"jwt",
|
|
"process",
|
|
"random",
|
|
"retry",
|
|
"safe",
|
|
"tasty",
|
|
"tasty-hunit",
|
|
"text",
|
|
"time",
|
|
"utf8-string",
|
|
"uuid",
|
|
"vector",
|
|
"zip-archive",
|
|
],
|
|
main_function = "DA.Ledger.Tests.main",
|
|
src_strip_prefix = "test",
|
|
# We spin up Sandbox as a separate process, so
|
|
# try not to overload the machine.
|
|
tags = [
|
|
"cpu:4",
|
|
"main-only",
|
|
] + (["manual"] if is_darwin else []),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//compiler/daml-lf-ast",
|
|
"//compiler/daml-lf-proto",
|
|
"//compiler/daml-lf-reader",
|
|
"//language-support/hs/bindings:hs-ledger",
|
|
"//libs-haskell/bazel-runfiles",
|
|
"//libs-haskell/canton-test-utils",
|
|
],
|
|
)
|
|
|
|
da_haskell_repl(
|
|
name = "repl",
|
|
testonly = True,
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//language-support/hs/bindings:hs-ledger",
|
|
"//language-support/hs/bindings:test",
|
|
"//language-support/hs/bindings/examples/chat",
|
|
"//language-support/hs/bindings/examples/nim",
|
|
],
|
|
)
|