phobos icon indicating copy to clipboard operation
phobos copied to clipboard

Add the Phobos v3 unit tests to the regular unittest build.

Open jmdavis opened this issue 3 months ago • 5 comments

This probably isn't the best way to do this, and presumably, it'll need to be reworked at some point (just like the Phobos v3 build in general likely will need to be reworked), but this should at least make it so that the Phobos v3 tests get run as part of the CI.

jmdavis avatar Apr 06 '24 13:04 jmdavis

Thanks for your pull request, @jmdavis!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#8972"

dlang-bot avatar Apr 06 '24 13:04 dlang-bot

Hmmm. It looks like the Linux, Mac, and FreeBSD VMs are all missing dub, and for better or worse, the Phobos v3 build uses dub, so those VMs don't work work with this. And the Windows x64 one is failing with an error that I don't understand

/usr/bin/link: extra operand '/OPT:ICF' Try '/usr/bin/link --help' for more information. Error: C:\Program Files\Git\usr\bin\link.exe failed with status: 1 Error C:\hostedtoolcache\windows\dc\ldc2-1.37.0\x64\ldc2-1.37.0-windows-multilib\bin\ldc2.exe failed with exit code 1.

And then buildkite is failing with

Error Package with target type "none" must have dependencies to build.

implying that there's probably something about the dub.sdl file that doesn't work with the version of dub that it's running, but I don't know.

So, I'm not quite sure what to do here. Obviously, the test runners in general are not set up to use dub.

jmdavis avatar Apr 06 '24 14:04 jmdavis

https://github.com/dlang/phobos/pull/8992 should fix the lack of dub problems, the windows failure I have no idea.

thewilsonator avatar Apr 29 '24 03:04 thewilsonator

The host compiler needs to be activated first, see e.g. https://github.com/dlang/dmd/blob/e5d7779794a1df4aa607e1ca989b3adf1f14073c/ci/run.sh#L130-L158. Then when using dub naively like this, it will most likely use the host compiler to compile Phobos, not fresh DMD master/stable.

The Windows issue is actually an LDC problem, which assumes link.exe in PATH is the MS one, not the GNU one. But when using DMD as compiler, not the LDC host compiler, that problem vanishes too.

kinke avatar May 03 '24 11:05 kinke

Extra care might also be required to make sure that Phobos v2 isn't importable and linked-in by default, only depending on druntime alone. As DMD doesn't have separate druntime and Phobos libs, but merges both to a single lib, that might be more difficult than it sounds.

kinke avatar May 03 '24 11:05 kinke