Commit Graph

293 Commits

Author SHA1 Message Date
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