-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Issue 12205: update posix.mak to use local, recently-built druntime and phobos #117
Conversation
Let's add a working default dmd.conf/sc.ini to dmd/src instead. |
OK, I'll give it a go tomorrow. The current solution was based on what I found in the druntime and phobos posix.mak files, but of course they have specialized needs that don't apply to tools. |
Actually ... isn't dmd.conf searched for first in current working directory, then in path of dmd, then in /etc/, ... ? Could it be better to have a dmd.conf in the tools project? The reason I ask is because I'm wondering if a dmd.conf in dmd/src might interfere with the druntime and phobos builds. |
Let's not. Because then I won't be able to override the default with my own if I have a different layout, as sc.ini will be in version control. |
TBH I think the tools build system pretty much assumes a certain standard layout these days. The move from the druntime/phobos builds using |
Looking at dmd.conf was productive at least in finding the solution :-) The newly-updated patch fixes the alignment problems by including the The remaining problem of this approach is that it's now non-trivial for the user to build using an alternative to |
Latest commit allows user to easily make use of system dmd for the build if they so wish. |
|
||
# Set DFLAGS | ||
ifneq (dmd,$(DMD)) | ||
DFLAGS = $(MODEL_FLAG) -I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL) -L--no-warn-search-mismatch $(DMDEXTRAFLAGS) -w |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rolled MODEL_FLAG
into this, but it might in principle still be preferable to keep it independent of DFLAGS
so that it will still be used even in the event of the user calling the system dmd
.
…me and phobos. This fixes https://d.puremagic.com/issues/show_bug.cgi?id=12205 by adding library/include paths to the locations where druntime and phobos have been built, plus a flag to prevent/suppress alignment errors in one of the builds. In the event that the user wishes to build using the system dmd instead of the locally-built ../dmd/src/dmd, this is trivial to achieve by overriding with DMD=dmd. DFLAGS will also then be overridden with those from the system dmd.conf.
OK, I've fixed, rejigged, rebased and re-pushed. The updated patch:
|
This pull is very desired to simplify tool packaging. |
Ping. Come on, the tools build is currently broken -- this patch fixes it, without imposing in any way on any other project. We can always implement a better or more comprehensive build design later, but this really ought to land. |
@MartinNowak @yebblies Ok to merge? |
Hm I thought that tools were meant to be build with working DMD installation/dmd.conf. |
Yes, it is the problem. All other repositories work without dmd.conf or any sort of global setup, |
Well, since I don't compile tools on daily basis and I see the easy workaround of |
Fix Issue 12205: update posix.mak to use local, recently-built druntime and phobos
Done. |
Awesome, thanks! |
This broke existing build scripts for tools, matching magic names as in DMD=dmd is problematic and -L-no-warn-search-mismatch doesn't work on FreeBSD. |
# Set DFLAGS | ||
ifneq (dmd,$(DMD)) | ||
DFLAGS = -I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL) -L--no-warn-search-mismatch $(DMDEXTRAFLAGS) -w | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the ifneq
here and append the paths to DMD not DFLAGS, so that someone overriding DMD doesn't get wrong include/link paths.
Why do you need no-warn-search-mismatch if you already know the MODEL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On balance I think it would be better to check for strict equality to ../dmd/src/dmd
. Re DFLAGS
: this is how it's done in the other build scripts (for druntime and phobos), see e.g.: https://github.com/D-Programming-Language/phobos/blob/master/posix.mak#L132 -- so I tried to follow the same principles here.
Re the need for no-warn-search-mismatch
: all I can say is that absent this setting, I was getting horrible errors; with it, I wasn't; and if I recall, that same issue applied to trying to build anything with any dmd
on my system, ever. It's one of the recommended dmd.conf
settings: http://wiki.dlang.org/Building_DMD#Installation
Oops. I guess we could use an autotester for the tools repo. |
Just to mention: the whole reason for this PR was that the build scripts were already broken, and they must have been broken for everyone. I'd have been happy to fix it simply by setting
Ack :-( The reason it's there is because I realized it's one of the recommended flags in the standard However, I don't understand why I was getting those matching errors in the first place, given that the
Yes, I think that's essential -- I'm amazed it's not there already. It's very frustrating that this patch broke things for FreeBSD. |
It's not part of the auto-tester because for most of it's life it's not been anywhere remotely in a testable state. If it's ready (meaning that it's as simple as: checkout; make; make unittest -- on all platforms) then I'll add it to my todo list. |
Well, the current patch ought to make it so, at least to the same extent as with druntime and phobos -- that is: it assumes that you have already built dmd, druntime and phobos and they are in |
@braddr Excuse me for posting it here... I can't reply to your email, I'm always receiving mail delivery error: Sorry for the noise... |
So who is taking care of fixing the
Recheck the link error, it doesn't look like the architectures were mixed up. |
I'm happy to provide an update, but I don't have Mac or FreeBSD systems to test on. Do I understand right that on FreeBSD the build works if the
I don't understand the link error. I did ask for assistance with this. I added the flag because not only did it prevent the link error but to my recollection it's a recommended flag to use with D on Linux (I have a recollection of regularly encountering these kinds of linker errors with self-built |
Please see #120 for a patch that should hopefully fix reported issues. I'll need help testing it as I don't have access to an OS X or FreeBSD machine. |
It would be more tedious to override the default, but it's possible. Spreading all of those DFLAGS around causes a lot of issues and duplication. |
For reference -- as discussed in #120 and #121 -- it looks like one reason some people may not have been seeing the linker errors I encountered is if they have an So, worth checking for everyone: (i) do you have an I have a horrible suspicion that the whole reason I ever added it to my Suffice to say that @MartinNowak's recent patch allows the tools build to succeed for me without the |
This fixes https://d.puremagic.com/issues/show_bug.cgi?id=12205 by adding library/include paths to the locations where druntime and phobos have been built, plus a flag to prevent/suppress alignment errors in one of the builds.
In the event that the user wishes to build using the system
dmd
instead of the locally-built../dmd/src/dmd
, this is trivial to achieve by overriding withDMD=dmd
. DFLAGS will also then be overridden with those from the systemdmd.conf
.