You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A potentially common scenario is having multiple melange.emit stanzas in the same dune project, where these emit stanzas consume the same libraries.
Currently, the dependencies on assets inside the library have to be defined using the emit alias, e.g. if a library foo depends on some asset bar.svg, the dune config will look something like:
The issue with this approach is that in a scenario like mentioned above, where there can be multiple usages of a given library by multiple emit stanzas, so users will need to write the copy_files rules for the library file N times unnecessarily.
One solution could be to define the dependency on the assets at the library level, e.g.:
I am not a big fan of the proposed solution with library.mode.assets. If this use case is generalizable to any library mode —not only melange, but also byte and native—, then it might be preferable to just add a new field runtime_deps inside the library stanza?
I would suggest a melange.runtime_deps field. I'm not sure how this field would be used outside of melange so a general runtime_deps field is premature. Sticking it into modes also isn't the style of how dune does things.
A potentially common scenario is having multiple
melange.emit
stanzas in the same dune project, where these emit stanzas consume the same libraries.Currently, the dependencies on assets inside the library have to be defined using the emit alias, e.g. if a library
foo
depends on some assetbar.svg
, the dune config will look something like:The issue with this approach is that in a scenario like mentioned above, where there can be multiple usages of a given library by multiple emit stanzas, so users will need to write the copy_files rules for the library file N times unnecessarily.
One solution could be to define the dependency on the assets at the library level, e.g.:
The text was updated successfully, but these errors were encountered: