CHANGELOG_BEGIN
[JSON API - Experimental]
Fixing package reload scheduling. The bug was introduced when upgraded
to the most recent Akka library. Also using `scheduleWithFixedDelay` and
awaiting for the reload future to complete. This is to guarantee that we
don't trigger multiple reloads simultaneously. Package reload is
thread-safe though.
CHANGELOG_END
* ledger-on-posix-filesystem: Run `scalafmt`.
* ledger-on-posix-filesystem: Just use file channel locks. Seriously.
* ledger-on-posix-filesystem: Rename `FileSystemLock#run` to `apply`.
* ledger-on-posix-filesystem: Conformance tests now run quickly.
So we can stop constraining the number of concurrent test runs.
* ledger-on-posix-filesystem: Lock the entire ledger with a file lock.
This ensures we can't have two separate ledger servers running against
the same directory.
This is mostly an experiment to better understand how to do this on an
SQL ledger for #4039.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-on-posix-filesystem: Run `scalafmt`.
* ledger-on-posix-filesystem: Use `Resource#use` in `FileSystemLock`.
* resources: Move `Resource#use` to `ResourceOwner#use`.
Makes more sense for the same object to govern both `acquire()` and
`release()`.
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
This allows using this from `akka-typed` where you otherwise get an
error that you `cannot create top-level actor from the outside on
ActorSystem with custom user guardian`. See
https://github.com/akka/akka-http/issues/1873#issuecomment-367655223
for the similar issue in `akka-http`. The resolution matches the fix
that `akka-http` https://github.com/akka/akka-http/pull/1878 and
`akka-streams` https://github.com/akka/akka/pull/24460 have used.
I’ve followed the approach taken by `akka-streams` which matches on
the system and only uses a system actor if it gets an
ExtendedActorSystem. For my purposes, it would also be fine to change
the signature to require an `ExtendedActorSystem` but that seems like
a larger change.
changelog_begin
changelog_end
* resources: Make it easy to use a resource and then release it.
* ledger-on-sql: Move database transaction methods to `Database`.
* ledger-on-sql: Make sure the ledger picks up where it left off.
This means seeding the dispatcher with the correct head, rather than
starting at 1 every time.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-on-sql: Move `Index` and `StartIndex` to the package object.
They're used everywhere.
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* fix release script
only upload from the linux machine and escape arguments to `publish`,
otherwise they get interpreted by bazel.
CHANGELOG_BEGIN
CHANGELOG_END
* Update release/src/Main.hs
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Update release/src/Main.hs
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* bracket -> bracket_
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
The `sandbox-perf` build has been failing for a while with the following
errors:
```
INFO: From Generating benchmark code for //ledger/sandbox-perf:sandbox-perf_codegen:
JMH benchmark generation: JMH Benchmark generator failed
JMH benchmark generation: Benchmark classes should not be final.
[com.digitalasset.platform.sandbox.perf.LargeTransactionBench]
JMH benchmark generation: The instantiated @State class cannot be abstract.
[com.digitalasset.platform.sandbox.perf.PerfBenchState]
```
However, these errors are ignored; running the benchmarks runs the
`AcsBench` benchmark and ignores the fact `LargeTransactionBench` and
`SimpleBench` failed to compile.
I've fixed the errors by making sure that classes are not final, and
that `SimpleBench` uses a concrete state class.
This also introduces a cheap patch to the Scala JMH Bazel rules that
makes sure they fail if there are any errors.
I'm not really sure how to patch the Bazel rules properly, but someone
else might have an idea. :-)
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Daml.Trigger.Assert for trigger testing API
Requires extracting part of Daml.Trigger into Daml.Trigger.Internal to
get access to internal data constructors and functionality
CHANGELOG_BEGIN
- [DAML Trigger - Experimental] Trigger testing functionality is now
available in the module Daml.Trigger.Assert.
CHANGELOG_END
* Set exposed-modules to hide Daml.Trigger.Internal
* API docs for Daml.Trigger.Assert
Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
Unfortunately, downgrading `scalafmt` resulted in files that would be
reformatted to invalid code, because lines would be merged but trailing
commas would be left in.
I've manually run it everywhere and fixed these issues so people don't
have to fix them as they go.
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
Before, we didn't mention in the docs that sum-types need to derive from
(Eq,Show) if they are to be used as arguments of templates or choices.
Now we do.
CHANGELOG_BEGIN
CHANGELOG_END
* language: add daml-react package to ts libraries
This adds the library formerly known as `daml-react-hook` into the
monorepo. We renamed it to `@daml/react`.
The tests sadly don't work with bazel right now because the local
imports aren't resolved correctly. Local testing with `yarn run test`
works as usual.
CHANGELOG_BEGIN
CHANGELOG_END
* address moritz comments
* get rid of DAVL mentions
* fix eslint warnings
* Update language-support/ts/daml-react/tsconfig.json
Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
* ledger-on-sql: Don't allow unnamed in-memory databases.
It seems that changing the connection pool size at runtime causes weird
issues, predominantly that sometimes all connections are dropped and
therefore the in-memory database is lost after migration. Obviously, it
then stops working.
This works around this problem by simply not allowing unnamed in-memory
databases, guaranteeing that we can share the database between the
various connection pools.
This will probably be necessary anyway when attempting to share the
database between the ledger and the index.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-on-sql: Make it clear we're generating a new JDBC URL in tests.
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* make searchInMemory do only one transaction stream
* drop unneeded deletes from memory while doing searchInMemory
* remove unused functions
* rename OffsetBookmark to BeginBookmark
* add AtAbsolute option to GetCreatesAndArchivesSince
* add GetTermination raw command
* propagate GetTermination to ContractsFetch
* remove fetching from searchDbOneTpId_
* fetch multiple contract IDs for DB persistence always to a fixed offset
* bugfix and cleanup; no changelog relevant
CHANGELOG_BEGIN
CHANGELOG_END
* Refactor modrefs out as a type.
This is in preparation for moving to a monadic style.
changelog_begin
changelog_end
* Update compiler/damlc/daml-compiler/src/DA/Daml/Compiler/DataDependencies.hs
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
We add a third type parameter `I` to the `Template` interface and use it as
the type of the `templateId` field. We add this parameter to `CreateEvent`,
`ArchiveEvent` and `Event` as well. The reason behind this is to allow for
patterns like
```ts
function handleFooOrBar(event: CreateEvent<Foo, Foo.Key, typeof Foo.templateId>
| CreateEvent<Bar, Bar.Key, typeof Bar.templateId>) {
switch (event.templateId) {
case Foo.templateId: ...
case Bar.templateId: ...
}
}
```
and get exhaustiveness checking. This will become particularly handy when
handling upgrades, where `Foo` and `Bar` would be the old and new version
of a template, resp.
CHANGELOG_BEGIN
CHANGELOG_END
Currently, the DAML language server use for DAML Studio crashes when the
`build-options` section of `daml.yaml` contains flags like `--package`.
This PR fixes this issue by allowing most of the flags for `damlc build`
for `damlc ide` as well.
CHANGELOG_BEGIN
- [DAML Studio] Allow all command line flags for ``daml build`` for
DAML Studio as well.
CHANGELOG_END
* ledger-on-sql: Pull out a superclass for the various integration tests.
* ledger-on-sql: Use Flyway to migrate tables in an idempotent manner.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-on-sql: Make it easy to run it with Bazel for experimentation.
* ledger-on-sql: Test that migrations will never change in the future.
* ledger-on-sql: Add a prefix of "ledger_" to the tables.
This is so we don't accidentally conflict with the index when the
schemas are shared.
I am letting myself modify the migrations because the existing
migrations haven't been merged into `master` yet.
* ledger-on-sql: Explain why we change the pool size after migration.
* ledger-api-test-tool: Tests now specify a timeout scale, not a timeout.
Makes it easier to change the default timeout in one place.
* ledger-api-test-tool: Increase timeouts on slow tests.
These tests produce a lot of volume and can make CI flaky.
* ledger-on-sql: Only tear down PostgreSQL in tests.
For other databases, we just create a new file for each test case.
* ledger-on-sql: Reduce the log output in tests.
* ledger-on-sql: Use a separate connection pool for Flyway when possible.
Apparently `setMaximumPoolSize` doesn't really have the desired effect
after the connection pool has already been used. The new test case will
be flaky if we process more than one commit in parallel.
For SQLite, it seems to be OK.
* ledger-on-sql: Use a separate connection pool for Flyway with SQLite.
Except in memory.
* ledger-on-sql: Use a separate PostgreSQL database for each test.
Because performance, innit. Don't have to tear them down.
* ledger-on-sql: Move the `Queries` values inside the `RDBMS` objects.
* ledger-on-sql: Go into even more detail about pool size hijinks.
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
It affects basically every file, so let's do it all at once.
CHANGELOG_BEGIN
CHANGELOG_END
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
Three problems here:
1. On failure, the Sandbox didn't close down the metrics reporting
thread, meaning the application would hang.
2. If there's a failure:
a. we didn't print it, and
b. we didn't exit with the correct status code.
These are now handled.
CHANGELOG_BEGIN
- [Sandbox] On initialization error, report the error correctly and exit
with a status code of 1. Previously, the program would hang
indefinitely. (This regression was introduced in v0.13.41.)
CHANGELOG_END
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Bazel test for trigger scenario
* daml-triggers: Allow testing trigger rules in scenarios
CHANGELOG_BEGIN
- [DAML Triggers - Experimental] DAML triggers can now be tested in
scenarios. Specifically, a trigger's ``rule`` can be executed in a
scenario and assertions performed on the emitted commands.
CHANGELOG_END
* Allow assertions on create commands
CHANGELOG_BEGIN
* [DAML stdlib] Add `CanAbort` instance for `Either Text`.
CHANGELOG_END
* Add convenience to construct ACS for testRule
* Add assertions for exercise and exerciseByKey
* fix assert message
* Test assertExercise(ByKey)Cmd
* unpackCommands --> flattenCommands
* Add API documentation
* Document that command ids start from "0"
* generalise command assertions to CanAbortm
* export ACSBuilder type
* Better haddocs for trigger command assertions
* explicit let
* ./fmt.sh
* Fix runfiles on Windows
* Add reference to Bazel issue
Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
fixes#3436
changelog_begin
- [DAML Compiler] ``damlc test`` now initializes the packagedb automatically which
means that it will work on projects that declare custom
``dependencies`` in ``daml.yaml`` without having to call ``damlc
init`` first.
changelog_end
* Preserve class method names during LF conversion.
This PR changes the LF conversion to pick names for dictionary
fields that will be easier to reconstruct as typeclasses
later.
For superclasses this uses "s_1", "s_2", "s_3" and so on,
and for methods this uses "m_foo", "m_bar", "m_baz" and
so on. (Is this enough C++?)
In the future we might want to distinguish between methods
that are mandatory and methods that are optional ... but
I think this should be good enough for now.
This PR also adds a test.
Fixes#4216
changelog_begin
changelog_end
* lint
* Run test in LF 1.7 as well
* Add test for superclass field.
They have been migrated to `ghcide` in
https://github.com/digital-asset/ghcide/pull/388 which is a much more
sensible place for them to live given that the code is in that repo.
changelog_begin
changelog_end
* Fail when a data-dependency fails to compile
Previously, we emitted errors but just kept on going which sometimes
kinda works but is certainly not the right thing to do.
Now we just crash and abort compilation.
changelog_begin
changelog_end
* why is windows
* undo crap
This fixes#4114 and cleans up the situation around
`data-dependencies` and `dependencies` as described in #4218.
There is still more work to be done here mostly around ironing out all
the edge cases and producing useful error messages instead of
silentely doing the wrong thing but I’ll leave that to a separate PR.
To test this, I’ve fixed the packaging tests to no longer deduplicate
package ids (which means they would return the wrong number if
daml-prim ends up in there twice) and I addded a test where we have 3
projects:
- `lib`
- `a` which depends on `lib`
- `b` which depends on `lib` via `dependencies` and 'a' via
`data-dependencies`.
changelog_begin
changelog_end