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

Proposal: Depending on DAR packages shipped with the SDK #2979

Closed
cocreature opened this issue Sep 23, 2019 · 3 comments · Fixed by #3056
Closed

Proposal: Depending on DAR packages shipped with the SDK #2979

cocreature opened this issue Sep 23, 2019 · 3 comments · Fixed by #3056
Labels
discussion Things to be discussed and decided language/now Language team priority NOW language Language team work

Comments

@cocreature
Copy link
Contributor

Currently, depending on a DAR package requires specifying a relative or absolute path to the DAR. This does not work well if we want to start distributing libraries with the SDK, e.g., I would like to ship a prototype of DAML triggers soon which will require shipping the trigger library.

I propose that we extend the dependencies field in daml.yaml to support paths of the form $SDK/lib.dar which will automatically be resolved to something like ~/.daml/sdk/$CURRENT_SDK/daml-libs. That should be easy to implement and reasonably easy to use and makes it feasible to commit this in your repository.

cc @associahedron as the benevolent dictator of the assistant and @Robin-da and @nickchapman-da for general packaging questions and @bame-da for UX feedback.

@cocreature cocreature added discussion Things to be discussed and decided language/now Language team priority NOW language Language team work labels Sep 23, 2019
@bame-da
Copy link
Contributor

bame-da commented Sep 23, 2019

$SDK/lib.dar is inconsistent with std-lib and ghc-prim. I'm not opposed to special treatment of SDK-included packages, but think there should only be one mechanism.

@cocreature
Copy link
Contributor Author

That’s a fair point. daml-stdlib and daml-prim will always be special, e.g. they are not shipped as .dars and they are always in scope whereas these packagase won’t be in scoe implicitly. But that might not be something that we want to expose users to.

If we want to make them uniform, we could assume that all dependencies that do not end with .dar are shipped with the SDK and treat them specially. Does that sound reasonable?

So then you would specify dependencies: - lib and we internally translate that to something like ~/.daml/sdk/$CURRENT_SDK/daml-libs/lib.dar.

@ghost
Copy link

ghost commented Sep 23, 2019

@cocreature I like that. I like the simplicity & uniformity of:

dependencies: 
- daml-prim
- daml-stdlib
- daml-triggers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Things to be discussed and decided language/now Language team priority NOW language Language team work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants