Commit Graph

103 Commits

Author SHA1 Message Date
Bernhard Elsner
d40f2493ab
Docs style alignment (#8074)
* Docs restyle WIP

* Minor color changes

* Adjust fonts and shadows

* Remove redundant local contents

* Further fixes to "In this Section"

* Restyle previous and next buttons

* Make visited link color blue

* Top-level nav

* Change how anchors are underlined

* Fix header spacing

* Improve tables

* Improve search results

* Improve copy button

Match sphinx versions between dev-env and bazel

* Copy button and code block fixes

* Fix copy button z-index

* Making things reactive

* Make the title spacing work on mobile & tablet

* Pixel adjustment for S3 hosting

* Spacing and font-size fixes

* Fix content menu for tablet

* Tidy up menu indentation

* Reorder Mobile Menu

* Move unified nav up

CHANGELOG_BEGIN
[Docs] New styling
CHANGELOG_END

* Remove non-free fonts

* Fix button padding

* Fix spacing above first h2

* Fix pixel adjustment of h1 line

* Fix menu click effects and antialiasing

* Pixel adjust h1 line once more
2020-11-30 17:16:26 +00:00
Moritz Kiefer
4e39e6163b
Get lsof from dev-env (#8064)
On MacOS we don’t seem to have lsof by default which disables our
sandbox cleanup for stray instances.

changelog_begin
changelog_end
2020-11-25 14:43:37 +00:00
Samir Talwar
1ab14c2232
dev-env: Add xargs. (#7769)
We use `xargs` a lot but rely on the version on the user's system.

This adds it to dev-env so it's consistent everywhere.

If nothing else, this means we can safely use the `--no-run-if-empty`
flag, which is not available on BSD (and therefore macOS) `xargs`.

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-21 13:00:19 +00:00
Stephen Compall
1a2afd5266
upgrade to Scala 2.12.12 from 2.12.11 (#7661)
* upgrade bazel settings to scala 2.12.12

* upgrade nix scala tool to scala 2.12.12

* upgrade silencer references to scala 2.12.12

* repin for scala 2.12, silencer, wartremover upgrades

* remove numerous occurrences of unused silencer now spotted

* update Scala version in our bazel notes

CHANGELOG_BEGIN
CHANGELOG_END

* update compatibility maven_install.json to match compatibility WORKSPACE
2020-10-13 08:42:14 -04:00
Samir Talwar
929c2216c2
nix: Pin scala to v2.12.11, the same version we use in Bazel. (#7379)
The version in nixpkgs is v2.12.10, which means that the Scala REPL we
used was not the same version as we use in our code.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-11 09:58:29 +00:00
Samir Talwar
f0e09c54b1
DAML on SQL: Renaming to "DAML for PostgreSQL", Markdown README, and further tweaks. (#7160)
* daml-on-sql: Formatting fixes for the README.

* daml-on-sql: Rename to "DAML on PostgreSQL" within the README.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-on-sql: Format README to make Markdown conversion nicer.

Markdown conversion:

    pandoc --reference-links --reference-location=section -t markdown+backtick_code_blocks-fenced_code_attributes -o ledger/daml-on-sql/README.md ledger/daml-on-sql/README.rst && sed -i 's/\\//g' ledger/daml-on-sql/README.md

* daml-on-sql: It's "DAML for PostgreSQL", not "on PostgreSQL" now.

* daml-on-sql: Generate a Markdown README with a script.

This is easier to parse by human beings than the reStructuredText.

* daml-on-sql: Reflow the README and manipulate whitespace a little.
2020-08-18 11:50:45 +00:00
Andreas Herrmann
4b1438276c
Update Bazel 2.1.0 --> 3.3.1 (#6761)
* Upgrade nixpkgs revision

* Remove unused minio

It used to be used as a gateway to push the Nix cache to GCS, but has
since been replaced by nix-store-gcs-proxy.

* Update Bazel on Windows

changelog_begin
changelog_end

* Fix hlint warnings

The nixpkgs update implied an hlint update which enabled new warnings.

* Fix "Error applying patch"

Since Bazel 2.2.0 the order of generating `WORKSPACE` and `BUILD` files
and applying patches has been reversed. The allows users to define
patches to these files that will not be immediately overwritten.
However, it also means that patches on another repository's original
`WORKSPACE` file will likely become invalid.

* a948eb7255
* https://github.com/bazelbuild/bazel/issues/10681

Hint: If you're generating a patch with `git` then you can use the
following command to exclude the `WORKSPACE` file.

```
git diff ':(exclude)WORKSPACE'
```

* Update rules_nixpkgs

* nixpkgs location expansion escaping

* Drop --noincompatible_windows_native_test_wrapper

* client_server_test using sh_inline_test

client_server_test used to produce an executable shell script in form of
a text file output. However, since the removal of
`--noincompatible_windows_native_test_wrapper` this no longer works on
Windows since `.sh` files are not directly executable on Windows.

This change fixes the issue by producing the script file in a dedicated
rule and then wrapping it in a `sh_test` rule which also works on
Windows.

* daml_test using sh_inline_test

* daml_doc_test using sh_inline_test

* _daml_validate_test using sh_inline_test

* damlc_compile_test using sh_inline_test

* client_server_test find .exe on Windows

* Bump Windows cache for Bazel update

Remove `clean --expunge` after merge.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-23 09:46:04 +02:00
Andreas Herrmann
cddb5e30ab
Remove unused with-packages-wrapper (#6693)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-10 16:02:01 +00:00
Samir Talwar
7f7eaa35e7
Use Distroless for the Java Docker base image. (#6537)
* Use Distroless for the Java Docker base image.

We switched away from Distroless because it was causing issues with
`docker pull` when you had Docker configured to use `gcloud` for
authentication, but weren't actually authenticated.

Adding `docker-credential-gcloud` to dev-env should hopefully fix this,
meaning we can switch back to a base image that is better-maintained.

CHANGELOG_BEGIN
CHANGELOG_END

* Bump rules_docker to v0.14.3.

This fixes an issue when running `bazel sync`:

```
ERROR: java.io.IOException: Error downloading [http://central.maven.org/maven2/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1.jar] to [...]/external/javax_servlet_api/javax.servlet-api-3.0.1.jar: Unknown host: central.maven.org
```
2020-06-30 12:01:43 +00:00
Nemanja
77c0b879e6
Copy code button (#6508)
* Copy code button

Added the sphinx copy code extension (https://sphinx-copybutton.readthedocs.io/en/latest/) to the docs. Tested with  and it worked.

CHANGELOG_START
CHANGELOG_END

* Remove vendored copy of sphinx_copybutton

changelog_begin
changelog_end

* remove debugging output

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-06-29 12:34:40 +02:00
Gary Verhaegen
e1bfbd6a72
remove jo from dev-env (#6435)
It doesn't seem to be used anywhere. Obviously `git grep jo` returns a
lot of results, so I may have missed something in the noise, but I did a
reasonable effort to look through them.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-19 15:21:43 +00:00
Moritz Kiefer
4f486623f1
Upgrade sphinx-autobuild dependencies (#6318)
This PR upgrades the dependencies of sphinx-autobuild to address
security vulnerabilities. I tested on Linux that the docs preview
script which is the only user of sphinx-autobuild still works
correctly.

I’ve renamed default.nix to requirements.nix to match the name used by
pypi2nix (otherwise you just have to rename it ant the end which is a
bit stupid). I’ve also added a brief readme.

I would appreciate if somebody could test the docs preview script on
macos.

fixes #6317

changelog_begin
changelog_end
2020-06-11 20:56:41 +02:00
dependabot[bot]
79837875e0
Bump pyyaml from 3.12 to 5.1 in /nix/tools/sphinx-autobuild (#3216)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 3.12 to 5.1.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/3.12...5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-11 17:39:45 +00:00
Gary Verhaegen
71d714510e
add find to dev-env (#6175)
The issues underlying #6173 prompted me to look into which `find`
version we had in dev-env, and I was surprised to notice we had none. We
already have `findutils` in our nix configuration, however, so this is
just adding the symlink.

Note that, on my machine at least, switching from the macOS-provided one
to the dev-env one does not change the result order for the hash
calculation in `ci/patch_bazel_windows`, so this would likely not have
helped for #6173. Still, we use `find` in many places in our scripts so
I think it's worth having there.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-01 15:11:55 +02:00
Moritz Kiefer
fc366478f0
Upgrade puppeteer (#6142)
* Upgrade puppeteer

We’ve seen a couple of issues in the compatibility tests of the form

```
Error: Protocol error (Runtime.callFunctionOn): Target closed.
```

Looking at the issue tracker in puppeteer this might be fixed in newer
versions and I don’t see why we should stick to a fairly old version
anyway.

changelog_begin
changelog_end

* Upgrade nodejs

changelog_begin
changelog_end

* temporary add a step to kill node_modules

changelog_begin
changelog_end

* Kill live server and try to fix Windows

changelog_begin
changelog_end

* Undo rm

changelog_begin
changelog_end
2020-05-28 21:58:52 +02:00
Brian Healey
cfab7dab63
Update netty and iogrpc version (#6063)
* io.grpc:grpc-xxxx to 1.29.0 (from 1.22.1)
io.netty:netty-xxxx to .1.50.Final (from 4.1.37.Final)
io.nett.netty-tcp-native-boringssl-static to 2.0.30.Final (from 2.0.25.Final)

To resolve open vulnerabilities with these versions
netty-4.1.37.Final vulnerabilities
 BDSA-2018-4022 (Medium)
 BDSA-2019-2610 (Medium)
 BDSA-2019-3119 (CVE-2019-16869) (Medium)
 BDSA-2020-0130 (Medium)
 BDSA BDSA-2019-4230 (CVE-2019-20445) (Low)
 BDSA BDSA-2019-4231 (CVE-2019-20444) (Low)
 BDSA BDSA-2020-0666 (CVE-2020-11612) (Low)
 BDSA BDSA-2019-2642 (Low)
 BDSA BDSA-2019-2649 (Low)
 BDSA BDSA-2019-2643 (Low)

CHANGELOG_BEGIN
Upgrade io.grpc:grpc-xxxxx and io.netty:netty-xxx version to latest
released to avoid exposure to reported security vulnerabilities in
currently used versions
CHANGELOG_END
–

* Update spray versions to address vulnerabilities
CVE-2018-18853 and CVE-2018-18854

CHANGELOG_BEGIN
Upgrade io.grpc:grpc-xxxxx and io.netty:netty-xxx version to latest
released to avoid exposure to reported security vulnerabilities in
currently used versions
CHANGELOG_END

* do not change io.grpc version since reflection seems to be misbehaving

* Clarify how to bump grpc/netty/protobuf versions

Also "downgrade" netty to 4.1.48, according to
https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty

CHANGELOG_BEGIN
CHANGELOG_END

* Load protobuf deps after haskell deps to avoid loading an older version of rules_cc

* Upgrade protoc and protobuf-java to 3.11.0

* buildifier reformat

* regen unique int after rebase

* remove commented patch

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>
2020-05-27 13:44:34 -04:00
Shayne Fletcher
887815c019
Get toxify from nix (#6110)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne@shaynefletcher.org>
2020-05-26 16:32:33 +00:00
Gary Verhaegen
081bc60e2f
remove envsubst from dev-env (#6098)
It should not be an issue, but I know of at least 4 people for whom
having envsubst in dev-env causes their local git to get confused and
spit out many lines of warning on each invocation. This also seems to
make git much slower.

Given that we're only using envsubst in this one place, I think it may
be worth replacing.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-26 12:25:54 +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
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
Samir Talwar
57a8d0b37e
CI: Run PostgreSQL once for all Scala tests. (#5919) 2020-05-14 09:06:34 +02:00
Andreas Herrmann
35fe61ed06
Update Bazel 2.0.0 --> 2.1.0 (#5651)
* Update Bazel 2.0.0 --> 2.1.0

CHANGELOG_BEGIN
CHANGELOG_END

* Update rules_haskell

For Bazel 2.1.0 compatibility.

* nix: grpc: patch glibc version incompatibility

* Fix hlint warnings

* CcToolchainInfo.compiler

https://docs.bazel.build/versions/2.1.0/skylark/lib/CcToolchainInfo.html#compiler

* CcToolchainInfo.ar_executable

* texlive: add missing transparent package

* Leave a debug note on the docs target

* Ignore FutureWarning in //docs:docs-no-pdf

* Isolate PR

This is to avoid any interference with pipelines prior to the Bazel
update.

* Remove isolation

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-05-11 11:47:54 +02:00
Gary Verhaegen
204c8b0657
add daily perf report (#5843)
This PR adds a simple daily job that runs the performance test on a
chosen "baseline" commit and then runs the same benchmark on latest
master. This should allow us to track overall performance improvements.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-06 13:50:35 +02:00
Robin Krom
4ede3fc711
docs: publish cheat sheet under docs.daml.com/cheat-sheet (#5841)
* docs: publish daml-cheat-sheet on docs.daml.com

* separate cheat sheet rule

* Fixed `@daml-cheat-sheet`

* Uses `_config.yml` to determine the source directory root.
* Uses `tar h` to resolve symbolic links. Otherwise the tarball just
  contains symbolic links to the execroot.
* Uses flags to make `tar` and `gzip` reproducible, i.e. avoid
  timestamps and the like.

* cleanup

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-05-05 17:35:30 +00:00
Rohan Jacob-Rao
7fafe6a08a
GSG: test messaging feature and remove copied code snippets (#5507)
* Diff with messaging feature and some noise manually removed

* Bazel target to use patch file in other build targets

* Patch file as data dep for integration tests

* Attempt to patch and test messaging feature in create-daml-app test

changelog_begin
changelog_end

* Use exports_files instead of filegroup

* Remove file existence checks that don't make sense

* Add patch to dev_env and reference it from integration tests

* Include patch on windows for later

* Set up yarn env again after codegen

* Restore file check

* Fix typo in comment on util function

* Add Tasty steps to make process explicit

* Use messaging patch for code snippets in GSG

* Use messaging code from template instead of copy

* Remove copied message code

* Refactor script to copy template code with messaging patch

* No need to retry second yarn install (only local deps should be updated)
2020-04-11 19:53:44 +00:00
Gary Verhaegen
1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00
Moritz Kiefer
e0d652df91
Generate ssl certs in a genrule instead of checking them in (#4950)
changelog_begin
changelog_end

For now this is only used for the daml-helper tests. I’ll shuffle
things around and use it for all tests in a separate PR.
2020-03-12 10:36:40 +01:00
Moritz Kiefer
ffc6f4e520
Include Bazel patch to mark tests as exclusive (#4918)
* Include Bazel patch to mark tests as exclusive

This should hopefully avoid rerunning the conformance tests as often
as we do now. While this patch is not applied on Windows (since we get
it from nix), this is not really an issue since most of the exclusive
tests (in particular, all conformance tests) are disabled on Windows
anyway.

I’ve tested this locally accross a couple of runs and I get the
caching I want and looking at the code in the patch, the change looks
very reasonable. I somewhat wonder if it just broke internally at
google because they marked tests as exclusive that should have gotten
no-cache.

changelog_begin
changelog_end

* Disable caching for canton
2020-03-10 13:13:58 +01:00
Gary Verhaegen
dd1b44eccc
add grep to dev-env (#4903)
Because it's not in there and we're all surprised to learn that.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-10 10:34:01 +01:00
Moritz Kiefer
d455267e58
Reduce the number of GHCs in our nix closure (#4729)
This reduces the number of GHCs to 2 on Linux (regular and DWARF) and
1 on macOS. Given that each derivation is > 1 GB this should hopefully
help a bit.

changelog_begin
changelog_end
2020-02-26 20:00:07 +01:00
Moritz Kiefer
4d734939c9
Inline packages.nix into default.nix (#4726)
I don’t see any reason why we should have this split into two files.

changelog_begin
changelog_end
2020-02-26 17:34:51 +01:00
Moritz Kiefer
8c14d16718
Disable pdf docs builds on macos (#4724)
This disables the PDF docs builds on MacOS on CI (they are still built
locally by default) and removes them from the Nix closure by
introducing a separate ci-cached attribute that filters out texlive.

Since we built `nix-build nix -A tools -A cached` on CI, I’ve also
removed all the Tex stuff from tools which only means that it ends up
in PATH which nobody seems to care about.

changelog_begin
changelog_end
2020-02-26 14:52:08 +00:00
Moritz Kiefer
6638e57e81
Remove release.nix (#4725)
This file is only used by Hydra which we do not use anymore.

changelog_begin
changelog_end
2020-02-26 14:33:18 +00:00
Andreas Herrmann
fdeca38651
Update to Bazel 2.0.0 (#4352)
* Update nixpkgs: To update to Bazel 2.0.0

CHANGELOG_BEGIN
CHANGELOG_END

* Windows: Update to Bazel 2.0.0

* Pin sphinx 1.8.3 for Bazel

* Clarify patches = []

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-02-07 12:13:38 +00:00
Andreas Herrmann
6cf5458e30
Avoid intermediate nodejs_dev_env (#4135)
* Remove unused npm_nix

* Use node_nix directly on Unix

rules_nodejs requires a vendored node to contain the node distribution
in a subdirectory of the provided external repository. With the default
node Nix package this is not the case. The nodejs_dev_env workspace used
an intermediate repository rule to fulfill these requirements.
Occasionally, this caused flakiness on CI.

This change fulfills this requirement on the Nix side, so that Bazel can
consume the provided Nix derivation directly.

CHANGELOG_BEGIN
CHANGELOG_END

* Avoid collision with dev-env tools like license-checker

* buildifier-fix

* Add comment motivating use of `@node_nix` on Unix.

* Document npm-cli patch

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-21 17:38:11 +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
Gary Verhaegen
83fdc6d164
remove unused python3.6-da dev-env bin (#3845) 2019-12-16 11:51:43 +01:00
Gary Verhaegen
42d66c97cf
remove unused nix file (#3831) 2019-12-13 11:43:50 +01:00
Gary Verhaegen
a995872c7d
fix docs live-preview.sh script (#3789)
pipenv is broken on current master as of #3366, as it invokes a Python
in a subshell that does not have access to virtualenv.
2019-12-10 18:25:39 +01:00
Samir Talwar
1f6529aea7 Upgrade Scalafmt to v2.3.1. (#3764)
* Upgrade Scalafmt to v2.3.1.

* Reformat daml-assistant/daml-sdk/.../SdkMain.scala with Scalafmt.
2019-12-06 12:56:07 +00:00
Moritz Kiefer
f0a111ca1a
Get grpc from nix on unix (#3632)
* Get grpc from nix on unix

The one from Bazel seems to cause linking issues when trying to run
things in GHCi. I’ve spent some time trying to use rules_foreign_cc to
build gRPC using CMake but decided that for my own sanity it’s better
to not pursue that further.

* Address review comments

* Add missing module load

* Cleanup GHCI_SCRIPT

* use the correct file ending on macos

* Import is_linux

* Switch back to grpc-1.23

The newer version seems to cause issues in combination with the java libraries.

* Try to fix package_app on macos

* more debugging

* Maybe this is not necessary, we will never know

* linkers are the worst

* Remove debugging output again

* readd rpaths

* treat libdispatch specially

* remove hack

* more fooling around

* lalala
2019-11-26 18:47:39 +01:00
Andreas Herrmann
15f12eea6a Remove Bazel override (#3603)
* Remove Bazel override

The extended default shell env is no longer required. See
https://github.com/digital-asset/daml/pull/3597#pullrequestreview-322096242

* Import diff from rules_sh posix toolchain
2019-11-26 09:06:44 +00:00
Andreas Herrmann
6c2f4ebe8f Fix pip and pipenv (#3366)
* Fix pip and pipenv

Since the latest nixpkgs update pip is no longer contained in the python
derivation but instead in its own `python37Packages.pip` derivation.

Additionally the pipenv version in nixpkgs is incompatible with the pip
version, as pipenv expects a module to be present which is only
available in later versions. This change overrides pip with a version
update to fix this issue.

Upstream nixpkgs has already updated pip accordingly

* Update nixpkgs

The versions of `pipenv` and `pip` contained in `nixpkgs` where
previously incompatible. They are compatible in the new `nixpkgs`
revision.

Just overriding the pip version caused too many uncached rebuilds and
timed out on CI.

* Update nixpkgs further

To incorporate
efce3c1367

* Try to build fewer GHCs

* nix: drop sass override

nixpkgs-unstable is on the same page.

* nix: use upstream chromedriver

* nix: remove pex override

* nix: drop pypi2nix override

* Fix bazel-watcher

* try upgrading rules go

* Remove overrides for ibazel

* Upgrade rules_go

* Remove references to sass overrides
2019-11-20 15:27:32 +01: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
Andreas Herrmann
e1727dc033 Update rules_haskell (#3275)
* Use cc_wrapper in ghcide test

The cc_wrapper is needed to find library dependencies.

* Update rules_haskell

* update rules_nixpkgs

Fixes issue with `nixpkgs_local_repository` and Nix `import`.

* Shorten RULES_HASKELL_EXEC_ROOT

Cabal package library paths are longer and overflow the command-line
length when calling `cc` on MacOS for template Haskell dependencies in
the IDE tests. Shortening the `RULES_HASKELL_EXEC_ROOT` prefix for each
`(LD_)LIBRARY_PATH` entry works around the issue.
2019-11-12 12:15:31 +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
Gary Verhaegen
934dae1ace
pin Terraform to 0.11 (#3291) 2019-10-30 15:32:24 +01: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
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
Gary Verhaegen
daf15e6ae6
dev-env: remove gradle (#2738) 2019-09-04 17:44:51 +01:00