Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Tango requires Phobos ?

Moderators: kris

Posted: 03/20/07 11:32:01

I'm trying to split the "gdc" package (RPM/DEB) into two (gdc and gdc-phobos), to allow for replacing gdc-phobos with gdc-tango.

But I ran into an issue where Tango requires a file from Phobos:

module tango.core.Intrinsic;
public import std.intrinsic;

Does this mean that I need to split the packages down further, to have the import modules (tango/std/etc) in one package and the object.d(i) and lib(g)phobos.a in another one ? (and make the Tango imports require the Phobos imports). I already moved the "gcc" directories from Phobos into the GDC package instead, since Tango requires "gcc.builtins" and some of the other configs like that.

Author Message

Posted: 03/20/07 11:55:34

No, Tango don't require Phobos in any way. std.intrinsic is provided as a .di file because DMD (and I think GDC) has the module name hardcoded into the compiler, and thus to provide the compiler intrinsics to the users, std.intrinsic needs to be part of the installation, even if the user imports tango.core.Intrinsic.

Posted: 03/20/07 12:28:30

My bad, I missed the "std" directory in the Tango %install - only did the "tango" directory.

Posted: 03/20/07 15:48:53

You might want to look at how Tango does the same thing. The 'gdc' package effectively lives in lib/compiler/gdc. The most significant structural change is that the garbage collector has been refactored out of this package, with accompanying code changes in the GDC code to support this. As a result, the official GDC runtime and the Tango GDC runtime are not drop-in replacements for one another.

Posted: 03/20/07 16:34:41

sean wrote:

You might want to look at how Tango does the same thing. The 'gdc' package effectively lives in lib/compiler/gdc. The most significant structural change is that the garbage collector has been refactored out of this package, with accompanying code changes in the GDC code to support this. As a result, the official GDC runtime and the Tango GDC runtime are not drop-in replacements for one another.

OK, so Tango doesn't work with the offical GDC binaries without patching/recompiling ?

I was under the impression I could just replace libgphobos.a and the import modules...

Posted: 03/20/07 21:17:21

Sorry, my prior post was a bit misleading. The GDC binary works with Tango as-is. You just have to replace libgphobos.a, like you mentioned. What I meant was that Tango's version of gphobos/internal doesn't match the official gphobos/internal, so mixing and matching gphobos code with Tango may not work. User code is fine, but anything called by the compiler (_d_* functions, for example) is likely to have problems. std.asserterror is one such example.

Posted: 03/20/07 21:28:06

That's OK, the packages operate under the assumption that Phobos and Tango are mutually exclusive and that you will rebuild everything when switching from one compiler to another. But it seems that as long as you use "rebuild" (and not just "gdmd"), GDC doesn't seem to be having any problems using Tango instead of Phobos. (i.e. with a hello.d test program)

Maybe it still needs a way for the two to co-exist, like when we renamed GDC's Phobos library to avoid conflicts with DMD's Phobos library, but it works if you uninstall GDC+Phobos and then re-install GDC+Tango instead. Maybe it can be possible to crossgrade between them later on, too. So you can switch between gdc-phobos-devel <-> gdc-tango-devel