-
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
Give users more tools to deal with ghc package name shadowing in dependencies and data-dependencies. #4948
Labels
Comments
ghost
added
discussion
Things to be discussed and decided
language
Language team work
component/packaging
labels
Mar 11, 2020
On the other hand, renaming packages doesn’t seem that much easier than renaming modules (which arlready works). I guess providing an alias for the package is nicer if you have lots of collisions. |
Actually looking at this again, the latter option of having a |
cocreature
added a commit
that referenced
this issue
May 26, 2020
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
6 tasks
cocreature
added a commit
that referenced
this issue
May 26, 2020
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
cocreature
added a commit
that referenced
this issue
May 28, 2020
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
mergify bot
pushed a commit
that referenced
this issue
May 28, 2020
* Add a module-prefixes field to rename all modules in a pkg 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 * Update compiler/damlc/daml-opts/daml-opts-types/DA/Daml/Options/Packaging/Metadata.hs Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me> * Improve docs and fix broken suggestion changelog_begin changelog_end Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
When packages have the same ghc package name, such as when importing multiple versions of the same package, or old versions of the current package, package qualified imports don't work by default. The user needs to a package flag in build-options to rename modules. This is really unintuitive, so I think we should add some support for dealing with package imports in
daml.yaml
, e.g. by giving the package an alias:So you could disambiguate modules by using package qualified imports:
Alternatively, this could be solved by adding a prefix to module names:
so you can just use a regular import,
I think the latter is a little cleaner for users, since you perform any necessary module renaming in a consistent place and you don't have to use package qualified import syntax, but I don't know which one is easier to implement.
The text was updated successfully, but these errors were encountered: