Commit Graph

65 Commits

Author SHA1 Message Date
Remy
41543ad161
LF: drop support for Exercise's actors (#8071)
This is a first set toward dropping support of deprecated LF version
(#7155).

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-26 14:38:16 +01:00
Remy
0e4adfc47b
LF: clean LF encoder from deprecated LF versions (#8049)
This advances the state of #7788.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 15:56:13 +01:00
nickchapman-da
b7f8e3a812
Regularize scala mod-parser syntax for controllers (#7748)
* Regularize scala mod-parser syntax for controllers in preparation for adding choice-observers.

From keyword "by" to identifier "controllers" + leading ","

changelog_begin
changelog_end

* fix another use of the old "by" syntax -> ", controllers"
2020-10-20 16:16:45 +01:00
Remy
0bb378690d
LF: Add ExerciseByKey Update (#7663)
CHANGELOG_BEGIN
CHANGELOG_END
2020-10-14 12:06:36 +02:00
Remy
dc34d4f637
LF: add PackageInterface a lightweigh Package (#7577)
CHANGELOG_BEGIN
CHANGELOG_END
2020-10-13 12:41:22 +02:00
Remy
ea2a637a11
LF: decouple template from record in the Scala Ast. (#7631)
CHANGELOG_BEGIN
CHANGELOG_END
2020-10-12 11:28:30 +02:00
Remy
31f274ebca
LF: force actor field in Exercise Update to be undefined. (#7578)
* LF: force `actor` field in Exercise Update to be undefined.

This PR forces the field 'actor' from 'Upate.Exercise' to be undefined
starting from LF 1.5.

This breaking change is approved by Bernhard Elsner and Shaul Kfir.

It will affect only handcrafted LF archives, as no compiler from SDK
1.0.0 or latter made use of this field.

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-07 14:42:10 +02:00
Remy
a899e5e4e6
Speedy: Check language version as part of Speedy compilation. (#7440)
Additionnally
+ move allowedLanguageVersion inside compiler config
+ add missing catch error insde
  ConcurrentCompiledPackages#addPackageInternal
+ implement EngineConfig method to easily produce a Compiler.Config

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-22 12:43:48 +02:00
Remy
42dcac38f0
[LF] Drop some tests for deprecated LF versions (#7449)
Since #5321, LF versions < 1.6 are deprecated. 
This PR drops some tests for those deprecated versions.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-21 15:36:47 +02:00
Remy
ada8ba033b
LF: ad-hoc data struct to store LF Struct like data (#7220)
A `Struct[+X]` is a list of pair `(FieldName, X)` ordered by first
component.

We use this data-structure to represent TStruct LF type.

It will be used in upcomming PRs to sorted fields in Struct values.

CHANGELOG_BEGIN
CHANGELOG_END
2020-08-26 12:18:18 +02:00
Remy
17abe2f4cd
DAML for PostgreSQL: prevent dev version of DAML-LF (#7176)
Add a hidden flag to enable dev mode for testing purpose only.

CHANGELOG_BEGIN
CHANGELOG_END
2020-08-20 12:15:38 +02:00
Remy
17926c5a8a
LF: move language version from modules to packages (#7064)
CHANGELOG_BEGIN
CHANGELOG_END
2020-08-10 11:26:58 +02:00
Stephen Compall
4355406259
add more scalac 2.12 warnings (#6798)
* set many extra scalac -Xlint options for all Scala projects

CHANGELOG_BEGIN
CHANGELOG_END

* move NoCopy to its own file

package.scala:18: warning: it is not recommended to define classes/objects inside of package objects.
If possible, define trait NoCopy in package data instead.
  trait NoCopy {
        ^

* move more traits, classes, and objects to proper packages

- note that `package` is itself a scoping construct, so if your reason
  is the apparent aesthetic of placing a bunch of things in one `package
  object`, that is easily remedied by deleting the `object` keyword

* fix some type-parameter-shadow warnings

- I'm generally in favor of sensible name-shadowing, following the
  "deliberately hide variables that should not be accessed here" school
  of thought.  But I think type name shadowing isn't quite as valuable
  and more likely to confuse than general variable shadowing, so have
  experimentally linted it out.

  Example warning:

EventsTableFlatEventsRangeQueries.scala:11: warning: type parameter
 Offset defined in trait EventsTableFlatEventsRangeQueries shadows class
 Offset defined in package v1. You may want to rename your type
 parameter, or possibly remove it.
private[events] sealed trait EventsTableFlatEventsRangeQueries[Offset] {
                                                               ^

* fix more package-object-classes warnings

* fix an inaccessible warning

ContractsService.scala:197: warning: method searchDb in class ContractsService references private class ContractsFetch.
Classes which cannot access ContractsFetch may be unable to override searchDb.
  def searchDb(dao: dbbackend.ContractDao, fetch: ContractsFetch)(
      ^

* enable -Xlint:infer-any

- continuing the saga of #6116, #6132

* enable -explaintypes for more detailed type errors

* missed header for NoCopy; probably should have left it in the package file

* misspelling in comment

* revert -Xlint:doc-detached

- there are a lot of these fixes, and they are noisy, so shifting to a
  separate PR
- thanks to @leo-da for pointing out
2020-07-21 08:18:01 -04:00
Remy
50694c7abe
DAML-LF. fix parameter and self binder in choices. (#5444)
* DAML-LF. fix parameter and self binder in choices.

* fix

* DAML-LF: address moritz's comments

* changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-06 14:32:30 +00:00
Remy
943919585e
Java Codegen: fix template code generation (#5443)
* Java Codegen: fix template code generation

* changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-06 08:56:51 +00:00
Gerolf Seitz
a2d785e3ee
Use com.daml as root package (#5343)
Packages com.digitalasset.daml and com.daml have been unified under com.daml

Ledger API and DAML-LF DEV protos have also been moved from `com/digitalasset`
to `com/daml` on the file system.
Protos for already released DAML LF versions (1.6, 1.7, 1.8) stay in the
package `com.digitalasset`.

CHANGELOG_BEGIN
[SDK] All Java and Scala packages starting with
``com.digitalasset.daml`` and ``com.digitalasset`` are now consolidated
under ``com.daml``. Simply changing imports should be enough to
migrate your code.
CHANGELOG_END
2020-04-05 19:49:57 +02:00
Gary Verhaegen
1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00
Remy
ac8554eddd
Engine: drop old internal comparsion builtin (#4990)
* Engine: drop old internal comparison builtin

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-16 15:15:32 +01:00
Moritz Kiefer
d68d3eb74a
Freeze DAML-LF 1.8 (#4770)
* Freeze DAML-LF 1.8

Two minor points that I did not mention in the previous PR:

We also include the renaming of structural records to `struct` and the
renaming of `Map` to `TextMap`.

There are some minor changes around the LF encoder tests which need to
be able to emit package metadata properly so I’ve added it to the
parser. Sorry for not splitting that out.

Following the process used for the DAML-LF 1.7 release, this does not
yet include the frozen proto file.

changelog_begin

- [DAML-LF] Release DAML-LF 1.8:

  * Rename structural records to ``Struct``. Note that
    structural records are not exposed in DAML.
  * Rename ``Map`` to ``TextMap``.
  * Add type synonyms. Note that type synonyms are not serializable.
  * Add package metadata, i.e., package names and versions.

  Note that the default output of ``damlc`` is stil DAML-LF 1.7. You
  can produce DAML-LF 1.8 by passing ``--target=1.8``.

changelog_end

* Update encoder

* Update java codegen tests

* Update comment in scala codegen

* Handle TSynApp in interface reader

* Bump lf_stable_version to 1.7

* Fix kvutils tests
2020-03-02 18:29:26 +01:00
Moritz Kiefer
c68dd19ade
Decode and validate package metadata in Scala (#4653)
This adds the code for decoding and validating package metadata
that is now emitted by damlc.

changelog_begin
changelog_end
2020-02-21 18:20:42 +00:00
nickchapman-da
62d592ec62
support type synonyms in scala (#4101)
* Support DAML-LF type synonyms in scala.

CHANGELOG_BEGIN
CHANGELOG_END

* dont create synonymns in GenerateSimpleDalf

* extend DAML-LF parser to support type synonyms

* test: expand type synonyms correctly
2020-01-23 10:49:28 +00:00
Andreas Herrmann
43bbfeaee6
Remove unused dependencies to da_scala_binary (#3937)
* Inline all scala_binary dependencies

* Run //:buildifier-fix

* da_scala_binary: Enable unused dependency checker

* //compiler/scenario-service/server:scenario-service-raw

* //language-support/scala/codegen:codegen-main

* //daml-lf/encoder:encoder_binary

* //daml-lf/repl:repl

* //language-support/codegen-main:codegen-main

* //language-support/scala/examples:quickstart-scala-bin

* //ledger-api/rs-grpc-akka:rs-grpc-akka-perf

* //ledger-service/jwt:jwt-bin

* //ledger/api-server-damlonx/reference-v2:reference-v2

* //ledger/api-server-damlonx/reference-v2:ephemeral-postgres-reference-server

* //ledger/ledger-api-auth:ledger-api-auth-bin

* //ledger/ledger-api-test-tool:ledger-api-test-tool

* //ledger/participant-state/kvutils/tools:integrity-check

* //navigator/integration-test:navigatortest-jar

* Run //:buildifier-fix

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-06 13:58:56 +01:00
Gary Verhaegen
878429e3bf
update copyright notices to 2020 (#3939)
copyright update 2020

* update template
* run script: `dade-copyright-headers update .`
* update script
* manual adjustments
* exclude frozen proto files from further header checks (by adding NO_AUTO_COPYRIGHT files)
2020-01-02 21:21:13 +01:00
Andreas Herrmann
9fbb787062 Remove unused dependencies to da_scala_test(_suite) (#3925)
* Remove unused scala.bzl imports

* override_targets org.scalatest.scalatest_2.12

Otherwise, rules_scala implicitly adds a different version to scala_test
than other packages transitively depending on scalatest. This causes
unused dependency checker to raise an error.

* Handle rules_scala scalatest in pom_file.bzl

* Inline all scala_test dependencies

So that `unused_dependency_checker = "error"` can be applied to them.

* Run //:buildifier-fix

* TMP scala_test_suite --> scala_test

* da_scala_test: Enable unused dependency checker

* //navigator/backend:navigator-scala-tests

* //ledger/sandbox:sandbox-scala-tests

* //ledger/participant-state/kvutils:kvutils-tests

* //ledger/participant-state:participant-state-tests

* //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test

* //ledger/ledger-api-common:ledger-api-common-scala-tests

* //ledger/ledger-api-client:ledger-api-client-tests

* //ledger/ledger-api-auth:ledger-api-auth-scala-tests

* //ledger-service/lf-value-json:tests

* //ledger-service/jwt:tests

* //ledger-service/http-json:tests

* //ledger-api/rs-grpc-akka:rs-grpc-akka-tests

* //language-support/scala/codegen-sample-app:tests

* //language-support/scala/codegen-sample-app:ScalaCodeGenIT

* //language-support/scala/codegen:tests

* //language-support/scala/bindings-akka:tests

* //language-support/java/codegen:test

* //language-support/java/codegen:ledger-tests

* //language-support/java/bindings-rxjava:bindings-java-tests

* //language-support/codegen-common:test

* //extractor:extractor-scala-tests

* //daml-lf/scenario-interpreter:scenario-interpreter_tests

* //daml-lf/language:language-test

* //daml-lf/interface:tests

* //daml-lf/engine:tests

* //daml-lf/encoder:tests

* //daml-lf/archive:daml_lf_archive_reader_tests

* //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests

* UNDO scala_test_suite --> scala_test

This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac.

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 13:49:59 +00:00
Remy
e055b2bd9b DAML LF: expose generic equality in LF (#3752)
* daml-lf: expose generic equality

* drop unnecessary parentheses

* fix issue number

* address Fran's comments
2019-12-06 14:12:48 +00:00
Remy
ac420a483b Daml LF Encoder: reactivate and fix tests (#3748)
* daml-lf-encoder: reactivate and fix tests

* lf encoder: fix test

* address reviews
2019-12-06 10:37:03 +00:00
Jussi Mäki
95ddb65483
DAML Engine: accurate package dependency annotations (#3726)
* Track used packages during whole of engine submit

- Introduce MutableCompiledPackages interface
- Add TrackingCompiledPackages that tracks fetched packages
- Make used packages in transaction optional to distinguish between
  missing dependencies and empty set of dependencies.

* Reimplement package dependency tracking

- Compute direct dependencies of a package during decoding
- Compute transitive dependencies of a package when adding a package
  to engine.
- Annotate the resulting transaction with package dependencies
  in Engine.submit.

* Create Ast.Package with proper direct deps in scenario service

While we don't have use for direct dependencies of a package in
scenario service (only Engine.submit needs it), it's better to be
accurate.

This of course overapproximates the direct dependencies.

* Compile a each new package once in ConcurrentCompiledPackages
2019-12-04 15:01:21 +01:00
Remy
5e63db7a40 speedy: Rename SMap to STextMap (#3664)
+ rename MAP to TEXTMAP in decoder/encoder
2019-11-28 17:05:26 +00:00
Remy
d465787dde Extractor: Add support for GenMap (#3614)
* Ledger-service: fix json encoding for genMap

* Extractor: Add support for GenMap

* Address Leo's comments
2019-11-28 12:31:28 +00:00
nickchapman-da
885bbefdf3 rename structural records: tuple -> struct (#3660)
* rename structural records: tuple -> struct

* add missing renames (tuple -> struct) in comments, var-names and error messages

* exposition: structural vs nominal; change history note

* remove accidentilly checked-in file
2019-11-28 10:00:24 +00:00
nickchapman-da
d3d6891021
Rename daml lf tuples (#3658)
* Rename DAML-LF tuples as structs (structural records)
2019-11-28 07:58:30 +00:00
Remy
d152c7cbfd daml-lf: rename Map to TextMap in archive proto (#3589)
* daml-lf: rename Map to TextMap in archive proto
+ in Scala/haskell AST

* a bit more renamming

* Update compiler/daml-lf-tools/src/DA/Daml/LF/TypeChecker/Serializability.hs

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>

* fix test

* Apply suggestions from code review

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>

* Update compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Base.hs

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
2019-11-25 12:14:57 +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
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
Remy
2885766826 daml-lf-encoder: validate dar generated by the encoder (#3339) 2019-11-05 15:15:08 +00:00
Remy
7d8a484ce9
daml-lf: prepare release of LF 1.7 (#3329)
* daml-lf: prepare release of LF 1.7

* add comment
2019-11-04 22:57:35 +01:00
Remy
d56a4aa715 Intern all strings: proto cleanup (#3296)
* daml-lf: cleanup strings/names interning for 1.dev

* change level of dottedName intening
* make interning mandatory
* rational name of proto field

* fix tests

* spec update

* fix test

* formatting

* Address Gerolf's comments

* Address Jussi's comments
2019-11-01 17:03:42 +00: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
f3b98ca31d DAML LF: limit allocations for trivial constants (#3212)
* speedy: limit allocation of trivial SValue constants

* daml-lf: limit allocation of constants for Value, Exp, Type

* weaken numeric equality in ledger service test
2019-10-18 15:00:49 +00:00
Remy
506a3be6e5 Revert "Revert "Intern all strings and dotted names in the DAML-LF protobuf encoding (#3067)"" (#3120)
This reverts commit 4596c1bde6.
2019-10-16 12:12:07 +00: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
Remy
449500bad8 Revert "Intern all strings and dotted names in the DAML-LF protobuf encoding (#3067)" (#3114)
This reverts commit 68e4453324.
2019-10-04 16:13:27 +02:00
Martin Huschenbett
68e4453324 Intern all strings and dotted names in the DAML-LF protobuf encoding (#3067)
* Intern all strings and dotted names in the DAML-LF protobuf encoding

On one of our huge DAML code bases this has brought down the size of the
DALF by 60% and cut the memory usage during decoding by 50%.

The `@QUERY-LF` tests in the damlc integration tests check that the
interning actually works.

* Add scala decoder support for interned strings

* Memoize versionisOlderThan. Speeds up decoding by 6x.

* Properly fix the performance problem with version ordering

LanguageVersion.ordering was a `def` and not `val` causing us to
recreate the ordering tables every time.

* Clean up //daml-lf/archive:decode-test

* Use int32 for interning indices

* Adapt QUERY-LF tests

* Strip a few useless field_ prefixes

* Add test for uniqueness in interning tables

* Drop field_ prefix from jq queries

* Fix Scala encoder

* Fix bond-trading tests

* Rename decode-test to decode-tester

* Address @cocreature's comments

* daml-lf: proper versioning for reading internedStrings

* daml-lf repl: revert change
2019-10-04 11:26:31 +00: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
Remy
220a03c9e8 Daml-LF: make MUL_NUMERIC and DIV_NUMERIC multi-scale (#2921)
* daml-lf: Make MUL_NUMERIC and DIV_NUMERIC multi-scale

* update release notes

* compiler: fix with type change
2019-09-17 14:32:49 +00:00
Remy
3ee9b83fb1 daml-lf: adapt interface reader to Numeric (#2666) 2019-09-02 10:02:56 +02:00
Remy
aa852311a0 daml-lf: minor fix in the encoder (#2694) 2019-08-28 16:30:31 +00:00
Remy
5f98347a73 daml-lf: minor fix for encoder (#2675) 2019-08-28 08:36:29 +00:00