mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
5d1d1db211
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 |
||
---|---|---|
.. | ||
aws | ||
base64 | ||
bats | ||
bazel | ||
bazel-deps | ||
bazel-project-view | ||
bc | ||
bq | ||
buck-out | ||
cabal2nix | ||
cc | ||
chromedriver | ||
circo | ||
convert | ||
coursier | ||
cram | ||
curl | ||
da-ghci | ||
da-ghcid | ||
da-install-git-hooks | ||
da-test-haskell-update-expected | ||
da-update-python-srcs | ||
da-virtualenv | ||
dad-add-source-dep.sh | ||
dade | ||
dade-assist | ||
dade-closure-size | ||
dade-collect-garbage | ||
dade-copyright-headers | ||
dade-env | ||
dade-freeze | ||
dade-help | ||
dade-init | ||
dade-list | ||
dade-list-broken-symlinks | ||
dade-pipenv-lock | ||
dade-preload | ||
dade-prepare-for-update | ||
dade-release-tool | ||
dade-test-sh | ||
daml-sdk-head | ||
data-uri | ||
dependency-check | ||
docker-credential-gcr | ||
dot | ||
envsubst | ||
fdp | ||
flake8 | ||
fsc | ||
gawk | ||
gcloud | ||
ghci | ||
ghcid | ||
ghcide | ||
gpg | ||
grep | ||
grpcurl | ||
gsutil | ||
hlint | ||
hub-detect | ||
ibazel | ||
ipython | ||
jar | ||
java | ||
javac | ||
jfrog | ||
jinfo | ||
jmap | ||
jo | ||
jq | ||
jstack | ||
license-checker | ||
live-server | ||
m4 | ||
make | ||
mvn | ||
nix-prefetch-git | ||
nix-update-src-json | ||
node | ||
node2nix | ||
npm | ||
openssl | ||
osht | ||
pandoc | ||
patch | ||
patchelf | ||
pex | ||
pip3 | ||
pip3.6 | ||
pipenv | ||
protoc | ||
pypi2nix | ||
python | ||
python3 | ||
python3.6 | ||
README.md | ||
runpipenv | ||
sass | ||
sbt | ||
scala | ||
scalac | ||
scaladoc | ||
scalafmt | ||
scalap | ||
semver | ||
sha1sum | ||
shellcheck | ||
sphinx-autobuild | ||
sphinx-build | ||
sphinx-quickstart | ||
terraform | ||
thrift | ||
tlc2 | ||
tred | ||
unflatten | ||
wget | ||
xmlstarlet | ||
xxd | ||
yapf | ||
yarn | ||
zinc | ||
zip |
dade-preload
This tool will force nix to build every derivation in the dev-env.
Wrapped tools
Once the dev-env is set up (either through direnv (recommended), or through
manually sourcing one of dev-env/profile_{z,ba}sh.sh
), the shell's PATH
will look through dev-env/bin
first for its executables. The executables in
there are mostly scripts that redirect the call to the corresponding nix-built
executable. However, having that script gives us an opportunity to wrap some
of those commands in special ways; this section is meant to document in what
ways the commands available in dev-env/bin
have been modified from their
vanilla variants.