Commit Graph

1747 Commits

Author SHA1 Message Date
Remy
2abf27cd67 Revert DAML-LF proto change for Numeric (#2600)
* Revert DAML-LF proto change for Numeric

This partially reverts commit 0ffe5945b8.

* daml-lf: udpate release notes

* Apply suggestions from code review

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>
2019-08-20 08:13:15 +00:00
Martin Huschenbett
f11e09f60f Stop highlighting signature as a keyword in the IDE (#2599)
This fixes #2598.
2019-08-20 07:23:39 +00:00
Moritz Kiefer
3e2ccc0842
Switch to a streaming zip encoding (#2595)
This switches the creation of the archive in `daml build` from
`zip-archive` to `zip`. This has a few advantages:

1. It gets rid of lazy IO for reading all the interface and source
files. This avoids the high usage of file handles in `daml build`.

2. It seems to be a slight improvement in max memory usage and runtime
and a giant improvement in allocations (but I think the latter
probably comes primarily from the fact that the locations are moved to
the bzip C library). The improvement in max memory usage is less than
I expected so probably there is still something off somewhere.

For now, I only switched over `createArchive`. Archive reading is
still done using `zip-archive`. We might want to switch that over in a
separate PR.
2019-08-19 20:15:13 +02:00
Ognjen Maric
c71237b4c1
Identity and package management (#2532)
* Identity and package management

* Apply suggestions from code review

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

* Bernhard's comments

* Simon's comments

* Update license

* Oh noes - I broked teh linkz!
2019-08-19 19:09:29 +02:00
Bernhard Elsner
d9298c8744 Various improvements to make hs-bindings usable outside repo (#2583) 2019-08-19 16:44:45 +00:00
Robin Krom
4634d35df2
language: Check for different SDK versions when building pkg db (#2591)
* language: Check for different SDK versions when building pkg db

This fixes #2510. We check whether packages were compiled with differen
SDK versions and emmit an understandable error if so.

* addressing moritz comments
2019-08-19 18:43:18 +02:00
Martin Huschenbett
486f2ae730 Make the DAML-LF AST in Scala land look less like a DSL (#2596)
Currently, the `SExpr` class has a method `apply`, which is basically an
alias for `SEApp`. Using this method makes the code harder to read, at
least of me. After all, ASTs are _data_ and not _control_. Thus, having
a DSL for them seems a bit overkill.
2019-08-19 15:53:52 +00:00
Moritz Kiefer
8831000b97
Bump rules_haskell (#2585)
* Bump rules_haskell

The c2hs Windows patches and the include dir patches have been merged
upstream so we can remove them.
2019-08-19 17:29:37 +02:00
Moritz Kiefer
11923381fa
Default to -c opt in Bazel (#2592)
This makes sure that C dependencies like gRPC or zlib get compiled
with optimizations. I patched rules_haskell to use -O instead of -O2
since the latter slows down compilation while not making things
faster (according to my measurements).
2019-08-19 17:10:30 +02:00
Robin Krom
47238a5508
language: docu: documentation for the migrate command of damlc (#2579)
* language: docu: documentation for the migrate command of damlc

This adds a section on how to migrate between two different versions of
two packages.

* addressing martin's comments

* addressing bernhard's comments
2019-08-19 16:58:52 +02:00
Remy
daf10bf247
daml-lf: make LF parser numeric compatible (#2587) 2019-08-19 16:31:33 +02:00
Moritz Kiefer
33e16eaef1 Remove arx patch files (#2593)
I forgot to remove them in the Stackage upgrade.
2019-08-19 13:55:32 +00:00
Andreas Herrmann
64e8f83af4
bazel 0.27.0 --> 0.28.1 (#2570) 2019-08-19 13:53:08 +02:00
Moritz Kiefer
b4dc886fa8
Bump stackage (#2588)
* Bump stackage

This PR switches us over to the latest Stackage LTS 0.14.1 (we were on
0.13.x before, so this includes major bumps) and gets rid of some
obsolete overwrites.
2019-08-19 13:31:10 +02:00
Gerolf Seitz
67d4b7aec6
Upgrade akka to 2.5.23 and akka-http to 10.1.9 (#2576)
When diagnosing error logging from akka when shutting down the ledger
API server, I wanted to give upgrading akka to the latest good release
between akka and akka-http. Incidentally, this actually removed the
errors and the shutdown should now be successful.
2019-08-19 12:34:03 +02:00
Moritz Kiefer
02a148fbb6
Bump hie-bios (#2586)
This includes my patches to fix the Stack cradle in hie-bios so
hie-core should now work properly on Stack projects.
2019-08-19 11:13:13 +02:00
Bártfai Tamás
a76f82d088 Fix log level for errors in Bot.java (#2581) 2019-08-17 19:42:54 +02:00
Leonid Shlyapnikov
0960c49cff
LedgerClient JWT pass-through in the HTTP JSON API gateway (#2566)
* The first draft of LedgerClient JWT support

not integrated with HTTP JSON API gateway yet.

* JWT pass-through for create and exercise commands

* JWT pass-through for contracts search and lookup

* Removing unused class

* Readme updates
2019-08-17 06:54:05 -04:00
Shayne Fletcher
4b8ac32651
Update hie-core README emacs instructions (#2567)
* Update hie-core README emacs instructions

* Send the reader to MELPA
2019-08-16 13:43:49 -04:00
Moritz Kiefer
333c90bd69
Cleanup build of c2hs (#2578)
* Cleanup build of c2hs

No need to inline the whole package and add a custom build file.

* Use hazel_hackage
2019-08-16 19:33:30 +02:00
Stefano Baghino
35a36a6fd6
Remove old CommandService integration tests (#2568) 2019-08-16 18:33:17 +02:00
Remy
832be124e0 engine: SDecimal -> SNumeric (#2577) 2019-08-16 16:17:56 +00:00
Stefano Baghino
eb965866cc
Simplify new test tool (#2573)
* Simplify new test tool

* Shorten exercise to leverage ContractId

* Remove dead code

* Address https://github.com/digital-asset/daml/pull/2573#discussion_r314702191

* Address https://github.com/digital-asset/daml/pull/2573#discussion_r314700739

* Simplify transaction requests
2019-08-16 16:24:00 +02:00
Moritz Kiefer
6a0ebc9f5e Go back to building grpc-haskell-core using c2hs (#2574)
* Go back to building grpc-haskell-core using c2hs

This should hopefully avoid issues like the CSize vs CULong issue we
had a while back and might fix some of the issues we have been seeing
on CI.

I’m marking the Haskell ledger bindings as non-flaky for now so we can
see if the issues reappear.

* Fix path

* Fix c2hs runfiles

* s/basedir/dirname/

* Fix varname

* Remove fixme \o/

* Mark hs ledger bindings flaky again
2019-08-16 14:17:11 +00:00
Martin Huschenbett
4ae8cfd940 Write template locations when converting to DAML-LF (#2575)
Until now we've omitted them for no good reason. Choice locations
will follow in a separate PR.
2019-08-16 14:16:45 +00:00
Remy
6920a6be11
daml-lf: base implementation of Decimal on top of Numeric (#2569)
* daml-lf: base implementation of Decimal on top of Numeric
2019-08-16 15:33:10 +02:00
Gary Verhaegen
78d6ac04b5
explain cron workaround (#2565) 2019-08-16 13:05:11 +01:00
Moritz Kiefer
992b46c8f2 Compile with optimizations on Windows (#2571) 2019-08-16 11:03:51 +00:00
Ognjen Maric
b3cf9df3c1
Ledger topologies (#2476)
* Ledger topologies: first draft

* Participant node definition

* Regroup headings

* Marcin's comments

* Second attempt after discussion with Brian H

* Change the topic order in the navigation sidebar

* Apply suggestions from code review

Co-Authored-By: Shaul Kfir <shaul-da@users.noreply.github.com>

* Shaul's/Bernhard's comments

* Clarify the interoperability statement

* Bernhard's comments
2019-08-16 10:57:23 +02:00
Remy
e8995ca0ec Daml-lf: Core type Numeric (#2556)
* daml-lf: rename data.assert function to data.assertRight

* daml-lf: implement internal Numeric type

* Apply suggestions from Gerolf

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

* Address Gerolf's comments

in particular add tests for round and toLong
2019-08-16 07:40:12 +00:00
Martin Huschenbett
0a82d9fd18 Make stack traces work with cached top level values (#2560)
* Make stack traces work with cached top level values

For stack traces to work properly in the presence of cached top level values,
we need to cache the stack trace together with the value and restore the
stack trace when we get the value from the cache.

We also need to push location information under the monadic. Otherwise, the
location information will be removed from the continuation stack before the
monadic action is _executed_.

We also change one test case to use `fail` instead of `error` since `fail` is
more tricky than `error` (due to the lazy expression embedding in DAML-LF).
Unfortunately, the test did not work woth `fail` in the past because of the
issues fixed in this PR.

* Explain special cases when pushing location information
2019-08-15 17:28:26 +00:00
Shayne Fletcher
8828ff74d4
Upgrade dlint (#2561) 2019-08-15 13:28:12 -04:00
Andreas Herrmann
76b9a477b3 hie-bios: Don't hard-code import-dirs (#2562)
* hie-bios: Don't hard-code import-dirs

* Formatting
2019-08-15 16:08:35 +00:00
Robin Krom
f209950f0b
language: append the version to the output dar name by default. (#2559)
* language: append the version to the output dar name by default.

We now by default output foo-1.0.0.dar instead just foo.dar. Also the
maven coordinate default naming got removed.

* fixing integration tests and quickstart.dar occurences
2019-08-15 18:07:52 +02:00
Gerolf Seitz
a17c6d1fc9
Add Command submission test (#2508)
Also loads all dar packages eagerly in sandbox tests
2019-08-15 16:45:50 +02:00
Robin Krom
27d798d68a
language: use versioned name for conf files. (#2558)
Otherwise importing two different versions of the same package overrides
one conf file.
2019-08-15 16:12:42 +02:00
Andreas Herrmann
a7fac2fbee
hie-core exe: initDynLinker (#2555)
The hie-core tests are flaky in stack. They can fail with the following
error message

```
hie-core: panic! (the 'impossible' happened)\n  (GHC version 8.6.5 for x86_64-unknown-linux):
        Dynamic linker not initialised

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
```

Explicitly initializing the dynamic linker at session startup should
avoid this issue.
2019-08-15 15:27:26 +02:00
Moritz Kiefer
f3f2d3311b
Remove dependency on isolated sandboxes from HS ledger bindings tests (#2554)
The only tests that relied on this, were the ones for package
management and party management but we can fairly easily remove that
dependency by only checking the diff in packages and thereby folding
the listKnown* and uploadParty/uploadDar file into a combined test.

I’ve also bumped one timeout that I’ve seen fail on CI and managed to
get to fail locally under load.

I am unable to get the tests to fail now locally so I’ve marked them
as non-flaky on everything but Windows (we’ve seen weird segfaults
there).
2019-08-15 11:50:51 +02:00
Moritz Kiefer
3554596f9a Wait for all gRPC requests to finish before shutting down gRPC (#2551)
This fixes all flakiness in `damlc test` that I was able to
reproduce. Previously, I got it to fail in about 10% of the cases
whereas now I have successfully run tests 200 times under load without
issues.

There were two issues at play here:

1. We run scenarios in separate threads to be able to kill the running
Shake session quickly even if a scenario has an infinite loop or
something like that (there is a timeout but it’s quite long). This
could result in one of those left-over threads trying to issue a
request while we are already trying to shut down.

To fix that, we wait for the concurrency semaphore to be empty before
shutting down.

2. Just waiting for scenario executions is not quite sufficient as
`runAction` does not wait for all rules to finish (we could just use
runActionSync in `damlc test` but I’d rather make this work
properly). While we do wait for all scenario executions to finish
there is one gRPC request in offInterest that we do not wait for:
gcCtxs.

To fix this, I’ve now routed all gRPC requests through the semaphore
which means that we will also wait for these requests to finish (or
prevent them from spawning).

This makes more sense anyway as scenario executions are mostly fairly
cheap requests while things like setting up the context are expensive
so we want to limit their concurrency.

We should make the concurrency limit configurable but I’ll leave that
for a separate PR.
2019-08-15 09:39:30 +00:00
Robin Krom
bf8d84216d
langauge: fix: broken package imports in ide (#2545)
We need to initialize the package database before we run
`defaultOptionsIO`, because the later filters package database path that
don't exist.
2019-08-15 11:39:15 +02:00
Andreas Herrmann
ad8c2e8426 Add more hie-core diagnostics tests (#2535)
* hie-core test: missing modules

* hie-core test: variable not in scope

* hie-core test: cyclic module dependency

* hie-core test: redundant import

* hie-core test: type error

* hie-core test: reorganise test

* hie-core test: factor out diagnostic tests

* Display unexpected diagnostics
2019-08-15 09:35:52 +00:00
Moritz Kiefer
7df6f98f51
Remove erroneous entries in unreleased.rst (#2552) 2019-08-15 11:19:07 +02:00
Remy
938c9f3ecc daml-lf: fix spec (#2550) 2019-08-15 08:07:49 +00:00
Rohan Jacob-Rao
9ab3609772 Remove outdated todo (#2548) 2019-08-14 21:29:51 +00:00
Rohan Jacob-Rao
5bf86db2a1
Update generic templates (#2547)
* Extract template instance doc from newtype constructor doc
* Use new ghc-libs
* Remove type application which is not needed anymore
* Update daml-doc output with template instances
* Update hlint version
2019-08-14 16:28:35 -04:00
Shayne Fletcher
6defc5fdf8
More dlint smoke tests (#2546)
* More dlint smoke tests

* Fix test case name
2019-08-14 15:20:11 -04:00
Shayne Fletcher
f85e2430d1
Change default lexer mode to Opt_KeepRawTokenStream (#2542)
* Change default lexer mode to Opt_KeepRawTokenStream

* Set lexer to Opt_Haddock in daml-doc tests

* Set Opt_Haddock in another daml-doc test
2019-08-14 14:13:42 -04:00
Leonid Shlyapnikov
d9121af530 Releasing //ledger-service/http-json module and its dependencies (#2543) 2019-08-14 17:19:31 +00:00
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