Commit Graph

157 Commits

Author SHA1 Message Date
Moritz Kiefer
1370ef3083 Upgrade ghcide and haskell-lsp (#3499) 2019-11-18 10:56:19 +00:00
Andreas Herrmann
c994703c0c Update rules_haskell (#3473)
* Update rules_haskell & rules_nixpkgs

* Define dadew POSIX toolchain on Windows

* Build hpp with stack and Cabal

* Replace Hazel hpp by @stackage hpp

* replace backslash by forward slash

* Cabal wrapper exclude bindist includes

* ghci-grpc patch fix missing argument

* Switch to rules_haskell master
2019-11-15 10:50:12 +00:00
Samir Talwar
d897b6b55a ledger-api-test-tool-on-canton: Upgrade Canton to v0.4.0. (#3468)
* ledger-api-test-tool-on-canton: Upgrade Canton to v0.4.0.

* workspace: Expose a Java library from the Canton external dependency.`

* workspace: Use double quotes for multiline strings too.
2019-11-14 14:55:38 +00:00
Samir Talwar
c5d9d1014e
ledger-api-test-tool: Run tests on Canton, and fix a few issues. (#3446)
* ledger-api-test-tool-on-canton: Run Canton.

* ledger-api-test-tool-on-canton: Run the SemanticTests against Canton.

This was _so_ much work.

These will probably be flaky, so can't merge them in until we fix the
underlying issues with the tests around multi-participant allocation.

* ledger-api-test-tool: Wait for parties to arrive on all participants.

Thanks to Canton for exacerbating this bug.

Can't turn on all the tests on Canton yet as there are other spurious
failures. Will investigate next.

* ledger-api-test-tool: Move all contract key tests to ContractKeys.

If a ledger doesn't support ContractKeys, they need to be able to turn
these tests off.

* ledger-api-test-tool: If a test name is misspelled, fail immediately.

I keep getting names slightly wrong in the `--exclude` arguments and
wondering why it didn't work.

* client_server: Revert client_server_test.bzl.

Turns out I don't know what I'm doing. ¯\_(ツ)_/¯

* sandbox: Don't call `.toString` on an array. Doesn't do much.

* dev-env: Don't untar netcat automatically.

It needs to be installed with Pacman.
2019-11-13 17:27:28 +01:00
Moritz Kiefer
4ed90187bb Fetch grpc and protobuf Haskell libraries from Hackage (#3444)
* Fetch grpc and protobuf Haskell libraries from Hackage

All the changes that resulted in us fetching them from git, have been
included in the latest Hackage releases.

* Switch back to a custom build file for grpc-haskell-core

* Remove grpc-haskell-core from hazel packages
2019-11-13 11:19:01 +00:00
Andreas Herrmann
964ca64951 Pass -optl-s (#3423) 2019-11-12 08:55:39 +00:00
Moritz Kiefer
7db11ca427 Add toAnyContractKey and fromAnyContractKey (#3408)
* Add toAnyContractKey and fromAnyContractKey

This is necessary to add exerciseByKey to DAML triggers.

* Switch to proper ghc-lib release

* Remove unnecessary filter

* Bump timeout because macos is terrible

* bazel fmt
2019-11-11 17:35:53 +00:00
Andreas Herrmann
33e47828e3
Bazel 1.1 (#3249)
* bazel: 0.28.1 --> 1.1.0

* bazel-watcher sha256

* Fix missing line in patch

* proto_source_root --> strip_import_prefix

See https://github.com/bazelbuild/bazel/issues/7153 for details.

* Update rules_nixpkgs

Required to avoid errors of the form
```
ERROR: An error occurred during the fetch of repository 'node_nix':
   parameter 'sep' may not be specified by name, for call to method split(sep, maxsplit = None) of 'string'
```

and
```
ERROR: An error occurred during the fetch of repository 'node_nix':
   Traceback (most recent call last):
	File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149
		_execute_or_fail(repository_ctx, <3 more arguments>)
	File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail
		fail(<1 more arguments>)

Cannot build Nix attribute 'nodejs'.
Command: [/Users/runner/.nix-profile/bin/nix-build, /private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/node_nix/nix/bazel.nix, "-A", "nodejs", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/nixpkgs/nixpkgs"]
Return code: 1
Error output:
src/main/tools/process-tools.cc:173: "setitimer": Invalid argument
```

* Update rules_scala

* .proto has been removed, use [ProtoInfo] instead

See
https://docs.bazel.build/versions/1.1.0/be/protocol-buffer.html#proto_library

* python3_nix add nix_file attribute

To avoid the following error

```
ERROR: /home/aj/tweag.io/da/da-bazel-1.1/BUILD:66:1: //:nix_python3_runtime depends on @python3_nix//:bin/python in repository @python3_nix which failed to fetch. no such package '@python3_nix//': Traceback (most recent call last):
        File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149
                _execute_or_fail(repository_ctx, <3 more arguments>)
        File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail
                fail(<1 more arguments>)

Cannot build Nix attribute 'python3'.
Command: [/home/aj/.nix-profile/bin/nix-build, "-E", "import <nixpkgs> { config = {}; overlays = []; }", "-A", "python3", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/nixpkgs/nixpkgs"]
Return code: 1
Error output:
error: anonymous function at /home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/nixpkgs/nixpkgs.nix:3:1 called with unexpected argument 'config', at (string):1:1
```

* rules_haskell unnamed string.split(_, maxsplit = _)

The keyword argument may no longer be named.

* string.replace(_, _, maxsplit = _) may not be named

* Move proto sources from deps to data

Fixes

```
ERROR: /home/aj/tweag.io/da/da-bazel-1.1/daml-lf/archive/BUILD.bazel:150:1: in deps attribute of scala_test rule //daml-lf/archive:daml_lf_archive_reader_tests_test_suite_src_test_scala_com_digitalasset_daml_lf_archive_DecodeV1Spec.scala: '//daml-lf/archive:daml_lf_1.6_archive_proto_srcs' does not have mandatory providers: 'JavaInfo'. Since this rule was created by the macro 'da_scala_test_suite', the error might have been caused by the macro implementation
```

* Define sha256 for haskell_ghc__paths

Bazel 1.1.0 fails on missing hashes.

* Disable --incompatible_windows_native_test_wrapper

* //compiler/daml-extension don't modify sources

Modifying sources in-place can cause issues on Windows, where build
actions are not sandboxed and changes on sources can affect other build
steps.

* bazel-genfiles --> bazel-bin

The bazel-genfiles symlink has been removed since Bazel 1.0.
See https://github.com/bazelbuild/bazel/issues/8651

* Mark dev_env_tool repository rule as configure

See
https://docs.bazel.build/versions/1.1.0/skylark/lib/globals.html#repository_rule

* Move data deps into data attribute

* Mark dev_env_tool as local = True

* Manually fetch @makensis_dev_env
2019-11-11 10:06:03 +01:00
Moritz Kiefer
028dfcf6d4 Expose projection from contract key to maintainers (#3396) 2019-11-09 18:00:00 +00:00
Andreas Herrmann
6877d5279c
recursively symlink all files in dev_env_tool (#3377)
* dev_env_tool - recursively symlink all files

* dev_env_tool: add prefix attribute

* Replace nodejs by dev_env_tool

* postgresql.exe --> postgres.exe

* Remove unused dev_env_package

And rename dev_env_package --> dev_env_tool

* dev_env_tool macOS compatbility

BSD find does not support `-printf`.

* ReserServiceIT: 4 attempts on Windows
2019-11-08 09:40:26 +01:00
Moritz Kiefer
d7f5b3b436 Add support for on-disk incremental builds in damlc build (#3378)
* Add support for on-disk incremental builds in damlc build

* Normalise file paths of internal modules because Windows

* stop stealing my $s hlint

* Apparently jars are also called exe

* Address review comments

* Bump to proper ghcide revision
2019-11-07 16:56:42 +00:00
Shayne Fletcher
c8a9e0b295 Update hlint; add some dlint smoke tests (#3319) 2019-11-01 18:29:51 +00:00
Shayne Fletcher
11c1bf0fba
Upgrade hlint (#3306) 2019-10-31 15:08:21 -04:00
Rohan Jacob-Rao
00fc6bf100 Log when user views scenario results (#3271)
* Extend Priority type with Telemetry value

* Include Telemetry logging level in logger

* Log viewing of scenario results

* Update ghcide with telemetry logging level
2019-10-28 23:42:20 +00:00
Andreas Herrmann
2bd1db490a
Replace bazel-deps by rules_jvm_external (#3253)
* Update bazel-common to fix javadoc issues

Specifically, to fix the following error

```
ERROR: /home/aj/tweag.io/da/da-bazel-1.1/ledger-api/rs-grpc-bridge/BUILD.bazel:7:1: in javadoc_library rule //ledger-api/rs-grpc-bridge:rs-grpc-bridge_javadoc:
Traceback (most recent call last):
        File "/home/aj/tweag.io/da/da-bazel-1.1/ledger-api/rs-grpc-bridge/BUILD.bazel", line 7
                javadoc_library(name = 'rs-grpc-bridge_javadoc')
        File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/com_github_google_bazel_common/tools/javadoc/javadoc.bzl", line 27, in _javadoc_library
                dep.java.transitive_deps
object of type 'JavaSkylarkApiProvider' has no field 'transitive_deps'
```

* Define Maven deps using rules_jvm_external

* Pin artifacts

* Remove bazel-deps generated targets

* Remove bazel-deps

* Switch to rules_jvm_external targets

* update bazel documentation

* pom_file: There are no more bazel-deps targets

* BAZEL-JVM.md `maven_install` typo
2019-10-28 13:53:14 +01:00
Andreas Herrmann
4a5b74b93d
Warn if module name mismatches file name (#3228)
* Test: Warn if module name mismatches file name

* Update ghcide

* Add module name mismatch preprocessor
2019-10-21 13:17:41 +02:00
Shayne Fletcher
040a4531de
Update DLint (#3234) 2019-10-21 05:31:58 -04:00
Shayne Fletcher
3e17d482c3
Update DLint; welcome pattern rules (#3230) 2019-10-18 12:19:29 -04:00
Moritz Kiefer
36719717fa
Update to current state of progress reporting in LSP (#3211)
* Update to current state of progress reporting in LSP

* fix ide-debug-driver

* Fix tests

* Fix build of ghcide executable
2019-10-17 16:14:49 +02:00
Andreas Herrmann
a49c6469c7 Implement templateTypeRep in DAML (#3174)
* Improve comment

https://github.com/digital-asset/daml/pull/3118#discussion_r332894977

* Implement templateTypeRep in DAML

* TemplateTypeRep tests: use === and =/=

https://github.com/digital-asset/daml/pull/3174#discussion_r334775937

* Switch to bintray ghc-lib 20191015
2019-10-15 10:08:41 +00:00
Moritz Kiefer
2f8708e1cf
Upgrade nixpkgs to latest unstable (#3093)
* Upgrade nixpkgs to latest unstable

* Fix package_app on MacOS

* Bump again

* fix sphinx

* Remove obsolete sphinx file

* Fix sphin183
2019-10-14 09:35:18 +02:00
Moritz Kiefer
48eb360a4f Add AnyChoice type to DAML (#3152)
* Add AnyChoice type to DAML

fixes #3131

* Fix ProposalDesugared

* Fix trigger tests

* Use the proper ghc-lib urls
2019-10-10 16:46:55 +00:00
Moritz Kiefer
a25c2e9de3
Avoid normalizing include dirs (#3103)
* Avoid normalizing include dirs

Fixes #3099

See https://github.com/digital-asset/ghcide/pull/152 for the
corresponding PR in ghcide

* bump to proper ghcide rev

* bump haskell-lsp rev
2019-10-04 10:41:44 +02:00
Moritz Kiefer
2f79ea3221 Bump ghcide (#3083)
* Bump ghcide

* Fix ghcide test output
2019-10-02 13:08:07 +00:00
Rohan Jacob-Rao
32e3099ddf Template instance type synonym polish (#3054)
* Release note

* Desugaring is hard to type

* Upgrade hlint version to new ghc lib

* Use template instance type synonym in some tests

* Rm space
2019-09-27 18:07:39 +00:00
Anup Kalburgi
3686162c02
Adding visual -web command (#3009)
adding the visual-web command to damlc
2019-09-27 10:26:20 -04:00
Rohan Jacob-Rao
5bcdb3e8a0
Desugar template instances to type synonyms instead of newtypes (#3013)
* Upgrade ghc-libs
* Convert template instances as type synonyms to DAML-LF
* Look for TEMPLATE_INSTANCE suffix for daml docs
* Update desugaring documentation
2019-09-26 14:05:47 -04:00
Shayne Fletcher
f6173c0037 Update hlint (#2999)
* Sync to f65e69951032a4c2ab308fd3c3471cd833925abf

* In the DAML parse tree, ListComps are coming through as MonadComps

* Linting smoke tests for lists

* Punctuate test header for readability
2019-09-25 03:17:13 +00:00
Shayne Fletcher
044560ad70
Update hlint (cabal changes) (#3011)
* Update hlint (cabal changes)

* Fix the now failing test
2019-09-24 17:21:20 -04:00
Moritz Kiefer
2ab06da199 Use a consistant include dir for cwd (#2978)
* Use a consistant include dir for cwd

See https://github.com/digital-asset/ghcide/pull/114 for the actual
fix.
This PR just bumps ghcide and adds a regression test. I’ll change the
revision before merging, I just want to test CI for now.

fixes #2929

* Switch to proper ghcide revision

* writeIfacesAndHie no longer exists

* Add changelog entry

* Maybe I should try to compile code before committing but I don’t want to

* Fix ghcide exe
2019-09-23 14:33:06 +00:00
Moritz Kiefer
69da1d6379 Implement AnyTemplate in DAML (#2947)
* Implement AnyTemplate in DAML

* Fix doctest path

* Shuffle around CPP

* Do not hide anything

* Hide it again

* Clean build

* Enable caching again

* debug windows crap

* more tests

* reinstantiate full tests
2019-09-19 08:42:55 +00:00
Moritz Kiefer
afde28f1da
Bump ghc-ghcide (#2936) 2019-09-18 10:29:02 +02:00
Rohan Jacob-Rao
c7eb05be6a Hlint update + release note (#2923)
* Update hlint version corresponding to ghc-lib update

* Add missing release note for corresponding compiler fix
2019-09-16 17:31:44 +00:00
Martin Huschenbett
9a4735a9b3 Allow qualified import of generic templates (#2892)
* Allow for importig generic templates qualified

Currently, there's a bug which breaks `template instance` declarations when
the module containing the generic template definition is imported qualified.

This PR fixes this problem.

* Update ghc-lib, allowing qualified import of generic templates
2019-09-16 17:00:21 +00:00
Rohan Jacob-Rao
68023ac289 Update hlint (#2899) 2019-09-13 15:02:57 +00:00
Rohan Jacob-Rao
e1ff195cee
Update ghc-lib, adding locations to errors with generic templates (#2894)
* Update ghc-lib, adding some locations to errors with generic templates

* Test for template instance location
2019-09-13 10:11:00 -04:00
Shayne Fletcher
546a52e745
Remove two redundant parenthesizations (#2873)
* Remove two redundant parenthesizations

* Add test and improve comments

* Improve comments, start on some more tests (more to come)

* Bind to the newest hlint; more tests.
2019-09-11 12:41:33 -04:00
associahedron
2027d39206 Enable {-# LANGUAGE CPP #-} for daml. (#2878)
* Passing the preprocessor

* Add ghcversion.h

* Remove {-# LANGUAGE CPP #-} for now.

* Remove spurious #line

* Always add platform info, and pass -P flag

* buildifier

* Generate blank ghcversion.h to get around copyright headers check.

* Reviewer suggestions
2019-09-11 15:28:34 +00:00
Moritz Kiefer
e2c3474f1c Upgrade ghcide to incorporate the latest changes (#2879) 2019-09-11 13:19:11 +00:00
Moritz Kiefer
f7befca723
Get ghcide from the new upstream repo (#2867)
* Get ghcide from the new upstream repo

* Update azure-pipelines.yml

Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2019-09-11 08:57:48 +02:00
Shayne Fletcher
d4d757f8bc
Update hlint; disable bracket rules for now (#2837) 2019-09-10 09:57:27 -04:00
Andreas Herrmann
cf6814e93b Use cc_wrapper to shorten library and include paths and rpaths (#2791)
* Fix bazel query deps(//...)

* Add rules_haskell cc_wrapper

Updates to latest rules_haskell master and adds the cc_wrapper PR as a
patch, see https://github.com/tweag/rules_haskell/pull/1039.

* Shorten include dirs in cc-wrapper

When using `haskell_cabal_library` GHC constructs unnecessarily long
include directories which can quickly overflow the maximum command-line
length. This patch avoids the issue by normalizing include paths.

* glob --> breadth_first_walk
2019-09-09 15:50:51 +00:00
Shayne Fletcher
fca502ac9e Update ghc-lib (v8.8.1.20190830) (#2716) 2019-08-30 21:58:23 +00:00
Moritz Kiefer
8f56205567 Remove libffi hack from ghc-lib (#2703)
We currently use a custom cabal file for ghc-lib that has libffi in
the extra-libraries section so Hazel adds the headers. Forcing GHC to
use the bundled libffi should hopefully remove the need for this hack
which simplifies things.
2019-08-30 10:47:07 +00:00
Shayne Fletcher
1a1895b722 Upgrade ghc-lib (v8.8.1.20190828.1) (#2690) 2019-08-28 15:46:14 +00:00
Moritz Kiefer
664a633e20
Fix heap corruption in grpc-haskell-core (#2685)
The details are in the patch which I will also upstream.

fixes #2644
2019-08-28 16:21:37 +02:00
Shayne Fletcher
12dee7fd64 Update ghc-lib (v8.8.1.20190828) (#2674) 2019-08-28 11:35:27 +00:00
Shayne Fletcher
ddf1c178e3
Upgrade hlint (#2668) 2019-08-27 10:33:47 -04:00
Moritz Kiefer
d9a237eb76
Upgrade to gRPC 1.23.0 (#2661) 2019-08-26 16:00:41 +02:00
Andreas Herrmann
c1623acfbb bazel-docs: Replace references to DACH-NY repo (#2655) 2019-08-26 08:50:11 +00:00