Bug 9330 – Cannot run dmd test suite with MSYS

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-01-16T21:44:00Z
Last change time
2015-06-09T05:11:54Z
Keywords
pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-01-16T21:44:49Z
DMD fails to invoke LINK.EXE for the build of `d_do_test.d`. config file (C:\Users\khara\sc.ini) : --- [Version] version=7.51 Build 020 [Environment] LIB="%HOME%\dmd2\windows\lib";%HOME%\dm\lib DFLAGS="-I%HOME%\dmd2\src\phobos" "-I%HOME%\dmd2\src\druntime\import" LINKCMD=%HOME%\dmd2\windows\bin\link.exe --- environment variables: --- > echo %HOME% C:\Users\khara command lines and outputs: --- > cd C:\Users\khara\dmd2\src\dmd\test # move to test directory > C:\MinGW\msys\1.0\bin\make # run makefile with GNU make in MSYS Creating output directory: test_results Building d_do_test tool OS: win32 OPTLINK (R) for Win32 Release 8.00.12 Copyright (C) Digital Mars 1989-2010 All rights reserved. http://www.digitalmars.com/ctg/optlink.html OPTLINK : Warning 9: Unknown Option : KHARA\DMD2\WINDOWS\BIN\LINK.EXE Users.obj Error 2: File Not Found Users.obj --- errorlevel 1 make: *** [test_results/d_do_test] Error 1 ================ That is a specific problem for the MSYS environment. With cygwin environment, the problem does not occur. When dmd invoked from MSYS make, getenv("HOME") returns "C:/Users/khara" instead of "C:\Users\khara" (note that the path separator difference). MinGW bug tracker report: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=1100932&group_id=2435 When reading sc.ini, DMD will try to expanding %HOME% environment variable for LINKCMD, but it is expanded to "C:/Users/khara\dmd2\windows\bin\link.exe" under the MSYS, then dmd fails to invoke link command which has the mixtured path separators. From the MSYS source code, LD_LIBRARY_PATH, TMPDIR, TMP, and TEMP have same issue. http://mingw.git.sourceforge.net/git/gitweb.cgi?p=mingw/msys-runtime;a=blob;f=winsup/cygwin/environ.cc;h=b88ca3d39d8d77a4d38be3fcd09e2fa8bbd0c265;hb=77f2469b25911ceebae6741cbd2fa1b0ff6b1d6e#l61 So, this is not actually the bug of DMD, but I think we should add a workaround to support development with MSYS. To resolve the problem, DMD should normalize path separator on the link command invocation.
Comment #1 by k.hara.pg — 2013-01-16T21:54:18Z
Comment #2 by github-bugzilla — 2013-01-17T00:34:43Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ab88809d64abb97d1e0387ba199380d67319dfb1 fix Issue 9330 - Cannot run dmd test suite with MSYS This is a workaroud for the MSYS bug: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=1100932&group_id=2435 https://github.com/D-Programming-Language/dmd/commit/6873d69990be15071d93475b23e529c248c629ea Merge pull request #1500 from 9rnsr/fix9330 Issue 9330 - Cannot run dmd test suite with MSYS