Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split daml3-script into internal and stable package #20334

Draft
wants to merge 9 commits into
base: main-2.x
Choose a base branch
from

Conversation

samuel-williams-da
Copy link
Contributor

@samuel-williams-da samuel-williams-da commented Nov 20, 2024

The goal here is to move "exported" types/exceptions from daml script into a separate stable package, then force the rest of the types to be non serializable. We achieve the latter with a new --force-utility-package flag, which ensures the generated package will not be considered for upgrades.
Note that all exceptions must be Stable, but not all newtypes/datatypes. However, since the Stable package must still compile, any types that exceptions depend on must also be stable.

In total, the stable types are:

  • data PartyManagement.PartyDetails
  • newtype PartyManagement.PartyIdHint
  • newtype PartyManagement.ParticipantName
  • newtype UserManagement.UserId
  • data UserManagement.User
  • data UserManagement.UserRight
  • exception UserManagement.InvalidUserId
  • exception UserManagement.UserAlreadyExists
  • exception UserManagement.UserNotFound
  • newtype Testing.CommandName <- required by Testing.FailedCmd below
  • newtype Testing.ErrorClassName <- required by Testing.FailedCmd below
  • newtype Testing.ErrorMessage <- required by Testing.FailedCmd below
  • exception Testing.FailedCmd

I have also moved daml3-script over to our bazel daml-compile. This required some tweaks to the rule, as it was putting source files in odd locations, which didn't match what daml-script had done before.

Previously, it would create a daml.yaml at root, then the source file paths would include their full bazel path (i.e. daml-script/daml3/Daml/Script.daml), whereas our goal would be simply daml/Daml/Script.daml
To achieve this, I first fixed the daml_compile rule to remove the label's package path from the source file, then I added a daml_source field, which we set to daml, to be consistent with how script used to be built.
This change has affected the independence check, as the source files within that dar are now correctly placed. Similarly, since dalf's include source locations with their full path, the top level dalf's hash has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant