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

LF: Add context in missing package errors #10418

Merged
merged 2 commits into from
Jul 28, 2021
Merged

Conversation

remyhaemmerle-da
Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da commented Jul 27, 2021

explaining the origining of the missing package.

This is builton top of #10314.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@remyhaemmerle-da remyhaemmerle-da added the component/daml-engine DAML-LF Engine & Interpreter label Jul 27, 2021
@remyhaemmerle-da remyhaemmerle-da added this to the Maintenance milestone Jul 27, 2021
@remyhaemmerle-da remyhaemmerle-da linked an issue Jul 27, 2021 that may be closed by this pull request
6 tasks
@remyhaemmerle-da remyhaemmerle-da mentioned this pull request Jul 27, 2021
6 tasks
@remyhaemmerle-da remyhaemmerle-da marked this pull request as ready for review July 27, 2021 13:29
Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -1410,6 +1410,7 @@ private[lf] object SBuiltin {
throw SpeedyHungry(
SResultNeedPackage(
tyCon.packageId,
language.Reference.Exception(tyCon),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we ever hit this? I thought loading the packages during preprocessing should be enough to make sure we never run into this so this is an internal error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In off-ledger mode, there is no preprocessing and the validation can be skipped.
So we can change that to internal error, assuming off-ledger engines have to preload everything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

off-ledger engines should already preload everything I believe so that seems like a reasonable requirement. Doesn’t have to be in this PR though

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it is probably fine to skip completely the check and wait the lookup of the definition fails.
Since the ref of the definition is a ExceptionMessageDefRef the error message will get from com.daml.lf.speedy.Speedy.Machine#lookupVal should be clear enough.

explaining the origining of missing package.

This is part of #9974

CHANGELOG_BEGIN
CHANGELOG_END
@remyhaemmerle-da remyhaemmerle-da removed a link to an issue Jul 28, 2021
6 tasks
@remyhaemmerle-da
Copy link
Collaborator Author

cc @daravep

@remyhaemmerle-da remyhaemmerle-da merged commit 73290c2 into main Jul 28, 2021
@remyhaemmerle-da remyhaemmerle-da deleted the remy-lf-lookup-errors branch July 28, 2021 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/daml-engine DAML-LF Engine & Interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants