Commit Graph

117 Commits

Author SHA1 Message Date
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
4be01e4df6
Update ghcide 0.1.0 --> 0.2.0 (#6745)
* Update rules_haskell hie-bios support

* Decouple Haskell ghcide and DAML ghcide

Creates a separate `stack_snapshot` to pull in `ghcide` for the Haskell
IDE use case independent of the `ghcide` for DAML. This allows to update
these two `ghcide` instances independently. As DAML uses `ghcide` the
library updates can be involved if the API experienced breaking changes.
At the same time we may wish to update `ghcide` for Haskell earlier to
make use of new features and stay compatible with rules_haskell's ghcide
support.

* Fix Haddock warnings reported by ghcide

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-16 16:30:09 +00:00
Gary Verhaegen
277e652b55
remove dade-base-profile (#6743)
It does not seem to be used anymore, and has been deprecated since Jul
2018.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-16 11:17:42 +00:00
Andreas Herrmann
0c16823c1b
Upgrade rules_haskell and pin stack_snapshot (#6548)
* Update rules_haskell

* Pin stack_snapshot repositories

* Document stack_snapshot_json

CHANGELOG_BEGIN
CHANGELOG_END

* Don't pin stack_snapshot on Windows

The lock file is generated on Unix and includes unix specific
dependencies, e.g. `unix`. Most developers don't have easy access to a
Windows machine, so regenerating the lock file for Windows would be
inconvenient.

* upgrade stack 2.1.3 --> 2.3.1 on Windows

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-02 18:55:09 +02:00
Moritz Kiefer
a0a1f90087
Fix daml-sdk-head --damlc (#6540)
We don’t want to pass all flags as a single string. If we don’t have
any flags (which is the default) we end up passing an empty string
which breaks Bazel.

changelog_begin
changelog_end
2020-06-30 15:16:26 +02: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
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
2c1d4cb805
Fix nix installation (#6400)
Nix now requires -L, I’ve gone ahead and just normalized everything to
use -sfL which we were already using in one place.

changelog_begin
changelog_end
2020-06-18 10:34:08 +02:00
Samir Talwar
8ccbd00f0d
Document a more modern way of using IntelliJ with our Bazel project. (#6328)
* Document a more modern way of using IntelliJ with our Bazel project.

Specifically, avoid `bazel-project-view` in favor of excluding a few
slow/unnecessary directories.

CHANGELOG_BEGIN
CHANGELOG_END

* Add .bazel-cache to .bazelignore instead of .bazelproject.

* Bazel: Don't mention a particular version of IntelliJ; just link.

Trust the canonical source.
2020-06-15 15:06:31 +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
405f3ad6ee
Sort files when calculating CACHE_KEY (#6173)
* Sort files when calculating CACHE_KEY

The order returned by `find` is unspecified and seems to have changed
for whatever reason in some cases. This changed the cache key which is
obviously not intended. It looks like the one we currently have in our
scoop manifest is the one that we get by sorting. Reversing the sort
produces the one CI currently calculates.

changelog_begin
changelog_end

* update manifest to match CI output

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2020-05-31 22:02:13 +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
Moritz Kiefer
db8c091467
Upgrade 7zip (#6138)
changelog_begin
changelog_end
2020-05-28 10:49:07 +02:00
Gary Verhaegen
ef0c06a47e
add sed to dev-env (#6129)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 17:11:09 +00:00
Gary Verhaegen
b28b543fc6
add toxiproxy to Windows (for #6114) (#6119)
I have never used Scoop before and I'm not sure how to actually test
this, but I thought this might at least get a conversation going.

Plus, if my reading of the documentation of both toxiproxy and Scoop is
correct, this may even work as is.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 13:37:55 +02:00
Gary Verhaegen
9a02ef6ef4
remove unused scoop tests (#6118)
This PR removes a few scoop-related files that seem to have been there
primarily to help us discover how Scoop worked when we first started
using it. They have not been touched in a long time and as far as I can
tell have not been run in a long time either.

I'm a firm believer in the idea that dead code belongs to the git
history, and has no place in the current worktree.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-27 13:37:04 +02:00
anthonylusardi-da
0ee217cdae
ADD: Change most Slack references to forum references where appropriate (#6071)
* ADD: Change most Slack references to forum references where appropriate

CHANGELOG_BEGIN
Replace references to Slack with references to discuss.daml.com
CHANGELOG_END

* ADD: Change issue template support link from SO to forum

* ADD: Add back Slack links
2020-05-26 09:26:53 -04: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
Moritz Kiefer
d7632c5b20
Include Bazel patch to cache exclusive tests on Windows (#6009)
* Include Bazel patch to cache exclusive tests on Windows

This includes the patch that we already use on Linux and MacOS to fix
caching of things marked exclusive. I’ve kept in the debugging output
that I added in the last patch for now. While our workaround seems to
be working, I’d like to wait a bit longer in case the issue reappears.

changelog_begin
changelog_end

* Actually bump manifest

changelog_begin
changelog_end
2020-05-18 16:01:29 +00:00
Gary Verhaegen
5d1d1db211
fix daml-sdk-head for macOS (#6012)
Bash is not easy to add to dev-env because dev-env depends on Bash. This
has not been an issue so far because Bash behaves in very sensible ways
overall and is mostly backwards compatible.

A recent change to `daml-sdk-head` is, however, using some feature of
Bash 4 that is not evailable in Bash 3. Bash 3 is ancient so in an ideal
world that would not be an issue, but macOS still ships with Bash 3 for
some obscure (licensing) reason.

It turns our that the line

```bash
arr=()
```

in Bash 4 sets the variable `arr` to an empty array, whereas it leaves it
unset in Bash 3. This means that the later use of `arr`, in the case
where no further element has been added to the array, will yield an
error in combination with the `set -u` option we are using.

This PR changes the usage pattern from

```bash
"${arr[@]}"
```

which fails on Bash 3 to

```bash
${arr[@]:-}
```

which works as expected. Note that the quotes have been removed: the
quotes in this case are not useful assuming that the flags themselves
are never multiword. Without the quotes, this evaluates to `""` under
Bash 3 (as the variable is not set), which confuses Bazel because now it
thinks it's asked to build the `""` target, which it has no rule for.

Ignoring the quoting issue, the actual fix is to include `:-` inside the
`{}`, which instructs Bash to replace the variable with what follows the
`-` in case the variable is not set (in this case, an empty string), and
therefore not crash on this specific variable not being set despite the
`set -u` option.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-18 15:59:20 +02:00
Gary Verhaegen
bb44e07fbf
redirect users to public channels (#6011)
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-18 15:21:27 +02:00
Samir Talwar
f18beb9851
daml-sdk-head: Delete the SDK temporary directory after installation. (#5986)
I'm aggregating a lot of SDKs.

```
$ du -h -d1 $TMPDIR | sort -rh | head -5
1.9G    /var/folders/5x/36ws6_n96qz_b4tbpvfbcth80000gn/T/
501M    /var/folders/5x/36ws6_n96qz_b4tbpvfbcth80000gn/T/tmp.ahBTENEeZw
500M    /var/folders/5x/36ws6_n96qz_b4tbpvfbcth80000gn/T/tmp.S4sB7DIjkA
500M    /var/folders/5x/36ws6_n96qz_b4tbpvfbcth80000gn/T/tmp.Q3VeVV8DIU
405M    /var/folders/5x/36ws6_n96qz_b4tbpvfbcth80000gn/T/tmp.b5ZWnPhLkH
```

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-14 15:33:32 +00:00
Samir Talwar
76a7e6e18d
daml-sdk-head: Standardize the syntax of the script. (#5984)
* daml-sdk-head: Quote all variables.

And use arrays where necessary.

* daml-sdk-head: Use Bash tests (`[[` and `]]`) rather than `test`.

Most importantly, they support the `&&` and `||` operators, because
they're a shell builtin, not a program.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-sdk-head: Refer to `${BASH_SOURCE[0]}` explicitly.

`BASH_SOURCE` is an array. Expanding an array gets the first element, but this
is unclear. We can clarify by explicitly expanding the first element.

* daml-sdk-head: Use `command -v` instead of `which`, as it's more standard.

* daml-sdk-head: Use semicolons judiciously.
2020-05-14 15:06:00 +00:00
Samir Talwar
57a8d0b37e
CI: Run PostgreSQL once for all Scala tests. (#5919) 2020-05-14 09:06:34 +02:00
Moritz Kiefer
577cd653d9
Add debugging output to inclusion errors (#5961)
* Add debugging output to inclusion errors

This adds some more debugging output to inclusion errors in Bazel
which should hopefully help us track it down. These are the only call sites
in the Bazel source that can produce them. My suspicion is that it’s
coming from HeaderDiscovery but I’m not entirely sure what is off.

We’ll almost certainly have to add more output once we know which of
those 3 cases we hit but let’s do it step by step.

changelog_begin
changelog_end

* Bump url and hash

changelog_begin
changelog_end
2020-05-13 18:18:17 +02:00
Gary Verhaegen
bda565fa44
patching Bazel on Windows (infra bits, no patch yet) (#5918)
patch Bazel on Windows (ci setup)

We have a weird, intermittent bug on Windows where Bazel gets into a
broken state. To investigate, we need to patch Bazel to add more debug
output than present in the official distribution. This PR adds the basic
infrastructure we need to download the Bazel source code, apply a patch,
compile it, and make that binary available to the rest of the build.
This is for Windows only as we already have the ability to do similar
things on Linux and macOS through Nix.

This PR does not contain any intresting patch to Bazel, just the minimum
that we can check we are actually using the patched version.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-12 23:16:04 +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
Moritz Kiefer
246d246ee5
Reenable isScoopEnabled (#5661)
Our CI machines have been reset so there is no need to keep this hack
around to force scoop to be upgraded.

changelog_begin
changelog_end
2020-04-22 10:08:12 +02:00
Moritz Kiefer
590833608c
Fix Windows CI (#5648)
The python install step started failing because there is a new pip
release so we get a warning. I tried to just upgrade python but the
new python manifest depends on functions that need an upgrade of scoop
so I upgraded that as well. Not quite sure which of those upgrades
fixes the issue …

changelog_begin
changelog_end
2020-04-21 13:31:57 +00:00
Gerolf Seitz
329320bad9
Organize maven coordinates (#5272)
* Use com.daml as groupId for all artifacts

CHANGELOG_BEGIN
[SDK] Changed the groupId for Maven artifacts to ``com.daml``.
CHANGELOG_END

* Add 2 additional maven related checks to the release binary

1. Check that all maven upload artifacts use com.daml as the groupId
2. Check that all maven upload artifacts have a unique artifactId

* Address @cocreature's comments in https://github.com/digital-asset/daml/pull/5272#pullrequestreview-385026181
2020-04-01 11:41:18 +02: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
c004c90fcb
Remove skydoc (#5208)
Nobody uses it, it’s deprecated anyway.

changelog_begin
changelog_end
2020-03-26 11:14:34 +00:00
Moritz Kiefer
0471b26d70
Get openssl from msys2 (#5063)
* Get openssl from msys2

changelog_begin
changelog_end

* Try to fix opensl config location
2020-03-18 13:09:03 +01:00
Moritz Kiefer
42b4441159
Bump openssl (#5054)
* Bump openssl

The previous one has stopped working for some reason :sadpanda:

changelog_begin
changelog_end

* daml-assistant: Add `--wall-clock-time` to the Sandbox Next test.

Missed this due to doing two things at once.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-03-18 10:24:05 +01:00
Andreas Herrmann
559c78003e
Update rules_haskell (#4751)
* Update rules_haskell

The workaround for linking against `Cffi` in the REPL has been
upstreamed in a more generalized form.

CHANGELOG_BEGIN
CHANGELOG_END

* ghcide: Use rules_haskell's hie-bios support

* Document `ghcide` Bazel integration

* Rename files to match module names

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-13 16:49:34 +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
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
mergify[bot]
c6d9000369
Added --damlc option to daml-sdk-head (#4853)
changelog_begin
changelog_end
2020-03-05 16:38:56 +00:00
Gary Verhaegen
3410000fc7
change msys2 mirror (#4825)
The `repo.msys2.org` server is currently broken and has been for about 7
hours at least from what I can find out online. This PR changes to the
next mirror in the list that seems to work for me locally; list taken
from [the GitHub
repo](https://github.com/msys2/MSYS2-packages/blob/master/pacman-mirrors/mirrorlist.msys).

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-05 11:56:32 +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
Gary Verhaegen
5a117dc358
introduce new release process (#4513)
Context
=======

After multiple discussions about our current release schedule and
process, we've come to the conclusion that we need to be able to make a
distinction between technical snapshots and marketing releases. In other
words, we need to be able to create a bundle for early adopters to test
without making it an officially-supported version, and without
necessarily implying everyone should go through the trouble of
upgrading. The underlying goal is to have less frequent but more stable
"official" releases.

This PR is a proposal for a new release process designed under the
following constraints:

- Reuse as much as possible of the existing infrastructure, to minimize
  effort but also chances of disruptions.
- Have the ability to create "snapshot"/"nightly"/... releases that are
  not meant for general public consumption, but can still be used by savvy
  users without jumping through too many extra hoops (ideally just
  swapping in a slightly-weirder version string).
- Have the ability to promote an existing snapshot release to "official"
  release status, with as few changes as possible in-between, so we can be
  confident that the official release is what we tested as a prerelease.
- Have as much of the release pipeline shared between the two types of
  releases, to avoid discovering non-transient problems while trying to
  promote a snapshot to an official release.
- Triggerring a release should still be done through a PR, so we can
  keep the same approval process for SOC2 auditability.

The gist of this proposal is to replace the current `VERSION` file with
a `LATEST` file, which would have the following format:

```
ef5d32b7438e481de0235c5538aedab419682388 0.13.53-alpha.20200214.3025.ef5d32b7
```

This file would be maintained with a script to reduce manual labor in
producing the version string. Other than that, the process will be
largely the same, with releases triggered by changes to this `LATEST`
and the release notes files.

Version numbers
===============

Because one of the goals is to reduce the velocity of our published
version numbers, we need a different version scheme for our snapshot
releases. Fortunately, most version schemes have some support for that;
unfortunately, the SDK sits at the intersection of three different
version schemes that have made incompatible choices. Without going into
too much detail:

- Semantic versioning (which we chose as the version format for the SDK
  version number) allows for "prerelease" version numbers as well as
  "metadata"; an example of a complete version string would be
  `1.2.3-nightly.201+server12.43`. The "main" part of the version string
  always has to have 3 numbers separated by dots; the "prerelease"
  (after the `-` but before the `+`) and the "metadata" (after the `+`)
  parts are optional and, if present, must consist of one or more segments
  separated by dots, where a segment can be either a number or an
  alphanumeric string. In terms of ordering, metadata is irrelevant and
  any version with a prerelease string is before the corresponding "main"
  version string alone. Amongst prereleases, segments are compared in
  order with purely numeric ones compared as numbers and mixed ones
  compared lexicographically. So 1.2.3 is more recent than 1.2.3-1,
  which is itself less recent than 1.2.3-2.
- Maven version strings are any number of segments separated by a `.`, a
  `-`, or a transition between a number and a letter. Version strings
  are compared element-wise, with numeric segments being compared as
  numbers. Alphabetic segments are treated specially if they happen to be
  one of a handful of magic words (such as "alpha", "beta" or "snapshot"
  for example) which count as "qualifiers"; a version string with a
  qualifier is "before" its prefix (`1.2.3` is before `1.2.3-alpha.3`,
  which is the same as `1.2.3-alpha3` or `1.2.3-alpha-3`), and there is a
  special ordering amongst qualifiers. Other alphabetic segments are
  compared alphabetically and count as being "after" their prefix
  (`1.2.3-really-final-this-time` counts as being released after `1.2.3`).
- GHC package numbers are comprised of any number of numeric segments
  separated by `.`, plus an optional (though deprecated) alphanumeric
  "version tag" separated by a `-`. I could not find any official
  documentation on ordering for the version tag; numeric segments are
  compared as numbers.
- npm uses semantic versioning so that is covered already.

After much more investigation than I'd care to admit, I have come up
with the following compromise as the least-bad solution. First,
obviously, the version string for stable/marketing versions is going to
be "standard" semver, i.e. major.minor.patch, all numbers, which works,
and sorts as expected, for all three schemes. For snapshot releases, we
shall use the following (semver) format:

```
0.13.53-alpha.20200214.3025.ef5d32b7
```

where the components are, respectively:

- `0.13.53`: the expected version string of the next "stable" release.
- `alpha`: a marker that hopefully scares people enough.
- `20200214`: the date of the release commit, which _MUST_ be on
  master.
- `3025`: the number of commits in master up to the release commit
  (included). Because we have a linear, append-only master branch, this
  uniquely identifies the commit.
- `ef5d32b7ù : the first 8 characters of the release commit sha. This is
  not strictly speaking necessary, but makes it a lot more convenient to
  identify the commit.

The main downsides of this format are:

1. It is not a valid format for GHC packages. We do not publish GHC
  packages from the SDK (so far we have instead opted to release our
  Haskell code as separate packages entirely), so this should not be an
  issue. However, our SDK version currently leaks to `ghc-pkg` as the
  version string for the stdlib (and prim) packages. This PR addresses
  that by tweaking the compiler to remove the offending bits, so `ghc-pkg`
  would see the above version number as `0.13.53.20200214.3025`, which
  should be enough to uniquely identify it. Note that, as far as I could
  find out, this number would never be exposed to users.
2. It is rather long, which I think is good from a human perspective as
  it makes it more scary. However, I have been told that this may be
  long enough to cause issues on Windows by pushing us past the max path
  size limitation of that "OS". I suggest we try it and see what
  happens.

The upsides are:

- It clearly indicates it is an unstable release (`alpha`).
- It clearly indicates how old it is, by including the date.
- To humans, it is immediately obvious which version is "later" even if
  they have the same date, allowing us to release same-day patches if
  needed. (Note: that is, commits that were made on the same day; the
  release date itself is irrelevant here.)
- It contains the git sha so the commit built for that release is
  immediately obvious.
- It sorts correctly under all schemes (modulo the modification for
  GHC).

Alternatives I considered:

- Pander to GHC: 0.13.53-alpha-20200214-3025-ef5d32b7. This format would
  be accepted by all schemes, but will not sort as expected under semantic
  versioning (though Maven will be fine). I have no idea how it will sort
  under GHC.
- Not having any non-numeric component, e.g. `0.13.53.20200214.3025`.
  This is not valid semantic versioning and is therefore rejected by
  npm.
- Not having detailed info: just go with `0.13.53-snapshot`. This is
  what is generally done in the Java world, but we then lose track of what
  version is actually in use and I'm concerned about bug reports. This
  would also not let us publish to the main Maven repo (at least not more
  than once), as artifacts there are supposed to be immutable.
- No having a qualifier: `0.13.53-3025` would be acceptable to all three
  version formats. However, it would not clearly indicate to humans that
  it is not meant as a stable version, and would sort differently under
  semantic versioning (which counts it as a prerelease, i.e. before
  `0.13.53`) than under maven (which counts it as a patch, so after
  `0.13.53`).
- Just counting releases: `0.13.53-alpha.1`, where we just count the
  number of prereleases in-between `0.13.52` and the next. This is
  currently the fallback plan if Windows path length causes issues. It
  would be less convenient to map releases to commits, but it could still
  be done via querying the history of the `LATEST` file.

Release notes
=============

> Note: We have decided not to have release notes for snapshot releases.

Release notes are a bit tricky. Because we want the ability to make
snapshot releases, then later on promote them to stable releases, it
follows that we want to build commits from the past. However, if we
decide post-hoc that a commit is actually a good candidate for a
release, there is no way that commit can have the appropriate release
notes: it cannot know what version number it's getting, and, moreover,
we now track changes in commit messages. And I do not think anyone wants
to go back to the release notes file being a merge bottleneck.

But release notes need to be published to the releases blog upon
releasing a stable version, and the docs website needs to be updated and
include them.

The only sensible solution here is to pick up the release notes as of
the commit that triggers the release. As the docs cron runs
asynchronously, this means walking down the git history to find the
relevant commit.

> Note: We could probably do away with the asynchronicity at this point.
> It was originally included to cover for the possibility of a release
> failing. If we are releasing commits from the past after they have been
> tested, this should not be an issue anymore. If the docs generation were
> part of the synchronous release step, it would have direct access to the
> correct release notes without having to walk down the git history.
>
> However, I think it is more prudent to keep this change as a future step,
> after we're confident the new release scheme does indeed produce much more
> reliable "stable" releases.

New release process
===================

Just like releases are currently controlled mostly by detecting
changes to the `VERSION` file, the new process will be controlled by
detecting changes to the `LATEST` file. The format of that file will
include both the version string and the corresponding SHA.

Upon detecting a change to the `LATEST` file, CI will run the entire
release process, just like it does now with the VERSION file. The main
differences are:

1. Before running the release step, CI will checkout the commit
  specified in the LATEST file. This requires separating the release
  step from the build step, which in my opinion is cleaner anyway.
2. The `//:VERSION` Bazel target is replaced by a repository rule
  that gets the version to build from an environment variable, with a
  default of `0.0.0` to remain consistent with the current `daml-head`
  behaviour.

Some of the manual steps will need to be skipped for a snapshot release.
See amended `release/RELEASE.md` in this commit for details.

The main caveat of this approach is that the official release will be a
different binary from the corresponding snapshot. It will have been
built from the same source, but with a different version string. This is
somewhat mitigated by Bazel caching, meaning any build step that does
not depend on the version string should use the cache and produce
identical results. I do not think this can be avoided when our artifact
includes its own version number.

I must note, though, that while going through the changes required after
removing the `VERSION` file, I have been quite surprised at the sheer number of
things that actually depend on the SDK version number. I believe we should
look into reducing that over time.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-25 17:01:23 +01:00
Moritz Kiefer
c64919cd58
Support --help in daml trigger/daml script/daml script-test (#4534)
fixes #4529
fixes #4530
fixes #4531

changelog_begin
changelog_end
2020-02-17 09:09:01 +01:00
Andreas Herrmann
655e4b3b55
Update CI nix version (#4443)
* Update CI nix version

For `--option http2 false` to take effect requires Nix 2.3.2.

CHANGELOG_BEGIN
CHANGELOG_END

* Set option `http2 = false` dev-env nix config

This is less likely to overlook an instance than manually adding
`--option http2 false` to each Nix invocation.

Setting `--option htt2p false` also had no effect on the multi-user Nix
installation on the Linux CI machines due to
```
WARNING: option '--disk_cache' was expanded to from both option '--config linux' (source /nix/store/2xnfb2l39d2b4nxw5vwmqz5hjwhw0caw-daml-bazelrc) and option '--config linux' (source /nix/store/2xnfb2l39d2b4nxw5vwmqz5hjwhw0caw-daml-bazelrc)
```

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-02-07 15:05:52 +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
a9828565db
Disable http2 with Nix to work around segfaults (#4427)
* Disable http2 with Nix to work around segfaults

CHANGELOG_BEGIN
CHANGELOG_END

* Disable http2 in dev-env calls to nix-build as well

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-02-06 15:15:11 +00:00
Gary Verhaegen
47bd131f15
add copyright headers to yml files (#4407)
We seem to have forgotten about them in the copyright scripts.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-06 12:54:07 +01:00
Moritz Kiefer
60e32a98c4
Disable release step on macos (#4330)
Originally we ran the release step on both Linux and MacOS to handle
platform dependent artifacts, in particular, damlc.jar. However, we
don’t have any platform dependent artifacts that are uploaded as part
of the release script anymore and I hope we will never have to add any
in the future.

So this PR, removes the code for handling platform dependent artifacts
in the release step and disables the release step on MacOS (while
still setting the variables like we do on Windows).

Currently the release step still costs us ~2 minutes on MacOS which is
already our slowest platform so hopefully this will speed things up a
bit.

changelog_begin
changelog_end
2020-01-31 17:08:47 +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