July 20, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

--- Comment #19 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
>But maybe your idea of registering on demand is worth considering even with that update.
if you'll decide that it worth keeping, then just drop a note in 16298, i can rewrite the patch to use CT reflection instead. if you don't want to create your own patch from scratch, of course. ;-)

>Sorry about the strife!
no problems. ;-)

--
July 28, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |johannespfau@gmail.com

--- Comment #20 from Johannes Pfau <johannespfau@gmail.com> ---
> as nothing directly referring to module ctors, linker just doesn't know that it > should not optimize 'em away. maybe we can fix that by emiting some flag for .o > files, but i don't really know -- i never even read about dwarf object file
> format, so i'm not sure if such flag exists.

The constructors are referenced by the ModuleInfo. ModuleInfo is theoretically unreferenced which will cause issues with --gc-sections, but as long as you don't use --gc-sections that doesn't matter. (LDC has a workaround, IIRC)


The problem in this case is that the linker does not even attempt to link in
the object file though. The linker only looks at object files in a static
library if it still has some unresolved symbols. A solution is using the whole
archive linker option:
http://stackoverflow.com/questions/805555/ld-linker-question-the-whole-archive-option

As you said this will result in bigger executables though.

--
July 28, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

--- Comment #21 from Steven Schveighoffer <schveiguy@yahoo.com> ---
I have a branch to fix this. I'm waiting for my cycle detection fix to be pulled, because I don't want to re-introduce cycles to make that fail (in case it's specific to an OS I don't test locally). Once that is pulled, I will create a PR to revert the changes I made.

--
August 23, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

--- Comment #22 from Steven Schveighoffer <schveiguy@yahoo.com> ---
I created a PR, but it still has cycles, only on Windows
(https://github.com/dlang/phobos/pull/4743)

Looks like it doesn't actually fix it :) I will work on a more suitable PR.

--
August 23, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

--- Comment #23 from Steven Schveighoffer <schveiguy@yahoo.com> ---
New PR: https://github.com/dlang/phobos/pull/4743

--
August 23, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

--- Comment #24 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Where's that edit button...

Real new PR: https://github.com/dlang/phobos/pull/4744

--
August 24, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

--- Comment #25 from Ketmar Dark <ketmar@ketmar.no-ip.org> ---
> I'm like 90% convinced that nobody uses std.encoding.EncodingScheme.
i am using it. i have my own iv.encoding (and some others), where alot of schemes are registered. and alot of my code depends on std.encoding. as badly designed as it is, it is still better than nothing, and this time i -- for some unknown reason -- decided to go with phobos implementation insted of rolling my own. ;-)

--
August 24, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

--- Comment #26 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
So all this is because encoding is a part of an unknown module cycle?

--
August 25, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

--- Comment #27 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to Sobirari Muhomori from comment #26)
> So all this is because encoding is a part of an unknown module cycle?

It's a known module cycle (cycle is printed when it's found).

However, I think the cycle only happens when unit testing phobos. I created another related issue to solve that problem: https://issues.dlang.org/show_bug.cgi?id=16265

But I keep finding other bugs when trying to fix this. Which is, in a way, a good thing.

--
October 01, 2016
https://issues.dlang.org/show_bug.cgi?id=16291

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@dawg.eu
            Summary|phobosinit fails to         |phobosinit never gets
                   |register encodings on       |called
                   |individual tests            |

--- Comment #28 from Martin Nowak <code@dawg.eu> ---
The phobosinit module is never referenced and subsequently never gets called. If you do import std.internal.phobosinit in your own program, the ctor crashes because it can't find all the unreferenced EncodingScheme classes.

--