Commit Graph

202 Commits

Author SHA1 Message Date
Paul Brauner
6291abbe7a
Remove the V1 major language version from engine (#18400) 2024-02-08 16:09:47 +01:00
Paul Brauner
ff5d3acf90
Remove the choiceObservers feature flag in the engine (#18368)
* Remove the choiceObservers feature flag in the engine

* apply suggestion
2024-02-07 17:54:36 +00:00
Paul Brauner
5bbc4159c6
remove the any type feature flag from the engine (#18351) 2024-02-07 17:14:31 +00:00
Paul Brauner
ef2d327de7
Remove the typeRep feature flag in the engine (#18352) 2024-02-07 17:02:43 +01:00
Paul Brauner
bcacc8d789
Remove the numeric feature flag in the engine. (#18349) 2024-02-07 16:55:02 +01:00
Paul Brauner
66e30035f6
Remove the exerciseByKey feature flag in the engine (#18367) 2024-02-05 10:31:44 +01:00
Paul Brauner
67854f489e
Remove the basiceInterfaces feature flag in the engine (#18370) 2024-02-02 14:05:19 +00:00
Paul Brauner
f7dfff8b49
make metadata non-optional in packages (#18363) 2024-02-02 11:16:03 +00:00
Remy
3b292d0032
[LF] drop retroactive interface instance (#18282) 2024-02-01 17:41:51 +01:00
Paul Brauner
4cb4525951
remove interned* feature flags in the engine (#18334)
run-all-tests: true
2024-01-31 12:47:30 +01:00
Paul Brauner
f6b49fd430
default to LF2 in the engine (#18320)
* default to LF2

* fix DamlLfEncoderTest.scala

* fix EngineInfoTest

* fix //daml-lf/encoder:validate-dar-2.1

* remove unused features and obsolete comment
2024-01-30 17:22:05 +01:00
Paul Brauner
3d3e05981a
remove v1 encoder and decoder in the engine (#18295)
run-all-tests: true
2024-01-30 09:04:26 +01:00
Hubert Slojewski
3b5dce66f5
#15209 Remove agreement text part 1 (internal changes only) (#18218) 2024-01-22 17:06:17 +00:00
Paul Brauner
6393fd084c
Remove LF1 in the compiler (#18203)
* make lf v2 and daml3-script the default

* delete V1 integration tests

* Remove LF major version V1 from the compiler

run-all-tests: true

* fix security evidence

* fix //compiler/damlc/tests:damlc-test

* fix //compiler/damlc/tests:data-dependencies

* fix //compiler/damlc/tests:integration-v2*

* fix //compiler/damlc/tests:packaging

* fix //compiler/damlc/tests:platform-independence-dar-hash-file-matches

* fix //compiler/damlc/tests:stable-packages

* fix DarReaderTest.scala

* fix DecodeCommonSpec.scala

* fix //daml-lf/archive:proto_immutability_check

* fix DamlLfEncoderTest.scala

* fix //language-support/java/codegen:test

* fix //daml-assistant/integration-tests:integration-tests

* fix artifacts.yaml

run-all-tests: true
run-full-compat: true

* Disable scenario-perf for now

See https://github.com/digital-asset/daml/pull/18217.

run-all-tests: true
run-full-compat: true

* restore explicit target version in docs template

run-all-tests: true
run-full-compat: true

* Restore DamlLfEncoderTest.scala.

Introduce a ENGINE_LF_VERSIONS constant in daml-lf.bzl instead.

run-all-tests: true
run-full-compat: true

* delete daml-lf/scenario-interpreter/src/perf

run-all-tests: true
run-full-compat: true

* Address review comments.

* Apply

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>

* Restore golden/BUILD.bazel and port to 2.1

run-all-tests: true
run-full-compat: true

---------

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2024-01-19 15:19:34 +00:00
Remy
1971ccb930
[LF] Remove agreeement text from LF parser. (#18209)
part of removing agreement text.
(See https://docs.google.com/document/d/14z_OOaeqXjfKrQubkk6Gt1bwHIYnzxzd1xQiarZICKk/edit#bookmark=id.tdh4ghxn547)

also remove  remove the agreement from the Create Node generator
2024-01-19 12:06:48 +00:00
tudor-da
4f48e106ba
Sematically ordered typesafe PackageVersion (#18145) (#18223)
* Made PackageVersion typed and orderable semantically

* PackageVersion size limit is 255 and enforce comparisons
* Fix bug that led to some tests not running

run-all-tests: true
2024-01-19 10:30:52 +00:00
Gary Verhaegen
179d85362d
update copyright (#18167)
* update copyright

* undo hack from #18168

* update hash in platform-independence-pre-check
2024-01-15 20:27:42 +01:00
Paul Brauner
2b28e59017
Introduce LF 2.1 (#17865) 2023-11-23 08:59:14 +01:00
Paul Brauner
931214fb18
Refactor package decoding. (#17863) 2023-11-20 16:18:29 +01:00
Paul Brauner
f4ee00361e
Make LF v2 non backwards-compatible with LF v1 in the compiler (#17492)
* initial commit

* split gen-stable-packages-v_i into two targets

* rename compatibleWith to canDependOn

* update damlc integration tests annotation to allow for 2.x

* use the right package ID for preconditionFailed when compiling to V2

* fuse stable-packages-v1 and stable-packages-v2 into one single filegroup

* Fix DA.Daml.LF.Ast.Tests

* remove leftover 'undefined' in Version.hs

* progress on fixing DataDependencies.hs

* fix Cross-SDK typeclasses test for 2.dev

* Fix the 'Typeclasses and instances' data dependency test

* Update comment

* fix //compiler/damlc/tests:packaging

* Add TODO

* parameterize the machine by the langage version, hardcode v1 in script v2, v2 in script v2, v1 in exports

* get EngineTests to pass

* fix more tests

* fix canton integration tests

* formatting

* fix more tests

* fix transactionversiontest

* fix exceptiontest

* Fix ValueEnricherSpec

* Fix EngineInfoTest

* fix PartialTransactionSpec

* fix upgragetest

* fix TransactionSnapshot

* Fix ContractKeySpec

* Fix ReinterpretTest

* fix InterfaceViewSpec

* fix InterfacesTest

* fix stable package v1 names

* fix validate.sh tests

* formatting

* Fix ChoiceAuthorityTest

* fix explicit disclosure test

* Fix SpeedyTest

* formatting

* Fix integration test

* fix data dependency tests

* fix package vetting count, increased due to metadata being added

* Redact stable package IDs in error messages in order for the ExceptionSemantics test to work for both v1 and v2

* cleanup

* fix Daml2ScriptTestRunner

* fix JsonApiIT and daml-script golden tests

* fix daml3-script runner test

* enable v2 for all integration tests

* formatting

* fix NodeSeedsTest

* fix since-lf annotations

* add comments, improve consistency

* stop hardcoding V1 in runPureExpr and runPureSExpr

* formatting

* remove harcoding of LFv1 in ConcurrentCompiledPackages.apply

* Parameterize Compiler.Config.Default with major language version

* remove global parser implicit and default package ID and language version
2023-10-11 11:40:17 +02:00
Remy
4f2007238b
do not test anymore LF 1.6 and 1.7 (#17434) 2023-09-19 13:27:26 +02:00
Paul Brauner
a5cd445d3b
Introduce LF2 major version (#17348)
- Introduces a new major version, "2", in the daml_lf proto
- Adds new major versions to the compiler and the engine
- Updates all code that assumes only one major version
- Updates all code that assumes only one dev version
2023-09-13 10:01:42 +02:00
Paul Brauner
da08791df4
Use feature names instead of explicit mentions to 1.dev in speedy (#17379) 2023-09-09 10:33:28 +02:00
Paul Brauner
818bb1e6e8
Clean up some bazel rules (#17359)
* Fix a probable typo in //daml-fl/encoder/testing-dar-*

* apply TODOs in bazel files

* remove obsolete comments in bazel files

* use 'default' instead of 'latest' for targets relying on 'latest' in order to ensure interfaces are supported
2023-09-06 08:25:58 +02:00
nickchapman-da
587efe4401
[Upgrades POC] softExercise (#16893) 2023-05-31 12:21:39 +00:00
Moisés Ackerman
990308ce53
[Upgrades PoC] softFetch (#16839)
* Refactor PackageMetadata construction

* Package Metadata now can include an upgraded package id

* define PackageInterface#lookupPredecessors

* Add SoftFetch in Daml LF

* Add softFetch function in Daml

* Add USoftFetch LFConversion primitive

* Define SoftFetch in terms of SBPromoteAnyContract

* daml_compile rule now takes upgrades arg

* Add script test for softFetch

* TODOs

* Check LF >= 1.dev when decoding 'upgradedPackageId' and 'softFetch' in DecodeV1.scala

* Check that softFetch is not called on templates with contract keys

* Seq=>List

* ModParser todo

* Extract PackageUpgradesIT from AbstractFuncIT

* Update docstring for SBPromoteAnyContract

* Fix build errors

* Fix build error

* DecodeV1Spec case for softFetch

* DecodeV1Spec case for upgradedPackageId

* EncodeV1 case for upgradedPackageId

* Fix build error

* Disable test due to cyclic dependency with canton

* Add transitive case to PackageUpgradesIT

* Clean up PackageUpgradesIT

* Fix build error

* Error if 'upgrades' field is present before featurePackageUpgrades

* Update doc on compileSoftFetchTemplate

* Reword WronglyTypedContractSoft error
2023-05-16 10:33:47 +02:00
Remy
31bfe9b4c4
[Engine] Implement numeric builtins compatible type nat erasure (#16773)
on the scala side except Speedy.

part of #11679
2023-05-02 12:07:54 +02:00
Remy
dc40709efe
[LF] add proper encoder tests for Builtins (#16758)
We test encoder with exhaustive list of builtins for 1.11, 1.12, 1.13,
1.14, 1.15, 1.dev.

This test indirectly allso, LF parser, and LF type checking for
builtins.
2023-04-26 17:09:38 +02:00
Remy
7a17c19bbf
LF: Rename builtins that would need a witness to allow nat type erasure (#16743)
part of #11679
2023-04-24 15:02:11 +00:00
nickchapman-da
3abbf2b972
[engine] Push choice authority through compilation pipeline (#16639) 2023-04-03 09:19:24 +00:00
Moisés Ackerman
98dd1a3045
Add dynamicExercise expression and builtin (#16431)
* Add dynamicExercise expression and builtin

* Add DAML_DYNAMIC_EXERCISE feature flag
2023-03-15 10:35:24 +01:00
Moisés Ackerman
8784ebd9ce
Add choiceController and choiceObserver functions (#16088)
* Add daml test file for choice functions

* Add HasChoice{Controller,Observer} type classes

* Add choice_{controller,observer} in LF

* Update GHC_REV

* Generate HasChoice{Controller,Observer} instances

* Remove manual instances in daml test file for choice functions

* Remove/forbid choice{Controller,Observer} before featureChoiceFuncs

* update *.desugared-daml golden files

* Apply code review suggestion

* Update GHC_REV (da-master-8.8.1)

Co-authored-by: Remy <remy.haemmerle@daml.com>
2023-01-18 14:50:00 +00:00
nickchapman-da
f9139f6761
revert actings_as_consortium changes; obsoleted by withAuthorityOf (#16067) 2023-01-16 15:27:56 +00:00
Gary Verhaegen
151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00
nickchapman-da
2df734e1ce
[engine] consortium primitives in LF (#15864) 2022-12-14 15:06:15 +00:00
Remy
3dee676cbb
[LF] making LF 1.15 stable (#15614) 2022-11-17 23:30:11 +01:00
Remy
a18fe164ca
[LF] reenable requires for interface (#15561)
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-11-15 08:59:24 +00:00
Remy
49f4d2979e
[LF] strengthen compilation flags (#15481) 2022-11-09 14:12:04 +01:00
Remy
56dfeb1e87
[LF] improve AstRewriter (#15073)
CHANGELOG_BEGIN
CHANGELOG_END
2022-09-23 15:13:19 +02:00
Remy
a1e92e539f
[LF] fix encoder for ELocation (#15070)
* [LF] fix encoder for ELocation

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-23 10:28:21 +00:00
Remy
769e26e104
LF: Remove unecesary spaces in LF snippet (#14762)
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-19 15:29:32 +02:00
Remy
b53c7c3799
LF test use consistently record for interface view. (#14746)
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-18 10:27:43 +00:00
dylant-da
a4e29299be
Implement Interface views in speedy (#14565)
* Add DA_Internal_Interface to convertTypeDef exclusion check

* Move desugared types/values for interface views into DA.Internal.Desugar

* Convert viewtype and view method declarations

* Typecheck view types and view declarations

* Add unit viewtypes to InterfaceChoiceCollision tests

* Add unit viewtypes to more compiler/damlc tests

* Modify empty interfaces/implements to have viewtypes/views

* Add unit viewtypes to remaining Interface tests

* Test for error thrown when viewtype not specified

* Fix daml-lf/ interface tests to use new syntax / unit views

* Add placeholder view of type Unit to TestInterfaces

CHANGELOG_BEGIN
CHANGELOG_END

* Fix typescript interface tests with unit viewtype

* Add unit viewtype to Java & Scala codegen

* Add unit viewtype to triggers tests interface

* Add unit viewtypes to ledger/test-common

* Add unit viewtypes to ledger-service/http-json

* Fix some damlc tests

* Use viewtype syntax in InterfaceViewNonSerializable test

* Remove HasInferfaceView instances in convertBind

* Add unit view to QualifiedInterface.daml test

* Generate HasInterfaceView instances in DataDependencies

* Add unit viewtypes and views to compiler/damlc/tests

* Document reconstruction of HasInterfaceView

* Move desugared types/values for interface views into DA.Internal.Desugar

* Add desugarable function view w/ EViewInterface desugaring

* Remove templateName and viewtype from generated EViewInterface

* Update desugared-daml

* Proof of concept: use _view -> EViewInterface prim via HasInterfaceView

* Move view, HasInterfaceView to DA.Internal.Interface

* Update desugared-daml tests

* Stop removing and re-generating HasInterfaceView instances

* Do not generate docs for generated "_view_" methods

* Report errors with interface TypeConNames prettily

* Fix InterfaceViewNotSpecified @ERROR to reflect new error text

* Don't import magic `view` method from Prelude to avoid name clash

* Update shake interface goto definition test locations

* Temp disable view spec tests, will re-implement views in speedy

* Add unit viewtype to Java code snippet docs

* Update Interface syntax docs for views

* Add unit viewtype to Transferrable.daml

* Add back "empty" interface implementation to interfaces.rst

* Re-enable view tests by having _view methods on InterfaceViews.daml file

* Remove deprecated commented-out view desugaring code

* Remove templateId and viewtype from EViewInterface

* Fix lint

* Compile DefRefs for views, return them in SBViewInterface

* Stop looking for `_view` method, remove ENoViewFound in TypeChecker.hs

* Remove ENoViewFound / remove view method lookup, use view param instead

* Fix use of viewMethod.returnType / import of MethodName

* Replace uses of `_view` in Scala, update parser w/ viewtype/view clauses

* Fix lint

* Update Interface LF encoding test for views

* Stop using unit views in ParsersSpec

* Fix tests to have new Scala test parser viewtype/view syntax

* Fix Interface_extended_1.dev_.lf to have viewtypes/views

* Change all spec/lf viewtypes/views to Unit

* Remove accidental use of requires

* Fix ParsersSpec to have record viewtypes/views

* Fix ValueEnricherSpec for switch to unit views

* Remove no view test from Scala - lack of view is caught at compile-time

* Remove unused _view method in InterfaceViews.daml test

* Return control expression via Control.Expression

* Retrieve compiled views via implementation body
2022-08-09 12:49:14 +01:00
Moisés Ackerman
c146bee87d
Reduce duplication between implements and co-implements (#14607)
* Reduce duplication between implements and co-implements

This extracts the common part (methods and view) to a new type InterfaceInstanceBody

changelog_begin
changelog_end
2022-08-04 17:01:15 +02:00
Remy
b475d710aa
LF: Create LF 1.15 in scala to park basic interface constructs (#14534)
basic interface constructs contain:
- interface definition
- interface implementation
- retroactive template implemenation
- exerciseInterface and fetchInterface
- basic builin

but do not contain:
- "requires"
- exercise guards

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-29 20:09:57 +02:00
Remy
88d4ff93f2
LF: remove precondition in interface (proto & scala side) (#14511)
CHANGELOG_BEGIN
CHANGELOG_END
2022-07-27 10:52:35 +02:00
Remy
df21aad8af
LF: Make ExerciseInterface guard field optional (#14493)
in protobuf

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-25 11:33:02 +02:00
dylant-da
ab948dd8de
Update LF AST protobuf for interface viewtype and implementation view (#14439)
* Update protobuf to include viewtype and implementation view

* Stub interface viewtype and implements view in updated AST

* Set views on Java builders in DecodeV1Spec

CHANGELOG_BEGIN
Update LF AST protobuf for interface viewtype and implementation view -
not currently linked to syntax or engine changes, all stubbed out in
LFConversion.
CHANGELOG_END

* Add view field to CoImplements

* Update iterators & parsers to account for CoImplements view

* Replace uses of TBuiltin(BTUnit) with TUnit

* Remove superfluous "Available in versions >= 1.dev" comment

* Fix missing TUnit imports, missing view param in daml-lf/parser

* Remove unused imports from DecodeV1Spec

* Add stub view in AstSpec
2022-07-19 12:00:04 +00:00
Moisés Ackerman
d3824945b0
Retroactive implements scala typecheck (cont) (#14346)
* Extend EncodeV1Spec with interface co-implements

* Add lookupTemplateImplementsOrInterfaceCoImplements to PackageInterface

* Use lookupTemplateImplementsOrInterfaceCoImplements in checkImplements

* Add TypingSpec cases for interface conversion functions via co-implements

* Add TypingSpec cases for interfaces with co-implements

* Apply code review suggestions: result type formatting

changelog_begin
changelog_end
2022-07-07 12:49:09 +00:00
Moisés Ackerman
1f1f2785b0
Retroactive implements scala typecheck (#14266)
* Add lookup functions for co-implements

* Typecheck interface co-implementations

    * Use new environment in checkIfaceCoImplementation

* Fix Interface_1.dev_.lf

* OtherMod=>InterfaceMod0

changelog_begin
changelog_end
2022-07-05 09:53:56 +02:00