dub icon indicating copy to clipboard operation
dub copied to clipboard

`dub_test_root` is deprecated, but used by unit test runners like Silly

Open ArthaTi opened this issue 10 months ago • 3 comments

Silly uses UDAs to name unittests. These UDAs are not normally available at runtime to the test runner, so Silly uses traits to fetch them from all known modules. It uses dub_test_root to do so, which has recently been deprecated.

I don't believe there exists a suitable replacement to access all modules at compile time, so I don't think it is appropriate to deprecate dub_test_root.

ArthaTi avatar Feb 08 '25 09:02 ArthaTi

I do agree that splitting it out and having it opt-in would be a good feature to have, I don't think you have the full picture here: https://github.com/dlang/dub/pull/2650

rikkimax avatar Feb 08 '25 09:02 rikkimax

Thanks for the link! I had no idea indeed.

If it's deprecated only to fix deprecation build failures, then maybe it would be a good idea to add some informative text inside the deprecation itself.

As it is the compiler's entry point, the module itself will not cause a deprecation warning, and it importing deprecating modules will not cause deprecation warnings (as there is no longer a transition of deprecation state).

So I suppose the only way to fix this would be to mark silly as deprecated from inside of itself?

ArthaTi avatar Feb 08 '25 10:02 ArthaTi