Commit Graph

71 Commits

Author SHA1 Message Date
Gary Verhaegen
ea55ea2d14
Further copyright updates (#12249)
Somewhat error-prone, so please review carefully.

Reasons we need this:

- Some file types are not properly handled by the script.
- The only exclusion mechanism we currently have (`NO_AUTO_COPYRIGHT`)
  is overly coarse.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-04 16:32:17 +01:00
Andreas Herrmann
66b407467f
Update protobuf docs plugin (#11880)
* Try to upgrade protobuf docs plugin

changelog_begin
changelog_end

* Fix extension number 65020 is already registered

Building `//ledger-api/grpc-definitions:ledger-api-docs` [failed
with](https://github.com/digital-asset/daml/issues/11761#issuecomment-978947565)
```
panic: proto: extension number 65020 is already registered on message google.protobuf.FieldOptions
```

Go dependencies are now pulled in via Gazelle. By default Gazelle will
generate new proto rules for any `.proto` files encountered in third
party Go dependencies. However, many of these already have pregenerated
`.pb.go` files generate with the appropriate configuration.

The problem can be avoided by configuring Gazelle to not generate new
proto rules, but instead use pre-existing `.pb.go` files.

For reference the field number is set in
[go-proto-validators](32a686adf8/validator.proto (L19))
which is an indirect dependency through protoc-gen-doc.

In this case we need to update protoc-gen-validate to v0.6.2 to include
4f41f10dde
which fixes unknown label errors.

* ./fmt

* Expose gRPC status.proto for Haskell bindings

* Update Gazelle to support embedsrcs on Windows

`protoc-gen-doc` relies on `go:embed` file embedding
2dde01902b/resources.go (L8).
Gazelle supports `embedsrcs`, however, it did not generate the attribute
correctly on Windows due to the different directory separator. This is
fixed in https://github.com/bazelbuild/bazel-gazelle/pull/1101.

* Add gazelle to compatibility workspace

It's loaded into `@daml`'s top-level `BUILD` file and ends up being a
dependency of the compatibility workspace as well.

* shift go_googleapis import

* Delete dead code

protobuf is imported transitively.

* Document how to add Go dependencies

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-11-25 20:51:24 +00:00
fabiotudone-da
f5d2135f97
Check protobuf compatibility of main and PR commits w.r.t. previous stable release [KVL-1109] (#10950)
* Check protobuf compatibility of release commits w.r.t. previous stable release

CHANGELOG_BEGIN
CHANGELOG_END

* Remove blank line

* Don't persist credentials

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

* check-protobuf-against-stable.sh: SRC_DIR -> PROJECT ROOT + simplify

* Don't set LATEST_STABLE global in a function

* Simplify by using only the main work tree

* Simplify further as the check will be only run from `main`

* Move the check to `ci/build.yml` so that it is also run on PRs

* Enter the development environment to use tools

* Make variables read-only

* Support release branches and PRs targeting them

* Fix and document the reference tag finding logic

* Fix SYSTEM_PULLREQUEST_TARGETBRANCH and print it

* Don't log the source branch

* Fix comment formatting

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

* Enable Slack integration

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

* Don't check if the branch is a release one

...as the check won't be run on release branches.

* Add compatibility_stable_protobuf to collect_build_data

* Do not activate dev-env globally but only in sub-shells

* Add an explanation about why the check is not run on release branch commits

* Simplify further by leveraging `buf`'s ability to compare against branches

* Use `buf`'s `tag` locator instead of `branch`

* Split buf checks by module and remove previous manual check

* Explain how to run locally

* Use more future-proof WIRE_JSON for participant-integration-api

Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>

* Use stricter FILE for the ledger gRPC API

* Propose an explanation for WIRE in kvutils

* Fix comment typo

* Re-introduce linting configuration for kvutils

* Simplify explanation for KVUtils' breaking check rule

* Remove extra (C) header from 3rd-party proto

* Don't touch the copyright of google/rpc/status.proto

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
Co-authored-by: Simon Meier <meiersi-da@users.noreply.github.com>
2021-09-23 15:50:33 +00:00
Andreas Herrmann
0b7980d6eb
Update rules_haskell (#10674)
* update rules_haskell

changelog_begin
changelog_end

* Build proto3-suite lib and exe in same repo

changelog_begin
changelog_end

* drop unneeded stack_snapshot packages

* Use packages.bzl consistently

* Sort stack_snapshot attribute values

* Remove unused constant

* drop unneeded stack_snapshot packages in compat

changelog_begin
changelog_end

* Sort stack_snapshot attribute values in compat

* Remove redundant dicts.add in compat

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-08-26 10:41:58 +02:00
Moritz Kiefer
5d91a25306
Disable deriving-defaults per file (#8684)
Disabling it per target works nicely for compilation but it gets
annoying in ghci since the warnings are still triggered. We could
disable it everywhere but I think the warning is generally useful. I
tried patching proto3-suite to use DerivingStrategies but that doesn’t
work because haskell-src is dead and doesn’t support it. So for now
adding it to the per-file list seems like the best option.

changelog_begin
changelog_end
2021-01-29 11:01:55 +00:00
Moritz Kiefer
c74fe9ea20
Delete unusued bzip2 BUILD file (#8678)
changelog_begin
changelog_end
2021-01-29 10:37:25 +01:00
Moritz Kiefer
c89e00342d
Clean broken entries from the Bazel cache (#8668)
* Clean broken entries from the Bazel cache

This is hopefully a somewhat reasonable workaround for the "output not
created" errors that keep annoying us.

For now, this is just part of the hourly cronjob but we could move it
somewhere else if desired.

changelog_begin
changelog_end

* Fix GCS credentials

changelog_begin
changelog_end
2021-01-28 17:57:09 +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
Gary Verhaegen
878429e3bf
update copyright notices to 2020 (#3939)
copyright update 2020

* update template
* run script: `dade-copyright-headers update .`
* update script
* manual adjustments
* exclude frozen proto files from further header checks (by adding NO_AUTO_COPYRIGHT files)
2020-01-02 21:21:13 +01:00
Andreas Herrmann
f4d0eb636e Replace Hazel by stack_snapshot (#2743)
* Unmangled libz.so and libbz2.so

* Use stack_snapshot instead of Hazel

* Remove Hazel

* Define stack_snapshot

* Update rules_haskell

* Document stack_snapshot

* Clean stack's lock file from aborted builds
2019-11-22 14:24:08 +00: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
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
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
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
Oliver Seeliger
c9658c7813
Multi participant node named logging (#2647) (#3080)
* Upgrade scala-logging and slf4j

* Named logging for multi-participant tests (#2647)
2019-10-03 18:20:57 +02: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
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
2de32b7419
Include all daml files in dar if source points to a file (#2970)
Previously, we only included the source file itself but not its
dependencies which didn’t make much sense.

This fixes #2960
2019-09-23 11:14:35 +02:00
Moritz Kiefer
afde28f1da
Bump ghc-ghcide (#2936) 2019-09-18 10:29:02 +02: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
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
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
Moritz Kiefer
d2b68d45d4 Rename hie-core to ghcide (#2820)
* Rename hie-core to ghcide

The name `hie-core` has caused a lot of confusion as to how we relate
to haskell-ide-engine so changing it should hopefully help with that.
I also think that ghcide is still a good name once we hopefully
integrate with haskell-ide-engine more closely.

The name ghcide seems to have a reasonable amount of support on
Twitter https://twitter.com/ndm_haskell/status/1170681262987710464
which is of course the only good way to come up with names.

* Add a readme that points people to the new directory.

* Fix bogus replacements

* Use a proper link

* links are hard
2019-09-09 13:55:16 +00:00
Andreas Herrmann
ed39800a9f Rename hazel_deps to hackage_deps (#2789)
* hazel_deps --> hackage_deps

Mechanical change:

```
sed -i 's/hazel_deps/hackage_deps/g' $(ag -l hazel_deps)
```

* Hazel dependencies --> Hackage dependencies
2019-09-06 09:01:09 +00:00
Stefano Baghino
13607031f5
Start porting the transaction service integration tests (#2713)
* Start porting the transaction service integration tests

Contributes to #1373

* Simplify creation of multiple contract in a single transaction

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319562016

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319562566

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319563441

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319563617

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319563788

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319563838

* Fix test case description

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Fix test case description for disclosure

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Fix test description of parallel requests test case

Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com>

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319883011

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319567251

* Address https://github.com/digital-asset/daml/pull/2713#discussion_r319567251

* Run all conformance tests in exclusive mode
2019-09-02 13:45:15 +02:00
Shayne Fletcher
fca502ac9e Update ghc-lib (v8.8.1.20190830) (#2716) 2019-08-30 21:58:23 +00:00
Gerolf Seitz
ecb506e803
SQL diagnostics (#2662)
* Use proper names for the DB connection pools.

* Add some trace logging for DB operations.

This does not capture timing of individual statements but
rather the time for "units of work".
For example "lookup contract" doesn't mean only loading
a single row from the contracts table, but also 2 additional
queries for looking up witnesses and divulgences.

This is not a problem, because this is trace level logging
that helps us debug problems and shouldn't be made sense of by
users at this stage.

* Make description a by-name parameter.

This avoids building up the string if trace logging
is not enabled (i.e. most of the time).
2019-08-30 13:41:44 +02: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
Shayne Fletcher
12dee7fd64 Update ghc-lib (v8.8.1.20190828) (#2674) 2019-08-28 11:35:27 +00:00
Moritz Kiefer
67c2e2a9ef
Switch to upstream gRPC-haskell (#2642)
* Switch to upstream gRPC-haskell
2019-08-23 15:10:15 +02:00
Rohan Jacob-Rao
4c53841eeb
Upgrade ghc-lib, improving parsing of template headers (#2609)
* Update ghc-libs
* Test for parsing template headers
2019-08-20 13:24:15 -04:00
Moritz Kiefer
3e2ccc0842
Switch to a streaming zip encoding (#2595)
This switches the creation of the archive in `daml build` from
`zip-archive` to `zip`. This has a few advantages:

1. It gets rid of lazy IO for reading all the interface and source
files. This avoids the high usage of file handles in `daml build`.

2. It seems to be a slight improvement in max memory usage and runtime
and a giant improvement in allocations (but I think the latter
probably comes primarily from the fact that the locations are moved to
the bzip C library). The improvement in max memory usage is less than
I expected so probably there is still something off somewhere.

For now, I only switched over `createArchive`. Archive reading is
still done using `zip-archive`. We might want to switch that over in a
separate PR.
2019-08-19 20:15:13 +02:00
Moritz Kiefer
33e16eaef1 Remove arx patch files (#2593)
I forgot to remove them in the Stackage upgrade.
2019-08-19 13:55:32 +00:00
Gerolf Seitz
67d4b7aec6
Upgrade akka to 2.5.23 and akka-http to 10.1.9 (#2576)
When diagnosing error logging from akka when shutting down the ledger
API server, I wanted to give upgrading akka to the latest good release
between akka and akka-http. Incidentally, this actually removed the
errors and the shutdown should now be successful.
2019-08-19 12:34:03 +02:00
Moritz Kiefer
333c90bd69
Cleanup build of c2hs (#2578)
* Cleanup build of c2hs

No need to inline the whole package and add a custom build file.

* Use hazel_hackage
2019-08-16 19:33:30 +02:00
Rohan Jacob-Rao
5bf86db2a1
Update generic templates (#2547)
* Extract template instance doc from newtype constructor doc
* Use new ghc-libs
* Remove type application which is not needed anymore
* Update daml-doc output with template instances
* Update hlint version
2019-08-14 16:28:35 -04:00
Andreas Herrmann
a1c21d9829
Update rules haskell (#2509)
* update rules_haskell

* adapt rules_haskell patches

* io_tweag_rules_haskell --> rules_haskell

* io_tweag_rules_haskell --> rules_haskell

* haskell:haskell.bzl --> haskell:defs.bzl

* rules_haskell_dependencies
2019-08-13 16:46:31 +02:00
Rohan Jacob-Rao
c2f315d2ba
Support generic templates (#2465)
* Upgrade ghc-libs supporting generic templates
* Update Proposal and ComposedKey tests to generic template syntax
* Temporarily patch daml-doc test output (will need to fix for template instances)
2019-08-09 17:15:51 -04:00
Leonid Shlyapnikov
c7b5482e43 JWT HMAC256 Authorization (#2389)
* Starting //ledger-service/jwt module

adding //3rdparty/jvm/com/auth0:java_jwt dependency, there are Scala JWT
libraries, however they are either immature or unsupported

* Keys and JWT generator utility/wrapper, WIP

* Keys and JWT generator utility/wrapper, WIP

* RSA Keys generator

* HMAC token validation added to command/create endpoint

HMAC is actually not good, need RSA, this is a shortcut for DABL team.

* Renaming

* command/create test cases fixed to pass OAth2 Bearer token

* removing unused method

* JWT authorization for /command/exercise

* the rest of the endpoints uses JWT authorization

removed hardcoded JwtPayload

* cleanup

* cleanup

* http status code in the header and in the json body should match now

* NotFound would also return a json body now

* Removing hardcoded JWT in the integration test

it is generated using the JwtSigner.HMAC256

* cleanup

* fixing error message

* instructions for making a JWT HMAC token for dev
2019-08-07 16:26:26 +00:00
Rohan Jacob-Rao
e6a4d8b251
New template desugaring (#2178)
* Update ghc-libs to use new template desugaring
* Replace old template typeclasses with generic-friendly ones
* New template desugaring doc
* Fix tests
* Fix damldoc tests regarding Archive choice
* Update visualisation code to not traverse master dictionary
* Additional class method stubs to template instance declaration for upgrades
* Increase stack limit for bond trading compilation test
* Update hlint version
2019-07-30 19:49:33 -04:00
Michał Majcherski
37a921516b
Upgrade gRPC JVM libs (#2276)
* Haskell ledger bindings tests setup fix - use --port-file to obtain sandbox's port

* Update gRPC JVM libs

* Add missing gRPC core dependency

* Redirect sandbox's stdout and stderr to /dev/null

* Amend ledger's NettyServerBuilder settings after gRPC upgrade
2019-07-26 14:44:59 +02:00
Shayne Fletcher
ee5079d9d3 Ghc lib 8.8.0.20190723 (#2279)
* Upgrade ghc-lib

* Patch bazel_tools : hazel-include-paths patch, no-isystem patch.

* Provide "haskell_c2hs" for package name to cabal_haskell_package

* Package name haskell_c2hs => c2hs.

* Switch to less hacky patch for include dirs
2019-07-25 08:59:34 +00:00
Shayne Fletcher
f7657159e4 ghc-lib-8.8.0.20190704.selective-optimizations-off (#2023) 2019-07-05 14:10:05 +00:00
Andreas Herrmann
93d8e01db2
Update rules_haskell and static GHC (#1515)
* Update rules_haskell and static GHC

Remove patches that have been upstreamed or are no longer required.
Update still required patches to match the new rules_haskell version.

Previously we patched rules_haskell to coerce GHC into using static
Haskell libraries in most places. In particular we moved hs-libraries
entries into extra-libraries entries in the package configuration files.
A much cleaner approach is to compile GHC with a static RTS, then GHC
will by itself choose to load static Haskell libraries.

* Remove haskell_cc_import

* da-hs-daml-cli -> daml-cli

* da-hs-damlc-app -> damlc-app
2019-07-01 13:26:19 +02:00
Robert Autenrieth
868a72b93a
Add support for DAML_PROJECT in Navigator (#1458)
* Add circe-yaml

* Add new helper library to load SDK config files

* Add support for DAML_PROJECT in navigator

Fixes #1128
2019-06-24 17:06:20 +02:00
Neil Mitchell
3e1083e1fe Rename haskell-ide-core to hie-core (#1809)
* Rename haskell-ide-core as hie-core, after discussions with Alan Zimmerman and others

* Update the readme to just say how to install
2019-06-21 17:07:09 +00:00
Moritz Kiefer
8272f952b7 Upgrade protobuf (#1781)
* Upgrade protobuf

This fixes the annoying “illegal reflective access” warnings when
using a newer JDK.

* Add release notes
2019-06-20 15:14:30 +00:00
Shayne Fletcher
130c51c8f7
update to ghc-lib-8.8.0.20190616 (#1696) 2019-06-16 23:01:39 +02:00
Moritz Kiefer
5b0faea2cf
Get haskell-ide-core to work on our codebase (#1692)
* Get haskell-ide-core to work on our codebase

* Fix ghc-lib-parser on Windows
2019-06-16 15:42:48 +02:00