Commit Graph

1749 Commits

Author SHA1 Message Date
Stefano Baghino
23ba870896
Testing tips (#2505)
* Remove commented-out (and outdated) reference to the Node.js bindings

* Add tips for testing

* Update unreleased.rst

* Update docs/source/app-dev/app-arch.rst

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Update docs/source/app-dev/app-arch.rst

Co-Authored-By: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* Update docs/source/app-dev/app-arch.rst

Co-Authored-By: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* Address https://github.com/digital-asset/daml/pull/2505#discussion_r313312041

* Address https://github.com/digital-asset/daml/pull/2505#discussion_r313312708

* Address https://github.com/digital-asset/daml/pull/2505#discussion_r313338384

* Address https://github.com/digital-asset/daml/pull/2505#discussion_r313340110
2019-08-14 18:43:49 +02:00
Moritz Kiefer
c27e126267
Add a test that haddock comments are shown on hover (#2539)
Apparently, we never had any tests for this, so this PR adds at least
a rudamentary test. The logic for this is rather stupid and easy to
break and might change soon so I’ll hold off on adding more extensive
tests until this works a bit better.
2019-08-14 16:44:51 +02:00
Robin Krom
b85623d4d3
language: make sure conf files are uniform accross OS's. (#2538)
If a package is build on Windows, it puts '\' into the conf files, which
will not work on a Linux system. Now we always use '/' as path
separator.
2019-08-14 16:40:11 +02:00
Moritz Kiefer
126ad13326
Only register gRPC methods once (#2537)
SS.scenarioServiceClient does not just read the actual client from
some IORef, it registers the available gRPC methods. Apparently we
never knew about this or at least I didn’t.

By only doing this once, we should speed things up a bit and this
fixes once of the assertion failures that we have been seing on
shutdown (pthread_mutex_lock(&mu->mutex) == 0 in sync_posix.cc) which
was caused by trying to register a method from another thread after
destroying the channel.
2019-08-14 16:21:17 +02:00
Martin Huschenbett
3e5115edc7 Make damlc inspect work with DARs (#2534)
So far is can only pretty print DALFs. Now, you can give it a DAR and it
will pretty print the main DALF.
2019-08-14 12:39:36 +00:00
Richard Kapolnai
4e596362fd Fix typo in intro screenshot for archived contract (#2533)
* fix title in intro screenshot

* fix title in intro screenshot for archived contract
2019-08-14 13:59:57 +02:00
Robin Krom
caa4193810
language: docs: added package import documentation (#2518)
* language: docs: added package import documentation

This adds a chapter on DAML archives and how to import them into other
projects to the documentation.

* Update docs/source/daml/reference/packages.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* addressing comments

* removed random include in integration kit docu
2019-08-14 13:57:29 +02:00
Richard Kapolnai
4c04155a1a fix title in intro screenshot (#2526) 2019-08-14 12:52:05 +02:00
Martin Huschenbett
4f178a3a63 Simplify the pretty printing of location info in DAML-LF (#2530) 2019-08-14 10:05:50 +00:00
Moritz Kiefer
502b09e5e7 Mark the "damlc test" tests as flaky (#2527) 2019-08-14 09:04:09 +00:00
Moritz Kiefer
7f09d87933 Release 0.13.19 (#2525) 2019-08-14 08:53:04 +00:00
Martin Huschenbett
4a952d59ea Make the detail level of damlc inspect configurable (#2498)
Add a command line option to `damlc inspect` which allows for configuring the
details level of the pretty printed DAML-LF. Right now the only difference is
that levels bigger than 0 print all location information. Level 0, which is
the default, also prints location information top level declarations.

This feature is useful for debugging location information.
2019-08-14 07:54:20 +00:00
jordan-mittleman
bb69daa231 Update damlpatterns.tar.gz (#2403)
Code here doesn't match with what's explained/shown in documentation
2019-08-14 09:39:10 +02:00
Martin Huschenbett
803fee057f Show function names in stack trace on failing scenario (#2516)
* Show function names in stack trace on failing scenario

So far, we've only shown the location of the function but not its name.
Now, we add the name of the function as well.
2019-08-14 09:16:07 +02:00
Shayne Fletcher
117afdafa1 Upgrade hlint (#2524) 2019-08-14 08:46:31 +02:00
Stephen Compall
f77e4229a2
document lf-value-json's encoding of various types (#2519)
* copy design draft for JSON LF encoding with minimal changes

* literal block formatting

* :: on its own

* only describe the variant notation we've chosen

* wrap

* mark some text literal

* correct reason why null is not a valid Unit

* alignment

* explain that the presence of type variables has no bearing on nested Optional encoding

* correct copyright header

* quotes and subscripts

* remove disallowed examples of variants

* positive? negative?

* you never know when JavaScript will ruin your day

* what's {} anyway

* we are talking about JSON, you know
2019-08-13 17:56:33 -04:00
Stephen Compall
0d72f84fe8
new JSON formats for some DAML-LF data (#2463)
* daml-lf: make match2's fallback lazy, and add tuple2 syntax for better inference

* lf-value-json: when decoding, branch on type, *then* on value

- restores totality checking for interface ADT
- makes alternate input formats obvious at a glance
- lets us restructure in the future to cache type branch lookups

* lf-value-json: support numbers for int64s

* lf-value-json: test failures and more timestamp cases

* lf-value-json: adapt timestamp decoding to new rules

* lf-value-json: cleanup

* lf-value-json: decode Number as decimal

* lf-value-json: forbid yet another timezone format

* lf-value-json: don't copy

* lf-value-json: replace {Some, {None optional format with nest-sensitive [] format

* lf-value-json: round decimals rather than rejecting, in either string or number form

* lf-value-json: support output to JsNumber for int64s and decimals, separately

- not dependent on JavaScript safe integer range, because that is not
  the purpose of this option

* lf-value-json: uncomment some now-tested rounding cases

* allow None record fields to be omitted in object syntax

* release notes
2019-08-13 17:00:08 -04:00
Moritz Kiefer
ef635ea301
Mark tests that use Haskell gRPC bindings as flaky (#2521)
I’m hoping to investigate this soon but for now this should hopefully
result in less time spend restarting tests.
2019-08-13 20:38:51 +02:00
Leonid Shlyapnikov
678ac0d725
Fixing the copyright header (#2522) 2019-08-13 14:25:28 -04:00
Moritz Kiefer
3eb112e4ca
Only report progress when client supports it (#2517)
* Only report progress when client supports it

This fixes an issue that some people encountered when running hie-core
in Emacs with a version of haskell-lsp that does not understand
progress events.

* Fix tests

* More test fixes
2019-08-13 20:00:21 +02:00
Moritz Kiefer
3d0699a9a8
Add an option to build Haskell code with DWARF debug info (#2504)
For now, this only works on Linux (that’s a GHC limitation as far as I
know) and you have to enable it by setting the GHC_DWARF env var to a
non-empty string.
2019-08-13 20:00:14 +02:00
Leonid Shlyapnikov
689d4d876c
Removing JWT verification (should be done by the ledger... eventually) (#2501)
* Removing JWT verification (should be done by the ledger... eventually)

Adding JwtDecoder that does not do JWT signature validation at all.

* Updating README

* Changes to allow overriding the default JWT decode only logic.

You can pass a function that does more than just decoding.
2019-08-13 13:43:26 -04:00
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
Andreas Herrmann
a1c21d9829
Update rules haskell (#2509)
* update rules_haskell

* adapt rules_haskell patches

* io_tweag_rules_haskell --> rules_haskell

* io_tweag_rules_haskell --> rules_haskell

* haskell:haskell.bzl --> haskell:defs.bzl

* rules_haskell_dependencies
2019-08-13 16:46:31 +02:00
Gary Verhaegen
1d7622c35d
exclude ledger migrations from copyright update (#2514) 2019-08-13 15:24:38 +01:00
Robin Krom
db59c228c1
language: tests: tests for merging and non-toplevel main files (#2515)
We add tests for the `merge-dars` command and check that we can handle
main files that are not at the top source level.
2019-08-13 15:47:41 +02:00
Richard Kapolnai
b4a9ee914f Fix URL to daml code (#2513) 2019-08-13 13:31:04 +00:00
Moritz Kiefer
da3f295507
Add commands for inserting and deleting lines to ide-debug-driver (#2511) 2019-08-13 15:25:26 +02:00
Gerolf Seitz
66f85ca530
Add ContractKeys test. (#2491)
This test represents the behavior of contract keys before the change of behavior in DAML LF 1.DEV.
The existing ContractKeys test is renamed to ContractKeysSubmitterIsMaintainer.

The `LedgerTestSuiteRunner` now uses a fixed number of
threads for the runner threadpool. This way we don't flood
the CPU with threads when using a CachedThreadPool.
2019-08-13 15:15:51 +02:00
Robin Krom
8400e33cb7
language: fix: compute correct source root when building dar (#2500)
* language: fix: compute correct source root when building dar

Previously we just took the base directory of the main file, which is
wrong when the main is deeper down in the module structure.

* hlinting

* reuse moduleImportPaths
2019-08-13 13:45:22 +02:00
Moritz Kiefer
052cbe0fd4
Fix more leaks in Development.IDE.Core.Shake (#2507)
We accumulated some thunks in those variables that leak over long
sessions.
2019-08-13 13:36:03 +02:00
Gary Verhaegen
7363d73500 copyright: do not add extra blank line (#2502) 2019-08-13 12:52:07 +02:00
Remy
c2e2e007e7 Fix release notes about improper freeze of 1.6 (#2489)
* daml-lf: clean up a bit how verion are handle

* fix releases not about imporper release of #1866

* address Gerolf's comments
2019-08-13 08:10:24 +00:00
Gerolf Seitz
9d1af43ec8
Port WitnessesIT to the new test infrastructure. (#2486) 2019-08-13 09:24:08 +02:00
Martin Huschenbett
c2940705ff Remove unused message from scenario service protobuf (#2503)
I assume the plan was to implement stack traces. I intend to do that as well
but the message type does not fit my approach. Thus, let's remove it first.
2019-08-13 07:07:38 +00:00
Martin Huschenbett
0ca2601cd9 Print stack traces in the scenario on failure (#2497)
* Print stack traces in the scenario on failure

Currently, we only print the last source location, which is not
particularly helpful for debugging. Now, we put all source locations we
encounter during execution on the continuation stack and print them when
a scenario fails. This PR does not print the names of entered functions
or choices. We leave this for a future PR.

* Address Moritz' comments
2019-08-12 19:05:19 +00:00
Moritz Kiefer
b87215e111 Remove the --dump-pom flag from damlc package (#2496)
It doesn’t serve any purpose at this point so we might as well get rid
of it.
2019-08-12 17:49:43 +00:00
Gerolf Seitz
8f14c19fc9 Move assertion on exception type to match block. (#2495)
Addresses
https://github.com/digital-asset/daml/pull/2282#pullrequestreview-272786088
2019-08-12 12:52:01 -04:00
Anup Kalburgi
c96dae3a52
Visual ide (#2467)
Generate visualization from IDE
2019-08-12 12:42:45 -04:00
Moritz Kiefer
9ce0d414c4
Force values in setValues and getValues (#2494)
Otherwise, we can end up retaining references to the old map which
prevent it from being garbage collected.

On a simple testcase that repeatedly opens and closes a module, this
seems to make memory usage constant whereas it was increasing
each time before.
2019-08-12 17:40:12 +02:00
associahedron
ed0d5667c2 damldocs: Small type rendering improvements. (#2492)
* Add parentheses around type operators in expressions.

* Remove levity arguments from (->) in stdlib docs

* Avoid parenthesizing type-level literals
2019-08-12 15:28:57 +00:00
Robin Krom
829cb4cef5
Daml stdlib with versions (#2479)
* language: build daml_stdlib with a version in the package name.

* versioned daml-stdlib in damlc

* reformat bazel files

* fix daml_doc_test
2019-08-12 16:05:28 +02:00
associahedron
b16f937d7e damldocs: Show relevant instances for types and classes. (#2487)
* Add md_instances field to ModuleDoc

* Extract instances

* Add instance fields to class and type docs.

* Implement distributeInstanceDocs

* Use Maybe list instead of list.

* Render instance docs.

* Add instance data in tests and add a golden test.

* Rename to orphan typeclass instances.
2019-08-12 13:48:46 +00:00
Moritz Kiefer
8f587dc456
Use per-test parties in HS ledger bindings tests (#2481)
* Use per-test parties in HS ledger bindings tests

This should hopefully solve the flakiness issues caused by the reset
service. For now, there is a very small number of tests that we run on
an isolated sandbox namely the tests for party management and package
management.

* shut up hlint

* Disable reset tests
2019-08-12 12:56:18 +02:00
Gary Verhaegen
bf5995f529
remove mentions of da-int servers (#2485) 2019-08-12 10:42:41 +01:00
Martin Huschenbett
bbfa0a1318 Simplify test for issue with GHC.Tuple.Unit (#2475)
* Simplify test for issue with GHC.Tuple.Unit

* Make sure tests actually produces GHC.Tuple.Unit somewhere
2019-08-12 09:20:40 +00:00
Gerolf Seitz
816b93e2c2
Produce a more compact test summary output. (#2483)
Example:

ContractKeys
- Divulged contracts cannot be fetched or looked up by key ... Success
- Contract Keys should reject fetching an undisclosed contract ... Success
- Contract keys should be scoped by maintainer ... Success

Divulgence
- Divulged contracts should not be exposed by the transaction service ... Success
- Divulged contracts should not be exposed by the active contract service ... Success

Identity
- A ledger should return a non-empty string as its identity ... Success

SemanticTests
- Test:consistency_doublespend1 ... Success
- Test:contract_keys_test ... Success
- Test:consistency_doublespend2 ... Success
- Test:authorization_success1 ... Success
- Test:authorization_rule2_failure ... Success
- Test:authorization_rule1_failure ... Success
- Test:privacy_projections1 ... Success
- Test:consistency_doublespend3 ... Success
- Test:authorization_success2_delegation ... Success

Time
- Advancing time should return the new time ... Success<Paste>
2019-08-12 09:13:38 +02:00
Rohan Jacob-Rao
c2f315d2ba
Support generic templates (#2465)
* Upgrade ghc-libs supporting generic templates
* Update Proposal and ComposedKey tests to generic template syntax
* Temporarily patch daml-doc test output (will need to fix for template instances)
2019-08-09 17:15:51 -04:00
Remy
a156880dc2 engine: cleanup environment (#2480) 2019-08-09 19:53:40 +00:00
Remy
55c573f29d Based the interface reader on the archive decoder. (#2441)
* daml-lf: base interface reader on archive decoder

* fix call to InterfaceReader.readInterface

+ cosmetic changes

* daml-lf: decoder can process only serializable data
2019-08-09 18:15:46 +00:00