Commit Graph

37 Commits

Author SHA1 Message Date
Michał Majcherski
fdbc1f51ce
windows: fixed daml-lf tests for Windows by using Bazel's rlocation (#1053)
* windows: fixed daml-lf tests for Windows by using Bazel's rlocation

* more consistent logging on CI; publishing Windows test logs on failure

* windows: fix daml-lf engine tests

* windows: add diff tool to msys
2019-05-14 16:18:55 +02:00
Nick Smith
6f6f3337c7
Fixes 895: Improve DA Bazel rules for building javadocs. (#896)
* Fixes 895: Improve DA Bazel rules for building javadocs.

Extend the da_java_library Bazel macro to also build the Javadoc for the
target. Add the Javadoc artefacts to the release procedure.
2019-05-14 09:40:30 +02:00
Stephen Compall
c6a382db70 warn on use of 'return' Scala keyword; remove most usages (#956)
*  enable Return wartremover wart

* remove return keyword from various places in daml-lf

* remove return keyword from various places in ledger

* simpler ImmArray equals

* move traverseEitherStrictly to point of use

* remove return from ledger-api-server-example
2019-05-13 17:10:29 +00:00
Andreas Herrmann
e428618f03
Update rules_haskell (#1106)
Some of the patches against rules_haskell and Hazel can now be dropped
as they've been merged upstream.
2019-05-13 16:59:58 +02:00
Andreas Herrmann
d455030e7f Fix uncached Windows CI (#1047)
* Windows: Drop rules_haskell CROSSTOOL patches

* Windows: Use cc_toolchain_config

* Windows: Fix haskell_zlib

* Windows: Add default link flags

* Windows: Define artifact_name_pattern .exe

Executable targets end on .exe on Windows.
2019-05-09 17:20:50 +02:00
Andreas Herrmann
5bb0b50286 Fix Hazel short paths (#1014)
The version macros fix had interfered with the actual short Hazel
library names. Now also shortening the Paths module.
2019-05-09 08:52:03 +02:00
Andreas Herrmann
9f46df8cd6 Hazel: Shorten target names (#937)
* Hazel: Shorten target names

Previously, Hazel would generate library and binary targets, that
repeated the package name in their target name. This easily lead to too
long paths on Windows, which could induce errors with code that did not
use API functions with long path support.

This change modifies Hazel to name the library target "lib" and shorten
the binary target names to "bin" or just the Cabal exe component name.

This change had further reaching consequences, because the package name
in the generated version macros was derived from the library target
name. rules_haskell has been extended to allow to override that default
behaviour.

* data-default: Remove custom build definitions

These had been introduced to resolve issues on Windows due to too long
target names. Hazel has meanwhile been patched to generate such shorter
target names by default, making the custom builds superfluous.

* Hazel: unshorten cbits name

This is a temporary workaround for otherwise clashing cbits library
names in the case of static only linking.
2019-05-07 17:45:23 +00:00
Andreas Herrmann
7cf02b8579 Hazel: ./configure in build step (#848)
* Hazel: configure in build step

* Hazel: patch network

* Hazel: unpatch old-time

* Hazel: Don't remove c2hs
2019-05-03 13:51:43 +00:00
Andreas Herrmann
3f3bd4b1bb Update rules_haskell (#828)
- Includes -optP response file patch
- Removes noise around version macros
2019-05-02 09:54:24 +00:00
Neil Mitchell
536b1ea87f Explicit export lists in the DAML-LF Haskell module (#813)
* Delete an entirely unused module

* Delete an entirely unused module

* Switch the compiler to use EUnit over mkEUnit

* Delete an unused module

* Whitespace only

* Clean up the API for World, don't expose the internals, better creation functions

* Clean up the type checker environment, don't expose the internals of Gamma, add a few helper functions

* Delete unused functions

* Explicit module export lists

* Fix the nub replacement hints

* Turn on the warning that we require module export lists

* Add an explicit export list
2019-05-02 10:12:31 +02:00
DavidM-D
8da835489f New diagnostics implementation (#737)
* Switch to haskell-lsp

* Fix build of data-default on Windows

* Use ghc environment files to avoid overflowing CLI length limits
2019-04-30 22:51:53 +02:00
Andreas Herrmann
3def0bd901 Update rules_haskell - now generates Haskell version macros (#769)
* Update rules_haskell: Generates version macros

- rules_haskell now generates a version macros header file that is
  passed on to preprocessors such as c2hs or hsc2hs.
- The haskell_import rule was also renamed to haskell_toolchain_library.

* Drop unix-compat patch

This was necessary to work around missing version macros.
2019-04-30 11:44:11 +00:00
Moritz Kiefer
c37df1a07a
Add a windows installer for the SDK (#738) 2019-04-29 10:16:11 +02:00
Moritz Kiefer
756b2c9e49
Switch to GHC 8.6.5 (#683)
This might improve our Windows build times a bit as the 8.6.4 bindist
was a messed up in various ways.
2019-04-25 17:22:38 +02:00
Moritz Kiefer
26d0dcfc8b
Fix packaging of ghc-pkg on Unix systems (#666)
This also changes --package-db to --global-package-db since ghc-pkg
will otherwise try to find a global package db itself.
2019-04-25 13:10:28 +02:00
Neil Mitchell
85c72f87d1 Move to using proto3-wire from upstream (#480)
* Move to using proto3-wire from upstream

* Move to upstream proto3-suite, with some custom patches in my fork

* Delete the BUILD.bazel for hte proto3 stuff, not used and the test was failing

* Delete the old proto3-wire and proto3-suite forks

* Delete proto3-wire

* Prettify BUILD.bazel files, sort the deps

* Remove some special cases from the license checker

* Delete unused Nix files from grpc-haskell

* Switch to upstream proto3-suite

* Make old-time work on Windows

* Formatting

* Patch rules_haskell to use a response file for -optP to avoid overflowing argument size limits on Windows

* Update 3rdparty/haskell/BUILD.old-time

Co-Authored-By: neil-da <35463327+neil-da@users.noreply.github.com>

* Update the comments in old-time

* Use the revised location of proto3-suite
2019-04-24 15:59:08 +00:00
Andreas Herrmann
fbade2e815 Build //daml-assistant:daml on Windows (#595)
* haskell: windows: always link system libraries

Modifies the patch to rules_haskell so that Windows system library are
not only applied to grpc, but to all targets on Windows.

* windows: test //daml-assistant:daml on CI
2019-04-18 10:37:03 +00:00
Moritz Kiefer
6c06dbd730 Support package_app on windows (#594)
* Support package_app on windows

* Fix formatting
2019-04-18 09:26:41 +00:00
Nicolas Mattia
f57c74d706 Build and run damlc on Windows (#568)
* Fix network build on Windows

Some files were not added to the build, which led missing symbols at
link time.

* Drop dll.a files from Windows GHC bindist

Those files greatly confuse GHC when linking statically.

* Add some Windows system libraries

These libraries are needed when linking GRPC.

* Statically link pthread on Windows

Otherwise the executables fail at runtime because they cannot find the
shared object.

* Build and run damlc on CI

* Try to fix package_db/* nullglob error

* Fix powershell command

* Cleanup package db rule

* Make formatting ugly again
2019-04-17 20:37:35 +00:00
Jussi Mäki
5233574d38 Add semantic test for the reference server (#424)
* Add semantic test for the reference server

Currently the semantic test is failing. Likely due to the
location annotation changes.

* Do not compare location annotations in isReplayedBy

The location annotations may not, and do not need to, match due to the
fact that the reconstructed update expression may not exactly match
the original one, and since the interpreter currently picks the closest
location annotation we cannot guarantee that they exactly match.

* scalafmt.

* buildifier.

* client_server_test: Increase timeout to 60s

Spawning a JVM-based server can easily take a long time on a very
loaded system (e.g. when running `bazel test //ledger/...` with enough
parallelism), so better have a high default timeout.

* ledger/api-server-damlonx: Address code review

* Fix client_server_test runner compilation. Bump timeout.

* Mark the reference server semantic test exclusive

* fmt reference/BUILD.bazel
2019-04-17 10:35:47 +02:00
Andreas Herrmann
4b0b8493ca
Build grpc-haskell on Windows (#532)
* Inline c2hs expansion.

* Patch unix-compat for Windows

unix-compat fails on Windows due to missing version macros in hsc files.
This patches unix-compat inlining the effect of the corresponding
version macro evaluation.

* Add grpc-haskell to Windows CI

* Fix formatting

* Move unix-compat.patch

Moved to bazel_tools, where all other Bazel patches reside.

* Remove .chi files

Those don't need to be checked in.

* Add FIXME on checked in c2hs files.
2019-04-16 15:36:27 +02:00
Nicolas Mattia
d722595e6a
Drop patches that were upstreamed to rules_haskell (#507)
* Remove long gone patch

The "shorten-source-dirs" patch was removed some time ago but was still
referenced in bazel_tools.

* Drop upstreamed rules_haskell patches

Some patches have been upstreamed to rules_haskell.

* Build haskell-ide-core on CI

* Apply buildifier

* Update rules_haskell

The latest version uses stackage's mirror of Hackage.
2019-04-16 11:37:07 +02:00
moritzkiefer-da
ec46b8cec5 Add codegen to integration tests (#494) 2019-04-15 17:53:05 +02: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
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
Jussi Mäki
e73ad8b957
Add client_server_test bazel rule (#365)
* Add client_server_test bazel rule

This adds a generic mechanism for constructing a test that launches
a TCP server and runs a test-suite against it. The rule orchestrates
passing the port number from the server to the client via a temporary
file and takes care of killing the server when the client process exits.

Still to be done is figuring out a good way to pass additional arguments
to the server and client programs (where these arguments could be other
bazel rules).

* Add missing copyright headers

* Add support for arguments to client_server_test

Note that this does not support passing in labels (":my_data_file"),
nor does it support "$(location :my_data_file)" string macros.

* Add data attribute to client_server_test

* Add support for location expansion in client_server_test args

* client_server_test: Address code review

* client_server_test: Bump waiting for port file write to 5s
2019-04-11 17:31:54 +02:00
moritzkiefer-da
fa4067ad1b
Move POM file generation to Bazel rules (#374)
* Move POM file generation to Bazel rules
2019-04-11 11:24:52 +02:00
Gaël Deest
f564fc3e90
Building c2hs (#355)
* Getting c2hs to build

* Build c2hs on CI

* Update 3rdparty/haskell/BUILD.c2hs

Co-Authored-By: gdeest-da <42969625+gdeest-da@users.noreply.github.com>

* Highlight changes in c2hs-package.bzl
2019-04-10 15:12:08 +02:00
Andreas Herrmann
c55273f622
Build grpc fat_cc_library on Windows (#352)
* fat_cc_library Windows support

* Add fat_cc_library to Windows CI

* Add dynamic library to error message

Addressing review comment https://github.com/digital-asset/daml/pull/352#discussion_r273905183
2019-04-10 14:42:27 +02:00
Jussi Mäki
1a4e6b8a7e
Add support for scala source jars (#332)
This adds an implicit "<target>_src" to every
scala library target. It assumes the sources of the
library are under 'src/main/scala'.
2019-04-09 17:41:42 +02:00
Stefano Baghino
7467925aa1
Fetch status.proto from remote, simplify JS gRPC codegen (#285)
* Fetch status.proto from remote, simplify JS gRPC codegen

Fetch the `status.proto` file (part of the standard gRPC distribution)
from a distribution channel. _Moreover_, use the recently introduced
`proto_gen` rule to simplify how the gRPC code for the Node.js bindings
are generated (and remove the need to have `google/rpc/status.proto`
locally in the repository.

* Add plugin_runfiles option to proto_gen

This allows use to add additional files to the bazel sandbox so that
plugins can refer to them. This will subsequently be used by the
protoc-gen-doc plugin.

Also, pass the plugin options via --name_opt parameter.

* Add missing status.proto dependency /language-support/java and /ledger

* Build proto docs using the proto_gen rule

To make this work, I had to turn on the bazel build flag
`--protocopt=--include_source_info` because we cannot turn enable this
flag only for specific build rules.

* Make /ledger-api/grpc-definitions:docs public again

* Revert to the old style of passing plugin arguments to --name_out=options:path

* Suppress output of unzipping

* Fix link for google.rpc.Status in proto-docs
2019-04-09 10:30:01 +02:00
Gaël Deest
2572eca983
Build gRPC on Windows with GHC's internal Mingw toolchain (#284)
* Adding patch to get GRPC to build on Windows with GHC's MingW

* Build gRPC on Windows CI
2019-04-08 15:32:46 +02:00
Nicolas Mattia
e63fbce7fa Drop rules_haskell patch shortening source-dirs
We used to have a workaround for the command line length limit on
Windows, which exceeded when building ghc-lib. The ghc-lib package was
recently split into two smaller packages and this workaround is not
needed anymore.
2019-04-05 12:42:29 +02:00
Nicolas Mattia
117f043698 Fix daml-lf-ast build on Windows (#237)
* Update rules_haskell

This updates to the latest rules_haskell, which fixes a few issues on
Windows. Most importantly it flags a few Windows libraries as "system"
libraries, preventing Hazel to fail because they are not provided
through Bazel.

* Fix the streaming-commons build on Windows

This modifies our custom streaming-commons BUILD file to make it work on
Windows. In particular it swaps some system libraries, passes the
`-DWINDOWS` flag and enables the build of an extra module.

* Clean up bazel_tools BUILD file

This wraps a very long line for legibility.

* Fix shared object issues on Windows

* This fixes rules_haskell to use the correct Windows path separator on Windows.
    GHC expects the LD_LIBRARY_PATH variable to be a list of semi-colon separated
    paths, as opposed to a list of colon separated paths:
    51fd357119/compiler/ghci/Linker.hs (L1646-L1650)

* This fixes the name of Haskell shared objects on Windows. By default
    Bazel's cc_library generates '.so' files, whereas GHC expects a `.dll`
    (or a few other extensions, non of which are `.so`):
    51fd357119/rts/linker/PEi386.c (L684)

* Build daml-lf-ast on Windows CI
2019-04-05 12:39:23 +02:00
Francesco Mazzoli
9c7357c7de update all references of old repo to new repo 2019-04-04 16:20:07 +02:00
Digital Asset GmbH
05e691f558 open-sourcing daml 2019-04-04 09:33:38 +01:00