Commit Graph

4249 Commits

Author SHA1 Message Date
Moritz Kiefer
b72f4eec83
Add documentation for error (#6077)
fixes #6072

changelog_begin
changelog_end
2020-05-22 20:17:46 +02:00
nickchapman-da
fb6cafa311
Bump the sha for CI perf (#6078)
changelog_begin
changelog_end
2020-05-22 16:24:18 +00:00
nickchapman-da
44d0128f29
Add control to speedy compiler to choose if stack-trace support occurs at runtime. (#6070)
Choices for `stacktracing` are `NoStackTrace` / `FullStackTrace`.

Adapt code so the selection is made by the original caller:
- `engine`
- `scenario-service`
- `repl-service`
- `daml-script` runner
etc

Currently, all callers pass `FullStackTrace` (the existing behaviour), except for the
exploration dev-code: `daml-lf/interpreter/perf/src/main/scala/com/daml/lf/explore`.

The idea is that once this control is in place, we can discuss if we can change how we
might expose it to the user, and/or perhaps change the default behaviour to have
`stacktracing` disabled.

changelog_begin
changelog_end
2020-05-22 16:36:03 +01:00
Rohan Jacob-Rao
f845bca12f
Trigger service: initialize database command (#6062)
Minimal database initialization with schemas for running_triggers and dalfs tables. The user passes in the database URL, username and password in a config string argument (approach and code adapted from the JSON API).

In future the idea is to also create a "service" role with permissions to read and write to the new tables. Then the user can pass in the service role to connect to the database when running the service for real.
2020-05-22 10:54:08 -04:00
Moritz Kiefer
629ec732dd
Include puppeteer tests in compat tests (#6018)
* Include puppeteer tests in compat tests

This PR adds the puppeteer based tests to the compatibility
tests. This also means that they are now actually compatibility
tests. Before, we only tested the SDK side.

Apart from process management being a nightmare on Windows as usually,
there are two things that might stick out here:

1. I’ve replaced the `sh_binary` wrapper by a `cc_binary`. There is a
   lengthy comment explaining why. I think at the moment, we could
   actually get rid of the wraper completely and add JAVA to path in
   the tests that need it but at least for now, I’d like to keep it
   until we are sure that we don’t need to add more to it (and then
   it’s also in the git history if we do need to resurrect it).
2. These tests are duplicated now similar to the `daml ledger *`
   tests. The reasoning here is different. They depend on the SDK
   tarball either way so performance wise there is no reason to keep
   them. However, we reference the other file in the docs which means
   we cannot change it freely. What we could do is to make this
   sufficiently flexible to handle both the `daml start` case and
   separate `daml sandbox`/`daml json-api` processes and then we can
   reference it in the docs. There is still added complexity for
   Windows but that’s necessary for users as well that want to run
   this on Windows so that seems unavoidable. (I should probably also
   remove my snarky comments 😇) I’d like to kee it duplicated
   for this PR and then we can clean it up afterwards.

changelog_begin
changelog_end

* Bump timeouts

changelog_begin
changelog_end
2020-05-22 14:02:59 +02:00
nickchapman-da
70201afc55
Make the Lightweight Pretty Printing more helpful. (#6069)
- reduce verbosity of PAP
- see inside applications & lambdas.
- see rhss/body of lets
- see scrut of case (maybe later we add alts!)
- see the name of the definition ref
- see bools
- see LOC(and-nested-expression) -- interesting where the LOCs are places
- see head of kont stack

changelog_begin
changelog_end
2020-05-21 15:41:22 +00:00
nickchapman-da
9e5ae15e6d
Bazel rule to inspect dar file when compiling daml (#6067)
This change extends the bazel rule for `compile_daml` to add a stage which will pretty-print the generated .dar file, suitable for human inspection. The generated file is named with a `.dar.pp` suffix, and will only be generated if explicitly requested as a build target or listed as a dependency.

Make use of the new rule by demanding CollectAuthority.dar.pp when the perf benchmark is built.

changelog_begin
changelog_end
2020-05-21 11:06:51 +00:00
nickchapman-da
3e4c67613a
Speedy explore dar (#6066)
Explore the execution of the speedy machine on small examples taken from a dar file
In particular interested in how the execution proceeds for standard patterns of recursion.

changelog_begin
changelog_end
2020-05-21 11:06:44 +00:00
Bernhard Elsner
b7947767c9
Delete two poor docs pages (#6058)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-21 10:13:13 +02:00
Shayne Fletcher
90c0194dd9
Change trigger maps to store tokens not parties (#6061)
changelog_begin
changelog_end
2020-05-20 16:54:13 -04:00
Shayne Fletcher
639bec5a83
New module TokenManagement.scala (#6060)
changelog_begin
changelog_end
2020-05-20 16:51:40 -04:00
Shayne Fletcher
03d8425e16
Rework start/stop & list to require bearer header with JWT token (#6055)
changelog_begin
changelog_end
2020-05-20 15:40:22 -04:00
Shayne Fletcher
17f6c29958
Remove --pure-lockfile to yarn (#6056)
changelog_begin
changelog_end
2020-05-20 13:41:46 -04:00
Gary Verhaegen
957a74c325
fix trailing newline in docs cron (#6053)
CI currently errors with:

```
Subprocess:
git checkout efe6545c2c
 -- docs/source/support/release-notes.rst
failed with exit code 127; output:
---

---
err:
---
Previous HEAD position was 2af134c... WIP: Draft version constraint
generation (#5472)
HEAD is now at efe6545... 1.2.0-snapshot.20200520.4224.0.2af134ca
(#6040)
/bin/sh: 2: --: not found

---

```

because the line

```
latest_release_notes_sha <- shell "git log -n1 --format=%H HEAD -- LATEST"
```

will assign a string that ends in a newline, and then when we try to
construct the shell command:

```
(shell_ $ "git checkout " <> latest_sha <> " -- docs/source/support/release-notes.rst")
```

we actually get two lines for Bash to execute.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-20 18:26:27 +02:00
Miklos
32625da92f
Pass on command ID as correlation ID for transaction submissions (#6051)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-20 17:51:03 +02:00
Gary Verhaegen
d56b5adc1a
1.2.0-snapshot.20200520.4228.0.595f1e27 (#6048)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-20 17:29:33 +02:00
nickchapman-da
3457d7ac28
Refactoring in Speedy Classify (#6045)
* Some refactoring in Speedy Classify, follow last PR.

Improve matching idiom, and shorten two annoyingly long names.

Use 0 for default value of all Clasification.Counts. Then dont need newEmptyCounts() function

changelog_begin
changelog_end

* final class, not case class, for Remy
2020-05-20 15:21:19 +00:00
nickchapman-da
c72daadba3
Better tests for environment handling. (#6047)
Have tests which will fail if we screw up the indexing for any of:
- function application args
- the stack (let bindings)
- free-variables of a closure

In particular if we mix up the direction of out indexing. i.e. 0..n-1 VS n-1..0

Try to make the three tests as selective as possible, by only failing for the one aspect they are designed to test.

changelog_begin
changelog_end
2020-05-20 14:41:56 +00:00
Shayne Fletcher
38f23dd08b
Write stdout log for yarn errors (#6050)
changelog_begin
changelog_end
2020-05-20 10:41:16 -04:00
Gary Verhaegen
94122ec561
fix docs cron (#6049)
Current version yields:

```
Subprocess:
git log -n1 --format=%H master -- LATEST
failed with exit code 128; output:
---
---
err:
---
fatal: bad revision 'master'
---
```

so apparently we can't trust a CI run on master to have a master branch
defined. `HEAD` should work, though.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-20 16:37:47 +02:00
Stefano Baghino
6f1e051648
Integrate metrics for cache (#6043)
* Integrate metrics for cache

Centralizes the creation of instrumented caches in a single point and adds
metrics coming from Caffeine into the mix.

changelog_begin
[Ledger API Server] if --max-state-value-cache-size is greater than zero, the
following additional metrics will be recorded under the daml.kvutils.submission.validator.state_value_cache namespace:
hits, misses, load_successes, load_failures, load_total_time, evictions and evicted_weight
changelog_end

* Fix Bazel build file formatting

* Address https://github.com/digital-asset/daml/pull/6043#discussion_r427902339

* Address https://github.com/digital-asset/daml/pull/6043#discussion_r427904794

* Review DropwizardStatsCounter

- address https://github.com/digital-asset/daml/pull/6043#discussion_r427905074
- address https://github.com/digital-asset/daml/pull/6043#discussion_r427905184
- address https://github.com/digital-asset/daml/pull/6043#discussion_r427905307
- address https://github.com/digital-asset/daml/pull/6043#discussion_r427905387
- address https://github.com/digital-asset/daml/pull/6043#discussion_r427905650

* Address https://github.com/digital-asset/daml/pull/6043#discussion_r427906243

* Fix implicit numeric widening fatal warning

* Address https://github.com/digital-asset/daml/pull/6043#discussion_r427960762

* Fix infinite loop in metrics
2020-05-20 15:51:45 +02:00
Gary Verhaegen
595f1e278d
fix fat-jar publish (#6046)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-20 15:08:53 +02:00
Gary Verhaegen
efe6545c2c
1.2.0-snapshot.20200520.4224.0.2af134ca (#6040)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-20 13:46:49 +02:00
nickchapman-da
ee4f89378d
Speedy Tail Call Optimization (#6003)
* Speedy Tail call optimization

The goal of this PR is to achieve Tail call optimization #5767

Tail call optimization means that tail-calls execute without consuming resources. In particular, they must not consume stack space.

Speedy has two stacks: The `env`-stack and the `kontStack`. For an optimized tail call in Speedy, we must not extend either. In Speedy, all function calls are executed via the code `enterFullyAppliedFunction`. The behaviour of this code (prior to this PR) is as follows:

(1) Push the values of all args and free-variables on the env-stack (because that's where the code expects to find them), and
(2) Push a KPop continuation on the kontStack, which will restore the env-stack to its original size before returning to the code which made the function call.

We must stop doing both these things. We achieve this as follows:

(1) We address function args and free-vars via a new machine component: the current `frame`.
(2) We make continuations responsible for restoring their own environment.

As well as achieving proper tail calls, we also gain a performance improvement by (a) removing the many pushes to the env-stack, and (b) never having to push (and then later re-enter) a KPop continuation. The args array and the free-vars array already existed, so there is no additional cost associated with constructing these array. The only extra costs (which are smaller than the gains) are that we must manage the new `frame` component of the machine, and we must record frame/env-size information in continuations so they can restore their environment.

To make use of the frame, we need to identify (at compile time) the run-time location for every variable in a speedy expression. This is done during the `closureConvert` phase. At run-time, an environment is now composed of both the existing env-stack and the frame. The only values which now live on the env-stack are those introduced by let-bindings and pattern-match-destructuring. All other are found in the frame.

Changes to SEExpr:
- Introduce a new expression form `SELoc`, with 3 sub classes: SELocS/SELocA/SELocF to represent the run-time location of a variable.
- SELocS/A/F execute by calling corresponding lookup function in Speedy: getEnv(Stack,Arg,Free).
- SEMakeClo takes a list of SELoc instead of list of int.
- During closure conversion all SEVar are replaced by an SELocS/A/F.
- SEVar are not allowed to exist at run-time (just as SEAbs may not exist).
- We adapt the synthesised code for SEBuiltinRecursiveDefinition: FoldL, FoldR, EqualList

It is worth noting the prior code also had the notion of before/after closureConvert, but SEVar was used for both meanings: Prior to closureConvert it meant the relative-index of the enclosing binder (lambda,let,..). After closureConvert it meant the relative-offset from the top of the env-stack where the value would be found at run-time. These are not quite the same! Now we have different sub-types (SEVar vs SELoc), this change of mode is made more explicit.

Run-time changes:
- Use the existing `KFun` continuation as the new `Frame` component.
- `KFun` allows access to both the args of the current application, and the free-vars of the current closure.
- A variable is looked up by it's run-time location (SELocS/A/F)
- A function application is executed (`enterFullyAppliedFunction`), by setting the machine's `frame` component to the new current `KFun`.
- When a continuation (KArg, KMatch, KPushTo, KCatch) is pushed, we record the current Frame and current stack depth within the continuation, so when it is entered, it can call `restoreEnv` to restore the environment to the state when the continuation was pushed.

Changes to Compiler:

- The required changes are to the `closureConvert` and `validate`.
- `closureConvert` `remaps` is now a `Map` from the `SEVar`s relative-index to `SELoc`
- `validate` now tracks 3-ints (maxS,masA,maxF)

changelog_begin
changelog_end

* changes for Remy

* Changes for Martin

* test designed explicitly to blow if the free variables are captured incorrectly

* address more comments

* improve comment about shift in Compiler
2020-05-20 12:37:52 +01:00
Gary Verhaegen
4882327db5
fix release diff (#6042)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-20 11:58:33 +02:00
Gert-Jan Bottu
2af134ca69
WIP: Draft version constraint generation (#5472)
First version of static verification tool.

The current state of the tool: 
- Reads DAR files.
- Partially evaluates the code.
- Generates constraints for the field and choice to be verified.
- Passes the constraints to an SMT solver.
- Some basic tests.
2020-05-20 08:08:18 +02:00
Stephen Compall
d7cc5e07c3
fix ACS race condition in sandbox-classic; enable random Websocket testing (#5969)
* Revert "disable test pending tracking down duplicates"

This reverts commit 8b5f9dfa04.

* activeContracts tells caller the ledgerEnd, rather than accepting activeAt argument

* naive port of http-json tests to sandbox-next

* Revert "naive port of http-json tests to sandbox-next"

This reverts commit 91d4590c90.

* lock before grabbing acs and ledgerEnd offset in InMemoryLedger

- as suggested by @gerolf-da; thanks
2020-05-19 13:26:37 -04:00
Gary Verhaegen
fb6dc904a4
trigger all releases from master (#6016)
trigger all releases from master

The 1.1.0 release went wrong and we had to trash it and release 1.1.1
instead. This is an attempt at identifying and correcting the root
cause behind that incident.

To understand the situation, we need to know how releases worked before
1.0. We had a one-line file called `LATEST` that specifies the git SHA and
version tag for the latest release. A change to that file triggered a
release with the specified release tag, built from the source tree of
the specified commit. The `LATEST` file looked something like:

```
f050da78c9 1.0.0-snapshot.20200411.3905.0.f050da78
```

To mark a release as stable, we would change it to look like this:

```
f050da78c9 1.0.0
```

i.e. simply drop the `-snapshot...` suffix. Even though the commit (and
thus the entire source tree we build from) is the same, we would need to
rebuild almost all of our release artifacts, as they embed the version
tag in various places and ways. That worked well as long as we could
assume we were doing trunk-based development, i.e. all releases would
always come from the same (`master`) branch.

When we released 1.0, and started work on 1.1, we had a few bug reports
for 1.0 that we decided should be resolved in a point release. We
decided that the best way to handle that would be to have a branch
starting on the release commit for 1.0, and then backport patches from
`master` to that branch. We adapted our build process to also watch the
`release/1.0.x` branch and, in particular, trigger a new release build if
the `LATEST` file in that branch changed. That worked well.

The plan going forward was to keep doing regular snapshot releases from
the `master` branch, and create support, point releases ("patch" releases
in semver) from dedicated branches.

On April 30, we made a snapshot release as an RC for 1.1.0, by changing
the `LATEST` file in the `master` branch. That release was built on commit
681c862d. On May 6, we decided to take a new snapshot as the RC for
1.1.0; we changed `LATEST` in `master` to designate 7e448d81 as the new
latest release.

On May 11, we noticed an issue that broke our builds. Without going into
details, an external artifact we depend on had changed in incompatible
ways. After fixing that on `master`, we reasoned that this would also
break the build of the final 1.1.0 release if we just tried to build
7e448d81 again. But as the target release date was May 13, we did not
want to take a new snapshot after that fix, as that would have included
one more week of work in the release, and given us no time to test it.

So we did what we did for the 1.0 branch, as it had worked well: we
created a branch that forked from `master` at commit 7e448d81 and called
it `release/1.1.x`, then cherry-picked the one fix to our build process to
work around the broken download. When the time came to make the final
1.1.0 build on May 13, we naturally picked the `LATEST` file from the
`release/1.1.x` branch and dropped the `-snapshot...` suffix. Importantly,
we did not need to update the target commit to include the "broken
download" fix as, in the meantime, the internet had fixed itself, and we
thus reasoned we should go for the exact code of the RC rather than
include an unnecessary, albeit seemingly harmless, change.

Everything went well with the release process. Tests went well too. Then
we got a report that an application that worked against the latest RC
broke with the final 1.1.0. The issue was that we had built the wrong
commit: by branching off at the point of the _target_ commit for the
latest snapshot, we did not have the change to the `LATEST` file that
designated that commit as the target. So the `LATEST` file in
`release/1.1.x` was still pointing to 681c862d.

I believe the root cause for this issue is the fact that we have
scattered our release process over multiple branches, meaning there is
no linear history of what was released and we are relying on people
being able to mentally manage multiple timelines. Therefore, I propose
to fix our release process so this should not happen again by
linearizing the release process, i.e. getting back to a situation where
all releases are made from a single branch, `master`.

Because we do want to be able to release _for_ multiple release branches
(to provide backports and bugfixes), we still need some way to
accommodate that. Having a single `LATEST` file in the same format as
before would not really work well: keeping track of interleaved release
streams on a single file would not really be easier than keeping track
of multiple branches.

My proposed solution is to instead have a multiline LATEST file, so that
all the release branch "tips" can be observed at the same time, and, as
long as we take care to only advance one release branch at a time, we
can easily keep track of each of them. This is what this PR does.

This required a few changes to our release process. Most notably:

- Obviously, as this is the main point of this PR, the build process has
  once again been restricted to only trigger new releases from the
  `master` branch.
- As our CI machinery cannot easily be made to produce multiple releases
  from a single build, the `check_for_release` step will only recognize
  a commit as a release trigger if it changes a single line in the
  `LATEST` file. This restriction comes in addition to the existing one
  that a release commit is only allowed to change either just the
  `LATEST` file or both the `LATEST` and
  `docs/source/support/release-notes.rst` files.
- The docs publication process has been changed to update _all_
  published versions to display the _latest_ release notes page. This
  means that the release notes page will always show you all published
  versions, regardless of which version of the documentation you're
  looking at. This also means that interleaving release notes correctly on
  that page is a manual exercise.
- As per the intention of the new process, the `LATEST` file has been
  updated to contained all existing post-1.0 stable releases. It should
  also include all existing snapshot releases should we have more than one
  at a time (say, should we discover an issue with 1.1.1 that required us
  to work on a 1.1.2).
- The `release.sh` script has been dramatically simplified as I felt it
  was trying to do too much and porting its existing functionality to a
  multi-line `LATEST` file would be too hard.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-19 19:18:10 +02:00
Andreas Herrmann
92a2b5a28c
Enforce a dependency on node_nix (#6035)
The workspace for the vendored node wrapper script `@nodejs_linux_amd64`
did previously not record a dependency on the nixpkgs provided node
workspace. This patch enforces that dependency by introducing a dummy
read of the vendored node binary.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-05-19 16:58:00 +00:00
Robin Krom
f276f97bb8
docs: updated the cheat cheat to the latest version (#6036)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-19 18:19:27 +02:00
Gary Verhaegen
af939a7ee4
provisional beta deployment for daml-on-sql (#6024)
Note: this is beta-level software. See documentation for the precise
guarantees this does and does not come with. (Documentation does not
exist at the time of opening this PR, but should exist by the time the
first version of this gets published.)

CHANGELOG_BEGIN
- We now publish Sandbox Next as an **ALPHA** standalone jar.
- We now publish the HTTP JSON API as a standalone jar.
CHANGELOG_END
2020-05-19 18:11:26 +02:00
Stefano Baghino
53a7e28126
Document CommandConfiguration (#6031)
changelog_begin
changelog_end
2020-05-19 15:33:38 +00:00
Robin Krom
0f75971f52
language: send live event when reconnecting (#5982)
not sending a live event after reconnecting means that the 'loading'
indicater is never updated to 'false'. we could also not set it to
'true' on the 'close' event, but that can lead to a rather unintuitive
behaviour where data is stale and then suddenly updated without any
indication.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-19 16:57:16 +02:00
Sofia Faro
73d58f3fa3
Run simplifier in topological order. (#6013)
* Run simplifier in topological order.

changelog_begin
changelog_end

* Remove bang pattern
2020-05-19 14:16:52 +00:00
Andreas Herrmann
2666c73c73
Handle record dot syntax in DAML REPL (#6028)
* REPL record dot syntax regression test

* REPL: Apply record preprocessor to expressions

CHANGELOG_BEGIN
- [DAML REPL] Record dot syntax is now handled in expressions entered
  into the REPL.
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-05-19 13:59:35 +00:00
Moritz Kiefer
1b52082e9f
Mark yarn compat tests exclusive everywhere (#6030)
For some reason this seems to be failing in particular on Linux but
I’ve now also seen it fail on MacOS. My suspicion is that running it
in parallel, somehow corrupts the cache but I don’t understand the details.

changelog_begin
changelog_end
2020-05-19 15:56:35 +02:00
Samir Talwar
5915dc158d
Create a Docker image for Sandbox Next. (#6019)
This image can be built with:

```
bazel run //ledger/sandbox:sandbox-next-image
```

This will, unfortunately, also run a container, which you will need to
kill with _Ctrl+C_. You can use `bazel build`, but this will only build
the image tarballs, which you need to import into your Docker image
repository yourself.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-19 13:11:45 +00:00
Andreas Herrmann
eb1f957396
nixpkgs_package quiet = True (#6020)
* nixpkgs_package quiet = True

CHANGELOG_BEGIN
CHANGELOG_END

* ./fmt.sh

* sdk-daml-head --> daml-sdk-head

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-05-19 12:32:36 +00:00
Samir Talwar
d76c4ec949
ledger-api-client: Make it Closeable. (#6014)
CHANGELOG_BEGIN
- Add `LedgerClient#close`, which will shut down the channel and await
  termination. This is optional; the channel will still be shut down on
  JVM exit if this method is not called.
CHANGELOG_END

This is offered as a compromise for those who would like to ensure
resources are shut down cleanly, while not making the API more
complicated. I originally wanted to make `LedgerClient.fromBuilder`
return a `Resource[LedgerClient]`, but the `Resource` API would lead to
an increased learning curve for users.
2020-05-19 08:09:01 +00:00
Martin Huschenbett
caedc72551
Implement a simple profiler for DAML scenarios (#5957)
* Implement a simple profiler for DAML scenarios

The profiler runs a single scenario and records timing information when
each function (and some other closures) are entered and left. The
resulting information can be visualized as a flamegraph using
[speedscope](https://www.speedscope.app/).

The profiler works by instrumenting the CEK machine at the heart of
DAML Engine. Unfortunetaly, this causes a very small overhead on
non-profiling runs too. However, in my benchmarks I could not measure
any significant impact on the overall runtime at all. More precisely,
the overhead is as follows:

Every closure now has an additional field called `label`. In
non-profiling runs this field is always set to `null`. This field needs
to be allocated, copied whenever we copy a closure and scanned during
garbage collection. Additionally, whenever we enter a closure, we check
this field and whenever it is _not_ `null`, i.e. never during
non-profiling runs, we record an "open event" and set up a hook for the
corresponding "close event". Thus, the additional cost during
non-profiling runs are a single pointer comparison and a jump beyond
the "then branch".

Since this is still very much in active development, there are no
documentation, other than an entry in a README, and no tests yet. They
will come before we promote this. However, the UX will look very
different then since we already have plans to significantly change it.

CHANGELOG_BEGIN
CHANGELOG_END

* Run scalafmt

* Make profiling argument to PureCompiledPackges optional

* Fix a bunch of tests

CHANGELOG_BEGIN
CHANGELOG_END

* scalafmt is so annoying

CHANGELOG_BEGIN
CHANGELOG_END

* Apply simple suggestions

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-18 17:20:44 +00:00
Moritz Kiefer
c94f7e16bd
Remove deprecated vscode-resource scheme (#6008)
fixes #6005

Take a look at #6005 for details. I verified manually that things
still work as expected. It does require bumping the vscode version to
1.38 which was released almost a year ago so hopefully that should be
safe.

changelog_begin
changelog_end
2020-05-18 18:28:17 +02:00
Andreas Herrmann
1b711d0ac6
Hermetic nixpkgs_cc_toolchain (#5976)
* update rules_nixpkgs

* Use hermetic nixpkgs cc toolchain

CHANGELOG_BEGIN
CHANGELOG_END

* Work around Bazel's cc toolchain autodetection

* Use --crosstool_top for hermetic cc toolchain

When using --incompatible_enable_cc_toolchain_resolution instead
cc actions still depend on
`external/local_config_cc/builtin_include_directory_paths`
as well as
`external/nixpkgs_cc_toolchain_config/builtin_include_directory_paths`.

* override local_config_cc

* remove unused attribute

* Fix posix toolchain on Windows

* nixpkgs cc toolchain not on Windows

* Fix nixpkgs cc toolchain on MacOS

* nixpkgs cc toolchain uses bin/cc

* Use darwin.binutils on MacOS

* Remove clang(++) and gcc (g++) symlinks

The toolchain only considers `bin/cc` and having the other symlinks
around could lead to confusion

* Use hermetic toolchain in compatibility workspace

* Avoid empty linker flags

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-05-18 18:03:51 +02:00
Moritz Kiefer
d7632c5b20
Include Bazel patch to cache exclusive tests on Windows (#6009)
* Include Bazel patch to cache exclusive tests on Windows

This includes the patch that we already use on Linux and MacOS to fix
caching of things marked exclusive. I’ve kept in the debugging output
that I added in the last patch for now. While our workaround seems to
be working, I’d like to wait a bit longer in case the issue reappears.

changelog_begin
changelog_end

* Actually bump manifest

changelog_begin
changelog_end
2020-05-18 16:01:29 +00:00
Edward Newman
be4f85d165
Fix launchd killing VMWare process at end of script execution (#6006)
* Fix alunchd killing VMWare process at end of script execution

* Fix alunchd killing VMWare process at end of script execution

CHANGELOG_BEGIN
Fix issue with MacOS Catalina Launchd killing VMWare instance on rebuild (AbandonProcessGrop)
CHANGELOG_END
2020-05-18 10:54:15 -04:00
Gary Verhaegen
5d1d1db211
fix daml-sdk-head for macOS (#6012)
Bash is not easy to add to dev-env because dev-env depends on Bash. This
has not been an issue so far because Bash behaves in very sensible ways
overall and is mostly backwards compatible.

A recent change to `daml-sdk-head` is, however, using some feature of
Bash 4 that is not evailable in Bash 3. Bash 3 is ancient so in an ideal
world that would not be an issue, but macOS still ships with Bash 3 for
some obscure (licensing) reason.

It turns our that the line

```bash
arr=()
```

in Bash 4 sets the variable `arr` to an empty array, whereas it leaves it
unset in Bash 3. This means that the later use of `arr`, in the case
where no further element has been added to the array, will yield an
error in combination with the `set -u` option we are using.

This PR changes the usage pattern from

```bash
"${arr[@]}"
```

which fails on Bash 3 to

```bash
${arr[@]:-}
```

which works as expected. Note that the quotes have been removed: the
quotes in this case are not useful assuming that the flags themselves
are never multiword. Without the quotes, this evaluates to `""` under
Bash 3 (as the variable is not set), which confuses Bazel because now it
thinks it's asked to build the `""` target, which it has no rule for.

Ignoring the quoting issue, the actual fix is to include `:-` inside the
`{}`, which instructs Bash to replace the variable with what follows the
`-` in case the variable is not set (in this case, an empty string), and
therefore not crash on this specific variable not being set despite the
`set -u` option.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-18 15:59:20 +02:00
Gary Verhaegen
bb44e07fbf
redirect users to public channels (#6011)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-18 15:21:27 +02:00
Moritz Kiefer
de03425664
Include the first feature in compat tests for create-daml-app (#6002)
* Include the first feature in compat tests for create-daml-app

This adds the step from the create-daml-app tests that applies the
patch for the messaging feature and tests that things will build. This
is the last step before we can actually run the puppeteer tests which
will turn this into an actual compatibility test.

changelog_begin
changelog_end

* temporarily run all tests

changelog_begin
changelog_end

* Fix exclusions

changelog_begin
changelog_end

* Revert "temporarily run all tests"

This reverts commit 7425dd09cf48f2bfd6064b55d857c76d51afc821.

* Remove accidentally committed messaging.patch

changelog_begin
changelog_end
2020-05-18 14:37:16 +02:00
Stefano Baghino
1018e2744b
Add put and getIfPresent methods to Cache (#6007)
* Add put method to Cache

changelog_begin
changelog_end

* Add getIfPresent method
2020-05-18 11:53:08 +00:00
Moritz Kiefer
6142241719
Include sources directory in the Bazel cache key (#6001)
* Include sources directory in the Bazel cache key

This should hopefully fix the “undeclared inclusion” errors we have
been getting daily on CI

The details are in a comment but the short summary is that
the daily cron job is running in D:\a\1 whereas jobs on the same
machine afterwards run in D:\a\2. Because absolute paths leak in some
places, this fucks things up.

changelog_begin
changelog_end

* Add debugging output to the cache
2020-05-15 19:35:52 +00:00
Moritz Kiefer
770a2763b0
Fix a stackoverflow in the script runner (#5989)
Previously, we used the stack to recurse when filling in the command
results which obviously breaks once you have large multi-command
submissions.

You probably want to view the diff with whitespace disabled.

changelog_begin

- [DAML Script] Fix a bug where large multi-command transactions
  produced a stack overflow.

changelog_end
2020-05-15 16:04:18 +02:00