* Convert experimental primitive TYPEREP_TYCON_NAME into proper LF builtin
* Add entry for TYPEREP_TYCON_NAME in daml-lf spec
* disable quickcheck test in DA.Test.Packaging
changelog_begin
changelog_end
* interfaces: Make fromInterfaceContractId pure.
This PR changes `fromInterfaceContractId` to make it pure. This means
it cannot verify the contract id coercion, and should only be used
with care. To balance this, this PR also adds `fetchFromInterface` which
combines a `fetch` with a `fromInterface` and `fromInterfaceContractId`,
to serve as a safer alternative to `fromInterfaceContractId`, and is more
useful than the old `fromInterfaceContractId` since it also returns the
fetched & converted contract payload.
changelog_begin
changelog_end
* fix integration tests
* add submitMustFail tests for fromInterfaceContractId
We add tests to check that by_interface fields are set for interface
transactions. We also extend the scenario service to show the
by_interface fields in the pretty printed transactions.
Fixes#13333
CHANGELOG_BEGIN
CHANGELOG_END
Previously, all dependencies were installed first in a single step, and then
the data-dependencies were installed according to the dependency graph.
This failed for dependencies with data-dependencies since those are processed later.
This was achieved by installing _all_ dependencies and data-dependencies according to the
dependency graph. Additionally, to ensure that the instance-rewriting behavior is preserved,
the dependency graph is extended with edges from each data-dependency to the subset of
dependencies without data-dependencies.
[instance rewriting behaviour: the class instances from data-dependencies are rewritten
to refer to a matching class definition from a dependency when such a class definition exists.
]
* Add edges from each data-dependency to all dependencies without data-dependencies
* Generate stub sources inside for loop
* Update PackageMap manually
* Make PackageNode a sum type
* Add TODO for replacing recachePkgDb
* Tests
* Generalize 'data-dependencies + exposed-modules' test with QuickCheck
* Add test for building a project where a dependency has a data-dependency
* Add test for building a project where a dependency has a data-dependency which is a plain dependency of the main project
* Add test for building a project where a dependency has a data-dependency which is not a dependency of any kind of the main project
changelog_begin
changelog_end
We encounter that when there are no transactions which can happen
legitimately if you’re testing pure functions.
fixes#11244
changelog_begin
- [Daml Studio] Fix an issue where script views failed to display if
there were no transactions. Now you can see trace messages even in
those cases.
changelog_end
* Replace scenario messages with script
In theory we could try to be clever and print the "right" thing. In
practice, scenarios are almost dead so the complexity for that doesn’t
seem worth it.
fixes#13178
changelog_begin
changelog_end
* .
* Speed up Daml repl startup
Daml repl startup is stupidly slow to the point where starting up and
executing 1+1 takes ~7s (piped to stdin so no typing included).
This PR speeds this up to ~4.5s. In addition to that, we also display
the repl process sooner and complete the last bit of setup while the
user is typing.
Specifically, we do the following:
1. Startup the JVM process in parallel with initializing our package
db and only block on it once it’s started (and remove a stupid 1s
sleep which doesn’t actually matter).
2. Load all packages in one go instead of one by one. This (roughly)
matches how the script service works.
3. Only block on packages being loaded once we start running the
script. Users can type before and we even typecheck their stuff
before.
We could take this further and do even more in parallel with users
typing but this seems to strike a good balance between implementation
complexity, UX (if startup actually fails you get somewhat sensible
errors) & performance.
changelog_begin
changelog_end
* handle tls logs
changelog_begin
changelog_end
* Update compiler/damlc/daml-compiler/src/DA/Daml/Compiler/Repl.hs
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* s/terminateBarrier/exitBarrier/
changelog_begin
changelog_end
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
Process:
- `git ls-files -z | xargs -0 -n 100 sed -i --follow-symlinks 's/DAML/Daml/g'`
- `git add -p`
- `git restore -p`
- Check there is no unstaged change left.
To review:
- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.
- Quicker check for fals positives:
```
git grep DAML | grep -v migration | grep -v DAML_
```
Fixes#13190
Note: This is the "second half" of #13191, which failed to cover all the
remaining DAMLs because of:
```
$ git ls-files | grep "'"
compiler/damlc/tests/daml-test-files/MangledScenario'.daml
```
CHANGELOG_BEGIN
CHANGELOG_END
Process:
- `git ls-files | xargs sed -i 's/DAML/Daml/g'`
- `git add -p`
To review:
- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.
CHANGELOG_BEGIN
- Removed all traces of DAML. This may affect error messages and debug
outputs.
CHANGELOG_END
* Use `this` param in method bodies in LF.
Instead of having method bodies be functions from the template, have them reuse the existing template parameter (usually `this`).
Fixes#13123
changelog_begin
changelog_end
* fix validation-test
* Update 'implements' blocks to use new syntax
* Add InterfaceSyntax test case
* Add InterfaceMultipleMethodDeclsError test case
* Add InterfaceDifferentNumArgsError test case
changelog_begin
changelog_end
This is needed so shared libraries are properly resolved and this
actually works outside of our build. Same issue that broke
damlc_legacy originally and we had someone trying to use cpp on their
own project (whether they should is another question but having it
half working is even worse).
I don’t know how to write a test for this unfortunately. It would only
fail if our nix store is not available which is pretty hard to
simulate. I could spin up a docker image or something but that doesn’t
seem worth the trouble.
fixes#13100
changelog_begin
changelog_end
* Prevent iface choice & method name collisions.
This PR adds interface choices and methods to the name collision checker.
changelog_begin
changelog_end
* check the names from interfaces
* add error
* implement name collision check in scala side
* scalafmt
* Add test for multiple ensure declarations in interface
* update ghc patch
* Update expected result for daml-doc interface test
changelog_begin
changelog_end
* interfaces:ensure that implementations are ordered
We make sure that the implementations are ordered by insertion in the
Scala AST. This is important to guarantee an evaluation order of the
interface preconditions that is determined by the order of interface
implementations of a template.
CHANGELOG_BEGIN
CHANGELOG_END
* use VectorMap instead of ListMap
The previous way of tracking this only worked for direct children of
rollback nodes but lost the information when there was an exercise
node in between.
Reported in https://discuss.daml.com/t/exception-rollback/4000
changelog_begin
- [Daml Studio] Fix a bug where contracts that have been rolled back
would still show up as active in the table view and in the list of
active contracts at the end of the transaction view. This only
affected display. Fetching those contracts failed and `query` also
did not return those contracts.
changelog_end
* Include orphan instance imports in buildLfPackageGraph
* Add failing test for cross-DAML-LF version data-deps with stdlib orphan instances
* Add failing test for cross-DAML-LF version data-deps with custom orphan instance
changelog_begin
changelog_end
* Upgrade sphinx
Don’t want to be stuck on 1.8.3 forever. The current version is
4.4.0 (this upgrades to 4.3.1 which is the latest in nixpkgs).
I did had to drop footnotebackref. This runs into the same issue as
https://tex.stackexchange.com/questions/137594/hyperref-footnotebackref-in-longtable
but just copying the fix doesn’t work and I don’t understand enough
about the details here to fix this myself.
We have 7 footnotes in the Daml docs + some in the Canton docs. That
does not seem worth sticking on a sphinx version from 2018 for just to
get backreferences from footnotes to the link on the same page.
changelog_begin
changelog_end
* turns out you need fonts maybe
* .
changelog_begin
changelog_end
* suppport :force: in daml-docs
changelog_begin
changelog_end
Part of #12792, this is the builtin we need to be able to effectively
store a TemplateTypeRep inside a template (i.e. you store a string
containing the template id, not a typerep).
changelog_begin
changelog_end
This is completely unmaintained, unused and partially broken so delete
it for now. Worst case, we recover it from Git history.
closes#6550 because it now refers to deleted code.
changelog_begin
changelog_end
I tried to keep the changes somewhat minimal and reuse what is already
there. I think there is a fair amount of cleanup we can do afterwards
but hopefully this way it’s easier to review.
fixes#12837
changelog_begin
- [Daml Script] `daml test-script` has been replaced by `daml script
--all`. The option to spin up a ledger automatically has been
removed and you always have to specify one.
changelog_end
* Disable implicit party allocation in Daml Studio
fixes#12058
This matches what sandbox does in 2.0 so it reduces a source of
inconsistency and potential confusion.
changelog_begin
changelog_end
* Update compiler/scenario-service/protos/scenario_service.proto
Co-authored-by: Remy <remy.haemmerle@daml.com>
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Migrate Haskell tests to Sandbox on X
The diff here looks extremely confusing. sandbox-classic is now
sandbox on x not sandbox classic so this isn’t a typo. It is really
moving to sandbox on x.
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
* Replace most scenario references in the docs by Daml script
There are still some left in the Daml studio docs (should be updated)
and in quickstart-java (should be updated but probably not by us
🤷) but I’ll leave those for separate PRs.
changelog_begin
changelog_end
* delete unused code
changelog_begin
changelog_end
* Add new primitives to proto spec
* implement E{Signatory,Observer}Interface in terms of EResolveVirtual{Signatory,Observer}
* define EToTypeRep primitive in terms of EToTypeRep Expr
* Remove experimental primitives TO_TYPE_REP and RESOLVE_VIRTUAL_{SIGNATORY,OBSERVER}
changelog_begin
changelog_end
List.foldl1 uses the first argument as the accumulator, whereas
Foldable.foldl1 uses the second argument. I believe the latter is an
oversight (though the documentation doesn't suggest one way or the
other), so swap them here.
As discovered and reported by @gyorgybalazsi on the Daml Forum:
https://discuss.daml.com/t/in-daml-foldl1-works-differently-from-haskell-is-this-intentional/3819
CHANGELOG_BEGIN
- [Daml Standard Library] An argument order in the default
implementation of ``Foldable.foldl1`` was reversed from that of
``DA.List.foldl1``; this incompatibly changes the former to match the
latter.
CHANGELOG_END