Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Issue 11666: Separate each platforms ports into its own directory #731

Closed
wants to merge 2 commits into from

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Mar 2, 2014

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.

@yebblies
Copy link
Member

yebblies commented Mar 2, 2014

Configure sucks, just use import!

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 2, 2014

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. :)

@yebblies
Copy link
Member

yebblies commented Mar 3, 2014

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?

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 3, 2014

Yep, see the referenced pull.

@yebblies
Copy link
Member

yebblies commented Mar 3, 2014

Ah! Awesome, that's 1000000000000000000000 times better than doing it by copying files!

@WalterBright
Copy link
Member

I object to this design because there is no ucontext_t.h on Linux. See my comments on #732

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 4, 2014

@WalterBright you can always do s/ucontext_t.d/ucontext.d/ and implement the entire sys.ucontext under each ports/ directory.

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 8, 2014

Rebased so the entire sys.ucontext module is moved into separate ports directories.

@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.

@jpf91
Copy link
Contributor

jpf91 commented Mar 8, 2014

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 :-)

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 9, 2014

I checked via git log -p you guys contributed this module at least. :)

@andralex
Copy link
Member

andralex commented Mar 9, 2014

@ibuclaw: I'm with @WalterBright on this. Sorry. OK to close this?

@redstar
Copy link
Contributor

redstar commented Mar 10, 2014

@ibuclaw I am OK with it.

@andralex
Copy link
Member

Closing with regret.

@andralex andralex closed this Mar 16, 2014
@WalterBright
Copy link
Member

Rebooted as #741

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants