Commit Graph

348 Commits

Author SHA1 Message Date
Samir Talwar
9976b4cd50
Bazel: Factor out logic around Protobuf JARs. [KVL-714] (#8084)
* kvutils: Use ScalaPB to generate a Scala JAR for daml_kvutils.proto.

* Bazel: Delete the unused `da_java_binary` rule, and inline `_wrap_rule`.

* Bazel: Factor out Java/Scala protobuf class generation into a helper.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lf/archive: Use `proto_jars`.

* Bazel: Remove the visibility modifier from `proto_jars`.

It's too confusing. Just make everything public.

* daml-lf/archive: Push protobuf source tarballs into `proto_jars`.

* Bazel: Add comments to the various parts of `proto_jars`.

* daml-assistant: Do unpleasant things with `location` in Bazel.
2020-11-27 08:34:53 +00:00
Moritz Kiefer
037ff64e96
Bump timeout in integration tests (#8059)
changelog_begin
changelog_end
2020-11-25 10:47:01 +00:00
Robin Krom
dabd55d0b0
assistant integratin tests: speed and cleanup. (#8032)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 19:05:02 +01:00
Robin Krom
936a0862fb
daml codegen: Add deprecation warning for scala. (#8033)
This fixes #8022. This adds a deprecation warning for the scala codegen.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-23 13:27:49 +01:00
Robin Krom
5bfff4e9ba
sandbox: fail on already existing port-file. (#7929)
Fixes #7806. This aligns the port file behaviour of the sandbox with the
HTTP JSON API.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-17 11:08:37 +01:00
Robin Krom
dae3c5caef
daml ledger: add a max-inbound-message-size flag for grpc (#7954)
* daml ledger: add a max-inbound-message-size flag for grpc

This new flag allows to set the maximal accepted inbound message size
when using gRPC to interact with a legger.

CHANGELOG_BEGIN
CHANGELOG_END

* added a test
2020-11-13 00:16:06 +00:00
Moritz Kiefer
07d5a19d50
Cleanup trigger service endpoints (#7950)
* Cleanup trigger service endpoints

fixes #6333

changelog_begin

- [Trigger Service]

  Endpoints have been rearranged to be more consistent:

  | New endpoint              | Old endpoint       | Functionality                |
  |---------------------------|--------------------|------------------------------|
  | GET `/v1/triggers`        | `/v1/list`         | List triggers                |
  | POST `/v1/triggers`       | `/v1/start`        | Start trigger                |
  | GET `/v1/triggers/:id`    | `/v1/status/:id`   | Trigger status               |
  | DELETE `/v1/triggers/:id` | `/v1/triggers/:id` | Stop/delete trigger          |
  | POST `/v1/packages`       | `/v1/upload_dar`   | Upload DAR                   |
  | GET `/livez`              | `/v1/health`       | liveness check               |

changelog_end

* Fix integration tests

changelog_begin
changelog_end
2020-11-12 11:23:28 +01:00
Robin Krom
a491002483
daml ledger: implementation of ledger commands via json api (#7885)
* daml ledger: implementation of ledger commands

Implementation of the remaining daml ledger commands via HTTP JSON
service endpoints instead of gRPC.

Fixes #4824 .

CHANGELOG_BEGIN
[daml assistant] `daml ledger` commands can now also be run against the JSON API instead of the gRPC API.
CHANGELOG_END
2020-11-09 16:24:45 +01:00
Robin Krom
e865ea7d5b
assistant: prompt users to automatically update PATH (#7910)
* assistant: prompt users to automatically update PATH

We ask the Max/Linux users on installation if we should update their
PATH environment variable to point to the assistant binary and
automatically do so when the answer is affirmative.

CHANGELOG_BEGIN
CHANGELOG_END

* set .profile insetad .bashrc

* add a case for sh

* fix tests

CHANGELOG_BEGIN
CHANGELOG_END

* use imports only on nix systems

* update windows updatePath function for YesNoAuto flag.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-06 17:07:40 +01:00
Robin Krom
ab3cce3e55
assistant tests: Testing hot-reload (#7871)
* assistant tests: Testing hot-reload

This adds a test to the assistant integration tests for testing the
hot-reload feature.

CHANGELOG_BEGIN
CHANGELOG_END

* hlint
2020-11-04 15:57:12 +01:00
Robin Krom
25edd9fd10
daml start: rerun the initialization script on rebuild (#7841)
We rerun the initialization script for every rebuild. In addition we fix
a potential bug that would lead to a wrong sandbox port when trying to
re-upload the package.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-02 10:41:05 +01:00
Robin Krom
2e22b5f5f2
daml ledger: Infrastructure for tests (#7794)
* daml ledger: Infrastructure for tests

This adds infrastructure for testing `daml ledger` and moves one test
from the assistant integration tests to the newly created tests.

CHANGELOG_BEGIN
CHANGELOG_END

* Update libs-haskell/test-utils/DA/Test/HttpJson.hs

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update libs-haskell/test-utils/DA/Test/HttpJson.hs

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

* small fixes

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-10-30 21:35:29 +01:00
Moritz Kiefer
4cc34c6be9
Fix error handling in ledger-upload-dar (#7842)
Currently we catch the exception and then print out "DAR upload
succeeded.". That’s clearly not what is intended here.

changelog_begin

- [DAML Assistant] `daml ledger upload-dar` now exits with a non-zero
  exit code on failures and no longer prints "DAR upload succeeded"
  in error cases.

changelog_end
2020-10-29 17:10:37 +00:00
Robin Krom
5bc70df1f2
fix: don't build before uploading a dar (#7838)
This makes sure the dar doesn't get build two times on reload.

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-29 17:47:06 +01:00
Martin Huschenbett
2adf2c428e
Refactoring: Use map in download helper for fetch-dar (#7784)
The `downloadAllReachablePackages` function, which is part of the
implementation of `featch-dar`, uses an associative list when a `Map`
seems more appropriate. More appropriate in both runtime complexity as
well as code complexity. This has caught my eye while reviewing some
code nearby and I thought I have a minute to spare to improve it.

This PR replaces the associative list with a `Map`.

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-23 15:07:30 +02:00
Robin Krom
cf85751c3c
daml assistant: cleanup of daml ledger commands (#7777)
* daml assistant: cleanup of daml ledger commands

This is a cleanup of the Helper/Ledger.hs module in preparation for
further implementations of `daml ledger` commands against the JSON API.
In particular the module Compiler/Fetch.hs is removed from daml-compiler
and its contents moved over the Helper/Ledger.hs. Some renaming and
reorganization is done for clarity.

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-22 17:07:43 +02:00
Robin Krom
2be6b4a265
language: daml ledger commands against JSON API (#7700)
* language: `daml ledger` commands against JSON API

This is the first step in offering the JSON API to run `daml ledger`
commands. First, only the `list-parties` command is implemented. The
other `daml ledger` commands will follow in separate PR's.

CHANGELOG_BEGIN
[Assistant] The `daml ledger list-parties` command can now query the
ledger via the HTTP JSON API instead the gRPC API for known parties on
the ledger.
CHANGELOG_END
2020-10-21 16:32:26 +02:00
Moritz Kiefer
e09c31899d
Connectify user-facing output (#7624)
Together with #7615, this overs all items in #7612.

changelog_begin
changelog_end
2020-10-09 15:45:02 +02:00
Robin Krom
51e53ce006
language: Rebuild/redeploy on key press (#7562)
This makes the `daml start` process listen for a key-press. When 'r' is
pressed, the package is re-build, the new package uploaded to the
in-memory sandbox and the codegen re-run.

Note: While we clean previous outputs of the code generation, there is
currently no way to drop previously uploaded packages from the in-memory
sandbox. However, it will take many re-uploads until this will become a
problem.

CHANGELOG_BEGIN
[daml start] You can now press 'r' (or 'r' + 'Enter' on Windows) in the
  terminal where `daml start` is running to rebuild the DAR package and
  generate JavaScript/Java/Scala bindings and upload the new package to
  the sandbox. This frees the user from killing and restarting `daml
  start`.
CHANGELOG_END
2020-10-08 17:10:25 +02:00
Moritz Kiefer
d2da2a7b88
Undamlify assistant output (#7611)
In preparation for the renaming, we are stripping the DAML prefix. It
is still called SDK and the sdk-version variable keeps existing.

changelog_begin
changelog_end
2020-10-08 16:57:43 +02:00
Robin Krom
b639d43ffa
language: fix: broken npm scope name from project config (#7579)
This fixes the parsing of the npm-scope field of the project config,
where a space is accidentally introduced.

CHANGELOG_BEGIN
[Codegen] Fix for an accidentally introduced space in the npm scope of
genreated JavaSript libraries when it was parsed from the daml.yaml
project config.
CHANGELOG_END
2020-10-06 16:46:06 +02:00
Robin Krom
6a328212f2
language: automatic ts codegen for daml start (#7516)
This executes the code generations specified in the daml.yaml
configuration file on every invocation of `daml start`
and hence frees the user of doing it manually.

CHANGELOG_BEGIN
- [DAML Assistant] The `daml start` now runs all the code generators
specified in the `daml.yaml` project configuration file under the
`codegen` stanza. This frees the user of doing so manually on every
change to the DAML model.
CHANGELOG_END
2020-10-02 15:43:06 +02:00
nickchapman-da
7c038119aa
Improve the user error message if the upload-dar command fails. (#7510)
* Improve the user error message if the upload-dar command fails.

In particular we want to catch the case of a gRPC timeout exception which we know can occur if the DAR is too large. But it seems helpful to catch any exception, and shows what we caught along with the helpful message.

* use safe-exceptions
2020-09-29 14:24:53 +00:00
Sofia Faro
e9cd92f061
Deprecate the "daml 1.2" version header. (#7513)
* changelog_begin

- [DAML] The "daml 1.2" version header is now deprecated.

changelog_end

* fix some line numbers

* fix some more locations
2020-09-29 13:14:59 +00:00
Martin Huschenbett
afdfec53dd
Deprecate specifying the template in daml new positional (#7490)
We deprecate specifying the template when calling `daml new` via a
positional argument, as in
```sh
daml new foo skeleton
```
The new syntax is
```sh
daml new foo --template skeleton
```
Whenever the former version is used, we now print a not that it is
deprecated and that the latter version is the recommended way.

CHANGELOG_BEGIN
[DAML Assistant]
- Deprecate specifying the template for `daml new` via a positional
  argument.
CHANGELOG_END
2020-09-25 12:39:49 +00:00
Bernhard Elsner
331ee44978
Documentation of our support and compatibility framework (#7458)
* Documentation of our support and compatibility framework

CHANGELOG_BEGIN
CHANGELOG_END

* Update docs/source/daml-integration-kit/index.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/support/component-statuses.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Address feedback

* Update docs/source/support/compatibility.rst

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>

* Add Deprecations and address feedback

* Fix short title underline

* Apply suggestions from code review

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>

* Improve sentence on Integration Kit

* Imprive SemVer TLDR

* Uncapitalize release candidate

* Fix release timeline image

* Make the DAML Language Server CLI a Labs feature

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>
2020-09-24 14:40:57 +00:00
Remy
71c19901fd
Ledger-API: Validate Dar before sending it to the ledger. (#7430)
This PR implements a part of the proposal from #7093.

Here packages are validated in the participant node before to be sent to the ledger.

CHANGELOG_BEGIN

- [Ledger-API] participant node validate Dar before uploading to the ledger.
   This may increase upload time significantly.

CHANGELOG_END
2020-09-18 17:26:22 +02:00
Sofia Faro
861d9b0d05
Add --navigator-port option in daml start. (#7401)
* Add --navigator-port option in daml start.

Fixes #5777

changelog_begin

- [DAML SDK] Added a ``--navigator-port`` option in ``daml start``,
  allowing you to specify the port for navigator's web server.

changelog_end

* Perform defaulting in optparse-applicative
2020-09-15 11:16:35 +00:00
Gary Verhaegen
d966178f47
add indication of DAML_SDK_VERSION for daml version (#7385)
Fixes #7381.

```
$ alias daml=~/.daml/sdk/0.0.0/daml/daml
$ daml version
DAML SDK versions:
  0.0.0
  1.4.0
  1.5.0-snapshot.20200811.4959.0.bbc2fe56
  1.5.0-snapshot.20200818.5027.0.1b33d374
  1.5.0-snapshot.20200902.5118.0.2b3cf1b3  (default SDK version for new projects)
$ DAML_SDK_VERSION=invalid daml version
daml: Invalid value for environment variable DAML_SDK_VERSION.
  context: Determining SDK version and path.
  details: Invalid SDK version  "invalid": Failed reading: takeWhile1

$ DAML_SDK_VERSION=1.4.4 daml version
DAML SDK versions:
  0.0.0
  1.4.0
  1.4.4                                    (selected by env var DAML_SDK_VERSION, not installed)
  1.5.0-snapshot.20200811.4959.0.bbc2fe56
  1.5.0-snapshot.20200818.5027.0.1b33d374
  1.5.0-snapshot.20200902.5118.0.2b3cf1b3  (default SDK version for new projects)
$ DAML_SDK_VERSION=1.4.0 daml version
DAML SDK versions:
  0.0.0
  1.4.0                                    (selected by env var DAML_SDK_VERSION)
  1.5.0-snapshot.20200811.4959.0.bbc2fe56
  1.5.0-snapshot.20200818.5027.0.1b33d374
  1.5.0-snapshot.20200902.5118.0.2b3cf1b3  (default SDK version for new projects)
$ DAML_SDK_VERSION=1.5.0-snapshot.20200902.5118.0.2b3cf1b3 daml version
DAML SDK versions:
  0.0.0
  1.4.0
  1.5.0-snapshot.20200811.4959.0.bbc2fe56
  1.5.0-snapshot.20200818.5027.0.1b33d374
  1.5.0-snapshot.20200902.5118.0.2b3cf1b3  (selected by env var DAML_SDK_VERSION, default SDK version for new projects)
$
```

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 19:31:06 +02:00
Moritz Kiefer
f28c877584
Expose Script in data-dependencies (#7391)
Previously, it was filtered out by accident since damlc considered it
to be an old-style typeclass. This PR fixes this by adding a dummy
field.

This is primarily useful in DAML REPL since all DARs there are
importad as data-dependencies atm. It’s not actually all that useful
across SDK versions since you end up with multiple daml-script
libraries but at least within an SDK you can use it and don’t have to
think about whether your project is a dependency or data-dependency.

changelog_begin
changelog_end
2020-09-14 15:29:09 +02:00
Moritz Kiefer
8d66817f1d
Remove redundant --force from npm invocations (#7358)
NPM doesn’t actually need this (at least it didn’t for me locally and
hopefully CI agrees) to pick up changes and it emits a very
scary-looking warning if you do pass it.

changelog_begin
changelog_end
2020-09-09 13:28:24 +02:00
Moritz Kiefer
fea21e33a6
Migrate leftover scenario in quickstart to DAML Script (#7338)
We already migrated everything in the Tests directory but forgot about
this one.

changelog_begin
changelog_end
2020-09-08 13:15:45 +02:00
Robin Krom
678a8eef71
Replace yarn with npm (#7222)
* replace yarn with npm in docs

CHANGELOG_BEGIN
CHANGELOG_END

* updating assistant and compatibility tests

* moved gitignore entry to toplevel
2020-09-08 12:07:04 +02:00
Moritz Kiefer
d9551b6cbd
Migrate skeleton to DAML Script (#7301)
* Migrate skeleton to DAML Script

Also kills the separate setup module since it’s the same thing

changelog_begin
changelog_end

* Fix test

changelog_begin
changelog_end
2020-09-02 19:14:50 +02:00
Moritz Kiefer
6e4f101aad
Remove ref-ledger-authenticator from trigger service (#7226)
* Remove authentication service from trigger service

This rips out the integration with ref-ledger-authenticator and
together with that the weird http basic auth which doesn’t actually
work for ref-ledger-authenticator outside of its testing mode and also
includes some very sketchy stuff like storing user
passwords (encrypted but still).

While the exact details of the new approach towards auth are still not
completely clear, it is clear that it is going to be sufficiently
different from what we did before that starting from a clean slate is
easier.

changelog_begin

- [Trigger Service] Parties are now specified in request bodies as
  opposed to via HTTP Basic auth. This is done in preparation for
  running the trigger service against authenticated ledgers.

changelog_end

* Fix integration tests

changelog_begin
changelog_end
2020-08-27 15:36:59 +02:00
Sofia Faro
19f002bb23
Add test for relative DAML_PROJECT in daml start. (#7150)
This fixes #6977

changelog_begin
changelog_end
2020-08-17 08:56:05 +01:00
Sofia Faro
25f158edb6
Make paths in assistant environment absolute. (#7142)
Part of #6977. This PR adds some assistant tests, but regression tests and documentation should be added before the issue is closed.

changelog_begin
changelog_end
2020-08-17 07:45:37 +01:00
Stephen Compall
96624a7677
use -Ywarn-unused for all Scala code (#6907)
* add -Ywarn-unused to all scalac options

* remove some unused arguments

* remove some unused definitions

* remove some unused variable names

* suppress some unused variable names

* changeExtension doesn't use baseName

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* work around no plugins in scenario interpreter perf tests

* remove many more unused things

* remove more unused things, restore some used things

* remove more unused things, restore a couple signature mistakes

* missed import

* unused argument

* remove more unused loggingContexts

* some unused code in triggers

* some unused code in sandbox and kvutils

* some unused code in repl-service and daml-script

* some unused code in bindings-rxjava tests

* some unused code in triggers runner

* more comments on silent usages

- suggested by @cocreature; thanks

* fix missing reference in TestCommands

* more unused in triggers

* more unused in sandbox

* more unused in daml-script

* more unused in ledger-client tests

* more unused in triggers

* more unused in kvutils

* more unused in daml-script

* more unused in sandbox

* remove unused in ledger-api-test-tool

* suppress final special case for codegen unused warnings

.../com/daml/sample/mymain/ContractIdNT.scala:24: warning: parameter value ev 0 in method ContractIdNT Value is never used
      implicit def `ContractIdNT Value`[a_a1dk](implicit `ev 0`: ` lfdomainapi`.Value[a_a1dk]): ` lfdomainapi`.Value[_root_.com.daml.sample.MyMain.ContractIdNT[a_a1dk]] = {
                                                         ^
.../com/daml/sample/mymain/ContractIdNT.scala:41: warning: parameter value eva_a1dk in method ContractIdNT LfEncodable is never used
      implicit def `ContractIdNT LfEncodable`[a_a1dk](implicit eva_a1dk: ` lfdomainapi`.encoding.LfEncodable[a_a1dk]): ` lfdomainapi`.encoding.LfEncodable[_root_.com.daml.sample.MyMain.ContractIdNT[a_a1dk]] = {
                                                               ^

* one more unused in daml-script

* special scaladoc rules may need silencer, too

* unused in compatibility/sandbox-migration

* more commas, a different way to `find`

- suggested by @remyhaemmerle-da; thanks
2020-08-07 13:16:09 -04:00
Andreas Herrmann
cf24597e70
Factor out reproducibility flags for tar and gzip (#6884)
* Factor out tar/gzip reproducibility flags

* use mktgz in package-app

* Bazel managed tar/gzip

* Remove quiet = True

As stated in the comment this is no longer required with Bazel >= 3.0.

* Build package-app as a sh_binary

This way Bazel will manage the runtime dependencies tar, gzip, mktgz,
and patchelf.

package-app.sh changes directory so it needs to make sure that all paths
are absolute and that the runfiles tree/manifest location is forwarded
to programs called by package-app.sh.

* Avoid file path too long errors

* Fix readlink -f on MacOS

* Document abspath

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-08-05 14:27:14 +00:00
Moritz Kiefer
2c10c4444b
Extend daml new to accept template as an option (#6877)
* Extend `daml new` to accept template as an option

The two positional arguments keep confusing users so this PR changes
things to allow the template to be passed via `--template`. Using a
positional argument still works so this is not breaking.

I’ve updated all docs to use the less confusing syntax.

changelog_begin

- [DAML Assistant] You can now use ``daml new project-name
  --template=template-name`` instead of ``daml new project-name
  template-name``. The old CLI syntax continues to be supported.

changelog_end

* Update docs/source/getting-started/index.rst

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-07-27 16:30:48 +02:00
Andreas Herrmann
4b1438276c
Update Bazel 2.1.0 --> 3.3.1 (#6761)
* Upgrade nixpkgs revision

* Remove unused minio

It used to be used as a gateway to push the Nix cache to GCS, but has
since been replaced by nix-store-gcs-proxy.

* Update Bazel on Windows

changelog_begin
changelog_end

* Fix hlint warnings

The nixpkgs update implied an hlint update which enabled new warnings.

* Fix "Error applying patch"

Since Bazel 2.2.0 the order of generating `WORKSPACE` and `BUILD` files
and applying patches has been reversed. The allows users to define
patches to these files that will not be immediately overwritten.
However, it also means that patches on another repository's original
`WORKSPACE` file will likely become invalid.

* a948eb7255
* https://github.com/bazelbuild/bazel/issues/10681

Hint: If you're generating a patch with `git` then you can use the
following command to exclude the `WORKSPACE` file.

```
git diff ':(exclude)WORKSPACE'
```

* Update rules_nixpkgs

* nixpkgs location expansion escaping

* Drop --noincompatible_windows_native_test_wrapper

* client_server_test using sh_inline_test

client_server_test used to produce an executable shell script in form of
a text file output. However, since the removal of
`--noincompatible_windows_native_test_wrapper` this no longer works on
Windows since `.sh` files are not directly executable on Windows.

This change fixes the issue by producing the script file in a dedicated
rule and then wrapping it in a `sh_test` rule which also works on
Windows.

* daml_test using sh_inline_test

* daml_doc_test using sh_inline_test

* _daml_validate_test using sh_inline_test

* damlc_compile_test using sh_inline_test

* client_server_test find .exe on Windows

* Bump Windows cache for Bazel update

Remove `clean --expunge` after merge.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-23 09:46:04 +02:00
Moritz Kiefer
6df8a98602
Limit JVM memory in a few tests (#6814)
This limits the JVM max memory and initial memory in a few tests that
look like they might be using more than they have two and that run for
a long time so there is a high chance they end up running in parallel
with something else.

changelog_begin
changelog_end
2020-07-21 15:53:36 +00:00
Robert Autenrieth
7ce9748066
Split sandbox code into separate packages (#6695)
* Move public code into daml-integration-api

CHANGELOG_BEGIN
[DAML Integration Kit]: Removed sandbox specific code from the API intended to be used by ledger integrations. Use the maven coordinates ``com.daml:participant-integration-api:VERSION`` instead of ``com.daml:ledger-api-server`` or ``com.daml:sandbox``.
CHANGELOG_END
2020-07-17 17:06:06 +02:00
Moritz Kiefer
b12a19181e
Add a --timeout option to daml ledger commands (#6774)
* Add a --timeout option to `daml ledger` commands

At least in the compatibility tests, we see timeouts fairly regularly
in the tests for fetch-dar. If we see those timeouts in the tests, I
see no reason why our users should never see that especially on
actually distributed ledgers and hardcoded timeouts are a bad idea
anyway so now they are configurable.

I’ve also changed the timeout for the fetch tests (those are the only
once I’ve seen timeout) to 120s.

changelog_begin

- [DAML Assistant] The `daml ledger` commands now accept a `--timeout`
  option which can be used to change the timeout for API requests from
  the default of 30s.

changelog_end

* Generate parties as uuids to avoid collisions

changelog_begin
changelog_end

* Match on Deadline Exceeded as well

changelog_begin
changelog_end

* Update compatibility/bazel_tools/test_utils/DA/Test/Util.hs

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

* Update daml-assistant/daml-helper/src/DA/Daml/Helper/Main.hs

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

* Add some docs

changelog_begin
changelog_end

* Better version checks

changelog_begin
changelog_end

* fix imports

changelog_begin
changelog_end

* This is not how you exception

changelog_begin
changelog_end

* Update daml-assistant/daml-helper/src/DA/Daml/Helper/Main.hs

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2020-07-17 16:35:55 +02:00
Moritz Kiefer
d6e5862645
Add platform-version field to daml.yaml (#6736)
* Add `platform-version` field to `daml.yaml`

This PR adds the `platform-version` field to `daml.yaml`. Based on the
approach agreed upon in #6558, the logic for this all sits in
`daml-helper` and there are no changes to the assistant.

The details of how the logic work are in a comment so I’m not going to
repeat them here but the commands that are affected are:

- `daml sandbox`
- `daml sandbox-classic`
- `daml json-api`
- `daml start` (but only for sandbox and the JSON API, not for
  Navigator or anything else)

For tests, I’ve added a test to the compat workspace that installs two
SDKs simultaneously and tries out various combinations and verifies
that we get the correct version. Open to other ideas for testing this
but that seemed like the most sensible option that actually tests what
we run.

changelog_begin

- [DAML Assistant] You can now specify the version of Sandbox and the
  JSON API independently of your SDK version by setting
  ``platform-version`` in your ``daml.yaml``. This is useful if you
  are deploying to a ledger that is running components from a
  different SDK version. See
  https://docs.daml.com/tools/assistant.html#project-config-file-daml-yaml
  for details.

changelog_end

* Run platform-version tests

changelog_begin
changelog_end

* Fix tag globbing

changelog_begin
changelog_end

* fmt

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* Try to fix env vars

changelog_begin
changelog_end

* Remove hardcoded references to 1.2.0

changelog_begin
changelog_end

* Rephrase doc comment

changelog_begin
changelog_end

* get things to compile

changelog_begin
changelog_end

* maybe fix things for realz

changelog_begin
changelog_end

* Remove debugging output

changelog_begin
changelog_end

* Get angry at windows

changelog_begin
changelog_end

* why is windows

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2020-07-15 16:30:01 +02:00
Gary Verhaegen
8176fb0c8d
fix the the typo (#6723)
```
s/the the /the /
```

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-14 16:55:33 +00:00
Moritz Kiefer
a0f9eae489
Respect project name in create-daml-app (#6694)
* Respect project name in create-daml-app

Now `daml new foobar create-daml-app` creates a project called
`foobar` replacing the name everywhere. The tests now run twice once
with the original project name since that’s what we use in the GSG and
once with a modified one. I guess you could argue that only running
the second should be enough so I’m open to removing the first one.

fixes #6681

changelog_begin

- [DAML Assistant] `daml new foobar create-daml-app` now properly
  respects the project name and creates a project called `foobar`
  instead of hardcoding the name fo `create-daml-app`.

changelog_end

* .

changelog_begin
changelog_end

* Remove debugging output

changelog_begin
changelog_end
2020-07-13 17:30:21 +02:00
Moritz Kiefer
3b6f966e48
Set YARN_CACHE_FOLDER in all tests (#6669)
The default cache directories in yarn don’t work in the Bazel
sandbox. This results in Yarn creating tons of temp directories for
each test that are never cleared up.

This PR changes this to create actual temp directories that are
properly cleaned up.

changelog_begin
changelog_end
2020-07-09 13:11:07 +00:00
Andreas Herrmann
1bc119e99a
Update rules_haskell (#6600)
* Update rules_haskell

- Fixes the issue where a `sh_test` wrapping a `haskell_binary` couldn't
  add runfiles as is the case with other Bazel rules.

CHANGELOG_BEGIN
CHANGELOG_END

* Save the runfiles environment at start-up

To work around the fact that `withProgName` overwrites `argv[0]`.
See https://gitlab.haskell.org/ghc/ghc/-/issues/18418.

* damlc_compile_test include damlc runfiles

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-07 09:34:26 +00:00
Samir Talwar
28873913d9
Bazel: Upgrade Buildifier. (#6625)
Buildifier now comes with a handy attachment to catch single `\`
characters inside strings and replace them with `\\` if the escape
sequence is invalid. Skylark/Python will do this at runtime anyway; this
just makes it clearer what the actual behavior is.

I needed to change `\` characters at the end of lines to `\\` manually
in order to stop Buildifier from simply concatenating the lines
together. Everything else was automatic.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-06 16:07:47 +00:00