-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add a module-prefixes field to rename all modules in a pkg #6105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's awesome! Great work. Thank you so much.
compiler/damlc/daml-opts/daml-opts-types/DA/Daml/Options/Packaging/Metadata.hs
Outdated
Show resolved
Hide resolved
.. code-block:: yaml | ||
|
||
module-prefixes: | ||
foo-1.0.0: Foo1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use a prefix with a dot, like Foo.Bar
, as well? If not, should we consider making it possible? Either way, let's document what is possible in this regard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we just append it. I’ll document it.
|
||
It is also possible to add a prefix to all modules in a package using | ||
the ``module-prefixes`` field in your ``daml.yaml``. For the example | ||
above you can use the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add some motivation why you would want to do this here? Or shall we add something to the upgrading docs and reference it from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section is about handling module name collisions so the motivation is there but I’ll try to make it a bit clearer.
This PR adds a `module-prefixes` field to `daml.yaml` a a shorthand for specifying a `--package` flag that renames all modules in a package to have the same prefix. The docs are updated to describe how you can use this field and there is a test case that makes sure it works. fixes #4948 changelog_begin - [DAML Compiler] You can now use the new ``module-prefixes`` field in ``daml.yaml`` to add a prefix to all modules from a dependency. This is particularly useful for handling colliding module names during upgrades. See https://docs.daml.com/daml/reference/packages.html#handling-module-name-collisions for more information. changelog_end
…ging/Metadata.hs Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
changelog_begin changelog_end
That's really neat. Thanks! |
This PR adds a
module-prefixes
field todaml.yaml
a a shorthandfor specifying a
--package
flag that renames all modules in apackage to have the same prefix.
The docs are updated to describe how you can use this field and there
is a test case that makes sure it works.
fixes #4948
changelog_begin
module-prefixes
field indaml.yaml
to add a prefix to all modules from a dependency. Thisis particularly useful for handling colliding module names during
upgrades. See
https://docs.daml.com/daml/reference/packages.html#handling-module-name-collisions
for more information.
changelog_end
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.