DLF September 2023 Planning Update

jmh530 john.michael.hall at gmail.com
Tue Nov 14 20:07:43 UTC 2023


On Tuesday, 14 November 2023 at 18:40:58 UTC, Adam D Ruppe wrote:
> [snip]
>
> But for existing libraries, I actually have a potential 
> solution for that: made dub look at the version tag date.
>
> So, suppose dub determines it wants to use abandoned-library 
> version 1.4. It knows version 1.4 was tagged on December 25, 
> 2016.
>
> This could automatically go ahead and add 
> `-edition=abandoned.library=2.092` to the build command for 
> that lib.
>
> Notice that build command used a package specifier, if an 
> edition is specified on the command line, it *MUST* be scoped 
> to a specific module (or D package, just like how `-i` works) 
> so when it is imported, the compiler can attach the edition tag 
> there without affecting other things in the build.
>
> It would basically work like you pass 
> `-edition=abandoned.library=2.092` on the cmd line and the 
> compiler acts exactly the same as if you wrote 
> `@edition(2.092)` when it sees `module abandoned library`.
>
>
> On the other hand, suppose dub sees a new tag, version 2.0, 
> created in 2024. This will be edition 2.107 since it has a date 
> range to version map.
>
> We'd have to work out the exact details, but just since dub 
> knows the tag date it can make a pretty good automatic guess as 
> to the proper version.

To bikeshed a little, dub has the concept of `subConfigurations` 
that you use to pass a configuration to a dependency. This is 
kind of like a `subEdition` so `subEdition "abandoned.library" 
2.092. Or something like that would be a bit more consistent.


More information about the Digitalmars-d-announce mailing list