digitalmars.D - dmd -c behaviour doesn't take account of packages.
- Bernard Helyer (11/11) Feb 22 2012 A discussion on the Mono-D IRC channel just made me realise
- David Nadlinger (4/6) Feb 22 2012 -oq, anyone? ;)
- David Nadlinger (5/6) Feb 22 2012 Whoops, forgot the link:
- Brad Roberts (2/9) Feb 22 2012 If only one of the attempts to implement that option actually worked.
- Jacob Carlborg (4/13) Feb 23 2012 Yeah, sorry, my bad.
- Jacob Carlborg (5/10) Feb 23 2012 I've tried to implement that several times but something always fails on...
- Jonathan M Davis (15/29) Feb 22 2012 Then what happens when you have
- Bernard Helyer (9/14) Feb 22 2012 Good point.
- Jonathan M Davis (8/27) Feb 22 2012 I really think that it should either put it in a single object file or c...
- Bernard Helyer (4/34) Feb 22 2012 Except DMD is faster by a factor of 10 when passing it all at
- Jonathan M Davis (8/10) Feb 22 2012 Then maybe there _should_ be a flag to tell it to use/generate the appro...
- =?UTF-8?B?U8O2bmtlIEx1ZHdpZw==?= (3/15) Feb 23 2012 Am I not seeing something obvious in this discussion, or is there
- Jacob Carlborg (6/16) Feb 23 2012 I don't see a point in putting the object files in different directories...
- H. S. Teoh (12/29) Feb 23 2012 [...]
- Bernard Helyer (7/42) Feb 23 2012 Did you not read what Jacob posted?
- Bernard Helyer (3/9) Feb 23 2012 Also, you can't have a package called module.
- Jacob Carlborg (4/43) Feb 23 2012 Exactly.
- Jonathan M Davis (15/33) Feb 24 2012 It organizes things better IMHO to have them in a separate directory hie...
- Jacob Carlborg (5/32) Feb 23 2012 I don't agree. The compiler should just put the object files in the same...
- Jacob Carlborg (5/21) Feb 23 2012 See my reply to Jonathan:
- Jacob Carlborg (16/45) Feb 23 2012 The way -oq works is the compiler uses the fully qualified name of the
- Jonathan M Davis (8/18) Feb 23 2012 Because then it nicely matches the layout of the source code. It's certa...
- H. S. Teoh (13/25) Feb 22 2012 [...]
- Jonathan M Davis (5/28) Feb 22 2012 Yuck. Yuck. Source should _always_ be separated from object files. It's
- Kevin Cox (8/36) Feb 22 2012 Although I agree that sources and objects should be sperated there are s...
- H. S. Teoh (12/26) Feb 22 2012 Not really. You just have .d's with their corresponding .o's sitting
- Jonathan M Davis (6/15) Feb 22 2012 I would consider the fact that they're in the same folder to be a mess i...
- H. S. Teoh (7/18) Feb 22 2012 [...]
- Martin Nowak (10/19) Feb 25 2012 use '-op' to preserve the directory structure
- Sean Kelly (10/27) Feb 25 2012 Be aware that if you use an archiver to put these files in a library you...
A discussion on the Mono-D IRC channel just made me realise something. dmd -c foo/a.d bar/a.d The second module overwrites the first. This makes using 'pass everything at once' with Mono-D (IDE plugin) difficult/impossible. As far as I'm concerned, it's just a bug that's never come up. The solution is trivial, of course. Prepend package names so you get foo_a.o and bar_a.o. Either that or allow specific output paths to be specified per-object. Or just produce one object file. Anything _but_ the current behaviour, in fact.
Feb 22 2012
On Wednesday, 22 February 2012 at 21:33:36 UTC, Bernard Helyer wrote:dmd -c foo/a.d bar/a.d The second module overwrites the first.-oq, anyone? ;) David
Feb 22 2012
On Wednesday, 22 February 2012 at 21:36:10 UTC, David Nadlinger wrote:-oq, anyone? ;)Whoops, forgot the link: https://github.com/D-Programming-Language/dmd/pull/563. David
Feb 22 2012
On Wed, 22 Feb 2012, David Nadlinger wrote:On Wednesday, 22 February 2012 at 21:36:10 UTC, David Nadlinger wrote:If only one of the attempts to implement that option actually worked.-oq, anyone? ;)Whoops, forgot the link: https://github.com/D-Programming-Language/dmd/pull/563. David
Feb 22 2012
On 2012-02-22 23:42, Brad Roberts wrote:On Wed, 22 Feb 2012, David Nadlinger wrote:Yeah, sorry, my bad. -- /Jacob CarlborgOn Wednesday, 22 February 2012 at 21:36:10 UTC, David Nadlinger wrote:If only one of the attempts to implement that option actually worked.-oq, anyone? ;)Whoops, forgot the link: https://github.com/D-Programming-Language/dmd/pull/563. David
Feb 23 2012
On 2012-02-22 22:37, David Nadlinger wrote:On Wednesday, 22 February 2012 at 21:36:10 UTC, David Nadlinger wrote:I've tried to implement that several times but something always fails on Windows. -- /Jacob Carlborg-oq, anyone? ;)Whoops, forgot the link: https://github.com/D-Programming-Language/dmd/pull/563. David
Feb 23 2012
On Wednesday, February 22, 2012 22:33:35 Bernard Helyer wrote:A discussion on the Mono-D IRC channel just made me realise something. dmd -c foo/a.d bar/a.d The second module overwrites the first. This makes using 'pass everything at once' with Mono-D (IDE plugin) difficult/impossible. As far as I'm concerned, it's just a bug that's never come up. The solution is trivial, of course. Prepend package names so you get foo_a.o and bar_a.o. Either that or allow specific output paths to be specified per-object.Then what happens when you have dmc -c foo/a.d foo_a.dOr just produce one object file. Anything _but_ the current behaviour, in fact.Generating one object file would make far more sense. If you're going to worry about modules when generating object files, then you really should be putting the object files in the same directory layout as the modules have. But that sort of thing is arguably a build tool's job, not the compiler. Regardless, I really wouldn't like the idea of screwing with the object file names to try and avoid collisions. If anything, the compiler should complain that dmd -c foo/a.d bar/a.d will result in a conflict, because one file would overwrite the other. But the single object file solution sounds reasonable. - Jonathan M Davis
Feb 22 2012
On Wednesday, 22 February 2012 at 22:05:51 UTC, Jonathan M Davis wrote:Then what happens when you have dmc -c foo/a.d foo_a.dGood point.Regardless, I really wouldn't like the idea of screwing with the object file names to try and avoid collisions.Well, the thing is in this case everything is being passed to the compiler. It knows the names of everything. But yeah, I think complaining is fine _if_ dmd allows individual modules to be named explicitly. Otherwise, all in one is good. But really, even prefixing it would be better than what we have now. What about 'module.foo_a.o' if foo_a isn't in a package?
Feb 22 2012
On Wednesday, February 22, 2012 23:33:57 Bernard Helyer wrote:On Wednesday, 22 February 2012 at 22:05:51 UTC, Jonathan M Davis wrote:I really think that it should either put it in a single object file or complain and disallow it. Really, the correct way to build such modules is to put each object file in a directory hierarchy which matches the modules. Anything else is a mess. But that's the job a build tool, not the compiler. So, it should do what's reasonable, which doesn't include renaming files to avoid module collisions IMHO. - Jonathan M DavisThen what happens when you have dmc -c foo/a.d foo_a.dGood point.Regardless, I really wouldn't like the idea of screwing with the object file names to try and avoid collisions.Well, the thing is in this case everything is being passed to the compiler. It knows the names of everything. But yeah, I think complaining is fine _if_ dmd allows individual modules to be named explicitly. Otherwise, all in one is good. But really, even prefixing it would be better than what we have now. What about 'module.foo_a.o' if foo_a isn't in a package?
Feb 22 2012
On Wednesday, 22 February 2012 at 22:44:15 UTC, Jonathan M Davis wrote:On Wednesday, February 22, 2012 23:33:57 Bernard Helyer wrote:Except DMD is faster by a factor of 10 when passing it all at once.On Wednesday, 22 February 2012 at 22:05:51 UTC, Jonathan M Davis wrote:I really think that it should either put it in a single object file or complain and disallow it. Really, the correct way to build such modules is to put each object file in a directory hierarchy which matches the modules. Anything else is a mess. But that's the job a build tool, not the compiler.Then what happens when you have dmc -c foo/a.d foo_a.dGood point.Regardless, I really wouldn't like the idea of screwing with the object file names to try and avoid collisions.Well, the thing is in this case everything is being passed to the compiler. It knows the names of everything. But yeah, I think complaining is fine _if_ dmd allows individual modules to be named explicitly. Otherwise, all in one is good. But really, even prefixing it would be better than what we have now. What about 'module.foo_a.o' if foo_a isn't in a package?
Feb 22 2012
On Wednesday, February 22, 2012 23:50:53 Bernard Helyer wrote:Except DMD is faster by a factor of 10 when passing it all at once.Then maybe there _should_ be a flag to tell it to use/generate the appropriate directory structure. You already typically give it an output directory. It wouldn't be all that hard for it to then generate and use the correct directories in that directory. That still bugs me a little, because that's more of a build tool's job, but it wouldn't be hard to do, would fix the file conflicts across modules, and would let you keep that extra speed. - Jonathan M Davis
Feb 22 2012
Am 23.02.2012 00:03, schrieb Jonathan M Davis:On Wednesday, February 22, 2012 23:50:53 Bernard Helyer wrote:Am I not seeing something obvious in this discussion, or is there something that "dmd -op -c ..." or "dmd -odobj -op -c ..." would do wrong?Except DMD is faster by a factor of 10 when passing it all at once.Then maybe there _should_ be a flag to tell it to use/generate the appropriate directory structure. You already typically give it an output directory. It wouldn't be all that hard for it to then generate and use the correct directories in that directory. That still bugs me a little, because that's more of a build tool's job, but it wouldn't be hard to do, would fix the file conflicts across modules, and would let you keep that extra speed. - Jonathan M Davis
Feb 23 2012
On 2012-02-23 00:03, Jonathan M Davis wrote:On Wednesday, February 22, 2012 23:50:53 Bernard Helyer wrote:I don't see a point in putting the object files in different directories when the compiler can output the object files with fully qualified module names. -- /Jacob CarlborgExcept DMD is faster by a factor of 10 when passing it all at once.Then maybe there _should_ be a flag to tell it to use/generate the appropriate directory structure. You already typically give it an output directory. It wouldn't be all that hard for it to then generate and use the correct directories in that directory. That still bugs me a little, because that's more of a build tool's job, but it wouldn't be hard to do, would fix the file conflicts across modules, and would let you keep that extra speed. - Jonathan M Davis
Feb 23 2012
On Thu, Feb 23, 2012 at 01:42:44PM +0100, Jacob Carlborg wrote:On 2012-02-23 00:03, Jonathan M Davis wrote:[...] Because ambiguity can arise. Like my/module/A.d -> my_module_A.o my_module_A.d -> my_module_A.o (conflict) my_module/A.d -> my_module_A.o (conflict) my/module_A.d -> my_module_A.o (conflict) Granted, this is a really contrived example, but unexpected coincidences like that do happen. T -- "Hi." "'Lo."On Wednesday, February 22, 2012 23:50:53 Bernard Helyer wrote:I don't see a point in putting the object files in different directories when the compiler can output the object files with fully qualified module names.Except DMD is faster by a factor of 10 when passing it all at once.Then maybe there _should_ be a flag to tell it to use/generate the appropriate directory structure. You already typically give it an output directory. It wouldn't be all that hard for it to then generate and use the correct directories in that directory. That still bugs me a little, because that's more of a build tool's job, but it wouldn't be hard to do, would fix the file conflicts across modules, and would let you keep that extra speed. - Jonathan M Davis
Feb 23 2012
On Thursday, 23 February 2012 at 21:28:17 UTC, H. S. Teoh wrote:On Thu, Feb 23, 2012 at 01:42:44PM +0100, Jacob Carlborg wrote:Did you not read what Jacob posted? my.module.A.o my_module_A.o my_module.A.o my.module_A.o No conflicts.On 2012-02-23 00:03, Jonathan M Davis wrote:[...] Because ambiguity can arise. Like my/module/A.d -> my_module_A.o my_module_A.d -> my_module_A.o (conflict) my_module/A.d -> my_module_A.o (conflict) my/module_A.d -> my_module_A.o (conflict) Granted, this is a really contrived example, but unexpected coincidences like that do happen. TOn Wednesday, February 22, 2012 23:50:53 Bernard Helyer wrote:I don't see a point in putting the object files in different directories when the compiler can output the object files with fully qualified module names.Except DMD is faster by a factor of 10 when passing it all at once.Then maybe there _should_ be a flag to tell it to use/generate the appropriate directory structure. You already typically give it an output directory. It wouldn't be all that hard for it to then generate and use the correct directories in that directory. That still bugs me a little, because that's more of a build tool's job, but it wouldn't be hard to do, would fix the file conflicts across modules, and would let you keep that extra speed. - Jonathan M Davis
Feb 23 2012
On Thursday, 23 February 2012 at 23:06:56 UTC, Bernard Helyer wrote:Did you not read what Jacob posted? my.module.A.o my_module_A.o my_module.A.o my.module_A.o No conflicts.Also, you can't have a package called module.
Feb 23 2012
On 2012-02-24 00:06, Bernard Helyer wrote:On Thursday, 23 February 2012 at 21:28:17 UTC, H. S. Teoh wrote:Exactly. -- /Jacob CarlborgOn Thu, Feb 23, 2012 at 01:42:44PM +0100, Jacob Carlborg wrote:Did you not read what Jacob posted? my.module.A.o my_module_A.o my_module.A.o my.module_A.o No conflicts.On 2012-02-23 00:03, Jonathan M Davis wrote:[...] Because ambiguity can arise. Like my/module/A.d -> my_module_A.o my_module_A.d -> my_module_A.o (conflict) my_module/A.d -> my_module_A.o (conflict) my/module_A.d -> my_module_A.o (conflict) Granted, this is a really contrived example, but unexpected coincidences like that do happen. TOn Wednesday, February 22, 2012 23:50:53 Bernard Helyer wrote:I don't see a point in putting the object files in different directories when the compiler can output the object files with fully qualified module names.Except DMD is faster by a factor of 10 when passing it all >>at once.Then maybe there _should_ be a flag to tell it to >use/generate the appropriate directory structure. You already typically give >it an output directory. It wouldn't be all that hard for it to then generate and use the correct directories in that directory. >That still bugs me a little, because that's more of a build tool's >job, but it wouldn't be hard to do, would fix the file conflicts >across modules, and would let you keep that extra speed. - Jonathan M Davis
Feb 23 2012
On Thursday, February 23, 2012 13:42:44 Jacob Carlborg wrote:On 2012-02-23 00:03, Jonathan M Davis wrote:It organizes things better IMHO to have them in a separate directory hierarchy which matches the source's directory hierarchy, but outputing modules with fully qualified modules names does solve the core problem as long as it can be done in a manner that's not going to result in conflicts (which you've shown a way to do). A build tool can organize the object files differently if you want it to. Worrying about the directory structure is the sort of thing that's better left to a build tool anyway. I was pointing out that I thought that using a separate directory structure is the ideal way to go and that the previous suggestion of renaming modules wouldn't work. The only remaining issue then is the fact that dmd is faster when compiling multiple modules at once, which ends up making it so that using a build tool to build each module separately to organize it how you want would result in a slower build. But that may just be the way that life goes. - Jonathan M DavisOn Wednesday, February 22, 2012 23:50:53 Bernard Helyer wrote:I don't see a point in putting the object files in different directories when the compiler can output the object files with fully qualified module names.Except DMD is faster by a factor of 10 when passing it all at once.Then maybe there _should_ be a flag to tell it to use/generate the appropriate directory structure. You already typically give it an output directory. It wouldn't be all that hard for it to then generate and use the correct directories in that directory. That still bugs me a little, because that's more of a build tool's job, but it wouldn't be hard to do, would fix the file conflicts across modules, and would let you keep that extra speed. - Jonathan M Davis
Feb 24 2012
On 2012-02-22 23:43, Jonathan M Davis wrote:On Wednesday, February 22, 2012 23:33:57 Bernard Helyer wrote:I don't agree. The compiler should just put the object files in the same directory and use the fully qualified module name. -- /Jacob CarlborgOn Wednesday, 22 February 2012 at 22:05:51 UTC, Jonathan M Davis wrote:I really think that it should either put it in a single object file or complain and disallow it. Really, the correct way to build such modules is to put each object file in a directory hierarchy which matches the modules. Anything else is a mess. But that's the job a build tool, not the compiler. So, it should do what's reasonable, which doesn't include renaming files to avoid module collisions IMHO. - Jonathan M DavisThen what happens when you have dmc -c foo/a.d foo_a.dGood point.Regardless, I really wouldn't like the idea of screwing with the object file names to try and avoid collisions.Well, the thing is in this case everything is being passed to the compiler. It knows the names of everything. But yeah, I think complaining is fine _if_ dmd allows individual modules to be named explicitly. Otherwise, all in one is good. But really, even prefixing it would be better than what we have now. What about 'module.foo_a.o' if foo_a isn't in a package?
Feb 23 2012
On 2012-02-22 23:33, Bernard Helyer wrote:On Wednesday, 22 February 2012 at 22:05:51 UTC, Jonathan M Davis wrote:See my reply to Jonathan: http://forum.dlang.org/thread/svyqjflmabsxabmnpzrg forum.dlang.org?page=2#post-ji56kf:242j8p:241:40digitalmars.com -- /Jacob CarlborgThen what happens when you have dmc -c foo/a.d foo_a.dGood point.Regardless, I really wouldn't like the idea of screwing with the object file names to try and avoid collisions.Well, the thing is in this case everything is being passed to the compiler. It knows the names of everything. But yeah, I think complaining is fine _if_ dmd allows individual modules to be named explicitly. Otherwise, all in one is good. But really, even prefixing it would be better than what we have now. What about 'module.foo_a.o' if foo_a isn't in a package?
Feb 23 2012
On 2012-02-22 23:05, Jonathan M Davis wrote:On Wednesday, February 22, 2012 22:33:35 Bernard Helyer wrote:The way -oq works is the compiler uses the fully qualified name of the module in the file name of the object file. So if foo/a.d has "module foo.a;" and foo_a.d has "module foo_a;" then the following object files will be created: foo.a.o foo_a.o No conflict. If there would have been a conflict with the object files ,it would have been a conflict with the module names as well and the compiler would have stopped before generating the object files.A discussion on the Mono-D IRC channel just made me realise something. dmd -c foo/a.d bar/a.d The second module overwrites the first. This makes using 'pass everything at once' with Mono-D (IDE plugin) difficult/impossible. As far as I'm concerned, it's just a bug that's never come up. The solution is trivial, of course. Prepend package names so you get foo_a.o and bar_a.o. Either that or allow specific output paths to be specified per-object.Then what happens when you have dmc -c foo/a.d foo_a.dNo I don't think so. If the compiler generate object file names based on the fully qualified module name it will be A LOT easier to implement a build tool that can do incremental builds. I don't see any advantage of putting the object files in sub directories.Or just produce one object file. Anything _but_ the current behaviour, in fact.Generating one object file would make far more sense. If you're going to worry about modules when generating object files, then you really should be putting the object files in the same directory layout as the modules have. But that sort of thing is arguably a build tool's job, not the compiler.Regardless, I really wouldn't like the idea of screwing with the object file names to try and avoid collisions. If anything, the compiler should complain that dmd -c foo/a.d bar/a.d will result in a conflict, because one file would overwrite the other. But the single object file solution sounds reasonable. - Jonathan M Davis-- /Jacob Carlborg
Feb 23 2012
On Thursday, February 23, 2012 12:06:54 Jacob Carlborg wrote:On 2012-02-22 23:05, Jonathan M Davis wrote:Because then it nicely matches the layout of the source code. It's certainly the typical thing to do with many projects in other languages. It also keeps the object files separate from the source files, which makes for cleaner directories, fewer issues with source control, easier cleaning of builds, etc. (at least in comparison to putting them in the same directories as the source, which some folks do). - Jonathan M DavisIf you're going to worry about modules when generating object files, then you really should be putting the object files in the same directory layout as the modules have. But that sort of thing is arguably a build tool's job, not the compiler.No I don't think so. If the compiler generate object file names based on the fully qualified module name it will be A LOT easier to implement a build tool that can do incremental builds. I don't see any advantage of putting the object files in sub directories.
Feb 23 2012
On Wed, Feb 22, 2012 at 05:05:40PM -0500, Jonathan M Davis wrote:On Wednesday, February 22, 2012 22:33:35 Bernard Helyer wrote:[...] The real solution is that when creating object files, dmd should put the .o files in the modules' respective subdirectories. I.e., it should keep the pathname component of every source file and use that for the object file. Then you have a 1-to-1 mapping between source files and object files. Either that, or duplicate the source tree structure in an object tree (if you like that kind of compile structure -- some projects do that). Everything else is just a hack and prone to errors. T -- My program has no bugs! Only unintentional features...A discussion on the Mono-D IRC channel just made me realise something. dmd -c foo/a.d bar/a.d The second module overwrites the first. This makes using 'pass everything at once' with Mono-D (IDE plugin) difficult/impossible. As far as I'm concerned, it's just a bug that's never come up. The solution is trivial, of course. Prepend package names so you get foo_a.o and bar_a.o. Either that or allow specific output paths to be specified per-object.
Feb 22 2012
On Wednesday, February 22, 2012 16:08:20 H. S. Teoh wrote:On Wed, Feb 22, 2012 at 05:05:40PM -0500, Jonathan M Davis wrote:Yuck. Yuck. Source should _always_ be separated from object files. It's incredibly messy otherwise.On Wednesday, February 22, 2012 22:33:35 Bernard Helyer wrote:[...] The real solution is that when creating object files, dmd should put the .o files in the modules' respective subdirectories. I.e., it should keep the pathname component of every source file and use that for the object file. Then you have a 1-to-1 mapping between source files and object files.A discussion on the Mono-D IRC channel just made me realise something. dmd -c foo/a.d bar/a.d The second module overwrites the first. This makes using 'pass everything at once' with Mono-D (IDE plugin) difficult/impossible. As far as I'm concerned, it's just a bug that's never come up. The solution is trivial, of course. Prepend package names so you get foo_a.o and bar_a.o. Either that or allow specific output paths to be specified per-object.Either that, or duplicate the source tree structure in an object tree (if you like that kind of compile structure -- some projects do that).That's definitely the way to organize things. - Jonathan M Davis
Feb 22 2012
Although I agree that sources and objects should be sperated there are some benifits. All tools know where to look for the objects. And is not dificult to keep out of scm. A great example of this is Haskell. To compile an app you only need to specify the main file and it finds all the included modules, only recompiling if nessary. And if I remember correctly it also spits out a "definition list" type file that is great for things like code completion. On Feb 22, 2012 7:15 PM, "Jonathan M Davis" <jmdavisProg gmx.com> wrote:On Wednesday, February 22, 2012 16:08:20 H. S. Teoh wrote:On Wed, Feb 22, 2012 at 05:05:40PM -0500, Jonathan M Davis wrote:Yuck. Yuck. Source should _always_ be separated from object files. It's incredibly messy otherwise.On Wednesday, February 22, 2012 22:33:35 Bernard Helyer wrote:[...] The real solution is that when creating object files, dmd should put the .o files in the modules' respective subdirectories. I.e., it should keep the pathname component of every source file and use that for the object file. Then you have a 1-to-1 mapping between source files and object files.A discussion on the Mono-D IRC channel just made me realise something. dmd -c foo/a.d bar/a.d The second module overwrites the first. This makes using 'pass everything at once' with Mono-D (IDE plugin) difficult/impossible. As far as I'm concerned, it's just a bug that's never come up. The solution is trivial, of course. Prepend package names so you get foo_a.o and bar_a.o. Either that or allow specific output paths to be specified per-object.Either that, or duplicate the source tree structure in an object tree (if you like that kind of compile structure -- some projects do that).That's definitely the way to organize things. - Jonathan M Davis
Feb 22 2012
On Wed, Feb 22, 2012 at 07:15:37PM -0500, Jonathan M Davis wrote:On Wednesday, February 22, 2012 16:08:20 H. S. Teoh wrote:[...]Not really. You just have .d's with their corresponding .o's sitting side-by-side. It's a 1-to-1 correspondence. No mess.The real solution is that when creating object files, dmd should put the .o files in the modules' respective subdirectories. I.e., it should keep the pathname component of every source file and use that for the object file. Then you have a 1-to-1 mapping between source files and object files.Yuck. Yuck. Source should _always_ be separated from object files. It's incredibly messy otherwise.[...] To each his own. :) But either way, the point is that the source tree structure *must* be reflected by the object files. Otherwise you break the 1-to-1 correspondence and all sorts of nasty bugs show up. T -- It only takes one twig to burn down a forest.Either that, or duplicate the source tree structure in an object tree (if you like that kind of compile structure -- some projects do that).That's definitely the way to organize things.
Feb 22 2012
On Wednesday, February 22, 2012 16:28:45 H. S. Teoh wrote:On Wed, Feb 22, 2012 at 07:15:37PM -0500, Jonathan M Davis wrote:I would consider the fact that they're in the same folder to be a mess in and of itself even without going into the other pros and cons, but there's no point in getting in an argument about it.Yuck. Yuck. Source should _always_ be separated from object files. It's incredibly messy otherwise.Not really. You just have .d's with their corresponding .o's sitting side-by-side. It's a 1-to-1 correspondence. No mess.But either way, the point is that the source tree structure *must* be reflected by the object files. Otherwise you break the 1-to-1 correspondence and all sorts of nasty bugs show up.Definitely. - Jonathan M Davis
Feb 22 2012
On Wed, Feb 22, 2012 at 09:36:12PM -0500, Jonathan M Davis wrote:On Wednesday, February 22, 2012 16:28:45 H. S. Teoh wrote:[...] You're entitled to your opinion. :) I just prefer to keep things in one place if there's no confusion caused. T -- IBM = I Blame MicrosoftOn Wed, Feb 22, 2012 at 07:15:37PM -0500, Jonathan M Davis wrote:I would consider the fact that they're in the same folder to be a mess in and of itself even without going into the other pros and cons, but there's no point in getting in an argument about it.Yuck. Yuck. Source should _always_ be separated from object files. It's incredibly messy otherwise.Not really. You just have .d's with their corresponding .o's sitting side-by-side. It's a 1-to-1 correspondence. No mess.
Feb 22 2012
On Wed, 22 Feb 2012 22:33:35 +0100, Bernard Helyer <b.helyer gmail.com> wrote:A discussion on the Mono-D IRC channel just made me realise something. dmd -c foo/a.d bar/a.d The second module overwrites the first. This makes using 'pass everything at once' with Mono-D (IDE plugin) difficult/impossible. As far as I'm concerned, it's just a bug that's never come up. The solution is trivial, of course. Prepend package names so you get foo_a.o and bar_a.o. Either that or allow specific output paths to be specified per-object. Or just produce one object file. Anything _but_ the current behaviour, in fact.use '-op' to preserve the directory structure use '-od' to set the root directory mkdir foo bar echo "module foo.a;" > foo/a.d echo "module bar.a;" > bar/a.d dmd -c -op -odout foo/a.d bar/a.d tree out rm -r foo bar out
Feb 25 2012
Be aware that if you use an archiver to put these files in a library you'll o= verwrite one. The command to preserve path name that the archiver provides o= n some OSes doesn't exist everywhere.=20 On Feb 25, 2012, at 7:09 AM, "Martin Nowak" <dawg dawgfoto.de> wrote:On Wed, 22 Feb 2012 22:33:35 +0100, Bernard Helyer <b.helyer gmail.com> wr=ote:=20at once' with Mono-D (IDE plugin) difficult/impossible. As far as I'm conce= rned, it's just a bug that's never come up. The solution is trivial, of cour= se. Prepend package names so you get foo_a.o and bar_a.o. Either that or all= ow specific output paths to be specified per-object. Or just produce one obj= ect file. Anything _but_ the current behaviour, in fact.A discussion on the Mono-D IRC channel just made me realise something. =20 dmd -c foo/a.d bar/a.d =20 The second module overwrites the first. This makes using 'pass everything==20 use '-op' to preserve the directory structure use '-od' to set the root directory =20 mkdir foo bar echo "module foo.a;" > foo/a.d echo "module bar.a;" > bar/a.d dmd -c -op -odout foo/a.d bar/a.d tree out rm -r foo bar out
Feb 25 2012