* Add support for on-disk incremental builds in damlc build
* Normalise file paths of internal modules because Windows
* stop stealing my $s hlint
* Apparently jars are also called exe
* Address review comments
* Bump to proper ghcide revision
* Extend Priority type with Telemetry value
* Include Telemetry logging level in logger
* Log viewing of scenario results
* Update ghcide with telemetry logging level
* Update bazel-common to fix javadoc issues
Specifically, to fix the following error
```
ERROR: /home/aj/tweag.io/da/da-bazel-1.1/ledger-api/rs-grpc-bridge/BUILD.bazel:7:1: in javadoc_library rule //ledger-api/rs-grpc-bridge:rs-grpc-bridge_javadoc:
Traceback (most recent call last):
File "/home/aj/tweag.io/da/da-bazel-1.1/ledger-api/rs-grpc-bridge/BUILD.bazel", line 7
javadoc_library(name = 'rs-grpc-bridge_javadoc')
File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/com_github_google_bazel_common/tools/javadoc/javadoc.bzl", line 27, in _javadoc_library
dep.java.transitive_deps
object of type 'JavaSkylarkApiProvider' has no field 'transitive_deps'
```
* Define Maven deps using rules_jvm_external
* Pin artifacts
* Remove bazel-deps generated targets
* Remove bazel-deps
* Switch to rules_jvm_external targets
* update bazel documentation
* pom_file: There are no more bazel-deps targets
* BAZEL-JVM.md `maven_install` typo
* Upgrade ghc-libs
* Convert template instances as type synonyms to DAML-LF
* Look for TEMPLATE_INSTANCE suffix for daml docs
* Update desugaring documentation
* Sync to f65e69951032a4c2ab308fd3c3471cd833925abf
* In the DAML parse tree, ListComps are coming through as MonadComps
* Linting smoke tests for lists
* Punctuate test header for readability
* Use a consistant include dir for cwd
See https://github.com/digital-asset/ghcide/pull/114 for the actual
fix.
This PR just bumps ghcide and adds a regression test. I’ll change the
revision before merging, I just want to test CI for now.
fixes#2929
* Switch to proper ghcide revision
* writeIfacesAndHie no longer exists
* Add changelog entry
* Maybe I should try to compile code before committing but I don’t want to
* Fix ghcide exe
* Implement AnyTemplate in DAML
* Fix doctest path
* Shuffle around CPP
* Do not hide anything
* Hide it again
* Clean build
* Enable caching again
* debug windows crap
* more tests
* reinstantiate full tests
* Allow for importig generic templates qualified
Currently, there's a bug which breaks `template instance` declarations when
the module containing the generic template definition is imported qualified.
This PR fixes this problem.
* Update ghc-lib, allowing qualified import of generic templates
* Remove two redundant parenthesizations
* Add test and improve comments
* Improve comments, start on some more tests (more to come)
* Bind to the newest hlint; more tests.
* Fix bazel query deps(//...)
* Add rules_haskell cc_wrapper
Updates to latest rules_haskell master and adds the cc_wrapper PR as a
patch, see https://github.com/tweag/rules_haskell/pull/1039.
* Shorten include dirs in cc-wrapper
When using `haskell_cabal_library` GHC constructs unnecessarily long
include directories which can quickly overflow the maximum command-line
length. This patch avoids the issue by normalizing include paths.
* glob --> breadth_first_walk
We currently use a custom cabal file for ghc-lib that has libffi in
the extra-libraries section so Hazel adds the headers. Forcing GHC to
use the bundled libffi should hopefully remove the need for this hack
which simplifies things.
* Delete obsolete proto3-suite patch
My patch has been upstreamed so no need to keep it around in our repo.
* Upgrade proto3-wire
* Adapt to changes in proto3-suite
This switches the creation of the archive in `daml build` from
`zip-archive` to `zip`. This has a few advantages:
1. It gets rid of lazy IO for reading all the interface and source
files. This avoids the high usage of file handles in `daml build`.
2. It seems to be a slight improvement in max memory usage and runtime
and a giant improvement in allocations (but I think the latter
probably comes primarily from the fact that the locations are moved to
the bzip C library). The improvement in max memory usage is less than
I expected so probably there is still something off somewhere.
For now, I only switched over `createArchive`. Archive reading is
still done using `zip-archive`. We might want to switch that over in a
separate PR.
This makes sure that C dependencies like gRPC or zlib get compiled
with optimizations. I patched rules_haskell to use -O instead of -O2
since the latter slows down compilation while not making things
faster (according to my measurements).
* Bump stackage
This PR switches us over to the latest Stackage LTS 0.14.1 (we were on
0.13.x before, so this includes major bumps) and gets rid of some
obsolete overwrites.
* Extract template instance doc from newtype constructor doc
* Use new ghc-libs
* Remove type application which is not needed anymore
* Update daml-doc output with template instances
* Update hlint version
For now, this only works on Linux (that’s a GHC limitation as far as I
know) and you have to enable it by setting the GHC_DWARF env var to a
non-empty string.
* Upgrade ghc-libs supporting generic templates
* Update Proposal and ComposedKey tests to generic template syntax
* Temporarily patch daml-doc test output (will need to fix for template instances)
* Upgrade haskell-lsp and lsp-test
There have been some fixes upstream that should hopefully mean that we
no longer need to mark the lsp-tests as flaky on Windows. I am having
trouble reproducing the flakiness locally, so let’s see what happens
on CI.
* Also bump stack.yaml
* Update ghc-libs to use new template desugaring
* Replace old template typeclasses with generic-friendly ones
* New template desugaring doc
* Fix tests
* Fix damldoc tests regarding Archive choice
* Update visualisation code to not traverse master dictionary
* Additional class method stubs to template instance declaration for upgrades
* Increase stack limit for bond trading compilation test
* Update hlint version
* Upgrade ghc-lib
* Patch bazel_tools : hazel-include-paths patch, no-isystem patch.
* Provide "haskell_c2hs" for package name to cabal_haskell_package
* Package name haskell_c2hs => c2hs.
* Switch to less hacky patch for include dirs
fixes#2142
It turns out that typed-process has the behavior we want so rather
than rolling our own version of `withCreateProcess`, I just switched
to that.
* Bazel: 0.24.0 -> 0.27.0
* Update rules_haskell for Bazel 0.27 compatibility
* Update bazel-deps and bazel-watcher
* Windows escape JVM flags
* load commands at top of .bzl file
Bazel 0.27 no longer allows load commands that are not at the beginning
of the file.
* Update Bazel rules
* subpackage boundary
* native is not defined in BUILD files
* yarn: @bazel/hide-bazel-files
Seems to be required since latest rules_nodejs version. Otherwise, yarn
fails with errors about existing BUILD or BUILD.bazel files.
* grpc-java plugin visibility
* Update fat_cc_library
* Nix Python3 toolchain
* Iteration over depset
* dev_env_package: Create symlinks one level deeper
To prevent symlinking the BUILD file as well. The nested BUILD file
confuses Bazel as of 0.27 and rules_nodejs cannot find the node
executable anymore.
* Update rules_nodejs
* Add managed_directories for node_modules
* hie-bios: Extract bazel-genfiles from bazel info
Bazel 0.27 changed the genfiles location which breaks the hie-core test
on macOS.
* update cc_wrapper to Bazel 0.27
* bazel info -> bazel info bazel-genfiles
* Fix typo in BUILD
Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
The override of zip-archive was required at some point because the new
version added additional safety checks that blew up in our tests. The
codepaths affected by this are long gone so let’s just use whatever is
in stackage.
While I was touching packages anyway, I’ve also upgraded to the latest
snapshot in the LTS we are currently following.
* Update the hie-bios commit SHA
* Also update the SHA in our bazel WORKSPACE
* Update the hash too
* Tutorial for Emacs integration
* Update hie-bios patch
This implements step 1. from #1507 and also adds a test that uses an
insane percent-encoding to verify that we can handle that.
I also tested this in the IDE on Windows and Linux.
* Up-(actually down-)grade to ghc-lib-8.8.0.20190610
* A `#ifndef GHC_STABLE` removed. `ml_hie_file` must be set unconditionally
* Pass Opt_WriteHie in xFlagsSet
* Oops. Revert. This breaks Windows. Very confusing
* Disable test; track in issue https://github.com/digital-asset/daml/issues/1582
* Remove Opt_WriteHie flag (Causes test failures trying to write into a read-only filesystem in CI)
The custom methods changes to haskell-lsp have been merged upstream
and the Windows fixes to lsp-test have been merged as well. I’ll work
on upstreaming the custom methods patches to lsp-test next. After that
we should be in sync with upstream.
* Add an option to the IDE to disable the scenario service
This is useful for several reasons:
1. We currently have to disable all tests using the scenario service
on Windows since they are extremely flaky due to issues we haven’t
been able to solve so far. This allows us to run at least a subset of
tests on CI.
2. The LSP tests currently start a new instance of damlc for each
test (we might want to revisit this but it seems to be sufficiently
fast so far) and not starting the scenario service allows us to speed
things up a bit.
3. On large projects, this could be useful to avoid having the IDE use
up even more memory and speed things up a bit. However, this PR does
not yet expose this in a convenient way so there is more work to be
done (in separate PRs) to make that a viable option.
* Fix LSP tests on Windows
This needs more work but I’d like to get the initial boilerplate in
first. We will also have to make some changes to lsp-test and expand
it in various ways but those should hopefully be upstreamable.
* Upgrade to ghc-lib-0.20190531
* Listen up Wally, Remove redundant commented code!
* Argh! WhattamistakeAtomakeA!
* Whitespace to force Azure pipeline to reconsider ignoring this PR
* Repackage ghc-lib, update SHAs and push again
* Refer to a non-existent release as an experiment
* Put the release number back
* Fix build of haskell-ide-core-public
* Switch to using haskell-lsp for IO
I’ve tried to keep this as small as possible for review so this PR
does not attempt to remove a lot of the things that are now unused.
There is also still a compatibility layer in place to avoid changing
too many things at once.
I tested this in the IDE on Linux and Windows and diagnostics,
scenario results, hover, goto definition all seem to work as expected.
* Demo program for haskell-ide-core as a library
* Fix all warnings in the Demo file
* Build the IDE demo
* Give a better error message than undefined
* HLint
* Fix copyright header
* Sort the dependencies
* Improve the comment
* Bazel formatting
* Disable building on Windows until ghc-paths is fixed
* Bazel formatting
* Specify the main function
* Update rules_haskell
- rules_haskell now handles the global package db within Bazel
https://github.com/tweag/rules_haskell/pull/859
- We no longer use the Nix provided c2hs. So, we drop it.
- Rename `ghcWithC2hs` to `ghcStatic` to clarify that that's where the
static linking patches are applied.
- Extend package-db patches to align Nix store paths with the new $out.
This works around a restriction in current rules_haskell, where
the paths in the package config files must have the same prefix as
the path to the package config files themselves.
- Don't exclude haskell libraries from extra-libraries entries.
* Drop redundant unix-compat override
This is a left-over from when the package was patched.
* Windows GHC bindist includes ffi header
* Drop unused language-c Nix override
* Hazel: Shorten target names
Previously, Hazel would generate library and binary targets, that
repeated the package name in their target name. This easily lead to too
long paths on Windows, which could induce errors with code that did not
use API functions with long path support.
This change modifies Hazel to name the library target "lib" and shorten
the binary target names to "bin" or just the Cabal exe component name.
This change had further reaching consequences, because the package name
in the generated version macros was derived from the library target
name. rules_haskell has been extended to allow to override that default
behaviour.
* data-default: Remove custom build definitions
These had been introduced to resolve issues on Windows due to too long
target names. Hazel has meanwhile been patched to generate such shorter
target names by default, making the custom builds superfluous.
* Hazel: unshorten cbits name
This is a temporary workaround for otherwise clashing cbits library
names in the case of static only linking.
This reverts commit 3d8acde916.
For some reason that commit seems to have resulted in a lot of
"unexpected end of file" errors during cache downloads. I do not know
what is going on here or how to fix it so let’s revert it for now.
This PR copies the hack that I used for the other
data-default-instances-* packages to data-default-instances-dlist. The
exact conditions under which this seems to be required probably depend
on things like your username and the directory of your project which
is why this failed for Neil but not for me.
* Update rules_haskell: Generates version macros
- rules_haskell now generates a version macros header file that is
passed on to preprocessors such as c2hs or hsc2hs.
- The haskell_import rule was also renamed to haskell_toolchain_library.
* Drop unix-compat patch
This was necessary to work around missing version macros.
* Move to using proto3-wire from upstream
* Move to upstream proto3-suite, with some custom patches in my fork
* Delete the BUILD.bazel for hte proto3 stuff, not used and the test was failing
* Delete the old proto3-wire and proto3-suite forks
* Delete proto3-wire
* Prettify BUILD.bazel files, sort the deps
* Remove some special cases from the license checker
* Delete unused Nix files from grpc-haskell
* Switch to upstream proto3-suite
* Make old-time work on Windows
* Formatting
* Patch rules_haskell to use a response file for -optP to avoid overflowing argument size limits on Windows
* Update 3rdparty/haskell/BUILD.old-time
Co-Authored-By: neil-da <35463327+neil-da@users.noreply.github.com>
* Update the comments in old-time
* Use the revised location of proto3-suite
* daml-on-x: Drop StateInit and use AtomicReference
- Drop the StateInit update message and introduce "getLedgerInitialConditions".
- Switch to AtomicReference from SyncVar as this is non-blocking and hence safer to use from Akka.
* ledger/participant-state: Rename recordTimeEpoch to initialRecordTime
and use the time from timeProvider at the ledger object initialization
time as the initial record time.
* fmt
* Fix use of repo as external workspace. Fix compilation issue in IndexState.scala
* Refix the use of this repo as external bazel workspace
* Fix compilation after rebase
* refmt
* Inline c2hs expansion.
* Patch unix-compat for Windows
unix-compat fails on Windows due to missing version macros in hsc files.
This patches unix-compat inlining the effect of the corresponding
version macro evaluation.
* Add grpc-haskell to Windows CI
* Fix formatting
* Move unix-compat.patch
Moved to bazel_tools, where all other Bazel patches reside.
* Remove .chi files
Those don't need to be checked in.
* Add FIXME on checked in c2hs files.
* Remove long gone patch
The "shorten-source-dirs" patch was removed some time ago but was still
referenced in bazel_tools.
* Drop upstreamed rules_haskell patches
Some patches have been upstreamed to rules_haskell.
* Build haskell-ide-core on CI
* Apply buildifier
* Update rules_haskell
The latest version uses stackage's mirror of Hackage.
* language: new package command for damlc
The (internal) package-new command reads all information from the
daml.yaml file of a DAML project and also creates the .conf file for the
package database and packs it with the dar.
* Add buildifier targets.
The tool allows to check and format BUILD files in the repo.
To check if files are well formatted, run:
bazel run //:buildifier
To fix badly-formatted files run:
bazel run //:buildifier-fix
* Cleanup dade-copyright-headers formatting.
* Fix dade-copyright-headers on files with just the copyright.
* Run buildifier automatically on CI via 'fmt.sh'.
* Reformat all BUILD files with buildifier.
Excludes autogenerated Bazel files.
We used to have a workaround for the command line length limit on
Windows, which exceeded when building ghc-lib. The ghc-lib package was
recently split into two smaller packages and this workaround is not
needed anymore.