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
* Make UserId properly opaque by defining it as a variant instead of as a record.
changelog_begin
changelog_end
* hand coded Show instance for UserId
* rename: userName --> userIdToText
* Remove user-management error cases from scenario-service proto.
changelog_begin
changelog_end
* remove Error.UserManagement
* remove UserManagememtError
* simp
* meh... done over by scala's poor excuse for a type system
* Error handling for User Management exposed via daml-script
changelog_begin
changelog_end
adapt ScriptTest.daml to new user-management interface
adapt create-daml-app Setup.daml to new user-management interface
* Add deriving Ord for UserId
* change example of invalid user-id char to "%" from "." (which is no longer illegal)
* recover/reify ALREADY_EXISTS from GrpcLedgerClient.createuser
* fix testcase expected order of users from daml-script listUsers
* adapt create-saml-app Setup.daml to changed interface of user-management
* reinstate sort lost in merge
* sort user in ScriptService user-management test
* improve comment for error foobar hack
* improve doc comment for validateUserId
* use upper case as test example for invalid user-id
* Split channel configuration from LedgerClientConfiguration
Fixes#12391
The channel configuration now has to be provided separately from the
configuration specific to the ledger client. In this way we avoid
situations where the builder is provided with some configuration
that gets overridden.
changelog_begin
[Scala bindings] The channel configuration has been split from the
LedgerClientConfiguration class. Provide the gRPC channel specific
configuration separately or use a builder. The channel configuration
no longer overrides the builder.
changelog_end
* Fix compilation issues in //ledger-service/...
* kvutils: Remove the DAR upload parameters from the runner.
No production ledger needs to upload DARs on participant startup; this
feature is primarily for users of Sandbox. The feature never worked in
the case of multiple participants and was only ever used in testing.
This also removes the associated functionality from Sandbox-on-X as they
share a configuration object. Hopefully this won't be an issue.
Some tests were using this feature, so I have updated them to upload the
DARs through the PackageManagementService instead.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils: Remove the `writePackagesService` factory constructor.
We no longer use it.
* daml-lf/engine: Revert an unnecessary change.
* daml-script/test: Shut down the channel after uploading the DAR.
* Clarify unhandled exception error message
The previous error doesn’t make it clear that this is an exception in
user code rather than a Scala exception in our code.
Daml-lf exception would technically be more correct but I don’t think
it’s helpful here so I went with Daml exception.
changelog_begin
changelog_end
* adjust ledger api test tool
changelog_begin
changelog_end
* Update test assertions
changelog_begin
changelog_end
* fix another assertion
changelog_begin
changelog_end
* ledger api: support Auth0 user names in user management
See the `IdString.UserId` and `IdString.ApplicationId` comments wrt the
character classes being introduced.
Many thanks to @cocreature for helping with deciding on the exact
restrictions of user-ids.
CHANGELOG_BEGIN
CHANGELOG_END
Somewhat error-prone, so please review carefully.
Reasons we need this:
- Some file types are not properly handled by the script.
- The only exclusion mechanism we currently have (`NO_AUTO_COPYRIGHT`)
is overly coarse.
CHANGELOG_BEGIN
CHANGELOG_END
We missed keys of generic maps.
Don’t be scared of the diff, I just added some unit tests since there
didn’t seem to be any.
fixes#12234
changelog_begin
changelog_end
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
* Escape daml-lf tracelog messages
Currently veracode complains because this allows for clrf
injection (injecting newlines to make user input look like separate
log statements).
With this change
```
debug "abc"
debug "eaiu\neaiu"
debug "def"
debugRaw "abc
```
is logged as
```
[DA.Internal.Prelude:555]: \"abc\"
[DA.Internal.Prelude:555]: \"eaiu\neaiu\"
[DA.Internal.Prelude:555]: \"def\"
[DA.Internal.Prelude:555]: abc
```
You can debate whether we should escape the quotes are necessary but
90% of the reason why people add them is because they call `debug` on
strings when they should be using `debugRaw` so this seems fine to me.
changelog_begin
changelog_end
* fix tests
changelog_begin
changelog_end
CHANGELOG_BEGIN
- [User Management]: add support for managing participant node users and authenticating
requests as these users using standard JWT tokens.
CHANGELOG_END
Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
Co-authored-by: Adriaan Moors <90182053+adriaanm-da@users.noreply.github.com>
part of #11997
No tests for now since we don’t have a multi-participant ledger that
supports this in `main`. The logic for selecting the client for the
participant is the same as for party management and other stuff anyway
so tests don’t add that much.
changelog_begin
changelog_end
* Wire up Daml Script user management to gRPC API
part of #11997
The tests are disabled for now until #12063 is merged. I did test it
manually against that branch though and they pass happily.
changelog_begin
changelog_end
* fmt
changelog_begin
changelog_end
* Extend ScriptLedgerClient trait with user management
Spun out from #11899, part of #11977
This PR extends the ScriptLedgerClient trait with the methods we need
for user management. All implementations currently fail, I’ll fill
those in separately. I’ve chosen to make them fail in each instance
rather than in the trait since eventually they should all be filled in.
changelog_begin
changelog_end
* fmt
changelog_begin
changelog_end
* Move toInterfaceContractId and fromInterfaceContractId out of Implements class
* Split Implements class into single-method classes
* Define toInterface outside its class to swap type arguments
This allows users to call 'toInterface @Interface', since the type of the template can usually be inferred
* Move interface classes and functions to DA.Internal.Interface
changelog_begin
changelog_end
* Drop support for Daml-LF party literals from the Scala side
This PR enforces that forbidPartyLiterals is always `true` and drops
the corresponding literals from the AST. Haskell side is in #11930fixes#11581
changelog_begin
changelog_end
* Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ComparisonSBuiltinTest.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Revert "Update daml-lf/interpreter/src/test/scala/com/digitalasset/daml/lf/speedy/ComparisonSBuiltinTest.scala"
This reverts commit 55e542ce4e3a7fd15544ee703de3277ffc309b17.
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Limit supported input versions in damlc to >= LF 1.8
1.8 was the version that introduced type synonyms, we really don’t
gain much by dropping more since data-dependencies mainly depends on
that. and this provides for a very natural upgrade path for users
where pretty much everyone should be able to upgrade directly to SDK
2.0 without having to go through intermediate versions.
changelog_begin
- [Daml Compiler] The supported input LF versions for
data-dependencies are now limited to LF 1.8 and newer.
changelog_end
* fix some tests
changelog_begin
changelog_end
* Drop export 1.6 tests
changelog_begin
changelog_end
* Drop daml2js support for LF < 1.8
changelog_begin
- [Daml2js] DARs with LF version < 1.8 are no longer supported.
changelog_end
* .
changelog_begin
changelog_end
* bash is bad, stop using it
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
* Change daml script’s sleep to sleep for a minimum amount of time
We’ve seen a few flaky test failures where we slept for less than the
expected amount of time which isn’t what we want. We definitely cannot
guarantee an exact sleep time but at least a minimum.
changelog_begin
changelog_end
* Update daml-script/runner/src/main/scala/com/digitalasset/daml/lf/engine/script/ScriptF.scala
Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Drop LF < 1.14 from supported damlc output versions
fixes#11319
We keep test coverage by depending on the most recent snapshot which
still has 1.14 support.
changelog_begin
- [Daml Compiler] Damlc can only produce Daml-LF 1.14 or
newer. Passing aynthing older to `--target` is an error. If you
need to produce older versions, use an older SDK.
changelog_end
* Switch around legacy_compiler_lf_versions
changelog_begin
changelog_end
* drop since-lf
changelog_begin
changelog_end
This fixes a bug in the typechecker (#11558) and the command
preprocessor, since those were written with this behavior of
lookupTemplateChoice in mind. Enables the engine test that
caught this.
changelog_begin
changelog_end
* [Self-service error codes] Enabled by default
* Flag changed to `use-pre-1.18-error-codes` (disabled by default)
CHANGELOG_BEGIN
[Ledger API Specification] The Ledger API returns enriched error codes (see https://docs.daml.com/error-codes/self-service/index.html)
For backwards-compatibility, a new API flag `--use-pre-1.18-error-codes` is introduced for preserving the legacy behavior for
clients that want to migrate incrementally to the changed gRPC status code responses and error details format.
CHANGELOG_END
* Adapted HttpServiceIntegrationTest
* Renamed `Feature Flag` to `Configuration` in docs
* Fix Daml Script tests
changelog_begin
changelog_end
* Fix Repl functests
changelog_begin
changelog_end
* Fix haskell binding tests
changelog_begin
changelog_end
* Fix CommandClientIT test
* Fixed Sandbox and CommandServiceBackpressureIT tests
Please enter the commit message for your changes. Lines starting
* Adapt //compiler/damlc/tests:repl-functests again
* Fix more tests and address Miklos' comments
* Flag name changed to `grpc-status-codes-compatibility-mode`
* Remove useless flags sandbox-classic
* Sandbox-classic tests fix for ContractKeysIT and ExceptionsIT
* Created 2 deprecated test suites that have the more generic assertions as returned
by the deprecated in-memory backend
* More fixes for CommandServiceIT
* Fixes compilation issue with the deprecated exceptionsIT class for Sandbox-classic in-memory
* Compatibility mode for old test tools
* Change flag name to `use-pre-1.18-error-codes`
* Apply suggestions from code review
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
* Update ghc patch
* Replace Implements proxy datatype with a class
* Expose 'Implements' class in Prelude
* Add DA.Internal.Desugar.HasMethod class
This allows us to get the type of a method of an interface through the functional dependency
* Convert interfaces from new desugaring
* Update Interface daml-test-file to use Interface class functions
* Update InterfaceDesugared daml-test-file
* Replace remaining uses of Is<Interface> methods with Implements
* Document HasMethod, Method and mkMethod
* Ignore _method_ bindings in convertBind
* Ignore interface desugaring types/classes/instances/functions in LF conversion
* update snapshot after pin on windows
changelog_begin
changelog_end
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.
changelog_begin
changelog_end
* Use explicit party specifications in Daml Script over JSON API
This uses the new party set arguments from #11454 to allow Daml Script
over the JSON API to `submit p` even if we have a token with more
claims.
changelog_begin
- [Daml Script] When run over the JSON API, Daml Script can now use a
subset of the claims in the token. E.g., `submit p` works even if you
have a token with `actAs = [p, p2]`.
changelog_end
* Apply suggestions from code review
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Drop opt prefix
changelog_begin
changelog_end
* switch around error & success cases
changelog_begin
changelog_end
Co-authored-by: Remy <remy.haemmerle@daml.com>
Because a bug in the scala compiler deprecated pattern matching are
not detected (See https://github.com/scala/bug/issues/12493).
Hence some deprecated usage of Node aliases have been forgotten in
CHANGELOG_BEGIN
CHANGELOG_END
* Refactor speedy to distinuish SExpr types before/after ANF compilation phase
CHANGELOG_BEGIN
CHANGELOG_END
* remove commment/marker left in error
* make SExpr0 private to speedy
* reinstate (non-pp) print of original expression in AnfTest faiure
* avoid use of s./t. prefixes for expressions in SBuiltin; add 3 TODO markers
* inline "runtime" apply methods of SDefinitionRef into sole caller: SBCallInterface
* avoid use of t. prefix in SExpr0
* change s./t. prefix to source./target.
* add comment to summarize differences between SExpr0 and SExpr
* Synchronize in multi-participant script tests
This hopefully fixes the flakiness where the party allocation is not
yet propagated to the other participant.
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
* Remove virtual choices
* Remove choices without a body in 'interface' definition
* Remove choices in 'template ... implements' section
part of #11372
changelog_begin
changelog_end
* Remove virtual choices cont.
Switch uses of virtual choices to fixed choice with method implementation
* update snapshot after pin on windows
* Disable failing interface tests with TODO #10810
* Migrate matches-docs tests to sandbox on postgres
We’ve seen timeouts on party allocation which are likely caused by the
h2 issues that keep popping up. Switching to postgres should hopefully
solve that.
We need to wrap postgres to set LOCALE_ARCHIVE for this to work in
builds. We already pass it through in tests which is why it works fine there.
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
* Update nix/bazel.nix
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* disable on Windows
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Replace `sandbox-classic`-based fixtures with `sandbox`-based ones
changelog_begin
changelog_end
* Replace Scenarios with Script for BasicPrimitiveTypes
* Adapt ListsSpec
* Adapt TextMapsSpec
* Adapt OptionalSpec
* Adapt more tests
* More tests passing
- removed workflow_id testing (Daml Script doesn't set one)
- reduced failure threshold for VeryLargeArchiveSpec
- solved issu in TransactionSingleTableSpec (wrong parties were used)
* Port EnumMod and make EnumSpec pass
* Port GenMapMod and make GenMapSpec pass
* Shaking things around to make Windows happy -- maybe