Commit Graph

41 Commits

Author SHA1 Message Date
Martin Huschenbett
44db5de726
Damlc ITs fix pretty range (#7707)
The new version of `ghcide` fixes a bug in the pretty printer for
diagnostics. So far, the column number for an error/warning you would
be shown by `daml build` was always be one smaller than in DAML
Studio. Now, we show the same locations across the command line tools
and the IDE.

We also bring our test files in sync with the ranges the command line
tools print now.

CHANGELOG_BEGIN
[DAML Compiler] Show the correct column numbers in error locations
produced by command line tools like `daml build`.
CHANGELOG_END
2020-10-16 09:06:37 +02:00
Martin Huschenbett
ac4fef2d44
Bump the version of ghcide we use (#7694)
* Bump the version of ghcide we use

The new version gives access to the `ParsedModule` instead of only the
`ParsedSource` in the preprocessor. See
https://github.com/digital-asset/daml-ghcide/pull/3
for details.

We also need to fix a few things in `bazel-haskell-deps.bzl` to reflect
that we use our fork of `ghcide`, which lives in
`digital-asset/daml-ghcide`, instead of the old
`digital-asset/ghcide`, which we handed ove to the community, now.

CHANGELOG_BEGIN
CHANGELOG_END

* Update to use fixed ghcide version

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-15 15:11:15 +00:00
Andreas Herrmann
86bdf7b6ec
stack_snapshot_json on Windows (#7468)
* stack_snapshot_json on Windows

CHANGELOG_BEGIN
CHANGELOG_END

* document ad-hoc machines

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-09-24 12:03:15 +00:00
Moritz Kiefer
15bf131fed
Enable assertions in Haskell builds (#6853)
GHC hates its users and defaults to optimizing out assertions. We
fixed that in Buck at some point but clearly that got lost when
migrating to Bazel.

Turns out enabling assertions catches bugs. This insight was brought to
you from the people that also brought you “Turns out writing tests
catches bugs”.

fixes #5624

changelog_begin
changelog_end
2020-07-24 14:29:25 +00: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
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
Andreas Herrmann
0544323dfc
upgrade rules_haskell (#6284)
* upgrade rules_haskell

CHANGELOG_BEGIN
CHANGELOG_END

* Use autogenerated stack_snapshot tools

* ghcide import-dirs flags

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-06-10 17:21:31 +02:00
Gert-Jan Bottu
2af134ca69
WIP: Draft version constraint generation (#5472)
First version of static verification tool.

The current state of the tool: 
- Reads DAR files.
- Partially evaluates the code.
- Generates constraints for the field and choice to be verified.
- Passes the constraints to an SMT solver.
- Some basic tests.
2020-05-20 08:08:18 +02:00
Moritz Kiefer
3787a23948
Refactor damlc visualize tests (#5761)
This moves the code from the Shake testing module to a separate
module. This is required since the Shake test setup is not really
intended to test multiple packages. I’ve added a new test suite that
makes use of this and has an expected failure for the issue with
multiple packages. The issue is not actually fixed in this PR, I just
wanted to keep the refactoring separate since it is quite large and
noisy.

changelog_begin
changelog_end
2020-04-28 19:29:14 +02:00
Moritz Kiefer
db37e4c497
Patch zip library to not use temp files (#5621)
This should hopefully fix the issues we have been seeing on CI. While
I’m not super keen on including non-upstreamable patches it seems
better than having CI be flaky.

changelog_begin
changelog_end
2020-04-20 08:35:11 +00:00
Rohan Jacob-Rao
37ca4af529
create-daml-app: Add end-to-end tests to integration tests (#5540)
This PR gets yarn test running the Puppeteer end-to-end tests in the GSG integration test.

The first step of the test is adding the extra dependencies (Jest, Puppeteer and more). The GSG recommends a yarn add command, but this does not work against HEAD. This is because yarn add does not use resolutions in the parent package.json, and then complains about unknown versions 0.0.0 of the daml TS libaries. The solution here is to hack in the extra dependencies into the ui/package.json and then yarn install. This works, but it hard codes version numbers which we would need to maintain. I would like to be able to say version "latest", which is what yarn add would install.

The next step of the test is to copy the index.test.ts file and run yarn test in CI mode.

I've moved the GSG test to a new create-daml-app-tests target. It's marked "exclusive" in Bazel until we figure out how to avoid hardcoding port numbers. This is a bit tricky since the HTTP port is hardcoded in a couple of places in ui/package.json.

Finally, this PR gets the GSG testing docs to reference the code in the new templates/create-daml-app-test-resources folder.

changelog_begin
changelog_end
2020-04-17 12:42:24 -04:00
Moritz Kiefer
6af5b97273
Split up repl tests to make them faster (#5450)
* Split up repl tests to make them faster

This PR splits up the tests into the tests for TLS and Auth and the
tests for the actual functionality.

The func tests use the repl as a library which allows them to be
significantly faster:

1. We only need to start the service process once.
2. We only need to initialize the package db once.

There is at least one other point that I did not address for now and
that is only loading the packages into the repl service once. While
loading them multiple times is a noop, it still has a performance
implication.

Sadly, this has turned out much more messy than I thought it would be
due to various issues with haskeline/repline/tasty/computers. The
details are in a comment in DA.Test.Repl.FuncTests.

changelog_begin
changelog_end

* Try to nuke cache on window selectively

* Enable cache again
2020-04-07 10:22:15 +02:00
Andreas Herrmann
2d1e22fe33
Support import in DAML REPL (#5386)
* REPL parse import statements

* Factor parsing out of handleLine

* Pull binding and error handling into handleStmt

This is specific to the case of handling a statemt and does not overlap
with handling imports.

* Track module imports as ImportDecl

* Add new module imports

* Validate module imports

* Add REPL interaction test for import

* REPL document import declarations

CHANGELOG_BEGIN
- [DAML REPL - Experimental] You can now use import declarations at the
  REPL prompt to bring additional modules into scope.
CHANGELOG_END

* ReplState strict fields

* Use semigroupoids Alt to simplify parseReplInput

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-04-03 10:43:04 +00:00
Andreas Herrmann
90c94b0076
Use repline for DAML REPL (#5337)
* Use repline for DAML REPL

CHANGELOG_BEGIN
CHANGELOG_END

* REPL server print error messages

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-04-01 13:13:46 +00: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
aa48f3026e
Bump ghcide (#5128)
This PR bumps ghcide, haskell-lsp and haskell-lsp-types. There aren’t
really any important changes in ghcide itself but the haskell-lsp
update includes my fix for crashing completions.

One change in ghcide itself is that NormalizedFilePath got moved to
haskell-lsp. ghcide needs special treatment for empty file paths so we
use `toNormalizedFilePath'` from ghcide instead of
`toNormalizedFilePath` from `haskell-lsp`. I’ve added an hlint rule to
enforce this.

changelog_begin
changelog_end
2020-03-23 12:09:36 +00:00
Moritz Kiefer
be7f0802c6
Bump ghcide (#5103)
This includes some completion improvements.

changelog_begin
changelog_end
2020-03-20 16:43:59 +00:00
Moritz Kiefer
18033271de
Remove bzip2 library (#5105)
This used to be a dependency of our zip library that you couldn’t
disable. However, in the meantime it has gotten a flag to disable
it and we don’t actually use it. Given that the upstream URL is dead
atm now seems like a good time to kill it.

changelog_begin
changelog_end
2020-03-20 15:05:33 +01:00
Moritz Kiefer
668373ca85
Embed shake data-files via TH (#4584)
This is a bit ugly but after spending some time digging into the
issues in rules_haskell around data-files, this seems like the most
sensible option especially given that we also want to ship them in the
SDK which woud require additional work even if we do fix it in
rules_haskell.

fixes #4457

changelog_begin
changelog_end
2020-02-18 17:53:27 +01:00
Moritz Kiefer
943b43066f
Switch to HashSet/HashMap for NormalizedUri/NormalizedFilePath (#4468)
* Switch to HashSet/HashMap for NormalizedUri/NormalizedFilePath

This matches the change to ghcide in
https://github.com/digital-asset/ghcide/pull/420. Now that we have
optimized Hashable instances it makes sense to use them as much as
possible.

changelog_begin
changelog_end

* debug windows crap

* Fix a bug in vr scenario notifications

* Revert "debug windows crap"

This reverts commit f58fdb92c1.

* attempt to fix windows

who are we kidding, this is not going to work
2020-02-11 15:02:11 +00:00
Moritz Kiefer
023c532399
Disable debouncer in the CLI compiler (#4438)
This should hopefully fix the lost diagnostics in our packaging tests.

changelog_begin
changelog_end
2020-02-06 21:13:52 +00:00
Moritz Kiefer
959da4cdbb
Upgrade to haskell-lsp 0.20 (#4397)
* Upgrade to haskell-lsp 0.20

This includes another ghcide bump but the only change there is the
haskell-lsp ugprade. haskell-lsp 0.20 includes some performance
improvements.

changelog_begin
changelog_end

* Bump parser-combinators
2020-02-05 11:27:44 +01:00
Moritz Kiefer
52d4f60aec
Switch to ghcide 0.1.0 (#4381)
* Switch to ghcide 0.1.0

changelog_begin
changelog_end

* Bump hie-bios
2020-02-04 18:40:43 +01:00
Andreas Herrmann
b91ed9e93f
Update rules_haskell (#4280)
* Update rules_haskell

* Includes Bazel 2.0.0 support
* Some patches have been upstreamed

CHANGELOG_BEGIN
CHANGELOG_END

* External haskell_cabal_binary|library verbose = False

`haskell_cabal_binary|library` now supports setting `verbose = False`
which also avoids warnings coming from `Setup.hs`. As these are external
dependencies we are not going to address these warnings anyway. So, they
are just noise. This makes it unnecessary to pass `-w` or `-optF=-w`.

In case of build failure all errors and warnings will be displayed.

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-02-04 11:35:20 +01:00
Moritz Kiefer
93d7b1a472 Bump ghcide to fix GHC panics in LSP tests (#4176)
fixes #4152

changelog_begin
changelog_end
2020-01-24 08:40:57 +00:00
Shayne Fletcher
674eaffc70
Depend on ghc-lib-parser-ex (for hlint) (#4109)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-22 06:25:51 -05:00
Gary Verhaegen
760f9d4d37
docs cron: follow github pagination links (#4115)
The GitHub API is paginated (30 items by default). This creates two
problems:

1. At the moment, older versions silently drop from the docs website,
  without us having made any explicit decision about it.
2. When we prepare a new version, it gets created as a pre-release
  version. Our script filters that out, but that happens on our end so
  we end up with 29 published versions and the list is different form the
  existing one. If the prerelease then gets dropped, the oldest version
  comes back.

It is possible that we will sometime decide we do not want to keep old
documentation around forever, but that should be an explicit decision.
This patch changes the logic to fetch the list of versions from GitHub
so that we always get all the published versions (barring race
conditions inherent to that kind of paginated API).

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-20 18:47:47 +01:00
Moritz Kiefer
9ece831966
Make DAR generation deterministic (#4104)
This fixes the ZIP modification times in all DARs to a specific
value (1980-01-01) whereas they used the current time before. This
both gives us the nice property that not only our DALF builds but also
DAR builds should be deterministic (and there is a test for this). I
have a suspicion that this could help significantly with build times
and avoid rerunning half of the Scala tests on a change to damlc that
should not change the DALFs.

changelog_begin

- [DAML Compiler] The modification times in a DAR are now fixed to a
  given value which makes the output of ``daml build`` deterministic
  in single-threaded mode (which is the default).

changelog_end
2020-01-20 11:00:10 +01:00
Moritz Kiefer
74d12ce39a Bump ghcide to include bugfix (#4074)
* Bump ghcide to include bugfix

This includes a fix for a bug in completions which we introduced in
the latest ghcide bump which in turn broke the DAML IDE completely.

changelog_begin

- [DAML Studio] Fix a bug in completions that caused DAML Studio to
stop responding after the first completion was requested.

changelog_end

* Use ghcide from master branch and simplify test
2020-01-16 18:38:58 +00:00
Moritz Kiefer
b42216a2fa Bump ghcide (#4013)
* Bump ghcide

changelog_begin
changelog_end

* Fix ghcide target

* fix the fix
2020-01-10 19:06:42 +00:00
Gary Verhaegen
386250102b
remove MissingH (#3948)
I noticed all uses of this library had been removed by #3943, but the
library itself wasn't.
2020-01-06 14:36:14 +01:00
Andreas Herrmann
91f5dd573f stack update (#3935)
* Remove manual stack update

* Update rules_haskell

* rules_haskell_worker_dependencies after bazel-haskell-deps

* Update rules_haskell Windows patch

* make cabal haddock optional

* Don't generate Haddocks on stack_snapshot

Fails with ghc-lib and takes more time to build.

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-06 10:24:15 +00:00
Moritz Kiefer
42c586f8d4
Bump ghcide (#3943)
* Bump ghcide

* Fix ghcide build

* Include bugfix for Windows
2020-01-04 07:51:51 +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
Moritz Kiefer
c65f918145
Bump ghcide (#3865)
* Bump ghcide

* Fix goto definition tests

* Fix hie-bios config

* Try to fix windows
2019-12-17 10:21:52 +01:00
Moritz Kiefer
d675156e2c
Bump ghcide to fix flakiness in LSP tests (#3813)
fixes #3821

see https://github.com/digital-asset/ghcide/pull/235 for the actual
fix, I’ll change the commit before merging.
2019-12-12 17:11:35 +01:00
Moritz Kiefer
6716947931 Bump ghcide (#3800) 2019-12-10 13:05:20 +00:00
Moritz Kiefer
f0a111ca1a
Get grpc from nix on unix (#3632)
* Get grpc from nix on unix

The one from Bazel seems to cause linking issues when trying to run
things in GHCi. I’ve spent some time trying to use rules_foreign_cc to
build gRPC using CMake but decided that for my own sanity it’s better
to not pursue that further.

* Address review comments

* Add missing module load

* Cleanup GHCI_SCRIPT

* use the correct file ending on macos

* Import is_linux

* Switch back to grpc-1.23

The newer version seems to cause issues in combination with the java libraries.

* Try to fix package_app on macos

* more debugging

* Maybe this is not necessary, we will never know

* linkers are the worst

* Remove debugging output again

* readd rpaths

* treat libdispatch specially

* remove hack

* more fooling around

* lalala
2019-11-26 18:47:39 +01:00
Andreas Herrmann
16b6f1b4cb Hide warnings of external Haskell packages (#3593) 2019-11-22 18:27:33 +00:00
Andreas Herrmann
f1f41b6e3e Windows: Take stack from dadew (#3596)
rules_haskell looks for stack in PATH. On Windows it is provided by
dadew (i.e. scoop). rules_haskell then symlinks (copies on Windows) the
stack binary. Unfortunately, this breaks with scoop as the shim file is
then not found.
2019-11-22 17:27:42 +00:00
Andreas Herrmann
f4d0eb636e Replace Hazel by stack_snapshot (#2743)
* Unmangled libz.so and libbz2.so

* Use stack_snapshot instead of Hazel

* Remove Hazel

* Define stack_snapshot

* Update rules_haskell

* Document stack_snapshot

* Clean stack's lock file from aborted builds
2019-11-22 14:24:08 +00:00