I have to admit I still fdon’t fully understand why this sometimes
fails and sometimes doesn’t. It looks like some caching issue is
involved (e.g. currently builds in /d/a/2 succeed while builds in
/d/a/1 succed) but I’m not entirely sure that’s all.
This PR tries to address this in two ways:
1. Add the library when linking the Haskell bits instead of only on
the C library. I think this is required since we the final Haskell
binary is linked against the static cbits which does not carry a
reference to bcrypt but I’m not completely sure.
2. Rename the target to avoid interference with builds from before the
grpc upgrade. I suspect what is happening is that due to the lack of
sandboxing we sometimes end up picking up that library if it is in the
build tree from an older build instead of the new one.
changelog_begin
changelog_end
Apparently https://github.com/digital-asset/daml/pull/13066 resulted
in linker errors but only on clean builds (I think). I don’t fully
understand why. The requirement from bcrypt seems to come from the
grpc upgrade but reverting that still leaves undefined symbol errors
to DbgHelp. Don’t really care enough to track it down given that this
fixes it.
changelog_begin
changelog_end
We needed this before the upgrade to GHC 9.0 due to our use of
integer-simple. With GHC 9.0 and the corresponding switch from
integer-simple to ghc-bignum native this is no longer required.
changelog_begin
changelog_end
* upgrade scalapb/netty/grpc/protobuf in proven combination
CHANGELOG_BEGIN
Upgrade scalapb, netty, grpc, protobuf and guava versions
CHANGELOG_END
* bazel reformat
* match grpc version in deps.bzl
* upgrade akka
* keep grpc version to 1.43 that is used in latest nixpkgs-unstable
* rebase and regen
* update SHA for scalapb tarball
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Upgrade to Scala 2.13.8
changelog_begin
changelog_end
* Update hash for scala in nixpkgs
* update more hashes for scala upgrade
* Fix most warnings etc.
* Fix remaining errors etc.
* Fix formatting
* Resolve last errors hopefully
* Fix ledger api common build file
* Combine imports & revert accidental change that broke the CI run
* Rename exporting vals to scriptExport & minimize diff
* Remove more wrong changes
* moved warning around
* Move some daml-script compat tests to sandbox-on-x
The new sandbox doesn't accept LF < 1.14, so move those cases to
sandbox-on-x.
changelog_begin
changelog_end
* add comment
* buildifier
* Upgrade ghcide
Spun out from the GHC 9 upgrade to make it easier to review. All
credit goes to Moisés.
changelog_begin
changelog_end
* .
changelog_begin
changelog_end
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
withCreateProcess kills the server process but it doesn’t wait for it
to finish. The `typed-process` version does things properly here which
is also why we switched to it in other places.
changelog_begin
changelog_end
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.
[Here][1] is s a blog post by the Scala team about it.
Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.
Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.
changelog_begin
changelog_end
[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
Part of #11831. This kills another two uses of sandbox-kv.
Also fixes a daml-helper issue where we weren't passing "localhost" to the
ledger flags, so it was complaining about starting outside of a project.
changelog_begin
changelog_end
* Add timeouts to polling funcs in daml start.
This PR adds timeouts to some polling functions used in daml start and
the assistant integration tests, and also early exits based on a process
exit status. E.g. waitForHttpServer will make sure some process is
still running, instead of waiting to timeout.
The effect of this is that now whenever there is some error in a
subprocess, daml start and the integration tests will finish early
instead of running forever (or timing out in bazel).
changelog_begin
changelog_end
* missing a readPortFile instance
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.
I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.
CHANGELOG_BEGIN
CHANGELOG_END
* Update rules_haskell
changelog_begin
changelog_end
* Use mostly deterministic distdir path
changelog_begin
changelog_end
Use a path for distdir in the `haskell_cabal_*` rules that is based on
the package name and deterministic unless there is a collision with an
already existing file or directory.
The distdir path enters flags that are passed to GHC and thereby enters
the 'flag hash' field of the generated interface files. If the distdir
path is indeterministic, then the interface file will also be
indeterministic.
* Pin com_google_protobuf to 3.17.3
The latest version of rules_haskell pins protoc to 3.19.1. However, this
generates code that also requires a more recent version of the Java
proto libraries. This change pins the protoc version at the same version
as the protobuf-java library, see https://github.com/protocolbuffers/protobuf/issues/9236.
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* 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>
* Drop LF < 1.14 from supported damlc output versions
fixes#11319
We keep test coverage by depending on the most recent snapshot which
still has 1.14 support.
changelog_begin
- [Daml Compiler] Damlc can only produce Daml-LF 1.14 or
newer. Passing aynthing older to `--target` is an error. If you
need to produce older versions, use an older SDK.
changelog_end
* Switch around legacy_compiler_lf_versions
changelog_begin
changelog_end
* drop since-lf
changelog_begin
changelog_end
* Drop Scala 2.12 support
This only includes the CI/build system infrastructure
changes. Dropping compatibility layers from our code for 2.12 can be
done separately.
This is fine even in the context of backport builds since we already
disable the Scala 2.12 job for those anyway.
fixes#11315
changelog_begin
changelog_end
* Update bazel-java-deps.bzl
Co-authored-by: pbatko-da <pawel.batko@digitalasset.com>
Co-authored-by: pbatko-da <pawel.batko@digitalasset.com>
* Update rules_scala
Two patches have since been upstreamed and can be removed.
changelog_begin
changelog_end
* JMH deps were moved into a toolchain
https://github.com/bazelbuild/rules_scala/pull/1106
changelog_begin
changelog_end
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
We need to make some changes to have any chance of ARM support working
and I’d rather make those on top of the latest version.
Also deletes an unused patch.
changelog_begin
changelog_end
* Fix rules_scala Windows launcher
* Define nixpkgs_java_configure
To generate a java_runtime based on a Nix provided JDK similar to how it
is done with the Python and CC toolchain.
changelog_begin
changelog_end
* Enable Nix provided Java runtime on Linux and MacOS
* Define dadew_java_configure
To import a JDK and JAVA_HOME from dadew similar to
nixpkgs_java_configure.
* Enable dadew Java runtime on Windows
* Remove now unused java_home_runtime
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
If we build the dependency lists in the `_create_scala_repl` function,
we don't add the correct `scalac` options; specifically, we don't add
the Silencer option to ignore unused imports from
`scala.collection .compat`.
By passing directly to `_wrap_rule`, we compute the `scalac` options
correctly.
CHANGELOG_BEGIN
CHANGELOG_END
We need _wrap_rule to make sure plugins like wartremover are also
correctly applied here.
We need jline because otherwise the repl starts but then fails because
jline isn’t in scope.
changelog_begin
changelog_end
* Use nix-provided gRPC on Unix-like OSs
This fixes the da-ghcid command on macOS and Linux.
Unfortunately on macos at least on CI it still seems to segfault when
trying to run damlc in ghci. However, at least typechecking works
so this is clearly progress.
changelog_begin
changelog_end
Adding support for accepting server's private key as an encrypted file (since storing unencrypted private key in a file system might be a risk).
Encrypted private key is assumed to be encrypted using AES or similar algorithm. The details necessary to decrypt it are be obtained from a secrets server over HTTP as JSON document. The URL to secret's server is supplied through the new `--secrets-url` CLI parameter.
One can supply private in either plaintext (old behavior) or ciphertext: if a private key's file ends with .enc suffix it is assumed to be ciphertext. Otherwise it is assumed to be plain text.
CHANGELOG_BEGIN
- [DPP-418] [Participant] Add support for supplying server's private key as an encrypted file and then decrypting it with the help of a secrets server.
CHANGELOG_END
* Generate short to long name mapping in aspect
Maps shortened test names in da_scala_test_suite on Windows to their
long name on Linux and MacOS.
Names are shortened on Windows to avoid exceeding MAX_PATH.
* Script to generate scala test name mapping
* Generate scala-test-suite-name-map.json on Windows
changelog_begin
changelog_end
* Generate UTF-8 with Unix line endings
Otherwise the file will be formatted using UTF-16 with CRLF line
endings, which confuses `jq` on Linux.
* Apply Scala test name remapping before ES upload
* Pipe bazel output into intermediate file
Bazel writes the output of --experimental_show_artifacts to stderr
instead of stdout. In Powershell this means that these outputs are not
plain strings, but instead error objects. Simply redirecting these to
stdout and piping them into further processing will lead to
indeterministically missing items or indeterministically introduced
additional newlines which may break paths.
To work around this we extract the error message from error objects,
introduce appropriate newlines, and write the output to a temporary file
before further processing.
This solution is taken and adapted from
https://stackoverflow.com/a/48671797/841562
* Add copyright header
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* Use `extra` in the port file runner, rather than `temporary`.
* ledger-api-test-tool-on-canton: Use the port check runner.
Much simpler than the port file runner for our purposes.
* Replace `runner` with `runner_with_port_file`.
Rather than expecting a particular set of command-line-arguments, we use
templating.
CHANGELOG_BEGIN
CHANGELOG_END
* Rename the `runner_with_port_check` target to the default.
* Use the port file and dynamic port generation in client/server tests.
This creates a runner named `runner_with_port_file` which knows how to
interpolate two variables, `%PORT_FILE%` and `%PORT%`. This allows us to
use the `port-file` argument to the kvutils runner rather than
hard-coding a port for conformance tests.
For now, we only use this for generating the kvutils reference ledger
export.
CHANGELOG_BEGIN
CHANGELOG_END
* Simplify the runner_with_port_file considerably.
It doesn't need to check if the port is open; we trust that the process
will do it.
This also makes sure the port file will be cleaned up, and reduces the
number of dependencies by making use of more functions in `extra`.
* Simplify port file generation in the new client-server runner.
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Simplify the runner_with_port_file further.
This doesn't need to work if the server doesn't take a port file.
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Update rules_haskell & rules_nixpkgs
changelog_begin
changelog_end
* remove unused patch
* Remove the strict-source-names patch
This patch was largely motivated by issues with directory outputs on
Windows occasionally producing empty outputs that would poison the
remote cache. However, we have continued seeing this type of issue
despite this patch and have since resorted to a regular fixup job that
cleans such empty items out of the cache.
With that the strongest motivation with this change is no longer valid
and it doesn't seem worth it to maintain it any longer.
changelog_begin
changelog_end
* Remove windows-remove-fake-libs patch
This patch was upstreamed.
* Update windows-extra-libraries patch
The GHC bindist patch is no longer required as it applied to GHC version
8.10.3 but we are using 8.10.4 instead.
* Remove cc-wrapper-windows patch
This was upstreamed.
* Remove protobuf-source patch
This was upstreamed
* Keep patches in sync between daml and compatibility
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>