Commit Graph

293 Commits

Author SHA1 Message Date
nickchapman-da
d5a94625e8 daml deploy: small changes and code cleanup (#2398) 2019-08-05 15:48:47 +00:00
nickchapman-da
299d0c1b98
daml deploy, now with party management (#2384)
* daml deploy, now with party management

* address some review comments
2019-08-05 13:07:37 +01:00
Moritz Kiefer
705f014a88 Fix daml build for usernames with spaces (#2392)
* Fix daml build for usernames with spaces

This PR fixes two issues caused by having spaces in your username:

1. On Windows, we need to quote the path to the daml binary in the
batch wrapper (quotes are not valid in usernames, so no need to worry
about escaping them).

2. Invoking ghc-pkg via callCommand broke since shells are
terrible. Luckily, we can easily get away with just using callProcess
here.

* Update compiler/damlc/lib/DA/Cli/Damlc.hs

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>
2019-08-05 08:49:40 +00:00
Gary Verhaegen
d45671f926
clarify help text on assistant (#2382) 2019-08-02 14:33:30 +01:00
Robin Krom
3db5230a43
language: put hash in package directories (#2268)
* language: put hash in package directories

We put the package id of the main dalf of a package into the directory
names, where we store the files of that package in the package database.
This way we make sure that two equally named packages don't overwrite
their dependencies and files.
2019-07-31 14:31:45 +02:00
Moritz Kiefer
50a04397e4
Supporting producing sdist tarballs for the HS ledger bindings (#2336)
* Supporting producing sdist tarballs for the HS ledger bindings

The README.md has an explanation for how you can use this.

This should hopefully allow others to experiment with the bindings.
2019-07-30 14:34:16 +02:00
nickchapman-da
b90862ebec
improve haskell module hierarchy to be more consistent (#2319) 2019-07-29 15:55:55 +01:00
associahedron
573424f561 Add a daml deploy integration test. (#2299)
* Add a daml deploy test

* Use different template for proj2 in daml deploy test

* added --host localhost
2019-07-26 15:26:15 +00:00
nickchapman-da
49e21660f1
support --host option for daml deploy command (#2285) 2019-07-25 12:26:07 +01:00
nickchapman-da
b30228ab95
{-# LANGUAGE OverloadedStrings #-} is now on by default (#2270) 2019-07-24 08:09:26 +01:00
Martin Huschenbett
d6b8ea17de Fix the source field in daml.yaml produced by daml init (#2250)
Currently, if you do `daml init foo` and there's a file `foo/Main.daml`,
you'd end up with a file `foo/daml.yaml` whose `source` entry is
`foo/Main.daml`when it should actually just be `Main.daml`.

This PR fixes this problem.
2019-07-22 16:56:36 +00:00
Robin Krom
c8e0f51e90
Address martin comments (#2242)
addressing martin's comments
2019-07-22 13:48:29 +02:00
Moritz Kiefer
e570c10599 Remove dependency on ghc from daml-helper (#2233)
GHCi gets confused if both ghc and ghc-lib are exposed and there is no
reason why we should depend on ghc here anyway.
2019-07-19 19:33:11 +00:00
Robin Krom
8dd80cf112
language: add a 'main' option to the migration command (#2229)
We add an additional argument "main" to the migrate command to put the
right main filepath into the project config.
2019-07-19 16:32:53 +02:00
nickchapman-da
c0d6ac2a24
minimal quick fix for quickstart template, and test! (#2224) 2019-07-19 08:57:21 +01:00
nickchapman-da
49a6607160
daml deploy: first version (#2176)
* daml deploy: first version

* fix build: replace callCommand with runProcess_

* abstract/share: doBuild, getDarPath

* hide deploy command for now

* make sandbox port configurable for both deploy & start daml-helper commands
2019-07-17 14:09:55 +01:00
Moritz Kiefer
623e641ec9
Wait for child process to exit in the daml assistant and daml-helper (#2162)
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.
2019-07-16 18:21:00 +02:00
Robin Krom
aff7f1bc67
Generate interface files from dalf (#2151)
* language: upgrading: generating interface files
2019-07-16 13:46:43 +02:00
Gary Verhaegen
e2d9541c8c bundle vsix in sdk tarball (#2113) 2019-07-12 21:35:05 +00:00
Moritz Kiefer
23723a6fc4 Fix extraction of Maven tarball in integration tests (#2119)
extractTarball tries to restore the ownership stored in the
tarball. This goes wrong when the tarball is fetched from CI since the
uid/gid might not exist locally.
2019-07-12 10:04:31 +00:00
Moritz Kiefer
75ea177e87
Run exception handlers on SIGTERM in daml assistant (#2069) 2019-07-09 15:44:09 +02:00
Rohan Jacob-Rao
48f5153b74 Fix VSCode path for mac in daml assistant (#2051)
* Fix VSCode path for mac in daml assistant

* Release note
2019-07-08 22:26:36 +00:00
Michał Majcherski
3751ce9cee
Fix Maven calls in daml-assistant integration tests on Windows (#2027)
* Fix Maven calls in daml-assistant integration tests on Windows

* Cleanup daml-assistant integration tests
2019-07-08 16:38:35 +02:00
Moritz Kiefer
bb3a98bf61
Move code in daml-tools outside of daml-foundations (#2033) 2019-07-08 11:40:48 +02:00
Andreas Herrmann
df7bff6288 Update to bazel-0.27 (#1957)
* 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>
2019-07-05 14:04:47 +00:00
Moritz Kiefer
5087cc4be2
Bring release instructions up to date and inline test plan (#1972) 2019-07-02 15:53:37 +02:00
Fran
365ac2f94c
Use published extension by default in daml studio. (#1965)
* Use published extension by default in daml studio.

* Implement suggestions.

* Add release notes.
2019-07-02 11:29:19 +01:00
Moritz Kiefer
6bd76d80e1 Use the default dar path in the quickstart-java example (#1963) 2019-07-01 15:43:53 +00:00
Moritz Kiefer
af795d14ca Combine all artifacts output by damlc in .daml (#1959)
Fixes #1241
2019-07-01 15:07:30 +00:00
Robin Krom
e578f91efb
language: upgades: generate upgade code from dalfs (#1940)
* language: upgades: generate upgade code from dalfs

This switches the `migrate` command to read dalf files instead source to
generate upgrade code. The dalf files are read, data types are converted
back to haskell source, and from this we can generate generic instances
again.

There are two known issues that we want to address next:
  - Duplicate generic instance definitions will make the build fail.
  I.e this only works for data declarations that have no generic
  instances
  - Data declarations of the form `data Foo = Foo ()` can not be
  converted back to haskell source.
2019-07-01 14:44:53 +02:00
Andreas Herrmann
93d8e01db2
Update rules_haskell and static GHC (#1515)
* Update rules_haskell and static GHC

Remove patches that have been upstreamed or are no longer required.
Update still required patches to match the new rules_haskell version.

Previously we patched rules_haskell to coerce GHC into using static
Haskell libraries in most places. In particular we moved hs-libraries
entries into extra-libraries entries in the package configuration files.
A much cleaner approach is to compile GHC with a static RTS, then GHC
will by itself choose to load static Haskell libraries.

* Remove haskell_cc_import

* da-hs-daml-cli -> daml-cli

* da-hs-damlc-app -> damlc-app
2019-07-01 13:26:19 +02:00
Fran
074dadaf12 Use install script in integration test for unix. (#1952)
* Use install script in unix integration test.

* Fix waitForProcess
2019-07-01 09:21:04 +00:00
Michał Majcherski
7878120d5b
Fix hanging FFI call to scenario service problem on Windows (#1868)
* windows: hanging GRPC FFI call problem resolution

* windows: fix visual test

* windows: enabled back again some of disabled daml-assitant tests

* marking daml_ghc_integration_test as large
2019-06-26 11:45:52 +02:00
Robin Krom
05d80eeeb4
language: upgrades: no generics for data types having the instances already (#1840)
language: upgrades: dont derive generics for data types having the instances already

We only derive generic instances on the fly for data types that don't
have them already.
2019-06-25 18:17:34 +02:00
Fran
ce03f6a514
Remove navigator configs (#1859) 2019-06-25 12:32:03 +01:00
Fran
1648bba736 Exit from daml start if on-start command returns non-zero code. (#1857) 2019-06-25 09:45:08 +00:00
Fran
4cf5343dbb
Add support for da_haskell_repl targets in da-ghci (#1847)
* Add support for haskell_repl targets in da-ghci

* Change default target

* Revert newline loss.

* bazel fetch before bazel query

* Make a top level repl target the default.

* Add da_haskell_repl dependency in //BUILD

* Fix syntax error

* Fix bazel formatting...

* Rename DamlHelper modules to make //:repl work

* DamlHelper -> DamlHelper.Run

* Update the import in DamlHelper.Main

* Fix bazel rules again

* Update DamlHelper import in integration-tests
2019-06-24 16:39:41 +01:00
Robert Autenrieth
868a72b93a
Add support for DAML_PROJECT in Navigator (#1458)
* Add circe-yaml

* Add new helper library to load SDK config files

* Add support for DAML_PROJECT in navigator

Fixes #1128
2019-06-24 17:06:20 +02:00
Fran
d8c6239edc
Add options for scripting with daml start (#1837)
* Add more options to daml start

* Add release note for new options.
2019-06-24 14:57:01 +01:00
Fran
6318b3f858
Handle SIGINT in daml commands. (#1807)
* Raise UserInterrupt whenever SIGTERM happens when spawning processes in daml-helper.

* Avoid redundant installSignalHandlers

* Copyright header

* Update lint rules.

* Move installSignalHandlers to main
2019-06-24 08:25:12 +01:00
Robin Krom
b91c95d268
Write generic instances to separate modules on the fly (#1804)
* language: generate module containing generic instances

The migrate command generates generic instances of data types and puts
them in a separate module. For now this only works if the data type
doesn't have a generic instance already, we'll deal with this case in
the next PR.
2019-06-21 17:37:13 +02:00
Fran
728c1c9204
Implement daml install --install-assistant flag. (#1761)
* Add --install-assistant option

* Better doc on iActivate

* Determine whether to install assistant based on new flag

* Fix logic and update install warning

* Remove --activate from install.sh

* Add missing ]

* Change deprecation warning.

* Add release notes for new option.

* Update help text for install-assistant

* Fix release notes
2019-06-19 14:00:13 +01:00
Robin Krom
ca163d708e
language: feature: initial implementation of a 'migrate' command (#1707)
* language: feature: initial implementation of a 'migrate' command

We add a 'migrate' command to daml assistant that generates a project
that allows to migrate contract instances from package1 to package2.
This first version reads both package1 and package2 from source. As a
next step we read only the dalfs from package1, because it might have
been created with a different compiler.
2019-06-17 16:40:08 +02:00
Fran
e848b29cb4
Simplify daml version output (#1700)
* Simplify daml version output

* Make sure project version is really from daml.yaml

* Calculate latest version more thoroughly.

* Only show latest version if available
2019-06-17 12:19:56 +01:00
Fran
04f77626f9
Better error messages in daml-assistant when reading sdk-version from daml.yaml (#1677)
* Better errors for malformed daml.yaml

* Better error messages when reading sdk-version field.

* Lint
2019-06-14 18:24:12 +01:00
Fran
aa84930061
Strip env vars when calling vscode (#1667) 2019-06-14 13:13:53 +01:00
Fran
3eb2fd659a
Sort template list in daml new --list (#1599)
* Sort template list in daml new --list

* sort after takeFileName
2019-06-12 13:08:44 +01:00
Fran
9842570618 Tweak the "outdated DAML SDK in project" warning. (#1573) 2019-06-10 09:43:35 -04:00
Michał Majcherski
905410e1fd windows: daml-assistant tests (#1528) 2019-06-05 11:56:11 -04:00
Fran
161c1de31c
Implement daml uninstall command. (#1525)
* Define uninstall function.

* Add uninstall command.

* Change uninstall success messages.
2019-06-05 10:29:12 +02:00
Fran
8bc5387641
Display version number in yellow line. (#1499) 2019-06-04 09:31:25 +02:00
Fran
8d731fac39
Add version param to get-daml.sh (#1488)
* Add version param to get-daml.sh

* Deal with missing param better.
2019-06-03 14:47:27 +02:00
Moritz Kiefer
b16d94e958
Create VSCode extension directory on all platforms (#1470)
This is just as necessary when creating a symlink on Unix systems as
it is necessary on Windows.

fixes #1469
2019-05-31 14:44:50 +02:00
Moritz Kiefer
464ef86e0e Disable damlc test on Windows since it’s flaky (#1450) 2019-05-29 12:51:43 +00:00
Andreas Herrmann
1a80106753
damlc test --files (#1409)
* Add test case for damlc test-files

* Separate damlc test-files from damlc test

* Fix rules_daml/daml.bzl daml_test

* damlc test-files --> damlc test --files

The project options are still relevant for the --files case, as it may
be necessary to change into the project root directory in order to
locate the project package database.
2019-05-28 15:36:42 +02:00
A. F. Mota
34d8d705c7
Better error message for install --force failure on Windows. (#1422)
* Remove ghci[d].sh

* Add a nice error message on windows for install --force
2019-05-28 13:47:10 +02:00
Moritz Kiefer
53c5351144
Add a --project-root option damlc to specify the project root (#1401)
This was already possible before via the DAML_PROJECT environment
variable but for users that want to call damlc directly, e.g., via
damlc.jar a CLI flag can be more convenient.
2019-05-27 18:09:43 +02:00
A. F. Mota
2329b1b97a
Display warnings in daml build. (#1375)
* Display warnings in daml build.

* Prevent errors from showing twice.

* Use flagYesNoAuto for scenario service.
2019-05-24 14:36:48 +02:00
A. F. Mota
489244886c List all available versions, and persist version data. (#1339)
* List all available versions.

* Add --all flag in daml version

* Save version list to cache

* Update version cacheing logic.

* Linting error

* PR revisions.

* Update release notes.

* Update daml-assistant/src/DAML/Assistant/Version.hs

* Update docs/source/support/release-notes.rst

Co-Authored-By: Beth Aitman <bethaitman@users.noreply.github.com>
2019-05-23 14:33:07 +00:00
Moritz Kiefer
1c580d84a5
Make exposed-modules field in daml.yaml optional (#1345)
If unspecified, we expose all modules in the project.

Fixes #1328
2019-05-23 15:37:37 +02:00
Moritz Kiefer
d15f952dcc
Display daml-helper exceptions in a readable way (#1258)
This address part 2 of #1221.
2019-05-21 09:24:31 +02:00
Moritz Kiefer
d7209f3a09
Set program name of daml-helper to daml (#1256)
This prevents "daml new --help" and similar commands from showing
"daml-helper" instead of "daml".
2019-05-20 18:27:03 +02:00
A. F. Mota
db155477a5
Remove Data.SemVer workaround. (#1246) 2019-05-20 14:38:59 +02:00
A. F. Mota
128b8bed54
Add daml clean command (#1237)
* Add daml clean command

* Show what is removed during daml clean.

* Dont relativize
2019-05-20 13:11:35 +02:00
A. F. Mota
7013853694
Remove command kludge and prevent daml version from auto-installing. (#1229)
* Remove command kludge and prevent daml version auto-installing.

* Lint.

* Fix tests.

* Get rid of getMinimalDamlEnv.
2019-05-20 09:46:39 +02:00
A. F. Mota
9f184244f9 Add a couple failure modes to daml new. (#1212)
* Add a couple failure modes to daml new.

* Explain projectName == targetFolder check.

* Fix runNew documentation.
2019-05-17 11:13:38 +00:00
Gabor Aranyossy
e70cbfe65c eliminating some mutable state (#1130)
* no var no problem

further refactor

introduced InfraState

a bit less vars

encapsulating closes

SandboxServer starts automatically

rebase fixup

collecting state into a single object

some cleanup

removing exposed materializer

LedgerBackend is closed in SandboxServer

changed ownership of Ledger

fixing perf tests

fixing some compile errors

formatting

removing unused method

fixing integration test to use correct dar file

fixing issue with PostgresFixture and SandboxResource

Fix integration tests on Windows

* fixing rebase artifacts
2019-05-16 08:52:14 +00:00
Moritz Kiefer
7afc8af554
Add --open-browser flag to daml start (#1176)
I went with the yes/no/auto approach we already use in the assistant
and moved the logic for that to da-hs-base.
2019-05-16 10:28:49 +02:00
Moritz Kiefer
e48d5ccb22
Improve error messages on missing VSCode and missing Java (#1157)
* Improve error messages on missing VSCode and missing Java

* Better error messages
2019-05-15 17:18:03 +02:00
A. F. Mota
40f40d940a
Idempotent daml installs. (#1136) 2019-05-15 13:32:18 +02:00
Moritz Kiefer
ad10f98020
Fix SDK integration tests on Windows (#1125)
* Fix SDK integration tests on Windows

* Switch to Haskell-based tar extraction
2019-05-14 21:55:45 +02:00
A. F. Mota
f72fdf3552 Better error handling in get-daml.sh (#1121)
* Better error handling in get-daml.sh

* Use set -eu

* Review suggestions

* ORIGDIR is unused.
2019-05-14 10:54:05 +00:00
Moritz Kiefer
99a7b24b3b Add an option to not modify PATH in daml install --activate (#1119)
* Add an option to not modify PATH in daml install --activate

This is particularly useful in test suites where you install to a
temporary directory that should not be added to the registry.

* Use yes/no/auto

* Make check more robust
2019-05-14 09:01:35 +00:00
A. F. Mota
838b81d3da
Make daml version display installed SDK versions like da list. (#1114)
* Separate version logic out of DAML.Assistant.Env.

* Refactoring some of the exception handling.

* Update daml version command.

* Uncommit linting atrocity.
2019-05-14 08:46:55 +02:00
A. F. Mota
f7a0dd250a Open browser on daml start. (#1103) 2019-05-13 17:36:08 +00:00
Andreas Herrmann
c3a651364f Handle module root . and non-normal source paths (#1073)
* Handle module root `.` and non-normal source paths

* Add regression test for #1048
2019-05-13 08:54:40 +02:00
A. F. Mota
2d682f489e Implement daml init command. (#1080)
* Started working on daml init.

* Implement daml init.

* Nicer messages and nicer field generation.

* Cleaning up a duped definition.

* Review revisions
2019-05-10 16:32:41 +00:00
Moritz Kiefer
eb3b9a7ec4
Add an integration test for daml packages (#1050) 2019-05-09 16:45:40 +02:00
A. F. Mota
9cc18edd07
Catch all synchronous exceptions when making network requests. (#1038)
* Catch all synchronous exceptions when making network requests.

* Wrap all of getLatestVersion.

* wrapErr wraps sync exceptions as well.

* Pass through exit codes.
2019-05-09 14:41:45 +02:00
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
Moritz Kiefer
b5eb7ce52b
Move DAR created in "daml start" to dist/ (#993)
fixes #992
2019-05-08 10:14:05 +02:00
Moritz Kiefer
75be2e708d
Show help on errors in daml-assistant and daml-helper (#974) 2019-05-07 15:39:31 +02: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
A. F. Mota
2d63d27da0 Move the dispatch env vars to the end. (#880) 2019-05-06 16:10:13 +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
Moritz Kiefer
3f6ae21fbc
Output a note about the new project in "daml new" (#935) 2019-05-06 14:34:24 +02:00
Neil Mitchell
e36e1074e0 Rename the runTests function to main, since it serves as a main (#910) 2019-05-04 09:37:23 +00:00
A. F. Mota
e8ebbe6c91
Disable version nagging and avoid looking at unnecessary information in daml install. (#857)
* Do not ask user to install when they are already running the install command.

* Avoid looking at unecessary information when doing daml install.

* Update daml-assistant/exe/DAML/Assistant.hs

Co-Authored-By: associahedron <231829+associahedron@users.noreply.github.com>

* Remove unnecessary import.
2019-05-03 11:06:34 +02:00
A. F. Mota
12e8baa93f Simplify daml new template release process and add a simpler default template. (#850)
* Skeleton template.

* Add quickstart-java template.

* Update release rule

* Add Main.daml in skeleton template.

* Change default template for daml new.

* Update templates/BUILD.bazel

* Fix bazel rule formatting.

* Update integration test to use quickstart-java template.
2019-05-03 08:17:15 +00:00
A. F. Mota
0353c26929 Make the new version check time configurable. (#859) 2019-05-03 00:24:06 +00:00
A. F. Mota
e37d3eca9c
Pass project path as argument to vs code in daml studio. (#852)
* Pass project path (or cwd) as argument to vs code in daml studio.

* Remove unnecessary windows command tweak.
2019-05-02 18:21:55 +02:00
A. F. Mota
aa2d7a8dff
Add outdated version warnings in daml-assistant. (#758)
* Add outdated version warnings

* Fix stable version calculation.

* Cache latest sdk version.

* Rename test1 and test2.

* Catch HttpExceptions and TLSExceptions where appropriate.
2019-05-02 15:12:31 +02:00
A. F. Mota
087b2c4f3f Use open -a on mac for daml studio. (#836) 2019-05-02 14:11:29 +02:00
Moritz Kiefer
6ac0931a25
Fix daml studio on Windows if .vscode/extensions does not exist (#829) 2019-05-02 11:13:09 +02:00
Moritz Kiefer
b0478bbdbe
Fix permissions in "daml new" (#827)
* Fix permissions in "daml new"

I accidentally added the permissions stuff to the wrong use of copyDirectory
2019-05-02 10:22:06 +02:00
Martin Huschenbett
370b58d2fd
Turn on a few more hlint hints (#800) 2019-04-30 20:46:52 +02:00
Moritz Kiefer
c597becd2c
Support SDK install when TMP_DIR is a on a different filesystem (#770)
* Support SDK install when TMP_DIR is a on a different filesystem

fixes #746
2019-04-30 11:35:53 +02:00
Moritz Kiefer
f4b79c7518
Update path automatically on Windows in "daml install --activate" (#757) 2019-04-29 17:10:17 +02:00
Moritz Kiefer
4d4bbd8028
Move code shared between lib and tests to a DAML assistant library (#749)
* Move code shared between lib and tests to a DAML assistant library

Previously we were compiling the same code twice, once for the binary
and once for the test suite.

* Move tests and binary to separate directories

The lack of sandboxing on Windows in combination with
-Wmissing-home-modules breaks our Windows build otherwise.
2019-04-29 10:21:01 +02:00
K5
451858335f
Simplify daml assistant interface. (#725)
* Simplify daml assistant interface.

* Update descriptions based on suggestions

* Build dar in proper place.
2019-04-29 09:14:51 +01:00
K5
e340502097
Make get-daml.sh compatible with sh. (#750) 2019-04-29 09:13:33 +01:00
K5
d9f5097e67
Auto-installing requested SDK versions. (#692)
* Auto-install requested SDK versions.

* Avoid crashing if the requested sdk is missing (and auto-install is off).

* swap the default and the auto install

* Suggestions

* Explain why install messages go to stderr in one case.

* Lint error

* Determin running daml assistant version.

* Auto-update daml whenever assistant SDK version is less than auto-installed version.
2019-04-25 19:52:23 +01:00
Moritz Kiefer
edfd023b0b
Autoupgrade to newer vscode extensions (#703)
This PR changes `daml studio` to automatically install newer SDK
versions by default. The behavior can be overwritten to either force
the current SDK version (which should only be necessary if we break
backwards compatibility) or to not touch existing installations at all.
2019-04-25 17:53:47 +02:00
Moritz Kiefer
be30c35ef9
Fix daml start on Windows (#694)
* Fix daml start on Windows

* Automatically pass --scenario to sandbox
2019-04-25 15:06:54 +02:00
Moritz Kiefer
f9a438ffb7
Fix daml studio on Windows (#693)
There were two issues in `daml studio`:

1. We need to use `shell` instead of `proc` to launch VSCode.

2. Creating symlinks requires admin privileges on Windows so instead
we just copy the directory.

Note that `daml studio` will not install or upgrade the extension if
it is already installed (this fact is unchanged by this PR). We should
change this to upgrade to newer versions by default (and add an option
to not do this) but I’ll leave that for a separate PR.
2019-04-25 14:25:14 +02:00
K5
a28b44f95c Add script to download and install daml for Linux and MacOS. (#656) 2019-04-25 10:33:29 +00:00
K5
d1e8c3f9ef Forward sandbox arguments properly (and navigator & extractor). (#684) 2019-04-25 08:50:00 +00:00
Robin Krom
64290dc542 language: change default output dir of package command (#650)
* language: change default output dir of `package` command

This changes the default output path of the `package` and `build`
command from the project root to the `dist` directory.

* fixed daml-assistant integration tests
2019-04-25 02:53:15 +00:00
Gary Verhaegen
1780982fd6 add Windows tarball to github releases (#677) 2019-04-25 01:57:32 +00:00
K5
d97c099d03 Generate daml new config file from template (#652)
* Generate daml new config file from template.

* Use __VERSION__ instead of __SDK_VERSION__
2019-04-24 20:49:37 +00:00
Moritz Kiefer
1cc0126395 Disable echo in daml wrapper script (#655)
When echo is enabled (which is the default), the IDE can get really
confused since it tries to interpret the commands as LSP messages
which obviously fails.
2019-04-24 19:00:21 +00:00
K5
c0d1386329 Make daml new files writeable. (#642) 2019-04-23 19:02:01 +00:00
Moritz Kiefer
077e54042b
Fix daml wrapper on Windows (#624)
Apart from the fact that START was missing the windows title argument
it launches a new terminal window and then exits immediately (the
terminal windows is closed immediately as well) so it seems like the
wrong thing to use. Just calling the executable directly seems to work
fine both in cmd.exe and in powershell on my Windows 10 VM so
hopefully this is reasonably robust.
2019-04-23 10:12:12 +02:00
Moritz Kiefer
01602036f1
Build project automatically in "daml start" (#545)
* Build project automatically in "daml start"

This gives us an interface that more closely resembles "da start" and
is also more convenient for users.

* Make it clear what DamlAssistantPath points to
2019-04-16 18:12:31 +02:00
Fran
463029a078
Added daml assistant exec command. (#543)
* Added daml assistant exec command.

* Fix lint.

* Forward -h and --help as well.
2019-04-16 17:24:54 +02:00
Fran
0c10fafe69
Check SDK version before download and use redirect to find latest version. (#526)
* Add SDK version check before download.

* Get latest version from github, not URL directly.

* Prune unused parts of the Github API.

* Refactor AssetName out.

* Reorder the github module.

* Use redirect instead of GitHub API to get latest stable version.

* Do not limit number of redirects.

* Fix bazel rule

* Actually fix build rule
2019-04-16 15:26:24 +02:00
Moritz Kiefer
ac5bdc3a5d
Move Maven database to a separate rule (#527)
* Move Maven database to a separate rule

This should make sure that we get a cached version far more often and
thereby speed up the integration tests.
2019-04-16 14:37:39 +02:00
Moritz Kiefer
553cde8d02
Fix codegen integration tests (#510)
The codegen integration tests assume a specific location atm so we
need to specify that explicitely (eventually we might want to change
them to use the default location but not for now). The reason why we
didn’t catch this before merging the package-new command is that the
PR was not rebased on top of the changes that added the codegen
integration tests.
2019-04-15 21:22:59 +02:00
Robin Krom
0f2ac2d06d
language: new package command for damlc (#395)
* 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.
2019-04-15 18:12:04 +02:00
Fran
b91535d287
Make install target explicit in daml install. (#498)
* resolve merge

* Be explicit about install target.

* Refactor InstallTarget type out.

* Change install target metavar.
2019-04-15 18:04:12 +02:00
moritzkiefer-da
ec46b8cec5 Add codegen to integration tests (#494) 2019-04-15 17:53:05 +02:00
Fran
f53788535e
Save a GitHub API call in daml install. (#492)
* Save an API call when installing specific version.
* Fix little errors.
* Typo
2019-04-15 16:25:40 +02:00
Fran
3a0aa90a1e
Fix example asset name in github install module. (#488) 2019-04-15 15:35:18 +02:00
Fran
1a70bf68cc
Install from GitHub releases! (#459)
* Install from GitHub releases!

* Revert make-capsule script.

* Refactor a little.

* Reviewer comments
2019-04-15 13:46:53 +02:00
gleber
aa70c7f64e
Enforce consistent formatting of BUILD files. (#412)
* 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.
2019-04-12 13:10:16 +02:00
Fran
6984d9765d
Make daml-head work outside of devenv. (#428) 2019-04-12 12:03:05 +02:00
Fran
938bc4ae25
Rename sdk config file to sdk-config.yaml (#407)
* Rename sdk config file to sdk-config.yaml

* Use sed in head release.
2019-04-12 12:01:48 +02:00
Nicolas Mattia
a059340cec
Set src_strip_prefix and expand deps in assistant (#408)
The `daml-assistant` BUILD file was missing an `src_strip_prefix` field
and abtracted away the dependency list for two of its targets. The
latter is not strictly needed and may lead to too many dependencies
being specified for the targets.
2019-04-11 18:16:26 +02:00
Fran
61d8459494
Simplify daml install & some refactoring. (#379)
* Get rid of channels.

* Refactor version code.

* Remove --initial flag.

* Update daml-assistant/daml-project-config/DAML/Project/Types.hs

Co-Authored-By: fmota-da <francisco.mota@digitalasset.com>
2019-04-11 13:58:49 +02:00
Fran
0a906867ab
Use isWindows for runtime checks. (#381) 2019-04-11 13:13:45 +02:00
Fran
92cfc27f56
Avoid symbolic links altogether on windows. (#377)
* Only handle and test symbolic links on unix.

* Don't create a symbolic link on windows.
2019-04-11 12:09:34 +02:00
Fran
c6fc75d17b Switch to unix-compat for now. (#376) 2019-04-11 10:20:23 +01:00
Fran
292d2b40b4
Moving to new version logic in daml-assistant. (#337)
* Use global SDK version for release tarballs.

* Use semver for sdk versions.

* Update daml-assistant/BUILD.bazel

* Code comments pt 1

* Switch to lens

* Update daml-assistant/BUILD.bazel
2019-04-10 12:06:38 +02:00
Fran
651593097f
Add filepath checks to tarball extraction. (#323) 2019-04-09 15:27:19 +02:00
Fran
18c7ca2bbf
Move daml-assistant logic out of daml-project-config. (#302)
* Move daml-assistant logic out of daml-project-config.

* Add DamlHelper versions of required and requiredE.
2019-04-09 15:09:10 +02:00
Fran
36c846d32c
Handle symbolic links in tarball installs. (#314) 2019-04-09 13:17:43 +02:00
Fran
bd671336d0
Prevent crash when .daml/sdk is missing. (#312) 2019-04-09 11:52:13 +02:00
moritzkiefer-da
4c4b945f10
Rewrite integration tests in Haskell (#286)
* Expose daml-helper as a library

* Rewrite integration tests in Haskell
2019-04-08 15:49:58 +02:00
moritzkiefer-da
84b1076d6d
Do not use docker for daml integration tests (#277)
Docker causes a few issues for us here which imho outweigh the
benefits for us atm:

1. It is quite slow since we have to rebuild the image everytime. We
could fix this by caching the image somewhere but even that is
somewhat annoying since Azure does not provide local caches so we
would have to push the image to some external service and fetch it
everytime which is still somewhat slow.

2. It does not work on MacOS (even if you have docker on MacOS it is
not going to work since you will try to install the MacOS release
tarball in a Linux docker container).

On the other hand, DAML assistant allows us to specify the
installation directory and we get a fairly clean environment on CI so
the additional isolation we get from Docker is not that important for us.
2019-04-08 10:38:11 +02:00
moritzkiefer-da
fd156c33df
Add daml start (#254)
* Add daml start
2019-04-05 19:34:23 +02:00
Fran
dcc8e51085
Fix issues with daml-assistant CLI. (#223)
* Make daml-asisstant forward --help as intended.

* Refactor command-line parser in daml-assistant.

* Fix issues with daml-assistant CLI.

* Misalign things for Martin.
2019-04-04 19:40:38 +02:00
Francisco Mota
9c044b0c26 Add progress bar to daml install over http. 2019-04-04 15:17:38 +02:00
Digital Asset GmbH
05e691f558 open-sourcing daml 2019-04-04 09:33:38 +01:00