Commit Graph

569 Commits

Author SHA1 Message Date
A. F. Mota
5c8e1e0ef2
Make daml-sdk-head work alongside daml installation. (#997)
* Make daml-sdk-head work alongside daml installation.

* Delete any exsting legacy .daml-head installation.

* Do daml-head.cmd on windows.
2019-05-08 16:14:52 +02:00
Neil Mitchell
0948789386
Improvements to the IDE (#1006)
* Make the extensions of the Haskell files configurable

* Make sure we capture the errors from parsing, not the warnings
2019-05-08 14:27:51 +01:00
Jussi Mäki
a23000446b
Check contract visibility in reference index service (#947)
* Use Sandbox's ActiveContracts in reference index service

This properly handles contract key updates and adds the required
checks for contract activeness and visibility.

Could consider moving the ActiveContracts.scala into another library,
but since we're soon starting the work to bring sandbox onto the
daml-on-x stack we might postpone that.

* reformat

* Exclude logback.xml from sandbox the library

This allows users of sandbox as a library to specify their
own logging configuration.
2019-05-08 14:36:28 +02:00
Robin Krom
731b409537
compiler: follow ghc convention and put conf files in package.conf.d dir (#978)
* compiler: follow ghc convention and put conf files in package.conf.d dir

We follow the ghc convention and locate all .conf files for the package
database in the `package.conf.d` dir.

* addressed neil's comment
2019-05-08 14:23:04 +02:00
Robin Krom
207d6811cb
language: feature: write sdk version to dar manifest (#967)
We write the sdk version to the dar manifest under the Sdk-Version
field. This addresses https://github.com/digital-asset/daml/issues/926.
2019-05-08 13:23:39 +02:00
Michał Majcherski
784fc1b8dd
windows: adds Bazel's MANIFEST file lookup to DA.Bazel.Runfiles (#801) 2019-05-08 13:17:36 +02:00
Stefano Baghino
f9839a7e4c
Re-order fields in records if all labels are provided (#989)
* Re-order fields in records if all labels are provided

Fixes #988

* Add line to release notes

* Fix line on release notes

* Document change on the Ledger API definition

* Simplify pattern matching

* Improve and fix tests

Integration tests now look for the "Missing field label" rather then the
"Mismatching record label" when inspecting errors. Furthermore, a test
has been added that ensures that repetitions in labels still raise an
error.

* Add comment

Comment about relationship between fields length check and fields reordering based on labels

Co-Authored-By: stefanobaghino-da <43749967+stefanobaghino-da@users.noreply.github.com>

* Improve Ledger API docstring

Explicitly state the semantics of labeled fields (i.e. repeated keys are not accepted)

Co-Authored-By: stefanobaghino-da <43749967+stefanobaghino-da@users.noreply.github.com>
2019-05-08 12:54:53 +02:00
Stefano Baghino
7843621766 Document solution for .hs unneeded rebuilds (#932)
* Document solution for .hs unneeded rebuilds

* Update BAZEL.md

Co-Authored-By: stefanobaghino-da <43749967+stefanobaghino-da@users.noreply.github.com>
2019-05-08 09:39:19 +00:00
Andreas Herrmann
aa24ae0d2d Update rules_nixpkgs (#980)
Now enforces that nix_file_deps covers all files that are read by Nix.
2019-05-08 08:57:28 +00:00
Moritz Kiefer
b5eb7ce52b
Move DAR created in "daml start" to dist/ (#993)
fixes #992
2019-05-08 10:14:05 +02:00
Leonid Shlyapnikov
6cc9e685e5 Add quickstart-scala template to DAML Assistant (#991)
* Add quickstart-scala template to DAML Assistant , #614

Removing the rule to create a quickstart-scala.tar.gz, it is not needed

* Return non-zero error code if failures detected, #614

* Reading project name from `daml.yaml`, #614

Removing Versions.scala.template
2019-05-08 06:57:15 +00:00
Andreas Herrmann
9f46df8cd6 Hazel: Shorten target names (#937)
* 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.
2019-05-07 17:45:23 +00:00
Anup Kalburgi
b32ea91564
damlc test to run tests from files passed in or from the current project (#954) 2019-05-07 12:55:41 -04:00
gleber
2aa14338a1
Release DAML Integration Kit as ALPHA. (#892) 2019-05-07 18:20:27 +02:00
Francesco Mazzoli
bd4ca991ec
release (#985)
* release

* update release notes
2019-05-07 17:57:08 +02:00
Jussi Mäki
0dc49ea811
Fixes to kvutils when used as external workspace (#984)
* Export daml_kvutils_java_proto and add (un)packDamlLogEntryId

Export needed when using kvutils via bazel from another workspace.

* Use 'String' for participant state's LedgerId

Ref.PackageId is the wrong thing, and likely MatchingStringModule
isn't very usable from Java.
2019-05-07 17:55:11 +02:00
Leonid Shlyapnikov
8534e2837f
quickstart-scala DAML Assistant template (#745)
* Add quickstart-scala IOU example, DAML Assistant template, #614

* Move all scala examples under language-support/scala/examples

* Removing target dirs which don't get excluded by the glob, #614
2019-05-07 11:41:29 -04:00
Gerolf Seitz
bac5c4a6f4 Java Bindings: Properly convert CreateAndExerciseCommand (#982)
The conversion of the CreateAndExerciseCommand in the Command base class
was missing. This also adds a missing test for that.

Fixes #979.
2019-05-07 17:04:48 +02:00
Moritz Kiefer
aff53e256d
Document nixpkgs upgrades (#977) 2019-05-07 16:18:57 +02:00
Francesco Mazzoli
bb6f21373d
record keys locally to a single update, fixes #969 (#970)
* record keys locally to a single update, fixes #969

* do not delete keys in machine for nonconsuming choices, fixes #973

* amend release notes

* actualize new test results
2019-05-07 16:09:52 +02:00
gleber
e419420205
Improve error messages of Ledger API Test Tool. (#949)
* Drop LedgerTestingHelpers.asyncFromTimeService as unused.

* ledger-api-test-tool: Add clues to asserts in the main code paths.

This ensures that users get more informative errors for the currently used
semantic tests.

* semantic tester: add operation description to an underlying ledger.

This allows to provide richer error messages to users of LedgerApiTestTool.
2019-05-07 16:01:26 +02:00
Moritz Kiefer
2149c86c8a
Implement cross-package goto definition (#972)
* Implement cross-package goto definition

This is more tricky than one might think at first:

- The interface files do not contain proper source spans so we cannot
  use the information in there.
- We could theoretically try to get the source location from the DALFs
  but that is the wrong layer and also not an option when we want to
  act as a Haskell IDE.

So what we do instead is whenever we write interface files we also
write .hie files and consult those instead when we get useless source
spans otherwise.

* Move optLocateHieFile and optLocateSrcFile to a separate type
2019-05-07 15:39:46 +02:00
Moritz Kiefer
75be2e708d
Show help on errors in daml-assistant and daml-helper (#974) 2019-05-07 15:39:31 +02:00
Gabor Aranyossy
1a4a571488
making batch queries nicer (#968) 2019-05-07 15:34:26 +02:00
Gary Verhaegen
9ec0fad2a8 add sbt to dev-env (#964) 2019-05-07 09:27:38 -04:00
Gerolf Seitz
6ac1e5cf28
Java Codegen: Removing some dead/unused code (#971) 2019-05-07 14:59:20 +02:00
gleber
1225b45ce5
Extend test durations on CI for Ledger API Test Tool driven test. (#944)
* Extend test durations on CI for Ledger API Test Tool driven test.

This introduces a command-line argument to scale timeouts used in the test.

* ledger-api-its: Make FutureTimeouts.timeout duration scaled inside.

Also include more information in the error message.
2019-05-07 14:52:49 +02:00
Moritz Kiefer
55d5fa5dea
Upgrade to nixpkgs 19.03 (again) (#962)
* Upgrade to nixpkgs 19.03 (#871)

* Fix nix-build restart

Without || true we will never get to the next line.
2019-05-07 13:55:30 +02:00
Neil Mitchell
1f504ceb9c
Clean up UtilGHC (#963)
* Remove a duplicated comment

* Remove traverse from the convertor

* Move removing typeable to the converter

* Don't reexport getGhcCore

* Move coresForFile to its usage

* Just print out the GHC Core for everything, including internal modules

* Move modIsInternal out of haskell-ide-core

* Move some DynFlags setters over to Config

* Remove an unused orphan instance

* Move the orphans out to a different module

* Move functions for generating import syntax out of haskell-ide-core

* Expose fakeDynFlags as a blob, not the pieces

* Clean up the definition of fakeDynFlags

* Inline showSDocDefault

* HLint

* Fix the comment on IDE.Orphans
2019-05-07 12:42:48 +01:00
Neil Mitchell
a9b5ffd9e0
Clean up the IDE (#961)
* Split the Options into a separate module

* Make the Logger handle live in IO

* Reduce the amount of IDE logging to just two

* Rename CompileOpts to IdeOptions

* Rename PackageState to PackageDynFlags

* Clean up setting the PackageDynFlags

* Stop hiding PackageState, we no longer clash on it

* Introduce a helper for collecting the package flags

* Move the StringBuffer conversion to its only use
2019-05-07 10:19:12 +01:00
Gerolf Seitz
2c04e1fd6d
Java Codegen: Generate types with multiple name components (#946)
If a variant itself is not serializable, but the synthesized record for
one of its constructors is, then said record is returned by the
interface reader in the set of type declarations, when the variant type
itself is not.
When constructing the InterfaceTree in preparation of the codegen, we
previously rejected such a situation.

We now generate Java code for such a synthesized record, as it is a more
generally correct way of interpreting DAML LF (i.e. the DAML compiler
could decide tomorrow to create such multi-component record names for
regular records).

In any case, we consider this to be an edge case, as the synthesized
record for the variant constructor cannot be used directly either from
DAML or the Ledger API.
2019-05-07 11:12:42 +02:00
Neil Mitchell
68b0430284
GHC 8.6 compat for the IDE (#955)
* I have no idea now LPat and Pat previously managed to unify...

* Avoid using unRealSrcSpan as its only introduced for GHC 8.8

* Add some CPP to permit compiling with GHC 8.6

* Permit CPP in one more place
2019-05-06 21:29:22 +01:00
A. F. Mota
2d2159cd0a Fix getDispatchEnv / getDamlEnv re-entrancy. (#951)
* Add two failing getDispatchEnv tests.

* Fix getDispatchEnv idempotency.

* Fix new test formatting.

* Make getDamlAssistantPath look in env first.

* Fix daml env var overriding.

* Test all the Nothing cases of env var dispatching.

* Fix dispatchEnv and getDamlEnv for Nothings.

* Add hlint rule to avoid future setEnv debacles.

* Fix other uses of setEnv.

* Fix type error.

* Fix reviewer comments

* setEnv comment
2019-05-06 19:25:30 +00:00
Remy
0489c6e0a5
Daml lf type safty (Party & PackageId) (#761)
* daml-lf: split SimpleString into Party and PackageId

* daml-lf remove parameter from DefinitionRef
2019-05-06 20:40:43 +02:00
Stephen Compall
78bf1b878c
simplify, fix recursion in transaction equal instances (#903)
* Map case of Equal[Value] was not properly recursive

* protect SortedLookupList from equals incoherence

* simplify ImmArray creation

* clean up boilerplate in Equal[Value] definition

* use match2 for isReplayedBy
2019-05-06 13:59:28 -04:00
Neil Mitchell
54c6e441f0
Minor IDE cleanups (#945)
* Kill RealLocated, it just duplicates something already in GHC

* Move some things back to UtilGHC, they are useful for setting DynFlags values
2019-05-06 18:35:43 +01:00
Martin Huschenbett
c388455509
Remove the old DAML-LF specification (#912)
It only contains a redirect to the new spec.
2019-05-06 19:21:26 +02:00
Martin Huschenbett
1af740ced8 Remove a useless dependency on daml-prim from a sandbox-control test (#948) 2019-05-06 18:57:25 +02:00
Gary Verhaegen
fe8a7d11ce don't annoy people with broken master (#936) 2019-05-06 16:15:40 +00:00
Gabor Aranyossy
dd1ac5067b
adding a simple test to hedge against existing sql migration files (#943)
* simple test to hedge against existing sql migration files

* copyright

* adding better failure message

* adding intructions on generating the digest file
2019-05-06 17:34:56 +02:00
Beth Aitman
d77384bcb6 Migration guide for new assistant (#768)
* Migration guide for new assistant

* Add some more words about the changes and start explaining config file.

* Flesh out migration of configs.

* Fix summary of changes.

* Fix formatting of list

* Tidying up migration guide
2019-05-06 14:55:20 +00:00
A. F. Mota
2d63d27da0 Move the dispatch env vars to the end. (#880) 2019-05-06 16:10:13 +02:00
Moritz Kiefer
90fed27a63
Output a compilation message in damlc build (#934)
For long builds, it’s nice to know what damlc is doing. We might want
to consider making this configurable via some --quiet flag but given
that we already output the “Created out.ar.” message unconditionally
it seems reasonable to add this without an option for now.
2019-05-06 15:55:46 +02:00
Moritz Kiefer
66541f18d0
Upgrade to new Stackage snapshot (#941)
I also started an Upgrading.md document. I’ll add the documentation
for upgrading nixpkgs in a separate PR.
2019-05-06 15:45:31 +02:00
Neil Mitchell
1a069ad80b
Move the DAML config stuff out of haskell-ide-core (#940)
* Move the GHC config stuff out of haskell-ide-core

* Add an export list to UtilGHC
2019-05-06 14:11:36 +01:00
Moritz Kiefer
569fb1b2d2
Retry nix-build on unexpected end-of-file errors (#938) 2019-05-06 14:52:12 +02:00
Moritz Kiefer
3f6ae21fbc
Output a note about the new project in "daml new" (#935) 2019-05-06 14:34:24 +02:00
Nick Smith
d725d50be9 add result of exercise to transaction -- fixes #479 (#583)
Modify the DAML Engine, Ledger API and Sandbox to pass the result of the
exercise as a field of the transactions.
2019-05-06 14:33:44 +02:00
Jussi Mäki
32a168a999
Index service refactoring (#928)
* Add configuration to LedgerInitialConditions

* Wait until index state is established in reference index service

This fixes a race condition where the daml-on-x server has been
brought up before the index service can serve it.

* Remove ledgerId checks from index service

Now that we have decided on non-changing ledger identifiers, remove
the ledgerId checks from index service and simplify the interface.

* Reformat and fix leftover ??? from DamlOnXTransactionService
2019-05-06 13:59:06 +02:00
Gerolf Seitz
b38ac29532
Attempt at fixing flaky CodegenLedgerTest (#929)
* Increase call timeout to 40 seconds
* Run test exclusively
* Add logback-test.xml and set level to DEBUG

Contributes to #808.
2019-05-06 12:48:20 +02:00