Implement -rb switch for recursive build and -rx switch for exclusion lists.#1861
Conversation
src/mars.c
Outdated
There was a problem hiding this comment.
Preferably this would be part of the ini file, however that's not part of the repository so I can't change it.
There was a problem hiding this comment.
Ok great. But to avoid build failures the process would have to be:
- Merge pull (after review etc.)
- Add default exclusions to ini files
- Make another pull removing hardcoding
There was a problem hiding this comment.
Build failures? In the autotester? The autotester doesn't use sc.ini files from the repository?
Because it doesn't affect users (I assume there is no change in behavior if -rb is not specified).
There was a problem hiding this comment.
I meant if I update sc.ini right now and add -rb to the flags it will fail since this pull isn't merged yet.
There was a problem hiding this comment.
Sorry, what do you mean? Why not add the sc.ini changes in this pull? The ini files are stored in this repository, not in e.g. the installer repo, so since the ini changes will get pulled only together with the DMD changes, why would it cause build failures?
There was a problem hiding this comment.
Also, I don't think -rb should be in the .ini file, at least not for now. Just the -rx defaults.
There was a problem hiding this comment.
Ah I didn't know they're here, I'll take a look.
test/compilable/test9896.sh
Outdated
There was a problem hiding this comment.
I think the top-level makefile already sets the OBJ variable using a similar check.
test/compilable/test9896.sh
Outdated
There was a problem hiding this comment.
(Reposting) The top-level makefile declares the DSEP and OBJ variables.
|
Please spend the time to make a DIP and reach a solid consensus for this feature and how it will integrate with rdmd.
It's quite confusing but maybe still helpful to look at https://github.com/dawgfoto/dmd/tree/DIP11 which supported a |
|
Hi Martin, This patch is a follow-up to a discussion in the newsgroup. The discussion is linked to in the corresponding Bugzilla issue. I'm not sure how a DIP would be appropriate, considering that the issue can be summarized in one sentence (move rdmd's recursive compilation feature into the compiler). The actual flags are currently not as important, considering they are mainly used as an internal interface with rdmd. Changing dmd's interface (command-line) to be more user-friendly to take advantage of this new feature can be a separate enhancement, worthy of a separate discussion.
This proposal was also discussed in the newsgroup.
This is equivalent to I can't speak of matters related to compiler internals. |
test/compilable/test9896.sh
Outdated
There was a problem hiding this comment.
(Nitpick) No . before ${OBJ} (OBJ already starts with .)
Yeah, I also thought about this.
I've read the discussion. The DIP is to condense/fixate the discussion outcome and to promote a proper design of a feature. Having a simple DIP is not a problem but as the discussion shows there are already many constraints and corner cases. |
|
Well it's a start in some direction. As for compiler internals like As for the feature itself, it's not controversial. The compiler already tracks all dependencies and finds everything via import switches. It seems only natural that it would have the ability to compile everything itself. But since the compiler is so hacky in many places it might require more than this simplistic pull. |
These are not part of this pull request. As I said, that would be a separate enhancement. I think the bureaucracy overhead is uncalled for in this case. |
|
Note aside: The |
|
@klickverbot Indeed, I already have a patch ready laying out the foundation for a better mechanism. |
|
I've had some odd crashes in the glue layer with this feature. I guess this isn't as simple to implement as it seemed it would be. Closing for now. |
|
I haven't encountered any problems while using this feature. Could the crashes be latent bugs? Have you tried reducing them? |
|
@CyberShadow: I haven't reduced it yet, but the failing test-case can be seen in https://github.com/AndrejMitrovic/dgen in the There's a build script in the Building via RDMD works. Also building with DMD manually via the response file works ( |
|
Reopening this, it's rebased and there's no need to stall it. I'll go through all the comments again in the meantime. |
|
Bad fixup in mars.c, fixing it now. |
src/module.c
Outdated
There was a problem hiding this comment.
This is strange, I don't remember writing this section at all. I definitely wouldn't use these strange names for the variables or use lone ; in else statements or if right next to { braces. :s
Ah, I see the comment in the source here: I should probably set Edit: Did just that. |
|
Added default exclusion lists to the |
|
I don't think the tester uses those ini/conf files, I'm getting multiple definition errors. |
|
Yeah, the |
|
As a workaround for the testsuite I've added |
|
Does the test suite consult any ini files? If not, then that's probably the correct fix rather than a workaround. |
I don't think it does, but I thought maybe the ini files in the |
|
Updated: Using |
|
I think Martin's idea about whitelists could be useful. E.g. if you want to build your library Essentially this would build |
|
Wait, what happens if you specify a module on the command line that is blacklisted? Does it error out, or does it only build that module? I think it should error out, since if it doesn't the result will most likely not be what the user expected. |
|
@CyberShadow : I haven't thought of that. Yeah it should error out, will implement now. |
|
Although.. I'm not sure. |
|
What do you mean? When would this be useful? |
|
I still think this change goes in the wrong direction. |
|
Didn't think of that. How far is libdmd by current estimates? |
|
Keep in mind this pull was initially made 10 months ago. DDMD is coming soon, so I agree "libifying" DMD could be an option in the near future. Hence maybe we should close this? |
|
Clicked the wrong button.. but I guess we should close anywho. |
There was a problem hiding this comment.
I'm a bit sceptical that this is sufficient. What if Module::load is called during semantic3, you'll call buildModules.push(m); with a module that had no semantic run yet. When I implemented a similar functionality (~2 years ago) I had to explicitly do that.
Several month definitely, and it will be hard to do the necessary compiler refactorings, so it might take forever. |
|
Well, I think the main goal for the new switches is to get rdmd to use them - the |
|
No, my suggestion is to add an exclusive/private functionality for rdmd that we can change or drop whenever we want to. |
|
Yep, we're on the same page here. I was asking more about the means. |
Mainly undocumented, longer might help still help to prevent usage. |
http://d.puremagic.com/issues/show_bug.cgi?id=9896