* new names in daml-script/runner
* new names in json-api
* new names in Scala bindings/codegen
* new names in Java bindings/codegen
* new names in daml-lf interpreter tests
* more new names in daml-script tests
* new names in navigator backend
* deprecate all iface symbols and old method names
CHANGELOG_BEGIN
- [Scala API] ``com.daml.lf.iface`` has been deprecated, as discussed
further in
`issue #14783 <https://github.com/digital-asset/daml/pull/14783>`__.
Use the deprecation warnings as guidance to the new names.
CHANGELOG_END
* prefix cases in OrderingSpec
- suggested by @remyhaemmerle-da; thanks
* use new names in json-api
* use new names in java codegen
* use new names in Scala codegen
* use new names in TypedValueGenerators
CHANGELOG_BEGIN
CHANGELOG_END
* move interface directory to api-type-signature; change bazel target; move scala files
* rename iface package to typesig; rename EnvironmentInterface to EnvironmentSignature
* rename Interface to PackageSignature
* rename fromReaderInterfaces to fromPackageSignatures
* rename InterfaceReader to SignatureReader
* rename InterfaceReader to SignatureReader in deprecation note
* rename readInterface to readPackageSignature
* rename InterfaceReaderError to Error
* rename InterfaceReaderMain to SignatureReaderMain
* rename InterfaceType to PackageSignature.TypeDecl
* rename astInterfaces to interfaces
* rename astInterfaces to interfaces in PackageSignature
* rename findAstInterface to findInterface
* rename a couple arguments
CHANGELOG_BEGIN
- [Scala API] The "quasi-public" API in ``com.daml.lf.iface`` has moved
to the new ``com.daml.lf.typesig`` package, with many accompanying
name changes as documented in `issue #13669
<https://github.com/digital-asset/daml/issues/13669>`__.
Daml 2.5.0 or later will remove the old names, and also rename the
Maven artifact from ``daml-lf-interface`` to
``daml-lf-api-type-signature``. We recommend that users of this API
use the deprecation guidance in 2.4.0 to port their applications
before this happens.
CHANGELOG_END
* add resolveRetroImplements to EnvironmentInterface
* test that resolveRetroImplements does nothing with no data
* resolve retroactive interfaces in Java codegen
* resolve retroactive interfaces in Scala codegen
* resolve retroactive interfaces in json-api
CHANGELOG_BEGIN
CHANGELOG_END
* inherited choices are gone, convert to interface
* use toInterface for conformance tests on interfaces
CHANGELOG_BEGIN
- [Scala codegen] Interface choices can no longer be invoked directly on
template IDs, or via ``createAnd`` or ``key`` directly. Instead, use
``toInterface[Ifn]`` before calling the relevant ``exercise*`` method.
The resulting ledger commands now contain the correct interface ID
rather than template ID for looking up the choice, but see #13993 for
a caveat regarding create-and-exercise and exercise-by-key.
CHANGELOG_END
* Template.Implements marker, and toInterface for contract IDs
* unsafeToTemplate for interface contract IDs
* toInterface for create-and-exercise, exercise by key
CHANGELOG_BEGIN
- [Scala codegen] Template contract IDs and interface contract IDs have
new coercion methods, ``toInterface`` and ``unsafeToTemplate``,
respectively.
``toInterface`` can also be used with ``createAnd`` as well as ``key``
for create-and-exercise and exercise-by-key respectively; however, see
#13993 for a caveat regarding ledger API support.
CHANGELOG_END
* define Interface and InterfaceCompanion parent classes
* generate package ID aliases for interface-only modules
* generate choice methods for interfaces
* include all interfaces in what to write from Scala codegen
* handle interface references in variance resolution
CHANGELOG_BEGIN
- [Scala codegen] Interface contract ID types, and references to them in
serializable types, are now supported, as is exercise of interface
choices on interface contract IDs. To support this, ``DomainCommand``
now includes a ``ContractTypeCompanion``, which may describe either a
template or an interface, rather than a ``TemplateCompanion``.
CHANGELOG_END
* stop resolving in Java codegen, and use direct choices only
* wrong issue reference in Scala codegen
CHANGELOG_BEGIN
- [Java codegen] Direct invocation of interface exercise methods on
templates is no longer supported, and the ``exercise*`` methods, which
could generate invalid commands in some cases anyway, are removed.
Use ``toInterface`` to access interface exercise methods.
CHANGELOG_END
* introduce TemplateChoices to mediate template choice resolution
* if any resolutions fail in EnvironmentInterface, discard the template's resolution
* if any resolutions fail in Interface, discard the remaining unresolved
CHANGELOG_BEGIN
CHANGELOG_END
* add inherited choices for Scala codegen, test output exercises
CHANGELOG_BEGIN
- [scala codegen] Choices inherited from interfaces may be exercised
directly from those templates via ``createAnd``, contract ID, or
exercise-by-key. Exercise by interface-contract-ID and
interface-contract-ID types in signatures are not supported.
See `issue #13858 <https://github.com/digital-asset/daml/pull/13858>`__.
CHANGELOG_END
* Remove unused class `JavaConf`
* Adapt tests to add template references for every type
* Minimize the data passed to `collectDamlLfInterfaces`
* Separate `CodeGen` from `CodeGenRunner`
* Refactor interfaces collection and resolution
* Refactor Java codegen
* Return `InterfaceType`s from `transitiveClosure`, move `DefTemplateWithRecord` to the Scala codegen
* Remove unused abstractions from the Java codegen
changelog_begin
changelog_end
* Minimize diff: move as much as possible to `CodeGenRunner`
* Revert "Adapt tests to add template references for every type"
This reverts commit 37c8c827179daa29668fa843c79afc8cef09e431.
* Fix compilation errors
* Minimize diff: restore imports in `ClassForType`
* Minimize diff: get rid of unnecessary refactorings
* Further simplications and fixing compilation errors
* Minimize diff: move `collectDamlLfInterfaces` back to its previous position
* Address https://github.com/digital-asset/daml/pull/13440#discussion_r846301958
* Remove unused `name` field from `InterfaceTreeBuilder`, inline builder construction
* Remove unused `Traverse` instance for `TypeDeclOrTemplateWrapper`
* Remove unneccessary type parameter from `TypeDeclOrTemplateWrapper`
* Remove some unnecessary copies `.toList`
* Remove `TypeDeclOrTemplateWrapper`, use `Either` directly as a wrapper
* Use `bimap` instead of explicitly wrapping and unwrapping the `Either`
* Remove unnecessary type `Mode`
* Remove unnecessary type parameter from `WriteParams`
* Remove unnecessary binding
* Pull `OrderedDependencies` out of `Graph`
* Move computation of relevant packages to `codegen-common`
* Move `templateCount` from `LFUtil` into `CodeGen`
* Comment the purpose of `TransitiveClosure`
* Pull the variance cache out of `LFUtil`
`LFUtil`'s purpose is that of limiting passing around certain
values. While the purpose is questionable, the variance cache did
not need to access any of those values and it's quite easy to
move to a separate class where the purpose and the scope are clearer.
* Make `DependencyGraph` work directly on type declarations
* Add constructor for a collection of interfaces to `EnvironmentInterfaces`
* Factor the error message from `cyclicDependencies` out of `DependencyGraph`
changelog_begin
changelog_end
The Scala codegen code lives under `com.daml.codegen` but the common
library and the Java codegen both live under `com.daml.lf.codegen`.
In order to share code while preserving package private access of
certain facilities (i.e. `DependencyGraph`) the package needs to
be standardized. I chose to go the Java way mostly to reduce noise
on work currently on its way on the Java codegen (#13366).
Contributes towards https://github.com/digital-asset/daml/issues/13324
changelog_begin
changelog_end
* Refactor Scala codegen
changelog_begin
changelog_end
* Remove unnecessary abstractions
`DependencyGraph` and `LFUtil` both had an abstract superclass of
which they were the only implementation. Removing this unneccesary
layer of abstraction allows to avoid jumping between the superclass
and its concrete implementation to make sense of the overall meaning
of the code. Removing this layer also allows to find and remove
dead code and unused parameters.
* Throw away dead code around `BaseNode` and remove the unnecessary abstraction
* Throw away unused code
* Fix typo: unsopported -> unsupported
* Remove incorrect capitalization of type definitions
Before the refactoring, both `Util` and `LFUtil` had an implementation
of `toTypeDef` which were mostly matching, apart from the fact that
one capitalized its output while the other didn't. Apparently, I used
the wrong version and this broke existing code.
This adds the presence of interface names, as well as lists of choices
and their argument/return types for each interface.
It also changes the semantics of DefTemplate and EnvironmentInterface:
each may contain "unresolved choices", which are the choices inherited
from interfaces for each implementing template;
EnvironmentInterface#resolveChoices will copy the full type information
as a concrete choice for each implementing template, which should be
much simpler for codegen and json-api.
A type generator should take account of the astInterfaces as well as
typeDecls in EnvironmentInterface; interfaces aren't included in
typeDecls because where I is an interface only ContractId I is
serializable.
* Ast.DataInterface is empty, just use the interfaces map directly
* port json-api for interface API changes; does not solve #12689
* port Scala codegen for interface API changes; does not add support
* port Java codegen for interface API changes; does not solve #11350
CHANGELOG_BEGIN
CHANGELOG_END
Continues the work started in https://github.com/digital-asset/daml/pull/12543
These libraries were only needed to transition from Scala 2.12 to 2.13
and are no longer useful as all the necessary items are now available
in Scala 2.13.
changelog_begin
changelog_end
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.
[Here][1] is s a blog post by the Scala team about it.
Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.
Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.
changelog_begin
changelog_end
[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.
I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.
CHANGELOG_BEGIN
CHANGELOG_END
* Get rid of deprecated components
Removes:
- mentions of the Node.js bindings
- mentions of the Scala bindings
- usage of the Scala codegen as an SDK tool
- Java bindings "reactive components"
changelog_begin
The Node.js bindings are no longer supported as part of the Daml SDK
The Scala bindings are no longer supported as part of the Daml SDK
The Java bindings reactive components are no longer supported as part of the Daml SDK
The `daml codegen` command has dropped support for Scala
changelog_end
* Fix typo noticed by @cocreature
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Address https://github.com/digital-asset/daml/pull/12167#issuecomment-995714093
* Remove quickstart-scala from the SDK tarballs
* Fix failing codegen test
* Address https://github.com/digital-asset/daml/pull/12167#pullrequestreview-833991243
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Upgrade Scalatest to v3.2.9.
Because of some coupling we also have to upgrade Scalaz to the latest
v7.2 point release, v7.2.33.
The Scalatest changes are quite involved because the JAR has been broken
up into several smaller JARs. Because Bazel expects us to specify all
dependencies and doesn't allow transitive dependencies to be used
directly, this means that we need to specify the explicit Scalatest
components that we use.
As you can imagine, this results in quite a big set of changes. They
are, however, constrained to dependency management; all the code remains
the same.
CHANGELOG_BEGIN
CHANGELOG_END
* http-json-oracle: Fix a Scalatest dependency.
* ledger-api-client: Fix a Scalatest dependency.
* LF: change type from Try to Either in archive module
This is the first part of restructuring errors in archive module.
This is part of #9974.
CHANGELOG_BEGIN
CHANGELOG_END
* Apply suggestions from code review
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* remove type alias
* apply stephen suggestion
* fix after rebase
* fix test
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* LF: Simplify archive reader.
- decouple Reader and Decoder
- introduce case class to handle hash, proto payload, and version
CHANGELOG_BEGIN
CHANGELOG_END
* Address Moritz' review
* cosmetic
* daml-lf/data: Truncate party names in log output, on request.
The party name can grow quite long, so we offer ledger implementors the
opportunity to truncate it in structured log output.
Unfortunately, because we use Logback through the global
`LoggerFactory`, there is no place to inject logging configuration. This
means we also need to use global, mutable state to configure logging
output. I have added a `LoggingConfiguration` class+object in Daml-LF
Data, which may not be the best place, but I can't think of a better
one right now. I suggest we leave it there until it has reason to grow,
at which point we may want to move it.
CHANGELOG_BEGIN
CHANGELOG_END
* logging-entries: Make `ToLoggingValue` mixin-able.
* participant-integration-api: Truncate parties in filters when logging.
* participant-integration-api: Cast to `Party` for logging.
Invalid input should not break the request at this point. No assertions.
* daml-lf/data: Move `Party to LoggingValue` to a new package.
This avoids the transitive dependency issue most of the time.
* daml-lf-data: Move the `Identifier` logging to another package.
Again, reduces the need for transitively depending on _logging-entries_.
I don't find the output from Bazel very helpful most of the time. It
does, however, produce a lot of noise which I have to filter through
when something else goes wrong.
CHANGELOG_BEGIN
CHANGELOG_END
* upgrade scalacheck to 1.14.3
* regenerate maven_install files
* some different names and implicits
* remove some fromTryCatchNonFatal
* more porting
* port fromTryCatchNonFatal to attempt
* factor the assertions in SignatureSpec to avoid \/
* deal with invariant \/
* make partial unification do what we want
* \/, parse*, and toNel
* many uses of the .right method
* a legitimate use of fromTryCatchThrowable
* rebuild maven pins
* further invariant \/
* OneAnd and Nel interface changes
* further Either games
* \/ and reformatting
* \/ in http-json
* \/ in http-json
* deprecations
* more invariance
* cleanup unused
* more invariance; http-json compiles
* final either follies
* small 2.12 extra incompatibility
* rebuild deps
* revisit a couple earlier fixes using nicer expressions I learned later
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* repin 2.12
* Handle module-prefixes in Java codegen
changelog_begin
- [Java Codegen] The Java codegen will now pick up the
`module-prefixes` field from `daml.yaml` which can be used to handle
module name collisions between different DALFs.
changelog_end
* Reference ticket in todos
changelog_begin
changelog_end
* less stupid map initialization
changelog_begin
changelog_end
* Pull out string assembly
changelog_begin
changelog_end
* Update language-support/java/codegen/src/main/scala/com/digitalasset/daml/lf/codegen/CodeGenRunner.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Update language-support/java/codegen/src/main/scala/com/digitalasset/daml/lf/codegen/CodeGenRunner.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* fewer views
changelog_begin
changelog_end
* more assert
changelog_begin
changelog_end
* more private
changelog_begin
changelog_end
* fmt
changelog_begin
changelog_end
* fix scala 2.12
changelog_begin
changelog_end
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Include PackageMetadata in LF interface
I want to use this in codegens but more generally, I think it also
fits well into the scope of the iface library in that it’s only
metadata and relatively stable.
changelog_begin
changelog_end
* Iterating more is less
changelog_begin
changelog_end
* fix tests
changelog_begin
changelog_end
* fmt
changelog_begin
changelog_end
* fix scala 2.12
changelog_begin
changelog_end
* check whether collection.compat is unused when compiling for Scala 2.12
- Instead of always suppressing warnings for collection.compat._,
we should only do it for Scala 2.13
- We can also reduce boilerplate by automatically adding this
option when both silencer_plugin and collection-compat are
present
CHANGELOG_BEGIN
CHANGELOG_END
* remove unused import
* remove another unused import
* remove even more unused imports
* missed compat dependency
* more missed compat dependencies
* missed compat dependency
* use scala_deps in scaladoc_jar
- #8423 inlined the major version expansion, but this seems to
have been prior to proper support by scaladoc_jar
* restore custom handling of participant-integration-api
- fixing scaladoc_jar isn't worth it for a single case, as with
deps vs scala_deps
* Switch from `@silent` to `@nowarn`.
This annotation is native to Scala 2.12.13+ and 2.13.2+. It replaces
most usages of `@silent`.
I had to get creative about a couple of use cases that didn't work.
Specifically:
1. Suppressing deprecation warnings works, but Scala 2.12 erroneously
complains that the `@nowarn` is unnecessary. I had to suppress
this warning too with `-Ywarn-unused:-nowarn`.
2. I can't seem to suppress the warning, "The outer reference in this
type test cannot be checked at run time." Instead, I have
refactored the code to remove the warning.
We still need to use the silencer plugin to suppress some warnings about
unused imports (because of compatibility between Scala 2.12 and 2.13),
but this means we no longer need the library, and therefore it is not a
transitive dependency that downstream consumers need to worry about.
CHANGELOG_BEGIN
CHANGELOG_END
* Add some comments around `@nowarn` support.
* language-support/scala: Fix a warning suppression.
* Revert to the default warnings.
Compatibility was complaining.
* variance calculation without references or cycles
* an idea for handling the recursive reference case elegantly
* extra data for resolving constraints from [recursive] references later
* note on TypeVar case
* trying a different delayed resolution
* quagmire
* the problem: we were trying to solve too early and mix reference levels
* force inner delays to be pulled out; squash the delays iteratively
* make the variance result accessible
* phantoms are covariant
* scalafmt
* simplest GenMap test
* reference tests
* factoring
* don't treat covariant reference arguments as phantom
* making the wrong reference in delays was breaking solve steps
* test cons list self-recursion
* more recursion testing
* -> is better for 2-tuples here
* test cumulative variance tracking
* uninhabited types have variance too
* test mutual recursion with lots of indirect references
* trigger for failing case in incremental resolution
* redesign delayed constraints to handle nesting properly, and be much simpler
* integrate variance calculation with rest of Scala codegen
* handle concrete type and all-phantoms cases; test
* add integration test for variance inference
* add changelog
CHANGELOG_BEGIN
- [Scala Codegen] Type parameters used in GenMap keys are now supported.
See `issue #8879 <https://github.com/digital-asset/daml/pull/8879>`__.
CHANGELOG_END
* proper doc for covariantVars
- suggested by @cocreature; thanks
* remove useless local var
- suggested by @cocreature; thanks
* add another recursive function to capture more invariants
- suggested by @cocreature; thanks
* absence in what
- suggested by @cocreature; thanks
* use Identifier instead of I
- suggested by @cocreature; thanks
* remove unused type vars; make goSdt cleaner
* also precache variance of choice and key-referenced types
- suggested by @cocreature; thanks
fixes#8498
This fixes the error in 2.13 wtr to the location change of Predef. It
doesn’t yet address the warning wtr to the import of higherKinds. For
now, our build ignores that warning. Trying to figure out if we can
get away with a breaking change here or if we need to hide that change
behind a flag but either way, no need to block fixing the actual error
on that.
changelog_begin
changelog_end
This PR updates scalafmt and enables trailingCommas =
multiple. Unfortunately, scalafmt broke the version field which means
we cannot fully preserve the rest of the config. I’ve made some
attempts to stay reasonably close to the original config but couldn’t
find an exact equivalent in a lot of cases. I don’t feel strongly
about any of the settings so happy to change them to something else.
As announced, this will be merged on Saturday to avoid too many conflicts.
changelog_begin
changelog_end
The one thing that is still missing is making the generated Scala code
from the codegen compatible with Scala 2.13 so the examples are
excluded for now.
changelog_begin
changelog_end
* Replace many occurrences of DAML with Daml
* Update docs logo
* A few more CLI occurrences
CHANGELOG_BEGIN
- Change DAML capitalization and docs logo
CHANGELOG_END
* Fix some over-eager replacements
* A few mor occurrences in md files
* Address comments in *.proto files
* Change case in comments and strings in .ts files
* Revert changes to frozen proto files
* Also revert LF 1.11
* Update get-daml.sh
* Update windows installer
* Include .py files
* Include comments in .daml files
* More instances in the assistant CLI
* some more help texts