Issue 11666: Separate each platforms ports into its own directory #731
Conversation
Configure sucks, just use import! |
The problem is with imports you don't actually improve anything. You just take the consolidated mess from a large file, and move it to a new file with the same consolidated mess. This is something I'm just looking at now when trying to use packages. :) |
I mean like this: version(XYZ)
public import ports.xyz.whatever.this.file.is;
else version(ABC)
public import ports.abc.whatever.this.file.is;
else version(DEF)
public import ports.def.whatever.this.file.is;
else
static assert(0); Then you don't need to reconfigure to build for a different platform. Or is that what you mean by packages? |
Yep, see the referenced pull. |
Ah! Awesome, that's 1000000000000000000000 times better than doing it by copying files! |
I object to this design because there is no ucontext_t.h on Linux. See my comments on #732 |
@WalterBright you can always do |
Rebased so the entire @redstar @jpf91 @MartinNowak - I put you guys as the copyright owner of the relevant ports, as you were the ones who contributed them to druntime. Are you OK with this, or would you wish for your contribution to be noted in a more subtle way. |
Either way is fine by me. Although I can't take the credit for the whole ARM port, @klickverbot and probably some more people have contributed as well :-) |
I checked via |
@ibuclaw: I'm with @WalterBright on this. Sorry. OK to close this? |
@ibuclaw I am OK with it. |
Closing with regret. |
Rebooted as #741 |
This pull is a kickstarter to get some ball rolling on issue 11666. This implements the basic idea I had in mind in a very rough "tack it together with string" proof of concept sort of way. And is not suitable for merging yet.
This change takes the module core.sys.posix.ucontext by way of example, and moves it from
src/core/sys/posix
to$(PORTDIR)/core/sys/posix
. The idea being that we hand over the handling of architecture version conditons to the configure scripts, which in turn manages the exact files we need for compilation. (This is simply done in gdc, for instance, and hoping ldc will be the same).In self criticism, this is infact rather naive, and it would be more sensible to only move the ucontext/mcontext struct definitions into their own modules, leaving the original module intact without duplicating the function declarations everywhere.
I'll also raise a separate pull which does the same as here, except it leverages the recent packages feature that should be friendlier to dmd. (but will take a small while longer for me to do :o)
Watch this space.