-
-
Notifications
You must be signed in to change notification settings - Fork 668
Azure CI OMF job: Link testsuite tools with correct phobos.lib #11322
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
Conversation
91f5457 to
4b6abd1
Compare
|
@rainers: What a mess, thx for the pointers wrt. Optlink. I find it very surprising that the issue (tools compiled by host compiler, but linked against fresh phobos.lib) only begins to show up now with dlang/druntime#3141 and dlang/druntime#3142. Optlink apparently unconditionally reading from sc.ini in the containing directory, even when running DMD with |
Previously, the tools were compiled by the DMD host compiler, but linked with freshly compiled druntime/Phobos, leading to inevitable issues popping up in dlang/druntime#3141 and dlang/druntime#3142.
|
The (rather surprising) way to pass a library search path to optlink as a command line argument is to specify it in place of a library, but with a trailing Another option should be to pass phobos.lib explicitly on the command line, Not sure how to integrate that with the ci scripts and tools, though. |
|
I was wondering how/why the autotester works. And well, it's not using the host compiler for building any tools, but the fresh compiler exclusively: |
|
The autotester Win_32_64 job is also using the fresh compiler, as is the Azure 'Windows x64' job. The other Azure jobs with LDC in their name (presumably LDC as host compiler) use neither the fresh compiler nor LDC, but (AFAICT) some other DMD installation; these jobs also don't use the |
This a (unpleasant) necessity because the autotester uses
That is definitly wrong.
The makefile is a legacy nowadays because we can't access the autotester... |
|
LDC uses the fresh compiler to build the tools, always. I've had a discussion regarding this with Rainer some time ago and couldn't be persuaded that using the host compiler would help in making these tests more stable (preventing new compiler/druntime/Phobos from generating faulty tools). |
|
Oh wow, DMD apparently also completely ignores the DFLAGS env variable if it's specified in |
712f7cf to
e2d0fde
Compare
|
AFAICT, this should be working now as intended (all testsuite tool executables built by host compiler again). I've previously added a The Azure 'Windows x64' job now also uses the host compiler (DMD 2.084) for building those tools. |
| auto phobosPath = environment.get("PHOBOS_PATH", testPath(`..\..\phobos`)); | ||
| env["DFLAGS"] = `-I%s\import -I%s`.format(druntimePath, phobosPath); | ||
| env["LIB"] = phobosPath; | ||
| env["LIB"] = phobosPath ~ ";" ~ environment.get("LIB"); |
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.
Don't completely replace LIB, only prepend the dir containing fresh phobos.lib. We still need the original LIB dirs for kernel32.lib etc.
| LIBNAME=phobos32mscoff.lib | ||
| else | ||
| export MODEL_FLAG="-m32" | ||
| export LIB="$PWD/dmd2/windows/lib" |
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.
Not sure why this is still necessary, but linking the druntime unittests failed without this (Optlink complaining about incompatible libs in MSVC libdirs). So somehow the optlink.exe used for that command seems to respect the LIB env var (which in this case is a Posix path - /c/...).
| # manually for the host compiler. These 2 variables are adapted for the | ||
| # actual tests with the tested compiler (by run.d). | ||
| HOST_DMD_DIR="$(cygpath -w "$DMD_DIR/tools/dmd2")" | ||
| rm "$HOST_DMD_DIR/windows/bin/sc.ini" |
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.
Thanks for tackling this.
Instead of breaking the host compiler installation (in case someone uses the script outside of the CI), placing an empty sc.ini into the current directory should also work, because that's preferred by optlink.
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.
A quick local test shows that's not the case. DMD prefers that sc.ini in the current dir, but Optlink isn't, regardless of whether it's completely empty or contains an empty [Environment] section, and regardless of whether Optlink is invoked via DMD or directly.
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.
Ok. I was looking at this comment: https://github.com/DigitalMars/optlink/blob/87a85b0413d94fb8017656004a03f7fb0aa3a649/common/iniproc.asm#L52
I guess no one uses the CI build scripts locally.
rainers
left a comment
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.
Let's see how the affected druntime tests work with this.
No description provided.