Commit Graph

218 Commits

Author SHA1 Message Date
Remy
027d63a787 java representation for value GenMap (#3515) 2019-11-19 08:53:15 +00:00
Remy
fedc49dd12 leger-api: add GenMap support (#3506)
* leger-api: add GenMap support

* cosmetic

* Address Gerolf's  comment

* add a point in the release notes

* Address Fran's comments
2019-11-18 18:13:25 +00:00
Remy
43eb69cbbd DAML-LF: add GenMap tests for LF encoder (#3491)
* daml-lf: fix decoder

* daml-lf: extend testing dar for encoder

* add EOF to .lf files

* change 1.dev to 1.7 for java codegen encoding test

* formatting

* fixes
2019-11-18 10:07:13 +00:00
Remy
4bd98b6cbc DAML-LF: add GenMap in iface reader (#3487)
* daml-lf: add GenMap in iface reader

* remove useless code

* Update language-support/scala/codegen/src/main/scala/com/digitalasset/codegen/lf/LFUtil.scala

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

* please restart CI
2019-11-17 08:12:10 +00:00
Gerolf Seitz
172ce90597
Upload codegen fat-jars to maven central (#3476) 2019-11-14 18:40:54 +01:00
Fabio Tudone
011cb0cdcb Fix build command typo in quickstart-scala's README.md (#3459) 2019-11-13 17:18:03 -05:00
Stefano Baghino
f55a044312 Remove font coloring (#3448) 2019-11-13 12:38:22 +00:00
Andreas Herrmann
c7038f128e Fix Bazel warnings (#3414)
* No longer depend on "@bazel_tools//tools/jdk:jar"

To avoid the following warnings
```
WARNING: /home/aj/.cache/bazel/_bazel_aj/c1e06e2358666d118d0ae50e2d32c25d/external/bazel_tools/tools/jdk/BUILD:124:1: in alias rule @bazel_tools//tools/jdk🫙 target '@bazel_tools//tools/jdk:jar' depends on deprecated target '@local_jdk//:jar': Don't depend on targets in the JDK workspace; use @bazel_tools//tools/jdk:current_java_runtime instead (see https://github.com/bazelbuild/bazel/issues/5594)
```

* Targets and files should not share names

To avoid the warning
```
WARNING: /home/aj/tweag.io/da/da-master/compiler/damlc/tests/BUILD.bazel:316:1: target 'simple-dalf.dalf' is both a rule and a file; please choose another name for the rule
```
2019-11-11 15:41:34 +00:00
Stefano Baghino
377b43f2d6
Pass token in individual calls, remove default location for client token (#3403)
* Pass token in individual calls, remove default location for client token

* Fix things for AuthorizationIT

* Fix ledger-service usages of LedgerClient

* Fix remaining compilation errors
2019-11-11 16:22:25 +01:00
Martin Huschenbett
6fe3df57cd Rewrite PRSelf when loading a dependency package (#3406)
When buidling simple project that has our favourite large project as a
dependency, this decreased
- total allocations from 63GB to 57GB
- run time from 34.0s to 31.5s
2019-11-11 08:52:07 +00:00
Remy
d39d7974fc daml-lf: freeze version 1.7 (#3340)
* daml-lf: freeze daml-lf 1.7

* speedy: remove useless double checks
2019-11-07 09:51:18 +00:00
Stefano Baghino
c8aaffd62c Add GrpcException extractor (#3344)
* Add GrpcException extractor

* Use GrpcStatus in integration test

* Fix compilation error

* Fix compilation error

* Address https://github.com/digital-asset/daml/pull/3344#discussion_r342981204

* Restricting extractor types
2019-11-06 14:44:06 +00:00
Remy
2885766826 daml-lf-encoder: validate dar generated by the encoder (#3339) 2019-11-05 15:15:08 +00:00
Stefano Baghino
42051ae037
Add and validate expiration on claims (#3286)
* Add and validate expiration on claims

* Address review comments

* Test existing services for token expiration

* Test expiration mid-stream

* Address https://github.com/digital-asset/daml/pull/3286#pullrequestreview-309710454
2019-10-31 13:14:44 -04:00
Andreas Herrmann
2bd1db490a
Replace bazel-deps by rules_jvm_external (#3253)
* Update bazel-common to fix javadoc issues

Specifically, to fix the following error

```
ERROR: /home/aj/tweag.io/da/da-bazel-1.1/ledger-api/rs-grpc-bridge/BUILD.bazel:7:1: in javadoc_library rule //ledger-api/rs-grpc-bridge:rs-grpc-bridge_javadoc:
Traceback (most recent call last):
        File "/home/aj/tweag.io/da/da-bazel-1.1/ledger-api/rs-grpc-bridge/BUILD.bazel", line 7
                javadoc_library(name = 'rs-grpc-bridge_javadoc')
        File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/com_github_google_bazel_common/tools/javadoc/javadoc.bzl", line 27, in _javadoc_library
                dep.java.transitive_deps
object of type 'JavaSkylarkApiProvider' has no field 'transitive_deps'
```

* Define Maven deps using rules_jvm_external

* Pin artifacts

* Remove bazel-deps generated targets

* Remove bazel-deps

* Switch to rules_jvm_external targets

* update bazel documentation

* pom_file: There are no more bazel-deps targets

* BAZEL-JVM.md `maven_install` typo
2019-10-28 13:53:14 +01:00
Remy
25c3797d89
DAML-LF Numeric: compute properly the value version for + test update (#3122)
* extractor: update test with numerics
* java-codegen: test numeric
* fix some numeric tests
* fix assignVersion for values
2019-10-17 13:17:21 +02:00
Remy
e45b585307 daml-lf: repackage daml-lf archive proto (daml_lf -> daml_lf_dev) (#3169) 2019-10-15 09:36:11 +00:00
Remy
d64df4b5f7 daml-lf: clean achive bazel build (#3175)
* clean the mess in daml-lf achive bazel build

* add release note

* Address Moritz's comments

* more release notes
2019-10-15 08:36:46 +00:00
Remy
fc1a000090 daml-lf: rename daml_lf_archive_scala target to daml_lf_archive_reader (#3168)
* daml-lf: rename daml_lf_archive_scala target to daml_lf_archive_reader

* fix release
2019-10-14 14:53:50 +00:00
Gerolf Seitz
e310cbe143 Fix automatic retry mechanism in scala bindings. (#3061)
* Fix automatic retry mechanism in scala bindings.

This fix only affects the usage of
com.digitalasset.ledger.client.binding.LedgerClientBinding#retryingConfirmedCommands

The retry mechanism didn't distinguish between submission failures and
final completion failures. Retrying completion failures with the same
commandId doesn't make sense, as the deduplication mechanism will kick
in.
The new mechanism now only retries commands with an updated LET and MRT
in case the server responds with a RESOURCE_EXHAUSTED status code (i.e.
backpressure).

Fixes #3057.

* Add UNAVAILABLE as retryable error code

* fix unreleased.rst
2019-10-11 08:17:33 +00:00
Leonid Shlyapnikov
06a4d56025
Scala codegen StackOverflowError fix (#3159)
* introducing map and bimap

not relying on default implementations provided by Traverse and Bitraverse

* lazy collect

* updating release doc

* cleanup

* daml-lf/interface: add foldMap overrides

* implementing `bifoldMap` explicitly for `DefDataType` and `DataType`

* replacing `toStream` with `to[ImmArraySeq]`, updating release notes
2019-10-10 17:15:08 -04:00
Richard Kapolnai
4c280a5f1b Add helper to Java Bindings to prepare transformer for Bot.wire. (#3098)
* Add helper to Java Bindings to prepare transformator for Bot.wire. Fixes #3097

* Java bindings: rename to contractTransformer

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Rename to transformer

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Keep error info for invalid class

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Add generic info to declaration

* Add test for contract tranformer

* Add license header

* Improve contractTransformer by storing reflection results

* Rename folder scala to java

* Add maven coordinates tag

* rename bazel goal back to bindings-java-tests

* integrate contract transformation test with codegen

* manual merge on unreleased.rst

* add daml model for integration testing
2019-10-07 17:38:26 +02:00
Oliver Seeliger
c9658c7813
Multi participant node named logging (#2647) (#3080)
* Upgrade scala-logging and slf4j

* Named logging for multi-participant tests (#2647)
2019-10-03 18:20:57 +02:00
Gary Verhaegen
5e0f664473
fix haskell export script (#3076) 2019-10-03 08:36:14 +02:00
Remy
d540f7aab0 Daml-LF: change Numeric max scale from 38 to 37 (#2969)
* daml-lf: numeric maxScale change from 38 to 37

* daml-lf: update spec

* udpate protobuf comments
2019-09-23 12:39:28 +00:00
Leonid Shlyapnikov
c982478c6e Fixing quickstart-scala example and doc (#2901)
* Fixing quickstart-scala example

* Updating docs

* Adding Scala codegen config

* Minor cleanup

* Apply suggestions from code review

Applying doc changes, thanks @bame-da!

Co-Authored-By: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2019-09-16 12:44:04 +00:00
Leonid Shlyapnikov
4a9fb1ccff
DAML assistant codegen command (#2800)
* DAML assistant codegen command, codegen config reader and docs
2019-09-12 14:23:49 -04:00
Stefano Baghino
47d8432670
Panic on interface reader error (#2890) 2019-09-12 15:15:21 +02:00
nickchapman-da
69b520c879
Hlb update and document external build steps (#2769)
* stack setup for HLB and Nim

* build_packages.sh and daml-ledger.cabal

* update README

* export-package for daml-ledger

* export-package, run here

* find tmp daml-ledger

* update README for review comments

* ref daml instructions

* further improve the process and documentation in response to comments

* have -with-rtsopts match the bazel build

* fixes for Gary
2019-09-09 14:37:03 +01:00
Andreas Herrmann
ed39800a9f Rename hazel_deps to hackage_deps (#2789)
* hazel_deps --> hackage_deps

Mechanical change:

```
sed -i 's/hazel_deps/hackage_deps/g' $(ag -l hazel_deps)
```

* Hazel dependencies --> Hackage dependencies
2019-09-06 09:01:09 +00:00
Moritz Kiefer
1fa15ffb1d
Fix typo in filterEverythingForParty in HS ledger bindings (#2771) 2019-09-05 16:08:34 +02:00
Remy
3ee9b83fb1 daml-lf: adapt interface reader to Numeric (#2666) 2019-09-02 10:02:56 +02:00
Remy
20649cf78e ledger-api: rename decimal field to numeric in value Proto (#2688)
* add Numeric.java

* ledger-api: rename `decimal` field to `numeric` in value protobuf

* Address Gerolf's comment

* ledger-api: add missing renammings

* ledger-api: relax syntax of numbers that can be sent as numerics

* extractor:  fix

* leger-api: change format of number though ledger api

* daml-lf: fix numeric regexp

* ledger: fix tests
2019-08-29 22:51:33 +00:00
Moritz Kiefer
3cda28935b Refactor DAR manifest reader (#2699)
* Refactor DAR manifest reader

This PR replaces the ad hoc string munging by a proper parser.

* Fix tests

* Fix more tests

* Factor out isHeaderChar
2019-08-29 10:26:53 +00:00
Moritz Kiefer
96bc868261 Mark Haskell ledger bindings tests flaky on all platforms (#2692) 2019-08-28 15:37:12 +00:00
Remy
6a96060af1 daml-lf: udpate LF protobuf for numerics (#2649)
* daml-lf: update proto for Numerics

* daml-lf: test decoder

* daml-lf: update spec

* daml-lf: polish proto doc

* damlc: address reviewers' comments

* daml-lf: minor fix
2019-08-26 11:55:48 +00:00
nickchapman-da
ea02814b34
hlb, remove dependency on DAML-LF libs (#2650)
* hlb, remove dependency on DAML-LF libs

* Update language-support/hs/bindings/src/DA/Ledger/Services/PackageService.hs

newtype instead of data

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2019-08-23 18:00:58 +01:00
Stefano Baghino
d79e03d42c
Ensure uniqueness of decoding and encoding methods (#2651)
Fixes #2367
2019-08-23 17:31:37 +02:00
Remy
9a4dff63b2
daml-lf: introduce Numeric in internal AST (#2608)
* daml-lf: introduce numeric in daml-lf AST
* daml-lf: add test for command preprocessor
* interface-reader: fix for Numerics
* Address Gerolf's review
2019-08-23 15:27:14 +02:00
Moritz Kiefer
67c2e2a9ef
Switch to upstream gRPC-haskell (#2642)
* Switch to upstream gRPC-haskell
2019-08-23 15:10:15 +02:00
Gerolf Seitz
32a61b275f Java Codegen now supports parametrized ContractIds. (#2621)
Fixes #2258
2019-08-22 12:01:22 +00:00
Moritz Kiefer
49b2ec1558
Refactor gRPC request cancellation support in gRPC-haskell (#2626)
* Refactor gRPC request cancellation support in gRPC-haskell

Previously, we had a separate constructor that took an additional
callback that had access to the client call so that we could use that
for cancellation. This PR removes the separate constructor and instead
changes the callback accepted by ClientReaderRequest (and for
consistency also the one accepted by ClientBiDiRequest) to pass the
client call.

This seems like a simpler solution so I’m more hopeful that we will be
able to upstream this change (this is the only API breaking change we
made afaik). There are two caveats here:

1. This will break existing consumers that use ClientReaderRequest. At
this stage in gRPC-haskell this is very reasonable and upstream
doesn’t seem to try very hard to avoid those.

2. The callback is called slightly later than the custom callback we
added before so you have to wait a bit longer until you can cancel
things. At least on our test suite that doesn’t seem to make a
difference.
2019-08-22 12:53:30 +02:00
Bernhard Elsner
d9298c8744 Various improvements to make hs-bindings usable outside repo (#2583) 2019-08-19 16:44:45 +00:00
Bártfai Tamás
a76f82d088 Fix log level for errors in Bot.java (#2581) 2019-08-17 19:42:54 +02:00
Moritz Kiefer
6a0ebc9f5e Go back to building grpc-haskell-core using c2hs (#2574)
* Go back to building grpc-haskell-core using c2hs

This should hopefully avoid issues like the CSize vs CULong issue we
had a while back and might fix some of the issues we have been seeing
on CI.

I’m marking the Haskell ledger bindings as non-flaky for now so we can
see if the issues reappear.

* Fix path

* Fix c2hs runfiles

* s/basedir/dirname/

* Fix varname

* Remove fixme \o/

* Mark hs ledger bindings flaky again
2019-08-16 14:17:11 +00:00
Moritz Kiefer
f3f2d3311b
Remove dependency on isolated sandboxes from HS ledger bindings tests (#2554)
The only tests that relied on this, were the ones for package
management and party management but we can fairly easily remove that
dependency by only checking the diff in packages and thereby folding
the listKnown* and uploadParty/uploadDar file into a combined test.

I’ve also bumped one timeout that I’ve seen fail on CI and managed to
get to fail locally under load.

I am unable to get the tests to fail now locally so I’ve marked them
as non-flaky on everything but Windows (we’ve seen weird segfaults
there).
2019-08-15 11:50:51 +02:00
Moritz Kiefer
ef635ea301
Mark tests that use Haskell gRPC bindings as flaky (#2521)
I’m hoping to investigate this soon but for now this should hopefully
result in less time spend restarting tests.
2019-08-13 20:38:51 +02:00
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
Moritz Kiefer
8f587dc456
Use per-test parties in HS ledger bindings tests (#2481)
* Use per-test parties in HS ledger bindings tests

This should hopefully solve the flakiness issues caused by the reset
service. For now, there is a very small number of tests that we run on
an isolated sandbox namely the tests for party management and package
management.

* shut up hlint

* Disable reset tests
2019-08-12 12:56:18 +02:00
nickchapman-da
5ebc5e4d19
Hlb apps package discovery (#2455)
* suggested tiny code simplifications

* fix package discovery for Nim/Chat ledger apps
2019-08-08 16:50:17 +01:00