Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
July 14, 2020 misc questions about a DUB package | ||||
---|---|---|---|---|
| ||||
I have some D-wrapped C libraries I'm considering publishing to DUB, mainly for my own use but also for anybody else who might benefit. I've never done this before so I have some questions: - Should there be any obvious relationship between the DUB package version and the version of the C library? What are the best practices for connecting the two, if at all? - I'm very much about the "full fat" D experience, so I presently have no intention of designing my D wrappers for betterC/the-runtime-is-lava usage. That being the case, is there any compelling reason to avoid initializing the C library in a 'shared static this()' method? (ie automatically) |
July 15, 2020 Re: misc questions about a DUB package | ||||
---|---|---|---|---|
| ||||
Posted in reply to DanielG | On Tuesday, 14 July 2020 at 20:56:06 UTC, DanielG wrote: > I have some D-wrapped C libraries I'm considering publishing to DUB, mainly for my own use but also for anybody else who might benefit. I've never done this before so I have some questions: > > - Should there be any obvious relationship between the DUB package version and the version of the C library? What are the best practices for connecting the two, if at all? No. Usually, a DUB package supports a range of C library version or just a fixes set of C API. The version behavior of the dub package is up to you. Usually, D API changes more frequently than the underlying C library. > - I'm very much about the "full fat" D experience, so I presently have no intention of designing my D wrappers for betterC/the-runtime-is-lava usage. That being the case, is there any compelling reason to avoid initializing the C library in a 'shared static this()' method? (ie automatically) Yes. For a large project and services, it may be required to initialize shared a library with a function call instead of at startup. Furthermore, missing dependency may not be a fatal issue for service. In other hand, it all depends on your usage case. |
July 15, 2020 Re: misc questions about a DUB package | ||||
---|---|---|---|---|
| ||||
Posted in reply to 9il | Thank you. |
July 15, 2020 Re: misc questions about a DUB package | ||||
---|---|---|---|---|
| ||||
Posted in reply to 9il | On 2020-07-15 04:20, 9il wrote: > No. Usually, a DUB package supports a range of C library version or just a fixes set of C API. The version behavior of the dub package is up to you. Usually, D API changes more frequently than the underlying C library. If you support a specific version of the C API, I recommend adding the version of the C library as metadata: 0.0.1+5.3 In the above example "0.0.1" would be the version of the Dub package. "5.3" would be the version of the C API. The plus sign and anything after is ignored by Dub. See semantic versioning docs for more information: https://semver.org -- /Jacob Carlborg |
July 16, 2020 Re: misc questions about a DUB package | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Wednesday, 15 July 2020 at 11:49:09 UTC, Jacob Carlborg wrote:
> The plus sign and anything after is ignored by Dub.
Good to know, thank you.
|
Copyright © 1999-2021 by the D Language Foundation