* 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.
Not quite sure what is going wrong and if this is the issue but I’m
failing to reproduce it reliably to test this so bumping and seeing if
we still hit it on `main` seems like the easiest option.
changelog_begin
changelog_end
* add the MapOps argument to Compat.MapLike
* use immutable.Map newtype for GenMap instead of InsertOrdMap
- bindings tests and sample-app tests compile under 2.13 and 2.12
* add changelog
CHANGELOG_BEGIN
- [Scala Codegen] ``GenMap`` no longer requires ``InsertOrdMap``;
ordinary Scala immutable ``Map``s may be effectively used
instead. We still encourage use of the ``Primitive.GenMap``
alias for proper typing, future-proofing, and deprecation
warnings.
See `issue #9449 <https://github.com/digital-asset/daml/pull/9449>`__.
CHANGELOG_END
* implicitly convert from Map; test several aspects of the Scala GenMap API
* test best-effort class preservation
* drop the CBF for 2.12, as with TextMap
* test conversion in a contract construction
* remove unused CanBuildFrom compats
* combine Primitive tests
* reenable 2.13-only tests
* remove InsertOrdMap references in Shrink/Show instances
* remove test that GenMap order is preserved by Scala
Setting this manually has resulted in #9397 where we use a scala
version that doesn’t have a silencer version. This PR changes the
quickstart template to use the scala version we also use in our builds
which should avoid them getting out of sync in the future.
changelog_begin
changelog_end
* daml build: add a --access-token-file for remote dependencies
This adds a `ledger.access-token-file` field in the `daml.yaml` project
file and a `--access-token-file` flag to `daml build` to authorize
querying/fetching of remote dependencies.
CHANGELOG_BEGIN
[daml build] A new flag `--access-token-file` is added for the `daml
build` command. It allows the specify the path to an access token to
authenticate against the ledger API. This is needed if the project
depends on a remote Daml package hosted on such a ledger. Alternatively,
the path to the token can also be specified in the `daml.yaml` project
file under the `ledger.access-token-file` field.
CHANGELOG_END
* 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
* Add new variant to Value.scala for builtin-exceptions.
final case class ValueBuiltinException[+Cid](tag: String, value: Value[Cid]) extends Value[Cid]
And push through the code consequences.
Most places fixed up.
A couple more things to do in this PR (marked NICK)
A couple of things which can be left for later (marked 8020)
fix build
fix another scala match
changelog_begin
changelog_end
* fix any match
* add marker of code which needs attending to in the PR
* extend ledger-api value.proto & fix LfEngineToApi
* undo/comment-out the change to value.proto
* add tests in HashSpec for BuiltinException
* code but dont yet enable value-gen for builtin exceptions
* address comments which suggest we crash in various places
* support BuiltinException in scenario_service.proto
* one more TODO 8020 tag
* Do not require a JWT token for Health and Reflection services
CHANGELOG_BEGIN
- A JWT token is no longer required to call methods of Health and Reflection services
CHANGELOG_END
* Let service's authorizer decide about rejections
* Updated authorization test
* Added integration test for unsecured authorisation test for the Health service
* Added integration test for unsecured authorisation test for the Server Reflection service
* Updated Claims doc comments
* Minor change
* Reduced code duplication with SecuredServiceCallAuthTests and UnsecuredServiceCallAuthTests
* Added copyrights
* Move response status handling logic to Authorizer
CHANGELOG_BEGIN
- [LF] Release LF 1.12. This version reduce the size of transaction
- [Compiler]: Change the default LF output from 1.8 to 1.11.
CHANGELOG_END
* Ledger API test tool: test against legacy and preview version.
+ use dictionary instead of alias to map version keywords to LF version
CHANGELOG_BEGIN
CHANGELOG_END
improve previous generalization from #8695
- use lf version instead keyword (like 'stable', 'latest', 'dev') to
tag actual target. This will allow two keywords to map to the same
versions without doing twice the compilation/test work.
- use alias to map keywords tag target to versioned tag target.
- move package manage dar to test_commong.
CHANGELOG_BEGIN
CHANGELOG_END
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
At the very least this should produce better error messages and at
least on my machine it does reduce flakiness significantly by bumping
the timeout and increasing Bazel’s resource allocation (and thereby
reducing parallel runs).
Unfortunately, a proper fix here is much more involved than I have
time for right now.
changelog_begin
changelog_end
* Add --target=1.12 support in the compiler.
changelog_begin
- [DAML Compiler] Add support for ``--target=1.12`` in the DAML compiler.
changelog_end
* version1_12 not version1_11
* Update codegen tests.
* Update codegen tests again
* Fix data-dependencies test.
CHANGELOG_BEGIN
- [Daml-LF] Release LF 1.11
- add suport for Generic Map
- add support for choice observer
- add generic comparison
- add convert of contract ID to string (available only in off-ledger mode)
- reduce size of dar using type interning
CHANGELOG_END
* Upgrade scopt to 4.0.0
Scopt 3.x has some issues with Scala 2.13 because it expects an
immutable Seq on 2.13 meaning you cannot just pass in an Array. Rather
than fixing our callsites to convert to an immutable Seq everywhere,
this PR bumps to Scopt 4.0 which goes back to collection.Seq.
and leaving that aside, I’m a fan of upgrading dependencies anyway :)
changelog_begin
changelog_end
* Use val instead of def
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
* rxjava: support for multiparty submissions
This (conceptually) small set of changes adds overrides for the `submit`
family of methods that let clients pass lists of `actAs` and `readAs`
parties rather than a single party.
CHANGELOG_BEGIN
- [Java Codegen] The LedgerClient interface in the rxjava bindings has
been expanded with more overrides to the `submit` family of methods to
account for the new multiparty submission feature.
This is a compile-time breaking change for anyone who has a custom
implementation of the LedgerClient, CommandClient or
CommandSubmissionClient interfaces. Most Java IDEs will be able to
geenrate stub implementations that throw some variant of
UnsupportedOperationException or RuntimeException, which is a viable
workaround until you start using the new multiparty submission
feature.
We expect most users to use the provided implementations of these
interfaces rather than implement them themselves; for those users,
this change is purely additive.
CHANGELOG_END
* review comments
* fromProto
* use Arrays.asList
* 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
* Port damlc dependencies to Scala 2.13
I got a bit fed up by the fact that going directory by directory
didn’t really work since there are two many interdependencies in
tests (e.g., client tests depend on sandbox, sandbox tests depend on
clients, engine tests depend on DARs which depend on damlc, …).
So before attempting to continue with the per-directory process, this
is a bruteforce approach to break a lot of those cycles by porting all
dependencies of damlc which includes client bindings (for DAML Script)
and Sandbox Classic (also for DAML Script).
If this is too annoying to review let me know and I’ll try to split it
up into a few chunks.
changelog_begin
changelog_end
* Update daml-lf/data/src/main/2.13/com/daml/lf/data/LawlessTraversals.scala
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* fixup lawlesstraversal
changelog_begin
changelog_end
* less iterator more view
changelog_begin
changelog_end
* document safety of unsafeWrapArray
changelog_begin
changelog_end
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
This commit fixes a few copyright headers that have been missed in the
automatic update on Jan 1, as well as the generation code in the compat
workspace so it generates the right headers.
CHANGELOG_BEGIN
CHANGELOG_END
* Support DAML_PROJECT in daml codegen java
fixes#8406
We need to resolve the DAR path relative to the project
root. Otherwise, we’ll just fail to find the file if daml codegen java
is invoked from a different directory.
changelog_begin
changelog_end
* Fix test
changelog_begin
changelog_end
* fmt lalala
changelog_begin
changelog_end
* fix another test
changelog_begin
changelog_end
Fixes#8338
This is a bit of a weird one. The basic issue is fairly clear. We have
code which looks something like:
```
interface MyTemplate<K> {
keyEncode: (k: K) => unknown;
keyDecoder: () => K;
}
interface MyChoice<K = unknown> {
template: () => MyTemplate<K>;
}
function exercise(c: MyChoice) {
console.log(c);
}
const y = (x : MyChoice<undefined>) => {
exercise(x);
}
```
The key type is invariant here since it occurs in both covariant and
contravariant positions. We compile in strict mode so this is a
typescript error. This fails in all typescript versions I tested
including 3.8 which we use in our tests. So why don’t the tests fail?
Afaict, this is because the template constant is defined as an
intersection of the template type and the choices available on the
template. In TypeScript 3.8, this seems to (mostly, we’ll get to a
bit) hide this error. In TypeScript 3.9 and later, you hit it. There
is something in the release notes about intersection types but only
about optional properties which don’t seem to be required
here. Nevertheless, it is definitely related to the typescript
version.
So there are two more weird things about TypeScript 3.8:
1. Sometimes you get the error in the IDE but not in `npm start` and
`npm run build`. Afaict, this is caused by the VSCode plugin being
based on a different TypeScript version, e.g., mine was at 4.1.2 so
this seems to match up with the 3.9 hypothesis.
2. In some cases (not all afaict), the issue shows up in `npm start`
but only intermittendly. As described in #8338, it goes away after
a restart. I have no idea what is going on here. something
something incremental builds are hard 🤷 I’ve spent way too
much time trying to figure it out but since the underlying issue
seems clear, I gave up at some point.
changelog_begin
- [JS Client Libraries] Fix a bug where in some cases calls to
`exercise` and `createAndExercise` failed to typecheck with a mismatch
in the key type.
changelog_end
* participant-integration-api: Dedicated execution context for requests.
CHANGELOG_BEGIN
CHANGELOG_END
* participant-integration-api: Construct the services executor outside.
* participant-integration-api: Share the services EC with the GRPC stack.
* participant-integration-api: Use the new EC wherever possible.
And stop using DirectExecutionContext.
* sandbox-classic: Fix DevModeIT to use the right configuration.
I have no idea why this breaks now, but it was always technically
broken, so I'm fixing it.
* participant-integration-api: Push the services EC up one more level.
* Update newly added ApiParticipantPruning service accordingly
see https://github.com/digital-asset/daml/pull/7988#discussion_r525319097
* participant-integration-api: Ensure the LedgerConfigProvider is ready.
Somehow this slipped through.
* sandbox-classic: Fix `DefaultConfig` in tests.
* language-support/java: Disable seeding in tests again.
Co-authored-by: Oliver Seeliger <oliver.seeliger@digitalasset.com>
Highly unlikely this actually makes a difference in practice but it’s
one less thing I need to look at next time someone makes me analyse
spotbugs results.
changelog_begin
changelog_end
As we strive for more inclusiveness, we are becoming less comfortable
with historically-charged terms being used in our everyday work.
This is targeted for merge on Dec 26, _after_ the necessary
corresponding changes at both the GitHub and Azure Pipelines levels.
CHANGELOG_BEGIN
- DAML Connect development is now conducted from the `main` branch,
rather than the `master` one. If you had any dependency on the
digital-asset/daml repository, you will need to update this parameter.
CHANGELOG_END
See [discourse].
[discourse]: https://discuss.daml.com/t/best-practice-for-getting-ledger-state-in-multiple-nested-react-components/1814/3
CHANGELOG_BEGIN
* [JavaScript Client Libraries] When using our React wrapper from
TypeScript, users could end up having to manually reconstruct a
`QueryResult` type for a specific template, leading to code looking
like (assuming a `User` template):
```
const allUser: QueryResult<User.User, User.User.Key, typeof User.User.templateId> = useStreamQueries(User.User);
```
Our codegen will now generate an additional type definition per
template such that the above can be rewritten as
```
const allUser: User.User.QueryResult = useStreamQueries(User.User);
```
Developers using our JavaScript bindings directly (i.e. without taking
advantage of the TS type definitions) are not affected. Existing
(long-form) type declaractions will also keep working.
Note: In order to make this change, we had to move the definition of
the `QueryResult` type from the `@daml/react` package to the
`@daml/ledger` package. However, the `@daml/react` package is still
exporting it as before, so this is a backwards-compatible change.
CHANGELOG_END
* Upgrade Scala dependencies for 2.13 compatibility
This upgrades a bunch of Scala libraries to versions that have 2.13
support. There are two libraries that are still missing:
- diffson, this has a new version but with significant breaking
changes and it is only used in Naigator console which I hope to kill
before I have to worry about this.
- ai.x:diff, this is used in the ledger API test tool. The library is
abondened but there are a few alternatives.
changelog_begin
changelog_end
* Fix pureconfig
changelog_begin
changelog_end
* Fix Navigator
changelog_begin
changelog_end