* Delete obsolete proto3-suite patch
My patch has been upstreamed so no need to keep it around in our repo.
* Upgrade proto3-wire
* Adapt to changes in proto3-suite
This makes sure that C dependencies like gRPC or zlib get compiled
with optimizations. I patched rules_haskell to use -O instead of -O2
since the latter slows down compilation while not making things
faster (according to my measurements).
* Bump stackage
This PR switches us over to the latest Stackage LTS 0.14.1 (we were on
0.13.x before, so this includes major bumps) and gets rid of some
obsolete overwrites.
* Go back to building grpc-haskell-core using c2hs
This should hopefully avoid issues like the CSize vs CULong issue we
had a while back and might fix some of the issues we have been seeing
on CI.
I’m marking the Haskell ledger bindings as non-flaky for now so we can
see if the issues reappear.
* Fix path
* Fix c2hs runfiles
* s/basedir/dirname/
* Fix varname
* Remove fixme \o/
* Mark hs ledger bindings flaky again
For now, this only works on Linux (that’s a GHC limitation as far as I
know) and you have to enable it by setting the GHC_DWARF env var to a
non-empty string.
* Upgrade haskell-lsp and lsp-test
There have been some fixes upstream that should hopefully mean that we
no longer need to mark the lsp-tests as flaky on Windows. I am having
trouble reproducing the flakiness locally, so let’s see what happens
on CI.
* Also bump stack.yaml
* 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
* DA.Bazel.Runfiles based on bazel-runfiles
* locateRunfilesMb -> locateRunfiles
* .exe extension on Windows
* Add docstring to locateRunfiles
* bazel-runfiles: Normalize on Windows
* replace ApiValue ADT with aliases to daml-lf/transaction Value ADT
* porting rest of navigator to LF Value ADT
* porting more of navigator to LF Value ADT
* last error, not first
* rename ApiValueImplicits file
* special conversion features for ImmArray and FrontStack
- just .to[ImmArray] or .to[FrontStack] any random collection
* finish porting most of navigator main code
* use numeric indices for record field name fallback when pretty-printing
* tuples are not serializable
* use numeric indices for label fallback in JSON verbose encoding
* make traverseEitherStrictly more likely to preserve the seq's class
* to shortcut for ImmArraySeq .to[ImmArraySeq]
* compiling, passing navigator backend tests
* test traverseEitherStrictly more, er, strictly
* pass scalacopts through to scaladoc
* deal with unused warning
* remove unneeded function
* simpler error reporting, more private functions in ApiCodecCompressed
* move slowApply to FrontStack, test it so it actually works
* remove unneeded toStrings; better error from impossible ValueTuple case
* scalafmt FrontStackSpec
* support alternative, label-free record JSON encoding
* fuse some list operations
- suggested by @stefanobaghino-da; thanks
* blue error message
Python's `os.symlink` may fail on Windows if the user has insufficient
permissions to create symbolic links. This was not noticed on CI, since
builds there are executed with administrator privileges.
This changes `dev_env_package` to only outsource the listing of
directory contents to Python, but then fall back to Bazel's own
`repository_ctx.symlink` for the creation of symbolic links (or copies
if necessary).
* Bazel: 0.24.0 -> 0.27.0
* Update rules_haskell for Bazel 0.27 compatibility
* Update bazel-deps and bazel-watcher
* Windows escape JVM flags
* load commands at top of .bzl file
Bazel 0.27 no longer allows load commands that are not at the beginning
of the file.
* Update Bazel rules
* subpackage boundary
* native is not defined in BUILD files
* yarn: @bazel/hide-bazel-files
Seems to be required since latest rules_nodejs version. Otherwise, yarn
fails with errors about existing BUILD or BUILD.bazel files.
* grpc-java plugin visibility
* Update fat_cc_library
* Nix Python3 toolchain
* Iteration over depset
* dev_env_package: Create symlinks one level deeper
To prevent symlinking the BUILD file as well. The nested BUILD file
confuses Bazel as of 0.27 and rules_nodejs cannot find the node
executable anymore.
* Update rules_nodejs
* Add managed_directories for node_modules
* hie-bios: Extract bazel-genfiles from bazel info
Bazel 0.27 changed the genfiles location which breaks the hie-core test
on macOS.
* update cc_wrapper to Bazel 0.27
* bazel info -> bazel info bazel-genfiles
* Fix typo in BUILD
Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Fix running the IDE on damlc
There were two issues:
1. Missing include paths.
2. Files where the module name does not match the file name.
I’ve fixed both and added a test that we can load the damlc Main.hs.
* 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
* windows: root build
* windows: fixed haskell bindings tests
* windows: disable client_server_test test
* windows: marking daml_test flaky due to #1907
* windows: removing da-hs-damlc-app run from build.ps1
* windows: disable hie-core alias of currently disabled target
* Fix CPP issue with default da-ghci
The default REPL target did not exclude the //nix targets that set the
CPP language extensions.
* da-ghci -e () requires explicit target
Running the tests via the ledger-api-test-tool results in a nasty
runtime exception. This check only fixes paths if it detects a bazel
environment.
Fixes#1841
* Update the hie-bios commit SHA
* Also update the SHA in our bazel WORKSPACE
* Update the hash too
* Tutorial for Emacs integration
* Update hie-bios patch
* Fixes#1204: Release bindings and codegens to Maven Central.
Upload the Java and Scala Bindings with the respective code
generator binaries to Sonatype Open Source Repository
Host for synchronization with Maven Central.
* Fixes#1600. Improve Bazel Scala source JAR generation.
Include sources from JAR files defined as 'sources' to a Bazel Scala
target. The improvement will allow inclusion of generated source targets
in sources JARs of dependencies.
* Use temporary directory in the dar_to_scala() rule.
Place the output of the Scala code generator in a temporary
directory instead of a directory at the 'primary' output path as Bazel
rules should never have directory dependencies.
Extra command line arguments to the client_server_test target are passed
to the ledger-api-test-tool instead of the arguments defined in the
bazel target.
For example:
`bazel run //ledger/sandbox:conformance-test-static-time --list` will
pass the --list parameter to the ledger-api-test-tool (to print all
available tests), instead of actually running the tests in static-time mode.
The Ledger API Test Tool takes the flag --all-tests to run all defaul
and optional tests
The tool also allows multiple occurrences of the --include and --exclude
flags.
Also removes StandaloneSemanticTestRunner.
Fixes#1371
* Update rules_haskell
- rules_haskell now handles the global package db within Bazel
https://github.com/tweag/rules_haskell/pull/859
- We no longer use the Nix provided c2hs. So, we drop it.
- Rename `ghcWithC2hs` to `ghcStatic` to clarify that that's where the
static linking patches are applied.
- Extend package-db patches to align Nix store paths with the new $out.
This works around a restriction in current rules_haskell, where
the paths in the package config files must have the same prefix as
the path to the package config files themselves.
- Don't exclude haskell libraries from extra-libraries entries.
* Drop redundant unix-compat override
This is a left-over from when the package was patched.
* Windows GHC bindist includes ffi header
* Drop unused language-c Nix override
* 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
* 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.
* 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
* 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.
* 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
* 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.
* 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
* 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
* 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
* 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
* 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.
* 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.
* 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.
* 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
* 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
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.
* 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