As a first step for the daml package manager, we move all dalf files
from (data-)dependencies to a new `.daml/dependencies` directory.
CHANGELOG_BEGIN
CHANGELOG_END
* Improve errors on duplicate record field names
fixes#8994
changelog_begin
changelog_end
* Apparently I was wrong about names
changelog_begin
changelog_end
* hlint
changelog_begin
changelog_end
* newlines don’t render well in daml build
changelog_begin
changelog_end
* maybe I should test if my code compiles before pushing
changelog_begin
changelog_end
This PR adds stack traces to all ScriptF commands and handles those in
the converter. Those stack traces are not yet used. To ease review,
I’ve left that for a separate PR. The plan is to use this to tackle
https://github.com/digital-asset/daml/issues/8754.
changelog_begin
changelog_end
* feature: damlc lints all files in project directory
fixes#8887.
This changes the input options of `damlc lint` to take several files. If
no file is given, all `.daml` files contained in the directory are
linted.
CHANGELOG_BEGIN
CHANGELOG_END
Pure shuffling around there is no logic change in here. I keep getting
lost in the 1.4k LedgerInteraction file so this client splits it up
into a 4 different files to make it a bit easier to navigate.
changelog_begin
changelog_end
fixes#8966
changelog_begin
- [Daml Studio] Failed scripts (and scenarios) now also offer the
option to view the table view at the state before the failing
transaction to ease debugging.
changelog_end
* damlc test: feature: add --all flag.
This adds a flag `--all` that will test all present scenarios/scripts in
the code and also report code coverage with respect to all present
templates/choices, whereas without the flag, code coverage is reported
relative to a single package.
CHANGELOG_BEGIN
[damlc test] Added a `--all` flag to test all present scripts/scenarios.
CHANGELOG_END
* Fix closure references in Daml Repl
Turns out the comment "we probably need to extend this to merge the
modules from each line" was exactly correct: If the result evaluates
to a closure (or a value including a closure), it can reference
definitions from the current module. This happens if the simplifier
lifted something out of the current definition (otherwise we have only
one and it cannot be recursive so no chance of leaking a reference).
This PR fixes this by checking whether the result references the
current module and if it does, we keep it around.
changelog_begin
changelog_end
* Address review comments
changelog_begin
changelog_end
* fmt
changelog_begin
changelog_end
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
Not perfect but probably much cleaner than what we had before. Some
of the orders can definitely be debated and I don’t have strong
feelings beyond the first 5 so if someone feels strongly, I’m open to
changing things.
New output:
Usage: damlc repl [DAR] [-i|--import PACKAGE]
[--ledger-host ARG --ledger-port ARG]
[--access-token-file TOKEN_PATH] [--application-id ARG]
[--tls] [--cacrt ARG] [--pem ARG --crt ARG]
[--max-inbound-message-size ARG]
[(-w|--wall-clock-time) | (-s|--static-time)]
[--project-root ARG] [--project-check]
[--include INCLUDE-PATH] [--package-db LOC-OF-PACKAGE-DB]
[--shake-profiling PROFILING-REPORT] [--jobs THREADS]
[--debug] [--ghc-option OPTION]
Launch the Daml REPL.
Available options:
-h,--help Show this help text
DAR DAR to load in the repl
-i,--import PACKAGE Import modules of these packages into the REPL
--ledger-host ARG Host of the ledger API
--ledger-port ARG Port of the ledger API
--access-token-file TOKEN_PATH
Path to the token-file for ledger authorization
--application-id ARG Application ID used for command submissions
--tls Enable TLS for the connection to the ledger. This is
implied if --cacrt, --pem or --crt are passed
--cacrt ARG The crt file to be used as the trusted root CA.
--pem ARG The pem file to be used as the private key in mutual
authentication.
--crt ARG The crt file to be used as the cert chain in mutual
authentication.
--max-inbound-message-size ARG
Optional max inbound message size in bytes.
-w,--wall-clock-time Use wall clock time (UTC). (this is the default)
-s,--static-time Use static time.
--project-root ARG Path to the root of a project containing daml.yaml.
You should prefer the DAML_PROJECT environment
variable over this option.See
https://docs.daml.com/tools/assistant.html#running-commands-outside-of-the-project-directory
for more details.
--project-check Check if running in Daml project.
--include INCLUDE-PATH Path to an additional source directory to be included
--package-db LOC-OF-PACKAGE-DB
use package database in the given location
--shake-profiling PROFILING-REPORT
Directory for Shake profiling reports
--jobs THREADS The number of threads to run in parallel. When -j is
not passed, 1 thread is used. If -j is passed, the
number of threads defaults to the number of
processors. Use --jobs=N to explicitely set the
number of threads to N. Note that the output is not
deterministic for > 1 job.
--debug Enable debug output
--ghc-option OPTION Options to pass to the underlying GHC
changelog_begin
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
* Draw the rest of the Scala 2.13 owl
Not quite but pretty close and this switches us over from inclusions
to exclusions which makes it much easier to track.
Ledger API test tool should be fixed by #8821. Non-repudiation needs a
tiny bit of work since unwrapArray doesn’t work the same on 2.13 but
shouldn’t be hard to fix.
changelog_begin
changelog_end
* Fix ScriptService tests
Those tests were all dumb. They asserted on a fixed order while the
function to sort the things was broken so we ended up with the random
Map order which is unsurprisingly not the same.
This is easily fixed by fixing the sort function.
There is also a second issue with query not sorting.
changelog_begin
changelog_end
* Turns out if you fix one test the next one breaks
And clearly nobody ever tested this or give this a second thought.
changelog_begin
changelog_end
* damlc: fix: catch UserError instead IOException
When the package-db metadata can not be parsed, an exception is thrown
and needs to be catched. Previously we were catching IOException, but
in this case it's actually a UserError that is thrown.
CHANGELOG_BEGIN
CHANGELOG_END
* damlc test: show full coverage report
We add a flag `show-coverage` to `damlc-test` to show templates that
are never created and choices that are never executed during the tests.
CHANGELOG_BEGIN
[damlc test] A new flag `show-coverage` shows full test coverage
reports.
CHANGELOG_END
changelog_begin
- [DLint] You can now disable dlint hints for a specific functions in
the form `{- DLINT ignore functionName "hintName" -}`, e.g.,
```
{- DLINT ignore noHint "Use concatMap" -}
noHint f xs = concat (map f xs)
```
Note: The undocumented {- HLINT -} pragmas are no longer supported.
changelog_end
* damlc: show test coverage
We add output to show percentage of created templates and executed
choices for `damlc test`.
This fixes#6370.
CHANGELOG_BEGIN
[damlc] Feature: Test coverage is reported for `damlc test`.
CHANGELOG_END
* added a test
* Update compiler/damlc/lib/DA/Cli/Damlc/Test.hs
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* suggestions
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
This uses a "DamlException" tag to annotate which types should
be exported as exceptions. This tag will be added during the
desugaring of exceptions.
The code that scrapes for the HasMessage instance is based on the
corresponding template instance scraping code, but simplified since
we only have to pick up one instance. If we decide to pack more
information into the DefException structure in the future, we can
easily extend this.
This PR also adds a small test to make sure that a user-defined
exception is exported as such.
changelog_begin
changelog_end
We update ghcide, which enables cached goto definitions that keep
working when the document doesn't compile anymore. This also adds a test
to lsp-tests for this feature.
CHANGELOG_BEGIN
CHANGELOG_END
This is spun off from #7934 for ease of review.
For now, all of this is hidden (and for extra caution also marked as
early access). I expect we’ll tweak the API in a bunch of ways before
marking it stable but this at least is sufficient for the prototype.
At this point, we cannot support this over the JSON API. Not too
worried about that at least for now.
fixes#7847
changelog_begin
changelog_end
* DLint: Disable "Redundant pure" lint by default
When using `ApplicativeDo`, e.g. in Daml Scripts, a final pure might be
necessary although it would be redundant in a monadic context. This
leads to spurious warnings from the linter which I found quite
confusing.
CHANGELOG_BEGIN
CHANGELOG_END
* Adjust tests
CHANGELOG_BEGIN
CHANGELOG_END
This updates the daml-ghcide dependency and also adds a test to check
that we are not showing any internal symbols and dependencies in the
outline in daml studio.
CHANGELOG_BEGIN
CHANGELOG_END
We add a test to check that there are no internal imports returned by
the `getDocumentSymbols` endpoint for an empty module.
CHANGELOG_BEGIN
CHANGELOG_END
Fixes#8449
changelog_begin
- [DAML Standard Library] DA.Next.Map and DA.Next.Set are deprecated.
Please use DA.Map and DA.Set instead, or use DA.TextMap directly
for ledger API backward compatibility.
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.
Disabling it per target works nicely for compilation but it gets
annoying in ghci since the warnings are still triggered. We could
disable it everywhere but I think the warning is generally useful. I
tried patching proto3-suite to use DerivingStrategies but that doesn’t
work because haskell-src is dead and doesn’t support it. So for now
adding it to the per-file list seems like the best option.
changelog_begin
changelog_end
* Add DA.Set to match DA.Map
Fixes#8448
changelog_begin
changelog_end
* Make it a stable package
* Add test.
* add map field
* fix stable-packages test
* update Examples.daml
* Add note about loglevel to trace and debug api doc
CHANGELOG_BEGIN
CHANGELOG_END
* Explain log level in comment of debug
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* fix typo
* propagate explanation to trace, traceId and debug
* Fix DA.Internal.Prelude location
changelog_begin
changelog_end
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* damlc: check for inconsistent dependencies
This fixes#8553.
We check that all dependencies have the expected LF version.
CHANGELOG_BEGIN
CHANGELOG_END
* move filter to guard
* turn mainUnitId lookup into set lookup
* Add choice observers in LF spec.
Part of #7709. Adds choice observers to the syntax, type system, and
and operational semantics of LF. Adds a test for the operational
semantics of choice observers.
changelog_begin
changelog_end
* typo
* remove duplicate rule
* Always have choice observers
* Add comment in serialization section
When I first wrote these tests I didn't realise you could have the `@ERROR` annotation anywhere in the file so I put them all near the top. This PR is just to move the `@ERROR` annotations closeer to where the error is generated, so it's easier to maintain. This is in preparation for updating the spec & tests for choice observers.
changelog_begin
changelog_end
* damlc: incremental package db initialization
We keep a hash over all dependencies of a project in the package
database metadata and only recompute the package database if a
dependency changes, i.e. the computed hash changes.
Fixes#4413.
Fixes#8409.
CHANGELOG_BEGIN
CHANGELOG_END
* using Fingerprint
* added tests
* format
* use SdkVersion instead of hardcoded version
* added a reference in tests
* factored out project file template