Commit Graph

1636 Commits

Author SHA1 Message Date
Florian Klink
14ecfd7bae infra: add acls for google_storage_objects create via tf (#2460)
This ensures objects in the google storage bucket created by terraform
have the proper publicRead acl.
2019-08-08 19:13:15 +02:00
Martin Huschenbett
8fc5b62bd8
Avoid one indirection for dictionary construction (#2456)
* Avoid one indirection for dictionary construction

For every constructor `Foo` we generate a function `$ctor:Foo` which calls
the DAML-LF constructor for `Foo`. This function is useless since GHC already
creates a function `$WFoo` for us which does the same. This PR remove the
`$ctor:...` functions for type class dictionaries.

This makes a bit of a mess in the `Ctors` data type. This will be cleaned up
when all `$ctor:...` functions are finally gone.

* Fix construction of XInstance templates
2019-08-08 19:12:44 +02:00
nickchapman-da
5ebc5e4d19
Hlb apps package discovery (#2455)
* suggested tiny code simplifications

* fix package discovery for Nim/Chat ledger apps
2019-08-08 16:50:17 +01:00
Gary Verhaegen
87d2fd4f31 remove sandbox-head-tarball (#2458)
We can get the same jar out of the SDK tarball.
2019-08-08 16:34:00 +01:00
Robin Krom
6ccb18be08
language: put pkg version into pkgname (#2454)
This is a small step to solve the package name ambiguity problem.
Putting the package version into the package name allows to import a
package two times with different versions.
2019-08-08 16:31:09 +02:00
Stephen Compall
92f2dbf2eb
lf-value-json: don't hardcode String cids; more consistent test runtimes, with special cases called out (#2374)
* use Arbitrary for TypedValueGenerators to get existing 'sized' uses

* test Option[Option[Long]] specifically

* derive Arbitrary ValueMap solely by implicit means, for the sized

* make ApiCodecCompressed Cid-generic

* first sample JSON tests

* navigator adaptation to Cid genericity

* scalafmt

* Table-ify JSON tests

* more navigator adaptation

* adapt http-json to Cid-agnostic JSON codec

* stem the tide of namespace pollution wrought by the "mixin to import" style

* show line # of failed JSON cases

* naturally limit the nesting factor of generated types

* move SortedLookupList generation to data-scalacheck library

* more sample JSON cases from design doc

* add more parameters to ApiCodecCompressed

- AbsoluteContractId seems like it will give rise to incoherence
- and there are going to be two parameters
- so we might as well just parameterize the whole codec

* test canonical and equivalent encoded forms

* test lists

* test very very nested optionals

* many more optional-related tests
2019-08-08 09:02:05 -04:00
Martin Huschenbett
4d0a62801c Fix pretty printing of empty annotations in DAML-LF AST (#2453)
For example, we print two spaces if there's no annotation between `def` and
the function. This PR fixes this by using the `empty` document instead of the
document containing the empty string. (Please don't ask me why they are
different.)
2019-08-08 12:11:56 +00:00
Gerolf Seitz
6993232593 Fixed a bug that prevent sandbox from loading empty workflow ids. (#2446)
This happened because we translate empty workflow ids to None in the
API-to-domain translation layer. When we store the workflow id, we actually
convert the None case back to an empty string (and not a null value).

When loading the workflow id from the database, we parse the column as a regular
LedgerString, but unfortunately these cannot be empty. Therefore using empty workflow
ids on postgres has been broken since workflow id has changed from a tagged string
to LedgerString.
2019-08-08 11:29:21 +00:00
Shayne Fletcher
1d33433142
Update hlint (#2448) 2019-08-08 07:09:12 -04:00
Gerolf Seitz
d52d3bc451
Semantic tests fall back to wall-clock time if timeservice is not available (#2419) 2019-08-08 13:08:57 +02:00
Moritz Kiefer
9df8c7878e Add link to deploy URL in daml ledger --help and daml deploy --help (#2451)
* Add link to deploy URL in  daml ledger --help and daml deploy --help

* Update daml-assistant/daml-helper/src/DA/Daml/Helper/Main.hs

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
2019-08-08 08:41:22 +00:00
Moritz Kiefer
0c7cb171b7 Release 0.13.18 (#2447) 2019-08-07 17:13:13 +00:00
Leonid Shlyapnikov
c7b5482e43 JWT HMAC256 Authorization (#2389)
* Starting //ledger-service/jwt module

adding //3rdparty/jvm/com/auth0:java_jwt dependency, there are Scala JWT
libraries, however they are either immature or unsupported

* Keys and JWT generator utility/wrapper, WIP

* Keys and JWT generator utility/wrapper, WIP

* RSA Keys generator

* HMAC token validation added to command/create endpoint

HMAC is actually not good, need RSA, this is a shortcut for DABL team.

* Renaming

* command/create test cases fixed to pass OAth2 Bearer token

* removing unused method

* JWT authorization for /command/exercise

* the rest of the endpoints uses JWT authorization

removed hardcoded JwtPayload

* cleanup

* cleanup

* http status code in the header and in the json body should match now

* NotFound would also return a json body now

* Removing hardcoded JWT in the integration test

it is generated using the JwtSigner.HMAC256

* cleanup

* fixing error message

* instructions for making a JWT HMAC token for dev
2019-08-07 16:26:26 +00:00
Moritz Kiefer
c5664fe5b5
Speed up dependency information chasing (#2444)
Comparing FilePaths is really slow so by mapping them to Ints, we can
speed up dependency chasing significantly.

We might want to switch to doing some kind of global hash consing of
file paths at the Shake level but for now, this seems like a nice
improvement while not being too invasive.

This is roughly an ~8s speedup on my testcase.
2019-08-07 16:51:38 +02:00
Moritz Kiefer
9cd58e24fa
Fix VSCode invocation in "daml studio" (#2445)
Despite, a lot of searching around, I couldn’t find any information on
why exactly quoting "code" causes issues but removing the quotes seems
to fix the issue ¯\_(ツ)_/¯
2019-08-07 16:38:03 +02:00
Remy
5dd7f1afcf java-codegen: fix broken language-support/java/codegen/src/it/dar/integration-tests-model-1.0.dar (#2443) 2019-08-07 13:56:36 +00:00
nickchapman-da
8f9a781750
hlb, use Int64 / Fixed E10 as appropriate (#2440) 2019-08-07 13:27:58 +01:00
Martin Huschenbett
966dfbd400 Add test for manually desugared form of the generic proposal workflow (#2442)
Having a test that demonstrates how the desugared form of the template syntax
looks like seems to be a good idea.
2019-08-07 11:53:52 +00:00
associahedron
476181e9b8 Deliver additional detail in daml deploy documentation. (#2439)
* More detail about upload-dar and allocate-parties.

* Put the two steps in the right order.
2019-08-07 11:14:46 +00:00
Moritz Kiefer
8b171e50fb Release SDK 0.13.17 (#2437) 2019-08-07 10:40:41 +00:00
nickchapman-da
2b1204ceac
hlb, fix bug where sandbox is not being run on a dynamically allocated port (#2428) 2019-08-07 11:16:53 +01:00
Gary Verhaegen
a15256571a
macOS: cache the bazel repo cache (#2420) 2019-08-07 11:04:49 +01:00
associahedron
8916edef18
Adding some docs for daml deploy and daml ledger. (#2438)
* Some docs for daml deploy and daml ledger.

* Adding none in code blocks.

* Substitute*
2019-08-07 10:45:00 +01:00
Moritz Kiefer
b3e1833e71
Use FastString where possible and speed up conversions to Text (#2436)
This cuts allocations on my testcase by about 2% and provides a
similar speedup.
2019-08-07 11:03:40 +02:00
Martin Huschenbett
c0a07e7e07
Use template syntax in IOU proposal test (#2435)
Until now the test used the manually desugared syntax for the `Iou`
template. Now, we use the proper `template` syntax. The test is also
renamed from `IouDSL` to `ProposalIou` since the DSL would be confusing
after this change. In fact, we're mostly testing that the
instantiation of `Proposal a` with `a = Iou` actually works.
2019-08-07 10:04:45 +02:00
Martin Huschenbett
c63782791e Remove tests that are obsolete with new template desugaring (#2434)
* Remove tests that are obsolete with new template desugaring

The tests were only relevant during the transition phase to the new
template desugaring. Since that desugaring has landed the test don't
provide value anymore and can be deleted.

* Fix super class dictionary detection
2019-08-06 18:22:49 +00:00
Moritz Kiefer
d95d25fd2f Speed up convertModuleName (#2432)
On my testcase, this cuts allocations by about 6%.
2019-08-06 18:14:34 +00:00
associahedron
0673ceecac Fix daml ledger navigator configuration. (#2430)
* Fix daml ledger navigator

* Add newline after dots
2019-08-06 17:57:52 +00:00
Martin Huschenbett
15f94783d8
Use tasty-golden for daml-doc's golden tests (#2429)
* Use tasty-golden for daml-doc's golden tests

With our hand rolled version of golden tests it is pretty painful to update
the golden files when they must change. After this PR it is as simple as
```
> bazel run //compiler/damlc/tests:daml-doc -- --accept
```

* Address indentation issues

* Use diff command line tool for diffing

* Removed new unused dependecy on Diff package

* Ignore carriage returns in diff
2019-08-06 19:47:52 +02:00
Shayne Fletcher
1308c8232b
hlint => dlint everywhere (#2409) 2019-08-06 13:42:36 -04:00
Moritz Kiefer
180313b404
Unrecursionschemify freeVars calculation (#2427)
This cuts allocations and speeds things up (admittedly not by a whole
lot) but it also lets us delete a bunch of code which is always nice.
2019-08-06 19:33:11 +02:00
Anup Kalburgi
629266a445
Addressing comments on a previous PR #2371 (#2408) 2019-08-06 12:48:54 -04:00
Moritz Kiefer
859ac379de
Move simplification to GenerateRawDalf (#2424)
This allows us to GC the unsimplified DALF which decreases memory
usage and GC pressure. This does make GenerateRawDalf slightly slower
which could in theory have an effect on IDE performance since we use
the raw DALF for the scenario service. However, I haven’t been able to
measure any regressions (if it does become an issue, we could disable
optimizations completely in the IDE). In fact, things seem to be
slightly faster.

On my testcase max memory usage does seem to go down a bit but not a
lot (3.0GB to 2.7GB but it fluctuates somewhat between runs).
2019-08-06 16:40:29 +02:00
associahedron
8590dfacb9
--json flag for daml ledger list-parties (#2426)
* --json flag for daml ledger list-parties

* use TL.putStrLn

* lint
2019-08-06 15:37:53 +01:00
Martin Huschenbett
d723db8fca Simplify test for different choice syntaxes (#2405)
* Simplify test for different choice syntaxes

* Test for scoping rules of flexible controllers as well
2019-08-06 14:19:47 +00:00
Moritz Kiefer
a1ac927add
Avoid converting DARs to a strict bytestring (#2423)
Converting it to a strict bytestring only to then write it to disk
doesn’t make much sense.
2019-08-06 16:16:14 +02:00
associahedron
342a620f98
Implement deploy in terms of allocate-parties and upload-dar. (#2422)
* implement deploy in terms of allocate parties and upload dar

* Update release notes
2019-08-06 14:46:27 +01:00
Moritz Kiefer
d630b7134d
Activate VSCode extension on daml.resetTelemetryConsent (#2421)
Otherwise, you will get an error if you run the resetTelemetryConsent
command without having opened a .daml file.
2019-08-06 14:43:35 +02:00
Michał Majcherski
86bec619d0 Sandbox reset 'ledger ID not found' fix (#2331)
* Sandbox reset 'ledger ID not found' fix

* Improve Haskell Ledger bindings tests

- Add an interceptor to Ledger Sandbox rejecting calls during reset
- Wait for new Sandbox - retrying getLedgerId calls in Haskell's ResetService - retry on errors and when Ledger IDs don't change

* satisfy hlint

* backout unnecessary haskell changes

* fmt.sh
2019-08-06 13:42:16 +01:00
associahedron
72a7bc63a6
Organizing SDK ledger commands, adding ledger upload-dar and ledger navigator commands. (#2416)
* Add deploy-navigator command to daml helper.

* Rebase

* Organize ledger commands

* Sandbox /= Remote Ledger, should not use that config.
2019-08-06 12:41:43 +01:00
Gary Verhaegen
f4fd715b44
docs typo (#2412) 2019-08-06 12:31:31 +01:00
Gary Verhaegen
5f56e23c74
fix fetch repo in bazelrc (#2411) 2019-08-06 12:31:06 +01:00
Moritz Kiefer
dd41683381 Escape shell arguments in daml-helper (#2417)
This fixes another case of spaces in usernames breaking things
2019-08-06 11:16:57 +00:00
Moritz Kiefer
656d8f4a19 Handle ExitCodeException in wrapErr (#2415)
This is thrown by typed-process when the child process exits with a
non-zero exitcode.

fixes #2414
2019-08-06 08:49:25 +00:00
Martin Huschenbett
e0ced61770 Make Bernhard owner of docs and remove daml-foundations (#2402) 2019-08-06 06:14:35 +00:00
Shayne Fletcher
c8783d08bb Upgrade hlint (#2406)
* Upgrade hlint

* Reduce duplication
2019-08-05 18:45:31 +00:00
Martin Huschenbett
3a02b56117 Merge the Iou12 and Iou_template test into one test (#2407)
They differ only marginally and I don't see any reason why they should be
two different tests.
2019-08-05 17:14:59 +00:00
Martin Huschenbett
ecc66604b5 Simplify test for unserializability check (#2404) 2019-08-05 17:05:12 +00:00
Martin Huschenbett
f669d7e572 Remove the old template resugaring from the GHC Core -> DAML-LF conversion (#2400)
Since we changed how the parser desugares templates, this code path won't be
hit anymore.
2019-08-05 16:38:11 +00:00
Moritz Kiefer
a967b872e2 Use a single map for RawDependencyInformation (#2399)
This cuts allocations a bit and makes things slightly faster (sadly
not a lot).
2019-08-05 16:21:36 +00:00