Commit Graph

6161 Commits

Author SHA1 Message Date
Moritz Kiefer
0af4f522c7
Port the rest //daml-lf/... to Scala 2.13 (#8436)
* Port the rest //daml-lf/... to Scala 2.13

Draw the rest of the owl

changelog_begin
changelog_end

* Update daml-lf/encoder/src/main/scala/com/digitalasset/daml/lf/archive/testing/DamlLfEncoder.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

Co-authored-by: Remy <remy.haemmerle@daml.com>
2021-01-08 10:38:17 +01:00
azure-pipelines[bot]
7bae2be354
update NOTICES file (#8435)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-08 10:30:50 +01:00
Moritz Kiefer
424faa923a
Port damlc dependencies to Scala 2.13 (#8423)
* Port damlc dependencies to Scala 2.13

I got a bit fed up by the fact that going directory by directory
didn’t really work since there are two many interdependencies in
tests (e.g., client tests depend on sandbox, sandbox tests depend on
clients, engine tests depend on DARs which depend on damlc, …).

So before attempting to continue with the per-directory process, this
is a bruteforce approach to break a lot of those cycles by porting all
dependencies of damlc which includes client bindings (for DAML Script)
and Sandbox Classic (also for DAML Script).

If this is too annoying to review let me know and I’ll try to split it
up into a few chunks.

changelog_begin
changelog_end

* Update daml-lf/data/src/main/2.13/com/daml/lf/data/LawlessTraversals.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* fixup lawlesstraversal

changelog_begin
changelog_end

* less iterator more view

changelog_begin
changelog_end

* document safety of unsafeWrapArray

changelog_begin
changelog_end

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-01-08 07:22:38 +01:00
Bernhard Elsner
61beb175f3
Improve the docs copyright notice (#8205)
* Improve the docs copyright notice

CHANGELOG_BEGIN
CHANGELOG_END

* Update docs/configs/html/conf.py

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

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2021-01-07 17:22:12 +00:00
Andreas Herrmann
a830dd44ea
Update VC redist to 14.28.29325.2 (#8431)
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-01-07 16:31:25 +00:00
Andreas Herrmann
fa45a58b50
Avoid compiling damlc twice (#8428)
This only compiles `damlc-bootstrap` as a Haskell binary and `damlc` is
a simple symlink with additional runfiles.

We now need to define `damlc@ghci` manually since it is no longer
defined automatically. The manual definition was tested with

```
$ bazel run //:damlc@ghci --define ghci_data=True
> :main ide -d
```

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-01-07 16:58:32 +01:00
Samir Talwar
6d2140072f
kvutils: Wrap raw key and value bytestrings in types. (#8408)
* kvutils: Wrap raw key and value bytestrings in types.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Delete `Bytes`.

* kvutils: Inline LedgerStateOperations.{Key, Value}.

* kvutils: Extract out a `Raw` trait.

* ledger-on-memory: Use state reader type aliases.

* ledger-on-sql: Provide implicit conversions for Raw.*.

* kvutils: Merge raw weights.

* kvutils: Move `Raw` into the kvutils package.

* kvutils: Seal `Raw`.

* kvutils: Delete the `SubmissionEnvelope` alias.

* kvutils: Use Raw#size when computing cache weight.

* kvutils: Improve clarity in a couple of places.

* kvutils: Rename the `Raw` trait to `Raw.Bytes`.

* kvutils: Rename `Raw.Pair` to `Raw.KeyValuePair`.
2021-01-07 15:28:14 +00:00
Gary Verhaegen
cd858d53d5
remove buck-out (#8426)
Hopefully we don't need it anymore. 🤷

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-07 14:53:33 +00:00
Sofia Faro
5234f8a544
Update .vscode/settings.json (#8425)
* Update .vscode/settings.json

The "files.useExperimentalFileWatcher" setting was deprecated at some point. I tried to add "files.watcherExcluded" to see if this will help with the extreme CPU usage issues on macOS. Also removed the "buck" exclusions since we don't use buck anymore as far as I know. And I added node_modules exclusions because that seems like a sensible thing to exclude.

changelog_begin
changelog_end

* make it valid JSON
2021-01-07 14:32:33 +00:00
Remy
440b17af24
LF : Fix/Clean some LF related TODOs (#8387)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-07 15:13:28 +01:00
Sofia Faro
df5b98425e
Add DA.Maybe to preprocessor exceptions. (#8424)
Don't run the preprocessor on DA.Maybe since it doesn't need it, and the
preprocessor was generating a bunch of warnings due to use of the
PatternSynonyms extension. We can safely ignore these warnings.

Also refactors that part of the preprocessor a little bit.

changelog_begin
changelog_end
2021-01-07 14:09:29 +00:00
Gary Verhaegen
427179ab27
fix (some) copyright headers (#8422)
This commit fixes a few copyright headers that have been missed in the
automatic update on Jan 1, as well as the generation code in the compat
workspace so it generates the right headers.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-07 11:48:59 +01:00
azure-pipelines[bot]
d38a36ea0f
rotate release duty after 1.9.0-snapshot.20210105.5984.0.c68ba110 (#8404)
@robin-da is taking care of 1.9.0-snapshot.20210105.5984.0.c68ba110 (#8403), so they get pushed back to the end of the line.

Please do not merge this before #8403.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-07 10:22:24 +00:00
Moritz Kiefer
0549d07bdc
Port //daml-lf/interpreter to Scala 2.13 (#8421)
* Port //daml-lf/interpreter to Scala 2.13

For now the perf tests are left out since they depend on a DAR built
by damlc which depends on daml script which depends on the world
:exploding-head:

changelog_begin
changelog_end

* Scala 2.13-style to for ImmArray and FrontStack

changelog_begin
changelog_end

* Avoid extra conversion

changelog_begin
changelog_end
2021-01-07 10:13:08 +00:00
Richard Kapolnai
bee1fbcaa9
Doc: mention ledger offset in transaction service too (#8418)
* Mention ledger offset in Transaction service as well, not just in Active contracts service

* typo

* CHANGELOG_BEGIN
CHANGELOG_END
2021-01-07 08:02:07 +00:00
Shaul Kfir
3e67acf46c
Add docs link to skeleton daml.yaml template (#8420)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-06 20:44:07 +01:00
Andreas Herrmann
ef26c08ef8
Make auth callback state bounded (#8351)
* Bounded auth middleware client callback store

changelog_begin
changelog_end

* Json format for login response

* Add middleware client binding to test fixture

* Test middleware client callback store size

* Make max auth callbacks and timeout configurable on trigger service

changelog_begin
changelog_end

* Bounded pending login requests at auth middleware

* Make max logins and timeout configurable on middleware

* Test middleware login store size

* fmt

* Fix Windows

failed with `"localhost" != "127.0.0.1"`. Hardcode "localhost" to avoid
platform specific resolution.

* Use FiniteDuration for login timeout

* Respond with 503 on full login request store

Addresses https://github.com/digital-asset/daml/pull/8351#pullrequestreview-560859604

* Add tests for RequestStore

* Lower DefaultMaxLoginRequests

b48050eb91 (r552649275)

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-01-06 16:02:05 +00:00
Moritz Kiefer
94fed84647
Support DAML_PROJECT in daml codegen java (#8416)
* Support DAML_PROJECT in daml codegen java

fixes #8406

We need to resolve the DAR path relative to the project
root. Otherwise, we’ll just fail to find the file if daml codegen java
is invoked from a different directory.

changelog_begin
changelog_end

* Fix test

changelog_begin
changelog_end

* fmt lalala

changelog_begin
changelog_end

* fix another test

changelog_begin
changelog_end
2021-01-06 16:38:47 +01:00
Gary Verhaegen
19ed19c3c6
fix Artifactory hashes (#8414)
Apparently it's been silently broken since introduction all the way back
in #7196.

Huge thanks to @SamirTalwar-DA for reporting.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-06 15:36:16 +01:00
Remy
c49f319a6f
LF Spec: fix ordering of contract IDs. (#8389)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-06 14:33:20 +01:00
Remy
acf1134bae
LF: clone dev protobuf for LF 1.11 (#8373)
Create protobuf packages for DAML-LF 1.11

This is part of #7139

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-06 14:32:26 +01:00
Gary Verhaegen
7f7e4f9fdc
fix docs cron (#8412)
Typo introduced in #8384.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-06 13:25:52 +00:00
Remy
cdd9e36395
LF: document preview of LF 1.11 (#8401)
CHANGELOG_BEGIN
* Release preview of LF 1.11. Preview versions can be changed only to
  include bug fixes. Changes of LF 1.11 include:
  - add support for generic map;
  - add support for choice observers;
  - reduce archive size thanks to type interning.
CHANGELOG_END
2021-01-06 13:47:59 +01:00
azure-pipelines[bot]
98ae21b805
release 1.9.0-snapshot.20210105.5984.0.c68ba110 (#8403)
* release 1.9.0-snapshot.20210105.5984.0.c68ba110

This PR has been created by a script, which is not very smart and does not have all the context. Please do double-check that the version prefix is correct before merging.

@robin-da is in charge of this release.

CHANGELOG_BEGIN
CHANGELOG_END

* Bump commit to include #8402

changelog_begin
changelog_end

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-01-06 13:36:59 +01:00
Moritz Kiefer
9c2e2db34e
Include new Nix signing key in static nix config on CI nodes (#8407)
Our CI nodes install nix in multi-user mode. This means that changing
cache information is only available to certain trusted users for
security reasons. The CI user is not part of those so the cache info
from dev-env/etc/nix.conf is silently ignored.

We could consider not running in multi-user mode although from a
security pov this seems like a pretty sensible decision and our
signing keys change very rarely so for now, I would keep it.

changelog_begin
changelog_end
2021-01-06 13:24:34 +01:00
Moritz Kiefer
c6995a9c34
Fix variance of choice key type in ledger.(createAnd)exercise (#8402)
Fixes #8338

This is a bit of a weird one. The basic issue is fairly clear. We have
code which looks something like:

```
interface MyTemplate<K> {
  keyEncode: (k: K) => unknown;
  keyDecoder: () => K;
}

interface MyChoice<K = unknown> {
  template: () => MyTemplate<K>;
}

function exercise(c: MyChoice) {
  console.log(c);
}

const y = (x : MyChoice<undefined>) => {
  exercise(x);
}
```

The key type is invariant here since it occurs in both covariant and
contravariant positions. We compile in strict mode so this is a
typescript error. This fails in all typescript versions I tested
including 3.8 which we use in our tests. So why don’t the tests fail?

Afaict, this is because the template constant is defined as an
intersection of the template type and the choices available on the
template. In TypeScript 3.8, this seems to (mostly, we’ll get to a
bit) hide this error. In TypeScript 3.9 and later, you hit it. There
is something in the release notes about intersection types but only
about optional properties which don’t seem to be required
here. Nevertheless, it is definitely related to the typescript
version.

So there are two more weird things about TypeScript 3.8:

1. Sometimes you get the error in the IDE but not in `npm start` and
   `npm run build`. Afaict, this is caused by the VSCode plugin being
   based on a different TypeScript version, e.g., mine was at 4.1.2 so
   this seems to match up with the 3.9 hypothesis.

2. In some cases (not all afaict), the issue shows up in `npm start`
   but only intermittendly. As described in #8338, it goes away after
   a restart. I have no idea what is going on here. something
   something incremental builds are hard 🤷 I’ve spent way too
   much time trying to figure it out but since the underlying issue
   seems clear, I gave up at some point.

changelog_begin

- [JS Client Libraries] Fix a bug where in some cases calls to
  `exercise` and `createAndExercise` failed to typecheck with a mismatch
  in the key type.

changelog_end
2021-01-06 12:00:49 +01:00
azure-pipelines[bot]
d50bc4c62b
update NOTICES file (#8405)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-01-06 08:47:51 +01:00
Samir Talwar
c68ba11080
participant-integration-api: Dedicated execution context for requests. (#7945)
* participant-integration-api: Dedicated execution context for requests.

CHANGELOG_BEGIN
CHANGELOG_END

* participant-integration-api: Construct the services executor outside.

* participant-integration-api: Share the services EC with the GRPC stack.

* participant-integration-api: Use the new EC wherever possible.

And stop using DirectExecutionContext.

* sandbox-classic: Fix DevModeIT to use the right configuration.

I have no idea why this breaks now, but it was always technically
broken, so I'm fixing it.

* participant-integration-api: Push the services EC up one more level.

* Update newly added ApiParticipantPruning service accordingly

see https://github.com/digital-asset/daml/pull/7988#discussion_r525319097

* participant-integration-api: Ensure the LedgerConfigProvider is ready.

Somehow this slipped through.

* sandbox-classic: Fix `DefaultConfig` in tests.

* language-support/java: Disable seeding in tests again.

Co-authored-by: Oliver Seeliger <oliver.seeliger@digitalasset.com>
2021-01-05 18:11:54 +00:00
Sofia Faro
699e506a95
Fix hpp bazel rule. (#8399)
Change the name of the rule so it doesn't conflict with the output.

changelog_begin
changelog_end
2021-01-05 16:02:58 +00:00
Samir Talwar
cfbdeed1a6
language-support/java: Remove unused DAML imports in tests. (#8398)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-05 15:39:27 +00:00
fabiotudone-da
9224ecea03
KV pre-exec: don't prefetch indirect state inputs from keys (#8323)
* KV pre-exec: don't prefetch indirect state inputs from keys

CHANGELOG_BEGIN
CHANGELOG_END

* Ensure that the submission validator reads only once

* Fix test and improve readability

* Fix test and improve readability

* Clarify tested condition

* Tidy up code

* Address review comments

* Remove test about double load not happening with DAML contract key inputs

* Remove stale test that once was about de-referencing DAML contract keys when loading inputs

* StateReader.read ScalaDoc: document that it must be called only once per validation.
2021-01-05 16:30:01 +01:00
Robin Krom
f2b53d49e6
assistant: get the latest sdk version form docs.daml.com (#8393)
* assistant: get the latest sdk version form docs.daml.com

We get the latest sdk version from docs.daml.com/latest instead of
github.com. Getting the latest release from github proved to be tricky
because github defines 'latest' by the tag timestamp.

CHANGELOG_BEGIN
CHANGELOG_END

* hlint
2021-01-05 14:31:41 +01:00
Sofia Faro
eb6d8c0e95
Cut down data-dependencies test. (#8395)
* Cut down data-dependencies test.

This PR reduces the data-dependencies test from quadratic to linear in the number of LF versions. It does so by only testing sequential version pairs, e.g. 1.6 to 1.7, 1.7 to 1.8, 1.8 to 1.11, 1.11 to 1.dev, and 1.dev to 1.dev. These pairs covers almost all potential problem.

changelog_begin
changelog_end

* add sort to scope
2021-01-05 13:11:02 +00:00
Moritz Kiefer
df35aed5bb
Remove Navigator console (#8392)
* Remove Navigator console

This was a labs feature so we can remove it without a deprecation
cycle. It doesn’t have any known users and is almost completely
superseded by DAML REPL.

@bame-da agreed to the removal.

This also has the nice side effect of eliminating 1 of our 2
dependencies that were not Scala 2.13 compatible.

changelog_begin

- [Navigator Console] The labs feature Navigator Console has been
  removed. Users are encouraged to use DAML REPL instead.

changelog_end

* Kill Navigator database docs completely

changelog_begin
changelog_end
2021-01-05 13:20:48 +01:00
Moritz Kiefer
02d8e8fe95
Port //daml-lf/(parser|validation) to Scala 2.13 (#8391)
* Port //daml-lf/(parser|validation) to Scala 2.13

changelog_begin
changelog_end

* Rename (Expr|Type)Traversable to (Expr|Type)Iterable

changelog_begin
changelog_end
2021-01-05 13:11:27 +01:00
Gary Verhaegen
c1ff0d5d0d
update mergify config for ci split (#8390)
I forgot about this yesterday, apologies.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-05 11:31:48 +01:00
Gary Verhaegen
f45a065c54
ci: pin down Ubuntu versions (#8388)
For a couple weeks now there has been a warning on the Azure Pipelines
web UI that says `ubuntu-latest` is in the process of switching from
18.04 to 20.04. I am not aware of any specific issue this would cause
for our particular workflows, but I don't like my dependencies changing
from under me.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-05 10:39:59 +01:00
Moritz Kiefer
746b5f4774
Remove a few redundant toString calls (#8379)
Spotbugs yelled at me and while they don’t do any harm they might be slightly confusing.

changelog_begin
changelog_end
2021-01-05 08:31:15 +01:00
Moritz Kiefer
19c66d1a9c
Drop unused Source.empty (#8383)
changelog_begin
changelog_end
2021-01-05 08:30:53 +01:00
Gary Verhaegen
7edc57712d
separate CI config for main & prs (#8374)
This is another take on #8276, with the same underlying motivation.
However, this approach is mostly duplication-free, which seems better,
especially given the already-pretty-sorry state of our CI config.

Like #8276, this is done in 2 commits for ease of review. The first
commit is wholly unintresting and just copies `azure-pipelines.yml` to
both `ci/prs.yml` and `ci/build.yml`; the second commit removes from
each part what it shouldn't have. The intention is for `ci/build.yml` to
have all of the common parts.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 20:45:30 +01:00
Gary Verhaegen
eb9aba680e
ci/cron: remove temp hack (#8385)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 19:06:30 +00:00
Gary Verhaegen
b506393dc8
ci/cron: use proc instead of shell (#8384)
As suggested by @cocreature in #8382.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 19:47:13 +01:00
Stefano Baghino
355fa9dc63
Adjust CODEOWNERS for @stefanobaghino-da (#8377)
Remove @stefanobaghino-da from ledger subtrees, adding him to runtime app subtrees.

changelog_begin
changelog_end
2021-01-04 18:55:11 +01:00
Moritz Kiefer
0541b2b888
Prefer Integer.valueOf over new Integer (#8381)
The latter is deprecated in newer JDKs.

changelog_begin
changelog_end
2021-01-04 17:37:33 +00:00
Gary Verhaegen
2c497a3e75
fix typo in docs cron (#8382)
Introduced in #8372.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 18:32:57 +01:00
Moritz Kiefer
54f597ae57
Add missing + in prettyKind (#8378)
changelog_begin
changelog_end
2021-01-04 17:29:19 +00:00
Moritz Kiefer
5635ea45d2
Iterate over entrySet instead of keySet (#8380)
Highly unlikely this actually makes a difference in practice but it’s
one less thing I need to look at next time someone makes me analyse
spotbugs results.

changelog_begin
changelog_end
2021-01-04 17:16:21 +00:00
Remy
7c9331478b
LF: minro fixed suggested by Martin. (#8376)
from comments made in #8366.

CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 17:41:22 +01:00
fabiotudone-da
78ea8ed825
Don't sync-succeed (potentially) before async assertions (#8375)
CHANGELOG_BEGIN
CHANGELOG_END
2021-01-04 17:11:33 +01:00
Moritz Kiefer
102f20421b
Upgrade rules_haskell (#8370)
changelog_begin
changelog_end
2021-01-04 16:57:35 +01:00