* Unify rst and md output in damldocs.
* Fix errors
* Define RenderUnwords / RenderIntercalate in terms of RenderConcat
* Delete the old
* Small output format changes and update golden tests
* Fix table rendering and tests.
* Fix golden test.
* Delete more old
* Implement reviewer suggestions
* language: put hash in package directories
We put the package id of the main dalf of a package into the directory
names, where we store the files of that package in the package database.
This way we make sure that two equally named packages don't overwrite
their dependencies and files.
* Update ghc-libs to use new template desugaring
* Replace old template typeclasses with generic-friendly ones
* New template desugaring doc
* Fix tests
* Fix damldoc tests regarding Archive choice
* Update visualisation code to not traverse master dictionary
* Additional class method stubs to template instance declaration for upgrades
* Increase stack limit for bond trading compilation test
* Update hlint version
* Add anchor self-links in Rst docs
* Refactor a little with unwords
* Fix silly type error
* Refactoring and better type rendering
* Rename rst renderer functions.
* Update tests
* lint
* language: a shake rule to get interface/hie files
This adds a shake rule to get module interfaces and hie files. This
gives more control on when to build them and also an opportunity to
change the package name after typechecking. This is used in the next
PR to add package hashes to the package name in the interface files.
* generate hie files only on demand
Currently, we call `force` on every result of a rule. This was
problematic for the rules that produce LF packages:
Even if only the top-level module changes, the package for that module
contains all its dependencies. This means that we end up RNFing every
module that the current module depends on. On a project with ~900
dependencies this added up to over 1s for both GeneratePackageDeps and
GeneratePackage which corresponded to more than half of the overall
runtime.
This PR introduces a newtype for packages that does not evaluate the
modules in a package to NF. With this PR both rules are below 0.02s so
his is quite a significant improvement. We do not introduce any
potential space leaks here since the modules are produced by rules
that already force them to NF.
* damlc visual: detect ledger actions at surface level
Instead of detecting the DAML-LF primitives for `create` and `exercise`,
we detect the corresponding surface DAML functions and ignore the
dictionaries for the `Template` and `Choice` classes. This will be
necessary for swiching to the new template desugaring.
This is the quickest way to get this working but might turn into a brittle
maintenance nightmare one day. If that happens, we should switch to doing
proper symbolic evaluation, which will we be a bit more code though.
* Fix explanation
Co-Authored-By: Rohan Jacob-Rao <rohanjr@gmail.com>
* Add explanation for special casing archive
* Support depending on potentially stale values in damlc
For now, this is opt-in and only enabled for the scenario service.
Locations should be properly mapped so if lines are inserted above a
scenario, the scenario link will move down.
* Erase key lookup methods implemented using magic as well
We're already erasing `create`, `fetch` and `exercise` methods. I've
missed the ones related to key lookups when I did that. This PR fixes
my mishap.
* Fix typo in docs.
Co-Authored-By: Rohan Jacob-Rao <rohanjr@gmail.com>
We want to discourage users to pin down a target DAML-LF version but rather
want them to always use the default version, which is typically the newest
version. Thus, we turn this into an expert flag that is mostly used for
testing by us.
`template X` generates type class `XInstance` which contains a few methods
which are implemented in terms of `magic` and then rewritten during the
conversion to DAML-LF. The default implementations of these methods need to
be erase during the conversion to DAML-LF since `magic` is erased as well.
* language: added a merge command to damlc
This adds a 'merge-dars' command to damlc to merge two dars into one.
This is useful when you created an upgrade dar and want to ship it as
part of the latest version of a package.
* added a comment on nubSort for clarity
The gRPC library does not handle asynchronous exceptions properly and
ends up leaking things which causes various issues (segfaults,
assertion failures, weird backup poller timer messages, …) when
shutting down gRPC.
The switch to grpcShutdownBlocking is somewhat unrelated (the issues
happen with and without that and the fix seems to work both times) but
that function seems to be the right way to shut down gRPC in newer
versions and is what all the official language bindings switched to,
so I also made the switch.
I haven’t yet looked into the issues in the HS ledger bindings so not
sure if this helps with those as well.
* language: upgrades independent of stdlib
This fixes several issues in the code generation from dalfs. As a result
we can now generate upgrades independent of the stdlib source.
Some `Development.IDE.*` modules were imported qualified as either `Compile`
or `CompilerService`. These names are at least odd and maybe also
misleading. Since there's no actual need to import them qualified, let's
just import them not qualified.
* handling dalfs flowing to next line
* space not blank
* Lints and space
* fixing the test names
* filter using not.null
* Using fold instead. makes reading easy
* Format everything
* Removing use of partial function
* More stdlib tweaks
* Another commit to kick off build again
* Fix incorrect docs syntax
* Apply suggestions from code review
Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
* Apply suggestions from code review
Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
* More suggestions applied
* Support reading of DAML-LF 1.5 in damlc again
We dropped support for this for no good reason when we dropped support for
writing DAML-LF 1.5. Being able to _read_ older versions of DAML-LF is
important for the upgrading story.
We don't support reading older versions of DAML-LF since there seems to
be no need for this.
* Fix integration test
* DA.Bazel.Runfiles based on bazel-runfiles
* locateRunfilesMb -> locateRunfiles
* .exe extension on Windows
* Add docstring to locateRunfiles
* bazel-runfiles: Normalize on Windows