Commit Graph

84 Commits

Author SHA1 Message Date
Martin Huschenbett
7cebdb7c17 Shrink stack size on Windows in bond memory test (#2358)
We increased it by too much in order to get tests to pass earlier. Now we shrink it to something closer to what we had before.
2019-08-01 13:45:27 -04:00
Anup Kalburgi
e5a0206a62
Visual tests - Avoid using golden file tests (#2325) 2019-07-31 15:49:53 -04:00
associahedron
35ee96a613 damldocs: Unify output across formats. (#2351)
* 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
2019-07-31 17:34:52 +00:00
Robin Krom
8fe537e292
Dar building cleanup (#2357)
* reorganizing dar building
2019-07-31 18:34:41 +02:00
Robin Krom
3db5230a43
language: put hash in package directories (#2268)
* 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.
2019-07-31 14:31:45 +02:00
Shayne Fletcher
f220100ab8
Enable linting in 'defaultOptionsIO' (#2343) 2019-07-31 05:08:36 -04:00
Rohan Jacob-Rao
e6a4d8b251
New template desugaring (#2178)
* 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
2019-07-30 19:49:33 -04:00
Shayne Fletcher
b3dac78e66
hlint.yaml => dlint.yaml; globally disable "use newtype" hint (#2341) 2019-07-30 14:39:46 -04:00
Shayne Fletcher
8532316c3a
Enable linting in the IDE! (#2339) 2019-07-30 11:57:52 -04:00
Shayne Fletcher
18ecf0ee8c
Support per-project hlint customization (.dlint.yaml files) (#2328)
* Support per-project hlint customization (.dlint.yaml files)

* Simplify logic with 'foldMapM'
2019-07-30 07:41:11 -04:00
associahedron
29fa387910 Move GHC.Classes docs to Prelude, hide IP. (#2333) 2019-07-30 11:15:05 +00:00
nickchapman-da
b90862ebec
improve haskell module hierarchy to be more consistent (#2319) 2019-07-29 15:55:55 +01:00
associahedron
462a852a03
Anchor links in Rst docs, fixing type rendering, and refactoring. (#2315)
* 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
2019-07-29 12:28:37 +01:00
associahedron
2a17b3d191 damldocs: Drop --json flag, update release notes. (#2309)
* Drop --json flag, update release notes.

* Clean up import list
2019-07-29 07:19:01 +00:00
Robin Krom
5bdc0d1b37
language: a shake rule to get interface/hie files (#2291)
* 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
2019-07-26 15:06:20 +02:00
associahedron
3d6f740964
damldocs: Hook up multiple file rendering to cli options. (#2295)
* Hook up multiple file rendering to cli options

* Fix --output help

* Fix bazel rules, boo

* Fix rule again

* Address reviewer comments
2019-07-26 13:45:06 +01:00
Moritz Kiefer
a7bb901052
Avoid evaluating modules unnecessarily to NF (#2296)
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.
2019-07-26 14:11:43 +02:00
Martin Huschenbett
8d8b09c45f damlc visual: detect ledger actions at surface level (#2278)
* 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
2019-07-24 21:42:28 +00:00
Fran
16259ab00f
damldocs: Make function types mandatory. (#2274) 2019-07-24 11:22:17 +01:00
Fran
000ccfc86e
damldocs: Use blockquotes for layout in markdown rendering. (#2273)
* Use blockquote for layout

* Update tests
2019-07-24 10:30:52 +01:00
Fran
1bf9adf44e
damldocs: Reinstate contexts in markdown function docs. (#2269)
* Reinstate contexts in markdown function docs.

* Simplify missing types logic

* Fix rst rendering for sphinx
2019-07-24 09:03:33 +01:00
nickchapman-da
b30228ab95
{-# LANGUAGE OverloadedStrings #-} is now on by default (#2270) 2019-07-24 08:09:26 +01:00
Fran
d0dd201380
damldocs: Backend for rendering docs to multiple pages. (#2259)
* Begin multi-page rendering

* Fixed multi-file output rendering for HTML

* Remove renderSimpleHtml

* Remove unnecessary imports

* Remove unused lang extensions

* Address reviewer comments
2019-07-23 19:04:10 +01:00
Moritz Kiefer
5f3e4b4b35 Add property tests for PositionMapping (#2265) 2019-07-23 15:05:44 +00:00
Moritz Kiefer
80360af18b
Support depending on potentially stale values in damlc (#2257)
* 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.
2019-07-23 15:00:21 +02:00
Martin Huschenbett
35dc1848a2 Erase key lookup methods implemented using magic as well (#2252)
* 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>
2019-07-22 19:18:14 +00:00
Martin Huschenbett
a35af9697f
Hide the --target flag of damlc (#2253)
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.
2019-07-22 20:43:22 +02:00
Martin Huschenbett
82ef3e47cf Generic templates: erase default implementations of magic methods (#2249)
`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.
2019-07-22 16:57:01 +00:00
Martin Huschenbett
4acaa0abdd Prefix method names in generic template classes with underscore (#2248)
We will do this as part of desugaring the surface syntax to occupy less
precious namespace.
2019-07-22 15:07:53 +00:00
Robin Krom
20fde9fd98 language: added a merge command to damlc (#2232)
* 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
2019-07-22 14:04:28 +00:00
Fran
a324102a19
damldocs: Document template instances. (#2240)
* Add md_templateInstances field and TemplateInstance docs.

* Extract template instance docs from adt docs

* Turn template instance map into a set.

* Output template instances

* Refactor rst sections

* Remove extra line

* Use doc marker to detect template instances

* Remove lint

* Implement review suggestions
2019-07-22 14:48:12 +01:00
Moritz Kiefer
46a8737d82 Ignore optional notification and request methods (#2244)
* Ignore optional notification and request methods

* Update compiler/damlc/daml-ide/src/DA/Daml/LanguageServer.hs

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-07-22 13:12:36 +00:00
Robin Krom
c8e0f51e90
Address martin comments (#2242)
addressing martin's comments
2019-07-22 13:48:29 +02:00
Michał Majcherski
148d2a57d3
VSCode scenario codelenses improvements (#2141) 2019-07-22 10:50:30 +02:00
Moritz Kiefer
f9fbfaeed2
Fix gRPC issues in damlc (#2230)
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.
2019-07-19 16:38:48 +02:00
Robin Krom
fd82ec73ab
language: generate upgrades independent of daml-prim (#2228)
This finally allows upgrades to be generated independent of the
daml-prim package.
2019-07-19 16:29:47 +02:00
Robin Krom
2b110f88e6
Upgrades independent of stdlib (#2222)
* 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.
2019-07-19 13:36:01 +02:00
Martin Huschenbett
37b7820942 Import the IDE modules unqualified instead of as Compile(rService) (#2227)
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.
2019-07-19 10:05:49 +00:00
Anup Kalburgi
bdddad4d76 Handling Dalfs list in Manifest file (#2207)
* 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
2019-07-18 15:31:52 +00:00
Martin Huschenbett
c113378482 Drop two useless occurences of 'import ... as Base' (#2216)
They don't serve any purpose and are just noise.
2019-07-18 13:53:57 +00:00
Fran
9f93362d44 Fix MOVE in GHC.Enum (#2215) 2019-07-18 13:40:09 +00:00
Martin Huschenbett
fab77c8092
Enable GHC Core linter in damlc integration tests (#2206) 2019-07-18 10:26:03 +02:00
Beth Aitman
d9e079df39 More stdlib tweaks (#2203)
* 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
2019-07-17 17:05:10 +00:00
Fran
c3f798610f
Fix Rst typeclass headers, simplify/fix typename anchors, make type declaration docs more robust. (#2202) 2019-07-17 15:13:17 +01:00
Martin Huschenbett
885aed9e0a In damlc session setup, pass options record around (#2193)
... rather than individual option fields. This prepares a change where I want
to add another option which needs to find its way into `adjustDynFlags`.
2019-07-17 13:29:30 +00:00
Martin Huschenbett
f38d717433 Support reading of DAML-LF 1.5 in damlc again (#2180)
* 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
2019-07-17 11:34:53 +00:00
Fran
f9bb9dc149
damldocs: Show generic template args and context. (#2181)
* Collect generic template args and context

* Revert template anchor change (keep it separate)

* Output generic template args and context in Rst docs

* Add template args and context in Md output
2019-07-17 11:58:55 +01:00
Shayne Fletcher
e735b16c40 Rephrase lint exit actions (#2182) 2019-07-17 10:57:59 +00:00
Beth Aitman
cd514eb024 Stdlib doc edits (#2163)
* Stdlib doc edits

* Apply suggestions from code review

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update based on Moritz's suggestion

* Fix ledger-api-integration-tests
2019-07-17 07:54:13 +00:00
Andreas Herrmann
63b46304eb
Base DA.Bazel.Runfiles on bazel-runfiles (#2147)
* DA.Bazel.Runfiles based on bazel-runfiles

* locateRunfilesMb -> locateRunfiles

* .exe extension on Windows

* Add docstring to locateRunfiles

* bazel-runfiles: Normalize on Windows
2019-07-17 09:48:44 +02:00