daml/compiler/daml-lf-proto/BUILD.bazel

116 lines
2.7 KiB
Python
Raw Normal View History

# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2019-04-04 11:33:38 +03:00
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:haskell.bzl", "da_haskell_library")
2019-04-04 11:33:38 +03:00
da_haskell_library(
name = "daml-lf-util",
srcs =
[
"src/DA/Daml/LF/Mangling.hs",
"src/DA/Daml/LF/Proto3/Error.hs",
"src/DA/Daml/LF/Proto3/Util.hs",
],
hackage_deps = [
2019-04-04 11:33:38 +03:00
"base",
"bytestring",
"either",
"text",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = [
"//compiler/daml-lf-ast",
"//daml-lf/archive:daml_lf_dev_archive_haskell_proto",
],
)
da_haskell_library(
name = "daml-lf-proto-decode",
srcs = [
"src/DA/Daml/LF/Proto3/Archive/Decode.hs",
"src/DA/Daml/LF/Proto3/Decode.hs",
"src/DA/Daml/LF/Proto3/DecodeV1.hs",
],
hackage_deps = [
"base",
"containers",
2019-04-04 11:33:38 +03:00
"lens",
"cryptonite",
2019-04-04 11:33:38 +03:00
"memory",
"bytestring",
intern package IDs in LF (#1614) * specify the new fields for interning package IDs * percolating intern tables * crawl packages for package IDs as a pre-phase: generic prep * stub case for interned_id in Scala packageref reader * HasPackageRefs instances for the rest of the ast * make intern table and use when encoding PackageRefs in v1 * don't need where * stub out decode for interned package IDs * no benefit to using uint32 instead of uint64 * percolate in encode one step * interned case for decoding PackageRefs * naming details * intern table decoder * finish propagating the intern table in encoder * encode the package ID table * document the vital assumption of encodeInternedPackageIds * propagate the intern table through the LF decoder - done by stacking ReaderT on top of Decode internally, as discussed with @hurryabit * daml-lf-proto requires mtl * stub out interned case in Scala LF decoder * stub interface decoder function * get the interned table to most places in InterfaceReader * support for interned package IDs in Scala decoder * use ImmArraySeq instead of Vector for Scala intern decode table * adding that ghc extension didn't make sense * implement interned ID decoding for InterfaceReader * scenario service won't have interned package IDs * test the interned ID resolution in Scala by examining the proto -> AST in detail * proper precondition for the dev phase of interned IDs testing * better error reporting for malformed DALFs in intern test * just import Data.Int - suggested by @neil-da; thanks * pass around the lookup function instead of the vector in decoder - suggested by @neil-da; thanks * remove derivations for types deleted in e63b012d2d * rename VersionAware to EncodeCtx - suggested by @hurryabit; thanks * rename MDecode to MonadDecode - suggested by @hurryabit; thanks * pass a function through the encoder instead of a set - based on suggestions by @hurryabit and @neil-da; thanks * daml-ghc test that interned IDs are generated - suggested by @hurryabit; thanks * adapt to 5b480c99ec #1844
2019-06-26 12:15:24 +03:00
"mtl",
"proto3-suite",
2019-04-04 11:33:38 +03:00
"text",
"vector",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":daml-lf-util",
"//compiler/daml-lf-ast",
"//compiler/damlc/stable-packages:stable-packages-list",
"//daml-lf/archive:daml_lf_dev_archive_haskell_proto",
"//libs-haskell/da-hs-base",
],
)
da_haskell_library(
name = "daml-lf-proto-encode",
srcs = [
"src/DA/Daml/LF/Proto3/Archive/Encode.hs",
"src/DA/Daml/LF/Proto3/Encode.hs",
"src/DA/Daml/LF/Proto3/EncodeV1.hs",
],
hackage_deps = [
"base",
"bytestring",
"cryptonite",
"memory",
"containers",
"mtl",
"lens",
"text",
"vector",
"proto3-suite",
"unordered-containers",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":daml-lf-util",
"//compiler/daml-lf-ast",
"//daml-lf/archive:daml_lf_dev_archive_haskell_proto",
"//libs-haskell/da-hs-base",
],
)
da_haskell_library(
name = "daml-lf-proto",
srcs = [
"src/DA/Daml/LF/Proto3/Archive.hs",
],
hackage_deps = [
"base",
"containers",
"cryptonite",
"memory",
"bytestring",
"mtl",
"lens",
"text",
2019-04-04 11:33:38 +03:00
"vector",
"proto3-suite",
"unordered-containers",
2019-04-04 11:33:38 +03:00
],
visibility = ["//visibility:public"],
deps = [
":daml-lf-proto-decode",
":daml-lf-proto-encode",
":daml-lf-util",
"//compiler/daml-lf-ast",
"//daml-lf/archive:daml_lf_dev_archive_haskell_proto",
"//libs-haskell/da-hs-base",
],
2019-04-04 11:33:38 +03:00
)