Commit Graph

2049 Commits

Author SHA1 Message Date
Moisés Ackerman
67351efbfc
Fix //compiler/damlc/tests:multi-package on main (#18056) 2023-12-20 14:08:12 +00:00
Samuel Williams
6a88119637
Multi package test (#17746)
* Multi package test scaffold and first batch

* Add next set of tests

* Rearrange, add source testing

* Explicit imports

* Install sdk in tests

* Blank setEnv is different to normal setEnv >:(

* Fix paths for windows

* Add daml.yaml changes tests (that fail)

* Update from comments, add sdk-version check

* Update tests to match changes to CLI behaviour
2023-12-19 11:03:29 +00:00
Remy
da4033170c
Interpreter populate package name (#17990)
this advances the state of #17995
2023-12-13 16:01:20 +01:00
dependabot[bot]
27f3aeca16
Bump semver from 5.7.1 to 5.7.2 in /compiler/daml-extension (#18018)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-13 13:32:10 +01:00
dependabot[bot]
5e9697ccb9
Bump xml2js from 0.4.23 to 0.5.0 in /compiler/daml-extension (#18017)
Bumps [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) from 0.4.23 to 0.5.0.
- [Commits](https://github.com/Leonidas-from-XIV/node-xml2js/commits/0.5.0)

---
updated-dependencies:
- dependency-name: xml2js
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 17:59:03 +00:00
Moisés Ackerman
bb56339f72
Skip platform independence test when sdk_version != "0.0.0" (#18014) 2023-12-11 23:32:28 +01:00
Remy
1afb7cd8c1
[Daml] Handle new Numeric builtins more nicely (#17133)
* [Daml] integrate more nicely new Numeric builtin

In this PR, we rewrite the changes from #16852 without changing Daml
stdlib signature (we just add more constraint on type) and handle
properly Additive and Multiplicative type class form Numeric that was
not handle at all.

* fix BENumericOne

* fix KindChecking test

* Apply suggestions from code review

Co-authored-by: Samuel Williams <samuel.williams@digitalasset.com>
Co-authored-by: dylant-da <106664681+dylant-da@users.noreply.github.com>

* fix fix

* make DAML_NAT_TYPE_ERASURE LF2-only

---------

Co-authored-by: Samuel Williams <samuel.williams@digitalasset.com>
Co-authored-by: dylant-da <106664681+dylant-da@users.noreply.github.com>
Co-authored-by: Paul Brauner <paul.brauner@digitalasset.com>
2023-12-11 15:26:07 +01:00
Moisés Ackerman
4794454a70
Platform independence pre-check (#17955)
* Rename //bazel_tools:match-{cabal=>golden}-file

* Generate and check hash file for contents of //compiler/damlc/tests:platform-independence.dar

* Add pre-commit hook to test //compiler/damlc/tests:platform-independence-dar-hash-file-matches

* Print info when //bazel_tools:match-golden-file fails

* platform-independence-dar-check pre-commit hook runs depending on env var

* Skip platform-independence-check if RUN_PLATFORM_INDEPENDENCE_CHECK is unset

* Document dar_hash_file rules

* move platform-independence-checks warning to .envrc

* implement generate_dar_hash_file genrule in python

in particular, this allows us to produce the same output on all platforms

* fix windows

* Update rules_daml/daml.bzl

* bytes.replace does not operate in place
2023-12-07 18:18:24 +01:00
dylant-da
96485898f4
Fix issues with damlc with custom release version querying network (#17991)
Co-authored-by: Samuel Williams <samuel.williams@digitalasset.com>
2023-12-06 19:35:10 +00:00
Samuel Williams
9cc0a654d7
Fix missing name error when using multi-build with sdk-version daml.yaml (#17986)
* Fix `missing name` error when using multi-build with sdk-version daml.yaml

* Update with better warning
2023-12-06 12:28:32 +00:00
dylant-da
40b5eb8476
Fix split release for deps (#17968)
* Resolve release version for sdk build checks

* lint

* lint

run-full-compat: true

* Simple test for using daml-script in release versions

* Fix build issues in tests using pSdkVersion

run-full-compat: true

* Fix build issues with DamlcIntegration

* fix bad sdk version being an invalid version

run-full-compat: true

* Fix the linux "mmap 4096 bytes at (nil): Cannot allocate memory" error

* Fix compat tests on Windows

run-full-compat: true

* test windows os correctly

run-full-compat: true

* temporarily disable canton_3x

run-full-compat: true

---------

Co-authored-by: Paul Brauner <paul.brauner@digitalasset.com>
2023-12-05 23:46:27 +01:00
Remy
96f16df3c0
remove script/trigger/cantonFixture deps on scala-bindings (#17954)
Basically we remove the dependency of different components on "//language-support/scala/bindings" by:

- replacing com.daml.ledger.api.refinements.ApiTypes.Party by com.daml.lf.data.Ref.Party
- replacing com.daml.ledger.api.refinements.ApiTypes.ApplicationId by Option[com.daml.lf.data.Ref.ApplicationId] (here we use option as ApiTypes.ApplicationId allows empty string while Ref.ApplicationId does not).
- adding rounding logic for timestamp in com.daml.lf.data.Time.Timestamp and use it instead of the one from com.daml.api.util.TimestampConversion

Note we did not clean daml-sript export as it have never pass the alpha stage and will be dropped with the 3.x fork.
2023-12-05 15:08:09 +00:00
Paul Brauner
e22f8bebd9
Run costly tests after only after merging (#17956)
* do not run pr-only tests on main, do not run main-only tests on prs

* split data dep tests into main-only and pr-only

* run non-dev conformance tests on main only
2023-12-04 10:52:33 +01:00
Moisés Ackerman
c1f7a87572
Add feature flag for scenarios (off in LFv2) (#17927)
* Add feature flag for scenarios (off in LFv2)

* whitespace

* Use rule for old-proj-2.1.dar
2023-11-29 17:01:44 +00:00
Paul Brauner
9dbb53e97e
introduce lf_version_default_or_latest in bazel and use it everywhere were I had replaced the implicit default version with 'latest' (#17930) 2023-11-29 15:53:53 +01:00
Paul Brauner
c85eb0e59b
Test LF v2 in ShakeIdeClient.hs (#17922)
* Test LF v2 in ShakeIdeClient.hs

* Handle daml3-script conversion errors in scenario.Context
2023-11-28 11:36:30 +01:00
Paul Brauner
562b303a9b
clean up some comments (#17925) 2023-11-27 15:12:54 +00:00
Samuel Williams
aa2ea1b285
Fix mangled name test to run quick (#17919)
Improve failing test assertions
2023-11-27 14:22:16 +00:00
Paul Brauner
646a74e25a
Also test LF v2 in //compiler/damlc/tests:script-service (#17904)
* Also test LF v2 in //compiler/damlc/tests:script-service

* move setEnv TASTY_NUM_THREADS outside of defaultMain

* Track end of cleanup in withResourceCps
2023-11-24 10:45:06 +01:00
dylant-da
7070966b5c
Enable multi-package by default (#17901)
* Enable --enable-multi-package by default

* Make flags for multi-package visible in help
2023-11-23 17:06:45 +00:00
Paul Brauner
2b28e59017
Introduce LF 2.1 (#17865) 2023-11-23 08:59:14 +01:00
Paul Brauner
fa8d1dc1be
Refactor LF decoding in the compiler (#17864)
* Refactor decoding in compiler

* remove obsolete comment

* factorize -decodeLf2Version and decodeLf1Version

* call the right decodeScenarioModule depending on the target LF version, update incremental build tests

* split encoding into two modules, call the right encodeScenarioModule in writeDalfFile

* delegate to EncodeV2.hs in Encode.hs

* remove noisy type signature, was there initially to guide me but I think it adds more confusions than it clears up things
2023-11-21 15:41:09 +00:00
Samuel Williams
d7b63f9c42
Multi-package CLI changes (#17850)
* Allow cyclic multi-package
Fix test --output error

* Backup damlc arg parser with build options when daml.yaml args used

* Apply review suggestions

* Add tests for changed cli behaviour
2023-11-20 14:25:39 +00:00
Remy
ff7b5c7d51
[Daml-Script] minimal support for explicit disclosure (#17818)
Co-authored-by: Samuel Williams <samuel.williams@digitalasset.com>
2023-11-17 11:30:08 +01:00
Moisés Ackerman
9e9ffea143
Remove unvalidated damlc integration tests (#17832)
* Remove tests '//compiler/damlc/tests:integration-unvalidated-v{115,1dev,2dev}'

* Use mangle_for_damlc for consistency

* remove outdated comments
2023-11-16 12:01:24 +01:00
Samuel Williams
6d05c355ce
Warn on import of internal daml-script module (#17816)
* Warn on import of internal daml-script module

* Fix tests

* Address comment
2023-11-15 14:04:46 +00:00
mziolekda
b81ee69abe
disentangle ledger api (#17831)
* make testing-utils independent of ledger-api

* remove dead files

* move non ledger-api stuff to libs-scala
2023-11-14 22:44:10 +01:00
Paul Brauner
890dee12bf
Tie right-to-left evaluation order to LF v2 (#17811)
* Tie right-to-left evaluation order to LF v2

* fix typo
2023-11-14 10:34:31 +01:00
Marton Nagy
6933514df5
Switch from Akka to Pekko (#17814)
* Automated renames by bash script

This commit is exclusively contains changes by the bash script.
For the bash script is present at the pull request.

* Manual pekko migration changes

* adapt fully qualified name references
* adapt pekko package declarations
* adapt bazel files with dependency changes
* adapt canton pekko lib shade_rule
* adapt logger configuration declarations
* pin maven dependencies
* revert incorrect changes by script to compatibility module

Workarounds for further TODOs:
* disable http-json-perf and libs-scala/gatling-utils modules to maintain clean pekko dependencies (without akka)
* disable GraphQLSchemaSpec test (sangria library needs to be upgraded)

* Formatting
2023-11-13 23:22:22 +00:00
Moisés Ackerman
e67fd306d3
Bump stackage snapshot to lts-19.33 (#17795)
* clean up stack-snapshot.yaml

* bump stack to snapshot lts-19.33 pt. 1

* bump stack to snapshot lts-19.33 pt. 2

* repin windows snapshot

* Use a copy of "@stackage-exe/hpp" in runfiles to avoid hardcoding version in haskell code

* Crash with identifiable error if hpp resource/runfile is missing but CPP is used
2023-11-13 19:42:32 +01:00
Samuel Williams
9b70a112b1
Change default multi-package behaviour to search (#17810)
* Change default multi-package behaviour to search

* Ensure new build log is only given when multi-package enabled
2023-11-13 13:32:27 +00:00
Marton Nagy
78cc750714
Scala upgrade to 2.13.11 (#17803) 2023-11-13 09:05:39 +01:00
Paul Brauner
7d1521eeca
Port daml repl to LF2 (#17750)
* add an lf-major-version flag to the repl service and pass it from the haskell client

* test LF2 in the daml-repl tests

* formatting

* formatting

* remove obsolete TODO

* fix //compiler/damlc/tests:repl

* port repl-functests to LF v2

* do not assume that LFV2 => dev

* address Moises' comments
2023-11-10 18:17:48 +00:00
Moisés Ackerman
d52a42ff52
Handle fetch node actors correctly in scenario-service (#17734)
* Add failing tests

"'bank' fetches" should be "'alice' fetches" in the ledger output when 'alice' is the divulging party

* Handle fetch node actors correctly in scenario-service

* Handle fetch node actors correctly in lf-interpreter pretty printer
2023-11-10 14:17:23 +00:00
Samuel Williams
efbe746554
Fix daml3-script 1.dev error (#17801) 2023-11-10 14:17:09 +00:00
Remy
6ef062dac9
Revert "Nmarton/pekko rebased (#17789)" (#17796)
This reverts commit d310692d1b.

@remyhaemmerle-da messed up and merged the PR too fast.
2023-11-09 21:23:18 +00:00
Marton Nagy
d310692d1b
Nmarton/pekko rebased (#17789)
* Scala upgrade to 2.13.11
* Switch from akka to pekko
* Also disable gatling based libs to start from a clean stage
2023-11-09 18:17:33 +01:00
Moisés Ackerman
495c0a0192
Fix daml3-script query question timeouts (#17792)
* Add failing test

* Add failing daml3-script+grpc test

* ScriptF:parse expects 'QueryACS' instead of 'Query' for 'query' question
2023-11-09 17:12:09 +01:00
Samuel Williams
d1f46a3e23
Implement tryCommands for internal testing (#17715) 2023-11-09 12:35:41 +00:00
Paul Brauner
32c662671e
bump proto3 suite (#17780)
* rename daml_lf_{n}.proto to daml_lf{n}.proto

* bump proto3-suite to the latest version

* pin stackage packages on windows
2023-11-08 20:12:03 +01:00
Paul Brauner
313b789731
Bump netty and grpc-netty (#17770)
* pin dependencies to json and add missing dep

* fix cyclic dep

* remove unused dep

* add missing dep to //ledger-api/testing-utils:testing-utils

* remove unused dep in //ledger/ledger-api-auth:ledger-api-auth

* remove more unused deps

* more dep fixes

* yet more dep fixing

* more fixing..

* more of the same

* hopefully the last deps to fix

* Bump the version of protobuf and fix everything that depends on it. Took shortcuts that I need to fix in a next commit, but would like to run the CI on this now that it compiles

* don't error out in the grpc-haskell patch

* remove obsolete patch

* patch absl to compile on mingw

* Add a patch to recognize the compiler

* Define _DNS_SD_LIBDISPATCH for macOS gRPC

* bump netty_tcnative_version according to https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty

* pin maven deps

* Fix macos linking errors 'dyld[xxx]: missing symbol called'

* Skip Darwin frameworks in package-app.sh

* pin stackage packages

* pin stackage windows deps

* use the netty version agreed on

* bump the windows global cache to try and debug the upb issue

* restart the CI after timeout

* clean up

* disable failing tests for now

* comment out unused code

* reset the windows machine name to 'default'

---------

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2023-11-07 19:35:50 +01:00
Remy
a83a84b326
Add support for explicit disclosure in daml script 3 (#17723) 2023-11-07 15:46:20 +00:00
dylant-da
bb5ae76cd9
Warn instead of errors for expression changes in templates (#17609)
* Add warnings to Gamma

* Warn instead of error for changed template expressions

* lint

* Errors and warnings for key types

* add context to warnings where relevant

* Add warning logic to DamlcUpgrades, fix errors that are now warnings

* Add tests for key errors and warnings (signatories, expression, type)

* Refactor expression extraction, fix extract key expression/maintainers

* satisfy lint, trigger test restart

* Test error for dropped key and warning for added key

* Warn for extraction issue instead of erroring out

* Change `cannot change` error-wording with `has changed` warning-wording

* comments for extractors
2023-11-07 12:32:04 +00:00
Simon Maxen
ae5e9feda9
Allow for the construction of shared GlobalKeys.
* Revert "Add SharedGlobalKey"

This reverts commit 6592cb7bd5.

* Adding shared flag to GlobalKey

* Remove shared flag from GlobalKey

* Support old and new grcp error parsing

* Add tests for hashContractKey
2023-11-06 20:00:38 +00:00
Samuel Williams
e7edd942dc
Align execClean errors with execBuild (#17722) 2023-11-01 10:19:33 +00:00
Samuel Williams
79d7203f37
Implement daml clean --all (#17697) 2023-11-01 09:10:40 +00:00
Paul Brauner
1b8a676392
Revert "Cleanup after LF V2 backwards compatibility break (#17558)" (#17696)
This reverts commit 61ba0fa6fa.
2023-10-31 14:37:40 +01:00
Remy
8cfe4c01a3
Check qualified name when upgrading a contract (#17662) 2023-10-31 09:53:17 +01:00
Paul Brauner
db91552b4a
replace community canton snapshot with our bazel-built canton deploy jar (#17651)
* replace community canton snapshot with our bazel-built canton deploy jar

* add VERSION to the resources of the jar

* fix canton-test-runner-with-dependencies-script

* add resources to community_common

* Update test-common/canton/it-lib/src/main/com/daml/CantonFixture.scala

Co-authored-by: Remy <remy.haemmerle@daml.com>

---------

Co-authored-by: Remy <remy.haemmerle@daml.com>
2023-10-30 10:23:15 +00:00
Remy
422b6934d6
[Speedy] improve upgrade failure error message (#17634) 2023-10-25 15:16:11 +00:00