* Fix `instance Show Text` to produce escaped Text (#15177)
This adapts the code used in GHC's 'instance Show Char where { showList }', representing characters as single-character
'Text's using a type synonym. CPP can be used during development to switch to a newtype-based implementation in order
to check type safety.
changelog_begin
- [Daml Standard Library] ``show @Text`` now escapes special characters, producing syntactically correct expressions (#15177)
changelog_end
* Add daml-test-file testing `show @Text`
* Avoid 'explode' in 'showLitChr'
* Cleanup 'showLitChr'
* Update DarReaderTest.scala
* Clean up import of GHC.Base
* Add Note for __DEBUG__SHOW_TEXT_CHR_NEWTYPE macro
* Extract longStringSize from longStringOf in daml-test-file ShowText.daml
* Document differences with GHC implementation
* Remove redundancy between showLitChr and {ascii=>ctrlChrText}
* Add 'exhaustive' test case in daml-test-file ShowText.daml
* Change 'ctrlChrText' default case to throw error
* Point to latest GHC with archive choices on interfaces
* Update Desugared daml for interfaces Archives
* satisfy changelog check
CHANGELOG_BEGIN
CHANGELOG_END
* Update daml-doc test files
* Add relevant identifiers to SignatureReaderSpec for iface Archive choice
* lint
* Point to GHC with generated HasArchive instance
* Add test for archive on interface
* Test that second archive doesn't work
* Update desugar tests
* Point to GHC merge
TLDR: Remove broken code which constructs stackTrace().
Happy never to have to read those NOTE(MH) comments in the pushLocation code again!
(1) This code was fundamentally broken for various reasons:
- It doesn't make sense to track location info on the continuation stack. The continuation stack is a record of the evaluation still to come; not a context for the current evaluation.
- Stack traces can't sensibly be provided in a language such as Daml which promises that tail-recursion is evaluated in constant stack-space.
- Attempting to keep location info on the continuation stack does not play well when exceptions are thrown and the stack is unwound.
(2) The stack-trace management code was also very hacky:
- The pushLocation code contained special cases when the continuation stack was headed by a KArg/SToken continuation. This is an internal implementation detail. The KArg doesn't even exist when we stop using the deprecated SEAppGeneral expression constructor.
- The pushLocation code also contained special support for copying stack-traces into SEVal and SDefinition caches, and then later back on to the continuation stack. Yuck!
(3) The stackTrace() code was barely used:
- Some time ago an alternative/simpler location tracking system (lastLocation) was implemented.
- Only ScenarioRunner makes use of the stackTrace()
- Only a single test changes behaviour when we drop use of stackTrace() in favour of getLastLocation
* remove 2.4.0-deprecated symbols and functions from api-type-signature library
* rename daml-lf-interface maven artifact to daml-lf-api-type-signature
CHANGELOG_BEGIN
- [Daml-LF] Java/Scala applications that directly depend on the (not officially
supported) ``daml-lf-interface`` library should upgrade to 2.4.0 first, fix
all deprecations, then upgrade to 2.5.0+ and change their Maven dependencies
to point to ``daml-lf-api-type-signature`` instead.
CHANGELOG_END
Avoid construction of unrestricted speedy expression applications.SEApp (alias for SEAppGeneral)
- Replace occurrences of SEApp(General) to use SEAppAtomic, with SELet1 as required
- Add new helper SEApp for many cases where arguments are simple values.
- Rename the most general unrestricted constructor as SEAppGeneral_DEPRECATED. The only remaining use is by fromUpdateSExpr and fromScenarioSExpr, due to our unprincipled approach to stack-trace. See TODO in pushLocation. I hope to fix this in a future PR.
- Rename the slightly less unrestricted constructor as SEAppOnlyFunIsAtomic_DEPRECATED. The only call site being in Anf.scala (for the case when ANF is not performed). Maybe one day we can perform ANF in all cases, and hence remove this one remaining usage.
Transform our code for the protobuf-decoding phase to be stack-safe, by means of a Work trampoline. The code-style rules are:
runWork is never called in a nested context.
We introduce an explicit Work.Delay to break recursion.
Increase the size of the many-fields test from 120 to 160 fields.
(At 164 fields we run into the protobuf limit)
Part of: #13410
We need to extract all the package party mappings found in a transaction, including the nodes that are under a rollback node
Rollback nodes have no informees of their own but we extract the children as expected
changelog_begin
changelog_end
* Compiler changes:
- add in ContractKeyWithMaintainersDefRef
- ensure compileModule compiles contract key lambdas for templates (and so allow contract keys to be extracted from contract instances)
CHANGELOG_BEGIN
CHANGELOG_END
* Give type signature for runApi
* Add InterfaceRetro.dar in daml-lf/tests
* Add failing test case
* Include interface packageId in usedPackages
changelog_begin
changelog_end
* new names in daml-script/runner
* new names in json-api
* new names in Scala bindings/codegen
* new names in Java bindings/codegen
* new names in daml-lf interpreter tests
* more new names in daml-script tests
* new names in navigator backend
* deprecate all iface symbols and old method names
CHANGELOG_BEGIN
- [Scala API] ``com.daml.lf.iface`` has been deprecated, as discussed
further in
`issue #14783 <https://github.com/digital-asset/daml/pull/14783>`__.
Use the deprecation warnings as guidance to the new names.
CHANGELOG_END
* prefix cases in OrderingSpec
- suggested by @remyhaemmerle-da; thanks
* pass retroImplements from Ast.DefInterface to DefInterface and addted test case
CHANGELOG_BEGIN
CHANGELOG_END
* added todo
CHANGELOG_BEGIN
CHANGELOG_END
* fixed findTemplate , added test cases
CHANGELOG_BEGIN
CHANGELOG_END
* add test data
CHANGELOG_BEGIN
CHANGELOG_END
* add copyright
CHANGELOG_BEGIN
CHANGELOG_END
* Add version 1.15 - move interfaces into them
* Update Ast/Version & docs for 1.15, split interface into simple/extended
* Stage 1.15 protobuf
* Remove references to dev from 1.15 protobufs
* Add Tests file for 1.15 in ledger API testtool
* Update Version 1.15 changelog with Call/implements
* Make 1.14 default again
* Add 1.15 as preview version
* Add 1.15 test suite to testtool
* Reinclude 1.15 in COMPILER_LF_VERSIONS to build model-tests-1.15
* Move v1_15 ledger-api-tests into own suite
* Fix InterfaceNotSupported message to 1.15 or higher
* satisfy changelog check
CHANGELOG_BEGIN
CHANGELOG_END
* Update tests with extended interface features to only run on 1.dev
* Allow unsafe_from_interface and interface_template_type_rep in 1.15
* Fix StableVersions back to 1.14, make EarlyAccessVersions 1.15
* Run retroactive implements tests only in extended interfaces
* lint
* Temporarily disable 1.15 conformance tests - handle in another PR
* Also disable conformance-test-tls1.2-or-newer-1.15
* Disable PureConfigReaderWriter tests that assume early-access == stable
* lint
* Temporarily disable decode extended interface primitives test
* Use dictionary comprehension to generate ledger/test-common test_names
* Move InterfaceSubscriptionsIT test back into 1.dev suite
* lint
* Make exercise guards nullable, ignore Nothing in decode/encode
* Desugar UExerciseInterface[Guarded] differently, point to updated GHC
* Update to new GHC revision, removes pred argument from `exercise`
* Attach correct range to guard support error (if any)
Co-Authored-By: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* Rename interface features
Co-Authored-By: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* Remove unnecessary mention of v1_14 from supportedInputVersions
Co-Authored-By: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* Clarify purpose of `Maybe Expr` type for exercise guard
Co-Authored-By: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* Remove guarded exercise when Extended Interfaces are not enabled
* Remove all instances of guarded exercises in versions <= 1.15
* Add check for isId to splitDFunId
* Exclude via $cexerciseGuarded check - ClassOpId approach did not work
* Run damlc interface tests w/o requires when since DAML_INTERFACE
* Update desugared daml for UExerciseInterface[Guarded] generation
* Temporarily disable failing damlc tests
* Remove 1.dev-only references from 1.15 protobuf
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
* use new names in json-api
* use new names in java codegen
* use new names in Scala codegen
* use new names in TypedValueGenerators
CHANGELOG_BEGIN
CHANGELOG_END
* move interface directory to api-type-signature; change bazel target; move scala files
* rename iface package to typesig; rename EnvironmentInterface to EnvironmentSignature
* rename Interface to PackageSignature
* rename fromReaderInterfaces to fromPackageSignatures
* rename InterfaceReader to SignatureReader
* rename InterfaceReader to SignatureReader in deprecation note
* rename readInterface to readPackageSignature
* rename InterfaceReaderError to Error
* rename InterfaceReaderMain to SignatureReaderMain
* rename InterfaceType to PackageSignature.TypeDecl
* rename astInterfaces to interfaces
* rename astInterfaces to interfaces in PackageSignature
* rename findAstInterface to findInterface
* rename a couple arguments
CHANGELOG_BEGIN
- [Scala API] The "quasi-public" API in ``com.daml.lf.iface`` has moved
to the new ``com.daml.lf.typesig`` package, with many accompanying
name changes as documented in `issue #13669
<https://github.com/digital-asset/daml/issues/13669>`__.
Daml 2.5.0 or later will remove the old names, and also rename the
Maven artifact from ``daml-lf-interface`` to
``daml-lf-api-type-signature``. We recommend that users of this API
use the deprecation guidance in 2.4.0 to port their applications
before this happens.
CHANGELOG_END
* Add version 1.15 - move interfaces into them
* Update Ast/Version & docs for 1.15, split interface into simple/extended
* Stage 1.15 protobuf
* Remove references to dev from 1.15 protobufs
* Add Tests file for 1.15 in ledger API testtool
* Update Version 1.15 changelog with Call/implements
* Make 1.14 default again
* Add 1.15 as preview version
* Add 1.15 test suite to testtool
* Reinclude 1.15 in COMPILER_LF_VERSIONS to build model-tests-1.15
* Move v1_15 ledger-api-tests into own suite
* Fix InterfaceNotSupported message to 1.15 or higher
* satisfy changelog check
CHANGELOG_BEGIN
CHANGELOG_END
* Update tests with extended interface features to only run on 1.dev
* Allow unsafe_from_interface and interface_template_type_rep in 1.15
* Fix StableVersions back to 1.14, make EarlyAccessVersions 1.15
* Run retroactive implements tests only in extended interfaces
* lint
* Temporarily disable 1.15 conformance tests - handle in another PR
* Also disable conformance-test-tls1.2-or-newer-1.15
* Disable PureConfigReaderWriter tests that assume early-access == stable
* lint