Commit Graph

9970 Commits

Author SHA1 Message Date
Robin Krom
0f2ac2d06d
language: new package command for damlc (#395)
* language: new package command for damlc

The (internal) package-new command reads all information from the
daml.yaml file of a DAML project and also creates the .conf file for the
package database and packs it with the dar.
2019-04-15 18:12:04 +02:00
Fran
b91535d287
Make install target explicit in daml install. (#498)
* resolve merge

* Be explicit about install target.

* Refactor InstallTarget type out.

* Change install target metavar.
2019-04-15 18:04:12 +02:00
Gary Verhaegen
c11b511338
fix release pipeline (#499)
1. Only try to release if all tests have passed
2. Specifically push build product, rather than entire worktree
2019-04-15 17:01:53 +01:00
moritzkiefer-da
ec46b8cec5 Add codegen to integration tests (#494) 2019-04-15 17:53:05 +02:00
Gary Verhaegen
e83c21ae11
release 0.12.4 (#489) 2019-04-15 15:47:32 +01:00
Francesco Mazzoli
f50cbef297 use .dars consistently in tests (#484) 2019-04-15 16:45:08 +02:00
Beth Aitman
d9b35ad1ab Rescuing lost PRs from old repo (#493)
* Add docs publish instructions

* Make publish script fail if Bazel fails
2019-04-15 16:30:20 +02:00
Beth Aitman
5fafdc2a26 Remove performance benchmarks section (#491) 2019-04-15 16:29:58 +02:00
Fran
f53788535e
Save a GitHub API call in daml install. (#492)
* Save an API call when installing specific version.
* Fix little errors.
* Typo
2019-04-15 16:25:40 +02:00
Beth Aitman
fc0a3c9a98
Move DAML snippets from inline to their own files, so they're tested (#446)
* Move DAML-LF snippets to .daml file

* Move codegen snippets to .daml files

* Fix new code snippets

* Fixes from code review

* Silly mistake
2019-04-15 15:47:39 +02:00
Beth Aitman
7b8acd81d8
Update multiparty text (#486) 2019-04-15 15:45:33 +02:00
Fran
3a0aa90a1e
Fix example asset name in github install module. (#488) 2019-04-15 15:35:18 +02:00
Gerolf Seitz
2a932d9b22
Include google/rpc/*.proto into ledger-api-scalapb (#477)
Considering that there is no canonical source for status.proto generated
for scalapb (for java it is pulled in via a transitive dependency of
grpc-protobuf), we should rather compile and include it in the
ledger-api-scalapb artefact.
2019-04-15 14:57:43 +02:00
Gary Verhaegen
de4101b8c3
include artifacts in github releases (#487) 2019-04-15 13:54:04 +01:00
moritzkiefer-da
dff9f17ac6 Remove damli completely (#481)
The only command that we still had in damli which afaik isn’t
something anyone uses (and if it is, we should move it do damlc).
2019-04-15 14:47:59 +02:00
Fran
1a70bf68cc
Install from GitHub releases! (#459)
* Install from GitHub releases!

* Revert make-capsule script.

* Refactor a little.

* Reviewer comments
2019-04-15 13:46:53 +02:00
Neil Mitchell
d42171e52e
Add helpers for defining Hazel packages (#478)
* Add helpers for defining Hazel packages

* Make sure external github things look obviously external
2019-04-15 11:05:45 +01:00
Shayne Fletcher
1fdf847458
Add to ghc-lib developer documentation (#467)
* Add a new section explaining how to develop ghc-lib

* clarify git checkout commands
2019-04-15 05:58:33 -04:00
Shayne Fletcher
7b1682c190
Integrate ghc-lib-0.20190413; no regressions. (#468) 2019-04-15 05:41:42 -04:00
moritzkiefer-da
f145ba088e
Add an option to produce all release artifacts on MacOS (#474)
This can be quite useful for debugging purposes.
2019-04-15 10:58:19 +02:00
Gerolf Seitz
2f3189db9e
Reuse the same Engine object between ledger resets (#466)
Compared to older versions of the Engine, we do A LOT more validation
now. So when starting with a fresh engine after each reset (via
the ResetService), we also repeat the validation of the loaded packages
again and again. This is VERY expensive, especially for large DAML
packages.

Luckily, the specification of the ResetService states the following:
// Resets the ledger state. Note that loaded DARs won't be removed --
// this only rolls back the ledger to genesis.
This means that we can re-use the same Engine object and benefit from
not having "re-compile" packages via
ConcurrentCompiledPackages#addPackage, more specifically we can omit
this line: 1f2246c822/daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/ConcurrentCompiledPackages.scala (L56)

Fixes #178
2019-04-15 09:19:04 +02:00
Francesco Mazzoli
6af84051ee
fix various conversion functions from string to Decimal (#439)
* fix various conversion functions from string to Decimal

Fixes #399.

This fixes a critical bug -- since:

* The DAML-LF spec specifies that the scale of `Decimal` is 10 --
    that is, there are at most 10 digits past the decimal point:
    <79bbf5c794/daml-lf/spec/value.rst (field-decimal)>.
* However, the code converting from the string representation that
    we get on the wire was _not_ performing this check. This is due
    to two reasons:

    - `Decimal.check` is a function that checks whether a given
        `Decimal` is within the upper and lower bounds of what the
        DAML-LF spec specifies, but crucially it does _not_ check that
        the scale is not exceeded:
        <79bbf5c794/daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/Decimal.scala (L31)>.
        This behavior is correct in some cases (more on that later),
        but not in others. Crucially, `Decimal.fromString`, which was
        supposed to check if a decimal string literal is valid, used
        this function, which means that it accepted string literals
        containing numbers out of the required scale, rounding them to
        make them fit within the scale. This function has been renamed
        to `Decimal.checkWithinBoundsAndRound`, and a new function
        `Decimal.checkWithinBoundsAndWithinScale` has been added, which
        fails if the number provided has data not within the scale.
        `Decimal.fromString` now uses
        `Decimal.checkWithinBoundsAndWithinScale`.

    - `ApiToLfEngine.parseDecimal` assumed that `Decimal.fromString` _did_
        fail when passed numbers that were in any way invalid, and
        moreover did _not_ use the result of `Decimal.fromString`, but rather
        re-parsed the string into an unconstrained `BigDecimal`:
        <79bbf5c794/ledger/ledger-api-common/src/main/scala/com/digitalasset/platform/participant/util/ApiToLfEngine.scala (L96)>.
        The reason for the code to work this way is that in the past
        it was responsible for converting decimal strings both for the
        current engine but also for an older version of the engine which
        handled decimals of a different type. Both issues have been fixed.

* Therefore, `Decimal`s with scale exceeding the specified scale
    made it into the engine, and contracts could be created containing
    this invalid value.

* Once on the ledger, these bad numbers can be used to produce extremely
    surprising results, due to how `Decimal` operations are
    implemented. Generally speaking, all operations on `Decimal`
    first compute the result and then run the output through
    `Decimal.checkWithinBoundsAndRound`. The reason for this behavior
    is that we specify multiplication and division as rounding their
    output. Consider the case where the bad value 0.00000000005 made
    it to the engine, and is then added to 100. The full-precision
    result will be 100.00000000005, which after rounding becomes 100.
    Therefore, on a ledger where such invalid values exist, it is not
    the case that `y > 0 ==> x + y != x`, and so on.

Thanks a bunch to @briandbecker for the excellent bug report.

* fix failing test using to much precision
2019-04-14 13:49:28 +02:00
Shayne Fletcher
a3ff3797e5
Add example desugaring of contract key syntax (#465)
* add example desugaring of contract key syntax

* Update ghc-lib/template-desugaring.md
2019-04-13 10:04:30 -04:00
Brian Healey
b594fcffc1
correct jq in dev-env (#463)
* correct jq in dev-env

* Remove references to lsof and dead scripts that called lsof since it is no longer in dev-env
2019-04-12 16:44:15 -04:00
moritzkiefer-da
1326596795
Release 0.12.3 (#458) 2019-04-12 20:22:31 +02:00
Gary Verhaegen
0fd4b05e4e
minor tweaks to release/RELEASE.md (#457) 2019-04-12 19:22:18 +01:00
Brian Healey
aa35cf676d
***NO_CI*** download sdk badge (#269)
* ***NO_CI*** download sdk badge

* correct download sdk link
2019-04-12 13:16:15 -04:00
Shayne Fletcher
9df51dc1ee
update to latest ghc-lib (#453) 2019-04-12 13:00:14 -04:00
moritzkiefer-da
2f6dd7d4ee
Do not add the scala version suffix to navigator and extractor (#456)
Fixes #455
2019-04-12 18:30:49 +02:00
Simon Meier
d522effecb
daml-on-x-server: document all participant state interfaces (#432)
* daml-on-x-server: document all participant state interfaces
2019-04-12 17:43:45 +02:00
moritzkiefer-da
118aa6de05
Check for VERSION and release-notes.rst in the same commit (#450) 2019-04-12 17:38:17 +02:00
Bolek@DigitalAsset
0eb3c53289
web-ide: clean up / refactor (#421)
* using typescript
* using npm scripts
* separated management route to another port
2019-04-12 15:01:55 +00:00
Gary Verhaegen
911b82c6df
release 0.12.2 (#445) 2019-04-12 15:56:43 +01:00
Gary Verhaegen
d80b660210
fix GitHub tag conflict on release (#451)
As multiple platforms will create different annotated tags (because an
annotated tag includes a tag time), they will conflict on trying to
push. Therefore, we go for a lightweight tag for now, as those are
simple pointers to a commit and git will recognize that they are the
same and there is no conflict.
2019-04-12 15:55:20 +01:00
Florian Klink
5f75e9d1a0 infra/vsts_agent_linux_startup.sh: warm up local caches, purge old agents (#438)
Warm up local caches by building dev-env and current daml master This is
allowed to fail, as we still want to have CI machines around, even when
their caches are only warmed up halfway.

Afterwards, we purge old agents that might still be around, that didn't
unregister themselves

This depends on #402 to be merged, as otherwise purge_old_agents.py
can't be found obviously.
2019-04-12 16:47:36 +02:00
moritzkiefer-da
f6c6dd6a9a
Accept multiple files in damlc test (#436)
* Accept multiple files in damlc test

Since damlc test also runs tests in transitive dependencies, this can
be significantly faster than running "damlc test" individually on
a set of files as you will end up recompiling and rerunning tests
multiple times if those files depend on each other.

For //docs:daml-ref-daml-test This is roughly a 10x improvement from
~70s to ~7s.
2019-04-12 16:21:34 +02:00
Gary Verhaegen
59f480d978 prepare release note for next release (#443) 2019-04-12 16:17:31 +02:00
moritzkiefer-da
45aa8b984b
Remove pandoc from dev-env (#441)
We used to use this for generating documentation but we no longer
do. Removing it should slim down dev-env and make GHC upgrades less painful.
2019-04-12 15:18:27 +02:00
moritzkiefer-da
77033a6a69 Refactor and speed up release script (#431)
This rewrites the release script to be a lot simpler and significantly
faster:

- The artifacts are now declared in a separate yaml file which should
  make it easier for people to modify and doesn’t clutter the actual
  code.
- There is only a constant number of calls to Bazel which speeds up
  the script quite a bit.

I verified that the release artifacts are the same that we got
before and I traced the calls to the jfrog binary in a fake release
and ignoring order they are identical.
2019-04-12 14:57:37 +02:00
Florian Klink
5f962ebf82 CI: Add script to purge old agents (#402)
This adds `ci/azure-cleanup`, containing a script that talks to azure pipelines, removing agents older than 25 hours in a specific pool.
Machines are meant to be killed after 24 hours anyway, make sure they're properly unregistered from Azure Pipelines, too.
By doing this, we don't need to unregister nodes manually on shutdown.

Idea is to execute this every time a new agent is provisioned, it has cloned the repo. We intend to clone the repo and pre-warm the caches there anyhow.

WIP until the repo fetching and cache pre-warming is present, too.

cc @zimbatm 

### Pull Request Checklist

- [x] Read and understand the [contribution guidelines](https://github.com/digital-asset/daml/blob/master/CONTRIBUTING.md)
- [x] Include appropriate tests
- [x] Set a descriptive title and thorough description
- [x] Add a reference to the [issue this PR will solve](https://github.com/digital-asset/daml/issues), if appropriate
- [x] Add a line to the [release notes](https://github.com/digital-asset/daml/blob/master/docs/source/support/release-notes.rst), if appropriate

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with `/AzurePipelines run` to
trigger the build.
2019-04-12 14:56:20 +02:00
Beth Aitman
b902239fa3
Remove ExcludeFromDamlTests (#437) 2019-04-12 14:44:17 +02:00
Gary Verhaegen
b37474b0e9
require manual publication of GitHub releases (#435)
Because automated testing is not yet part of our release pipeline, we
need to manually publish releases after manual testing.
2019-04-12 13:15:19 +01:00
Michał Majcherski
79bbf5c794
windows: working //:git-revision target (#434) 2019-04-12 13:25:31 +02:00
gleber
aa70c7f64e
Enforce consistent formatting of BUILD files. (#412)
* Add buildifier targets.

The tool allows to check and format BUILD files in the repo.

To check if files are well formatted, run:

    bazel run //:buildifier

To fix badly-formatted files run:

    bazel run //:buildifier-fix

* Cleanup dade-copyright-headers formatting.

* Fix dade-copyright-headers on files with just the copyright.

* Run buildifier automatically on CI via 'fmt.sh'.

* Reformat all BUILD files with buildifier.

Excludes autogenerated Bazel files.
2019-04-12 13:10:16 +02:00
Neil Mitchell
86b16997af
Clean up the guidelines for PR title/description (#427) 2019-04-12 11:33:11 +01:00
Gary Verhaegen
6110d4be3a
push releases to github (#413)
Azure Pipelines has direct integration with GitHub, so we're just using
that. Releases on GitHub have to target a tag, so we also need to push
the tag as an intermediate step; we also need to include the platform
name in the artifact to avoid overwriting from different builds.

The two "GitHub release" steps depend on two Azure variables that are
not defined in the pipeline script. This may look like it should not
work, but in fact it does, because these variables are set by the
release script.

In Azure Pipelines, any build step can set variables for the next build
steps by outputting specially-formatted text to stdout. This text will
not appear in the build output displayed by Azure Pipelines, e.g.:

```
echo '##vso[task.setvariable variable=sauce]tomatoes'
```

would define the Azure variable `sauce` to have the string `tomatoes` as
its value for the next build steps.

See [0] for details.

[0]: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#set-in-script
2019-04-12 11:30:13 +01:00
Gabor Aranyossy
3e154fd682
Sandbox Postgres support with passing api integration tests (#392)
* TransactionServiceIT passes

* fixup

* using record time taken from TimeProvider

* taming TransactionBackPressureIT to avoid overloading of submission service

* implement AutoClosable on all Ledger related components having stateful resources

* reenabling InMemory fixture

* disabling contract key integration test for SandboxSQL fixture

* removing TODO

* bumping up timeout on TransactionServiceIT due to slow Azure pipeline

* 1 minute timeout for SqlLedgerSpec

* making jdbcurl CLI argument hidden

* updating release notes
2019-04-12 12:25:48 +02:00
Fran
6984d9765d
Make daml-head work outside of devenv. (#428) 2019-04-12 12:03:05 +02:00
Fran
938bc4ae25
Rename sdk config file to sdk-config.yaml (#407)
* Rename sdk config file to sdk-config.yaml

* Use sed in head release.
2019-04-12 12:01:48 +02:00
Neil Mitchell
bfa019997a
Prototype to accelerate Windows development (#411)
* Initial rattle prototype

* Build the IDE core

* Ignore the Rattle directory

* Clean up the dependencies

* Require stack-1.10, since that does much better extra-dep caching

* Streamline the ghc-lib dependencies

* Compile more pieces

* Add a build.bat

* Make the Windows build use the correct stack.yaml to bootstrap

* Fix up enough to build on Windows

* Generate the dylib's on Mac

* Remove accidental -v

* Make the Haskell build driven by the Bazel metadata

* Get proto3-suite building

* Delete the unneeded haskell-dependencies

* Allow generating the proto files and compiling them

* Fix metadata to deal with """ syntax

* Fix metadata to deal with a list of globs

* More work in the direction of daml-ghc

* Use correct daml_lf proto version

* Tell GHC to use shared objects in TH

* Specify needed packages

* wip

* wip

* Switch to the fork of gRPC-haskell

* Build executables with rattle

* setup build.sbt in daml-lf

* Build binaries with rattle

* rattle-sbt, move scala build scripts out of daml-lf subdir, and into rattle subdir

* convert scala-build.sh into MainScala.hs

* Clean up rattle build

* Pre-merge clean up

* Switch to the newer version of ghc-lib-parser

* remove dev ls from MainScala.hs

* compile java generated from protos as separate projects

* Add copyright headers

* HLint fixes

* Uscrewup an HLint fix

* fix scala formatting of rattle/build.sbt
2019-04-12 10:45:11 +01:00