daml/dev-env
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
..
bin Update ghcide 0.1.0 --> 0.2.0 (#6745) 2020-07-16 16:30:09 +00:00
dotfiles replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
etc Update CI nix version (#4443) 2020-02-07 15:05:52 +00:00
git-hooks open-sourcing daml 2019-04-04 09:33:38 +01:00
lib remove dade-base-profile (#6743) 2020-07-16 11:17:42 +00:00
t open-sourcing daml 2019-04-04 09:33:38 +01:00
windows Update Bazel 2.1.0 --> 3.3.1 (#6761) 2020-07-23 09:46:04 +02:00
.gitignore open-sourcing daml 2019-04-04 09:33:38 +01:00
profile_bash.sh replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
profile_zsh.sh replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
README.md remove dade-base-profile (#6743) 2020-07-16 11:17:42 +00:00
VERSION open-sourcing daml 2019-04-04 09:33:38 +01:00

Dev-env

This folder contains the development dependencies of this project.

Development

Structure

  • dev-env/lib/dade-common is the script meant to be included into all wrappers for dev-env provided tools and other dev-env specific tools (e.g. dade-info)
  • dev-env/lib/dade-dump-profile is a script which outputs - in porcelain mode - all environmental variables necessary for dev-env to function in a given shell.

Debugging

Run your comment with DADE_DEBUG=1 as prefix, e.g.:

DADE_DEBUG=1 jq

Environmental variables

Dev-env uses a common set of variables across it, here are they listed to be documented in future.

Public interface:

These variables are either used for dev-env initialization or are exported by dev-env for external tools to consume.

  • DADE_REPO_ROOT - root of a working directory where dev-env currently is executing; mutable content; input and output.
  • DADE_VAR_DIR - points to a directory which is meant for storing persistent and mutable data; mutable content; if not set, can be derived from DADE_DEVENV_DIR; input and output.
  • DADE_DEVENV_DIR - directory named dev-env under $DADE_BASE_ROOT, assume to be immutable (not yet the case); has to be set before dade-dump-profile is executed; input and output.
  • DADE_DESIRED_NIX_VERSION - user can provide this variable in their profile to silence the warning (in future, disable automatic installation of) the supported Nix version.

Private:

These variables are set in some of the dev-env tools and scripts and are not guaranteed to be always present in the dev-env environment (e.g. not guaranteed to be set by dade-common).

  • DADE_BASE_ROOT - root of the dev-env package; the directory which contains dev-env and nix directories, assume its immutable.
  • DADE_BUILD_RESULT - after a dev-env provided tool is built this variable is exported to point to a nix store where the tool was built.
  • DADE_DEBUG - sets -x in shell environemnt where dev-env scripts are executed.
  • DADE_CURRENT_SCRIPT_DIR - current directory of the currently running/sourced script, corresponds to $BASH_SOURCE[0], assume its immutable.
  • DADE_CURRENT_COMMAND - the name of the current command executed by dade
  • DADE_GC_ROOTS - points to a directory named gc-roots under DADE_VAR_DIR which contains Nix garbage collection roots and hashes for each dev-env provided tool individually; always mutable.
  • DADE_LIB_DIR - points to a directory lib under DADE_DEVENV_DIR which contains libraries for dev-env usage, assume its immutable.
  • DADE_NIXPKGS - points to a GC root which is a symlink to a Nixpkgs snapshot used by dev-env, used only in dade-dump-profile.