Commit Graph

227 Commits

Author SHA1 Message Date
Paul Brauner
0d5c249edc
fix dade-check-main-only-files instructions (#18242) 2024-01-26 09:23:20 +01:00
Gary Verhaegen
179d85362d
update copyright (#18167)
* update copyright

* undo hack from #18168

* update hash in platform-independence-pre-check
2024-01-15 20:27:42 +01:00
Gary Verhaegen
ee94820b4c
small fix to precommit (#18126) 2024-01-10 14:38:23 +00:00
Raphael Speyer
51bf3da977
precommit: add check for modified files under packages with main-only targets. (#17993)
Since https://github.com/digital-asset/daml/pull/17989

A simple heuristic to remind you to consider adding `run-all-tests: true` to your commit message if making changes in corners of the codebase most likely affected.
2023-12-08 18:35:54 +11:00
Gary Verhaegen
c6e439b862
clean-up docs & fix BlackDuck (hopefully) (#17975) 2023-12-05 16:20:44 +01:00
dylant-da
845b486e56
Add test-daml-version-and-install script, fix more updating issues (#17599)
* Add test-daml-version-and-install script, fix more updating issues

* Test `daml install`, improve checks for snapshots.txt

run-full-compat: true

* bring diff into scope for test-daml-version-and-install.sh

* Use runfiles to locate daml in test-daml-version-and-install.sh

* Bound versions.is_at_least("2.7.5") for test-daml-version-and-install.sh

run-full-compat: true

* Add logged diffing to diagnose issue

run-full-compat: true

* Add diff to data of test-daml-version-and-install.sh

run-full-compat: true

* Fix `daml install` call breaking - cache should still be refreshed

* Address minor issues: Daml 10.x.y matching, quoting, wrong comment

run-full-compat: true

* Drop printing

* Improve logging for test-daml-version-and-install.sh

* Fix undercased variable name DAML_CACHE, rerun CI

run-full-compat: true

* disable on windows

run-full-compat: true
2023-10-24 11:48:11 +00:00
Moisés Ackerman
17fc365e67
Update vcredist on Windows (#17436) 2023-09-19 12:13:34 +00:00
Gary Verhaegen
ce3fcf1d8c
update curl on Windows (#17416)
Old version is not available anymore.

Also revert the latest canton bump as the canton artifacts have changed.

Co-authored-by: Remy Haemmerle <Remy.Haemmerle@daml.com>
2023-09-18 14:49:35 +02:00
Moisés Ackerman
6ae0e0111e
Upgrade to Bazel 5 (again) (#17319)
* Update to rules_haskell v0.16
* Update comments re bazel patches
* clean up bazel overrides
* Upgrade to Bazel 5.2.0
* Remove '--distinct_host_configuration=false'
* Update buildifier to 6.3.2
* Suffix macos and ubuntu caches with yyyymm
* bump windows cache to v14
* [REVERTME] bump linux/macos/darwin timeout to 4h
2023-09-01 15:15:36 +02:00
Stefano Baghino
d999a21ac3
Replace cd .. && pwd with readlink -f (#17152)
The output of `cd` might be altered by `CDPATH` set on a
system, leading to `dade` being broken because it cannot
read the current path. Instead, using `readlink -f` seem
to get the job done without side effects.
2023-07-19 12:54:33 +00:00
Gary Verhaegen
7cd661aa4c
dev-env/windows: pin 7zip (#17003)
* dev-env/windows: pin 7zip

* check local manifest is used

* rename manifest

* move to gcloud
2023-06-16 10:23:31 +00:00
Gary Verhaegen
ef441d5439
dev-env/windows: pin nsis (#17002)
I've seen a handful of failures of the form:

```
>> Installing 'nsis-3.04' ...
<< Unknown state:
Installing 'nsis-3.04' (3.04) [64bit]
The request was aborted: Could not create SSL/TLS secure channel.
URL https://downloads.sourceforge.net/project/nsis/NSIS%203/3.04/nsis-3.04.zip is not valid

<< Unknown state:
Installing 'nsis-3.04' (3.04) [64bit]
The request was aborted: Could not create SSL/TLS secure channel.
URL https://downloads.sourceforge.net/project/nsis/NSIS%203/3.04/nsis-3.04.zip is not valid
At D:\a\3\s\dev-env\windows\libexec\core.ps1:159 char:13
+             throw $msg
+             ~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (<< Unknown stat...s not valid
:String) [], RuntimeException
    + FullyQualifiedErrorId : << Unknown state:
Installing 'nsis-3.04' (3.04) [64bit]
The request was aborted: Could not create SSL/TLS secure channel.
URL https://downloads.sourceforge.net/project/nsis/NSIS%203/3.04/nsis-3.04.zip is not valid
```

on CI recently. Hopefully this will fix it. As usual, you can check that
the file is the same because the hash has not changed.
2023-06-16 10:06:11 +00:00
dylant-da
224a6b1747
Add tool for compiling ghcide from a local copy (#16860)
* Add tool for compiling ghcide from a local copy

* Allow custom output path, so different repos can use different files
2023-05-16 15:56:20 +00:00
Gary Verhaegen
99821e0b66
infra: add a Windows node on Azure (#16705) 2023-04-20 08:32:25 -04:00
Gary Verhaegen
151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00
Claudio Bley
ca1453ee8c
Add pre-commit config and install hook in dev-env (#15637)
* Add `pre-commit` tool to dev-env

* Add pre-commit configuration

Fixes #15522

* Install pre-commit hooks inside the nix shell

* Limit buildifier hook to files to be comitted

The `:buildifier-fix` tool always runs on all Bazel files (by calling `find`),
which is not useful when using pre-commit.

* Install pre-commit hook only when `DADE_NO_PRE_COMMIT` is unset

Since direnv does not execute the shellHook, install in `.envrc` too.
2022-12-07 13:09:50 +00:00
Gary Verhaegen
e8e9f5dc36
fix gsg on node 18 (#15373)
CHANGELOG_BEGIN
CHANGELOG_END
2022-11-28 11:52:47 +01:00
Gary Verhaegen
5f126897e5
dev-env: pin msys2/mingw (#15311)
* dev-env: pin msys2/mingw

Today the postgresql 12.4 artifacts were purged from the msys2 primary
mirrors. I was able to find a copy on some old mirrors (I downloaded
from [mirrors.piconets.webwerks.in], [mirrors.aliyun.com], and
[mirror.iscas.ac.cn]), but that raised the question of where to put the
binary so our CI nodes can access it. I decided to put it on one of our
GCS buckets, and while I was there I did the whole msys2 set of
packages.

Does this manually may not be the best path forward for a long-term
solution (though maybe it is; they tend not to change all that often),
but it does unblock us right now.

For the postgresql binary specifically, I have checked that the three
mirrors give me the exact same file between them, and that it matches
the old hash. For the other files, I downloaded them from the primary
mirror ([repo.msys2.org]) and checked that the hashes match the recorded
values in our JSON manifest.

CHANGELOG_BEGIN
CHANGELOG_END

[mirrors.piconets.webwerks.in]: https://mirrors.piconets.webwerks.in/msys2-mirror/mingw/x86_64/mingw-w64-x86_64-postgresql-12.4-1-any.pkg.tar.zst
[mirrors.aliyun.com]: https://mirrors.aliyun.com/msys2/mingw/x86_64/mingw-w64-x86_64-postgresql-12.4-1-any.pkg.tar.zst?spm=a2c6h.25603864.0.0.32b23240Qp8jCL
[mirror.iscas.ac.cn]: https://mirror.iscas.ac.cn/msys2/mingw/x86_64/mingw-w64-x86_64-postgresql-12.4-1-any.pkg.tar.zst
[repo.msys2.org]: https://repo.msys2.org/mingw/x86_64/
2022-10-21 14:14:30 +02:00
Gary Verhaegen
659d48d53a
dev-env: remove dotfiles (#14732)
At this point it's mostly a Vim syntax plugin for the pre-open-source,
pre-GHC version of Daml, as the "last udpated in 2015" comment attests.

For setting up Vim for Daml code editing, see this [forum thread].

CHANGELOG_BEGIN
CHANGELOG_END

[forum thread]: https://discuss.daml.com/t/daml-on-vim/465
2022-08-17 14:32:58 +02:00
Claudio Bley
6f31303a66
Fix CI build on windows (#14279)
Prior to this change the installation of msys2 would fail because packages fail
to validate their signature:

```
:: File /var/cache/pacman/pkg/perl-HTTP-Cookies-6.10-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP s
ignature)).
Do you want to delete it? [Y/n]
error: perl-Net-SSLeay: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
:: File /var/cache/pacman/pkg/perl-Net-SSLeay-1.90-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP
signature)).
Do you want to delete it? [Y/n]
error: failed to commit transaction (invalid or corrupted package)
```

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2022-06-28 00:03:33 +02:00
dylant-da
2edd4c00f4
Add --ghc-repo-override flag to override GHC used in daml-sdk-head build (#14238)
* Add --ghc-repo-override flag to override GHC used in daml-sdk-head build

CHANGELOG_BEGIN
CHANGELOG_END

* Add BAZEL_MODE_FLAGS to third `bazel build` call
2022-06-21 14:26:34 +01:00
Gary Verhaegen
64f83228bd
dev-env: remove (broken) ipython symlink (#14208)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-16 19:14:17 +02:00
Andreas Herrmann
18a9c93549
Bazelify ghc-lib (#12508)
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Claudio Bley <claudio.bley@digitalasset.com>
2022-05-19 10:49:16 +02:00
Gary Verhaegen
e9dc1efe2b
ci: bump Windows vmImage to 2022 (#12557)
Azure is telling us to stop using 2019, so I've updated the job to be
compatible with 2022. (And future Windows images, too.)

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-12 15:02:43 +00:00
Victor Peter Rouven Müller
544c6fd33e
Change dir to the repo root folder when trying to start the Haskell Language Server (#13867)
changelog_begin
changelog_end
2022-05-12 10:21:13 +00:00
Moisés Ackerman
ad123f9b22
Add da-hls helper (#13853)
* Add haskell-language-server executable

* Add da-hls alias

* strip prefixes in da_haskell_libraries

* Remove dev-env-provided ghcide

* Update mentions of 'ghcide' to 'hls'

changelog_begin
changelog_end
2022-05-12 10:53:10 +02:00
Stefano Baghino
0a92bd7431
Fix binary for Coursier (#13310)
The binary should be called `cs`, the full `coursier` name causes the following error

```
/path/to/digital-asset/daml/dev-env/bin/../lib/dade-common: line 143: /nix/store/hsbnxsgqhaxavqdwmqyvcdp3ng22gvaf-coursier-2.0.16/bin/coursier: No such file or directory
```

changelog_begin
changelog_end
2022-03-16 15:30:07 +01:00
Gary Verhaegen
dfa648f585
hunt down DAML better (#13195)
Process:

- `git ls-files -z | xargs -0 -n 100 sed -i --follow-symlinks 's/DAML/Daml/g'`
- `git add -p`
- `git restore -p`
- Check there is no unstaged change left.

To review:

- Check for false positives by carefully reviewing the diff in this PR.
- Check for false negatives with `git grep DAML`.
- Quicker check for fals positives:

```
git grep DAML | grep -v migration | grep -v DAML_
```

Fixes #13190

Note: This is the "second half" of #13191, which failed to cover all the
remaining DAMLs because of:

```
$ git ls-files | grep "'"
compiler/damlc/tests/daml-test-files/MangledScenario'.daml
```

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-08 17:04:58 +01:00
Moritz Kiefer
e40f62f88a
Revert "Switch to Bazel 5 (#12935)" (#12974)
This reverts commit 4c0118df4d.

This breaks passing -p to bazel test for Haskell tests, e.g.,

bazel test //compiler/damlc/tests:integration-v1dev --test_arg -p
--test_arg InterfaceEq

which breaks with something horrifying like

moritz@adjunction ~/daml (main)> bazel test //compiler/damlc/tests:integration-v1dev --test_arg -p --test_arg InterfaceEq
[dev-env] Building tools.bazel...
[dev-env] Built tools.bazel in /nix/store/m7gzlmr0pqjpl01ihgvazxgfs3sfwl61-bazel and linked to /home/moritz/daml/dev-env/var/gc-roots/bazel
[dev-env] Building tools.find...
[dev-env] Built tools.find in /nix/store/645v3545lcbx77wq7355rgdrgbhn5wx7-findutils-4.8.0 and linked to /home/moritz/daml/dev-env/var/gc-roots/find
INFO: Invocation ID: 034b3e45-851f-472e-ab71-b7f718829582
DEBUG: /home/moritz/.cache/bazel/_bazel_moritz/bb4e4404f889dc1b816f246b08c0d9ea/external/rules_haskell/haskell/private/versions.bzl:60:10: WARNING: bazel version is too recent. Supported versions range from 4.0.0 to 4.2.1, but found: 5.0.0- (@non-git)
/nix/store/dadkhf8vch2i2kvig962ilfr5j3chshr-go-1.17.6
/nix/store/pzh24n543i6jqa01hdmgqknlyf294bn1-bazel-nixpkgs-posix-toolchain
/nix/store/2hfwndk47wpvaib06qyhcdp83b423xvh-jq-1.6-bin
/nix/store/hjggs9s82qh7r5j8sgapn389hf24wdx8-bazel-nixpkgs-cc-toolchain
/nix/store/yxgg3bn4v288sc00kf09svrwz2r461c9-ghc-native-bignum-9.0.2
/nix/store/2hwx0jhcdsx3wfvmb50ih19jkh2ra4jh-glibc-locales-2.33-108
/nix/store/8wpmx049z8m0ffhy3jyi41qb6pbxwvy8-bazel-nixpkgs-java-runtime
ERROR: file 'external/bazel_tools/src/tools/launcher/_objs/launcher/dummy.pic.o' is generated by these conflicting actions:
Label: @bazel_tools//src/tools/launcher:launcher
RuleClass: cc_binary rule
Configuration: 869f6bbd14d2ac66dcacb164312d88fa059b017e3c17513cb5051b23879ac7f9, 8c138cc79f95329f01b0d325511ad0ea89ca5126e421e67e5239706d0f247c2c
Mnemonic: CppCompile
Action key: 3d79fe1470dcb842d5944c98dfe7a62715db6d86fdb12d3ff60af3bdf41b7996
Progress message: Compiling src/tools/launcher/dummy.cc
PrimaryInput: File:[/home/moritz/.cache/bazel/_bazel_moritz/bb4e4404f889dc1b816f246b08c0d9ea/external/bazel_tools[source]]src/tools/launcher/dummy.cc
PrimaryOutput: File:[[<execution_root>]bazel-out/k8-opt/bin]external/bazel_tools/src/tools/launcher/_objs/launcher/dummy.pic.o
Owner information: ConfiguredTargetKey{label=@bazel_tools//src/tools/launcher:launcher, config=BuildConfigurationValue.Key[869f6bbd14d2ac66dcacb164312d88fa059b017e3c17513cb5051b23879ac7f9]}, ConfiguredTargetKey{label=@bazel_tools//src/tools/launcher:launcher, config=BuildConfigurationValue.Key[8c138cc79f95329f01b0d325511ad0ea89ca5126e421e67e5239706d0f247c2c]}
MandatoryInputs: are equal
Outputs: are equal
ERROR: file 'external/bazel_tools/src/tools/launcher/_objs/launcher/dummy.o' is generated by these conflicting actions:
Label: @bazel_tools//src/tools/launcher:launcher
RuleClass: cc_binary rule
Configuration: 869f6bbd14d2ac66dcacb164312d88fa059b017e3c17513cb5051b23879ac7f9, 8c138cc79f95329f01b0d325511ad0ea89ca5126e421e67e5239706d0f247c2c
Mnemonic: CppCompile
Action key: 9f46e824944add9e9951ef51ddb6cb4b744bc97f90b5749132179d1d1699dfa1
Progress message: Compiling src/tools/launcher/dummy.cc
PrimaryInput: File:[/home/moritz/.cache/bazel/_bazel_moritz/bb4e4404f889dc1b816f246b08c0d9ea/external/bazel_tools[source]]src/tools/launcher/dummy.cc
PrimaryOutput: File:[[<execution_root>]bazel-out/k8-opt/bin]external/bazel_tools/src/tools/launcher/_objs/launcher/dummy.o
Owner information: ConfiguredTargetKey{label=@bazel_tools//src/tools/launcher:launcher, config=BuildConfigurationValue.Key[869f6bbd14d2ac66dcacb164312d88fa059b017e3c17513cb5051b23879ac7f9]}, ConfiguredTargetKey{label=@bazel_tools//src/tools/launcher:launcher, config=BuildConfigurationValue.Key[8c138cc79f95329f01b0d325511ad0ea89ca5126e421e67e5239706d0f247c2c]}
MandatoryInputs: are equal
Outputs: are equal
ERROR: com.google.devtools.build.lib.skyframe.ArtifactConflictFinder$ConflictException: com.google.devtools.build.lib.actions.MutableActionGraph$ActionConflictException: for external/bazel_tools/src/tools/launcher/_objs/launcher/dummy.o, previous action: action 'Compiling src/tools/launcher/dummy.cc', attempted action: action 'Compiling src/tools/launcher/dummy.cc'

changelog_begin
changelog_end
2022-02-16 18:24:00 +00:00
Moritz Kiefer
4c0118df4d
Switch to Bazel 5 (#12935)
* Switch to Bazel 5

changelog_begin
changelog_end

* .

* .

changelog_begin
changelog_end
2022-02-16 10:47:05 +00:00
Samir Talwar
8540ba8f6a
daml-sdk-head: Fix help text so it doesn't refer to an unbound var. (#12944)
CHANGELOG_BEGIN
CHANGELOG_END
2022-02-15 11:49:42 +00:00
Gary Verhaegen
1b3ae53249
remove license-checker symlink (#12946)
Actual code removed in #12909.

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-15 11:48:49 +00:00
Moritz Kiefer
9e1e42d27c
Drop dependency on hosted nodes (#12901)
This should hopefully get CI working again.

There are two changes in here:

1. We can no longer change our patched Bazel. I didn’t switch away
   from the current patched version for now (we upload it to gcp bucket
   so it still works fine even if we cannot build it) but if we upgrade,
   we need to go to an unpatched version for now.
2. We need to get `az` from dev-env. I tested the self service compat
   job stuff and it works fine with this but there is a chance other
   parts don’t.

changelog_begin
changelog_end
2022-02-14 02:49:38 +01:00
Moisés Ackerman
e4764cc426
Upgrade to GHC 9.0.2 (#12300)
changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2022-02-01 11:27:11 +01:00
Moritz Kiefer
159f38474e
Drop 7zip from Windows dev-env (#12590)
* Drop 7zip from Windows dev-env

The download has flaked a few times over the last few days and if we
don’t need it, there’s no point in worrying about it.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* Revert "."

This reverts commit 56c2d23ddf.
2022-01-26 08:46:03 +00:00
Moritz Kiefer
a150737d17
Upgrade msys2 (#12545)
* Upgrade msys2

We’ve seen some weird errors with outdated signatures and it seems
plausible that an upgrade may help.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-01-24 10:58:34 +00:00
Moritz Kiefer
96b8651863
Drop orphaned vim syntax files (#12502)
I didn’t even know alp existed and this is definitely not the right
repo for Scala vim syntax defs. I’ve kept the daml def for now at
least since it’s at least in the right repo even if unmaintained.

Also seems very unfair towards emacs users to only have vim files.

changelog_begin
changelog_end
2022-01-20 10:23:12 +00:00
Moritz Kiefer
93aa5abef3
Upgrade to NodeJS 14 (#12429)
NodeJS 12 is eol in April and there are already packages (e.g. vsce)
that dropped support. We probably should upgrade even further but for
now I’m going with the most conservative approach.

changelog_begin
changelog_end
2022-01-17 12:05:53 +01:00
Moritz Kiefer
37680be310
Add sha256sum to dev-env (#12328)
Not quite sure what changed but our macos builds are unhappy and this
fixes it in my tests.

changelog_begin
changelog_end
2022-01-10 17:45:33 +01:00
Moritz Kiefer
103327263a
Bump curl to version 7.81 on Windows (#12314)
7.78 404s now :(

changelog_begin
changelog_end
2022-01-10 10:00:49 +00:00
Samir Talwar
b93f473c1c
dev-env: Don't use the "extra-" prefix in nix.conf. (#12306)
It turns out this prefix is only supported as of Nix 2.4.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-07 11:19:40 +00:00
Samir Talwar
3b8a9e4432
Revert "devenv: Just require Nix v2.4 or newer." (#12299)
This reverts commit ed442fa8ae.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-06 18:02:21 +00:00
Samir Talwar
854b66ee2f
devenv: Use NIX_USER_CONF_FILES to set caches. (#12265)
* devenv: Factor out a function to get the Nix version.

* devenv: On newer versions of Nix, use `NIX_USER_CONF_FILES`.

This stacks, rather than overwrites.

* devenv: Append Nix caches, instead of overwriting them.

The "extra-" prefix tells Nix to append.

We also switch to non-deprecated configuration keys.

CHANGELOG_BEGIN
CHANGELOG_END

* devenv: Just require Nix v2.4 or newer.

* devenv: `NIX_USER_CONF_FILES` may not be set already.
2022-01-05 13:24:52 +01:00
Gary Verhaegen
c673d1fe56
add lf extension to copyright script (#12259)
As requested by @cocreature in #12249.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-04 16:49:01 +00:00
Gary Verhaegen
ea55ea2d14
Further copyright updates (#12249)
Somewhat error-prone, so please review carefully.

Reasons we need this:

- Some file types are not properly handled by the script.
- The only exclusion mechanism we currently have (`NO_AUTO_COPYRIGHT`)
  is overly coarse.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-04 16:32:17 +01:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
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
2022-01-03 16:36:51 +00:00
Moritz Kiefer
f847767e36
Avoid nix result-* symlinks on CI (#12220)
We really don’t want those anywhere and they currently trip up
blackduck which starts scanning our nix store.

changelog_begin
changelog_end
2021-12-21 07:59:02 -05:00
Andreas Herrmann
4ed9deda39
Remove xxd from dev-env (#11876)
The corresponding Nix attribute is missing
```
$ xxd
[dev-env] Building tools.xxd...
error: attribute 'xxd' in selection path 'tools.xxd' not found
[dev-env] Build of tools.xxd has failed!
```

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-11-25 11:01:04 +00:00
Moritz Kiefer
32e9c4b13a
Bump go rules (#11829)
* Bump go rules

Was debugging something else and this seemed simple enough to factor
it out.

changelog_begin
changelog_end

* Bump Bazel on Windows

changelog_begin
changelog_end

* bump bazel manifest

changelog_begin
changelog_end
2021-11-23 18:58:55 +00:00
Moritz Kiefer
350ad983ea
Bump Windows postgres (#11804)
The old URL returns a 404 now

changelog_begin
changelog_end
2021-11-22 10:38:54 +00:00