BUG: rdmd cmd line argument bug

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Sat Jun 3 07:23:21 PDT 2006


Walter Bright wrote:
> Bruno Medeiros wrote:
>> Hum, I found it does work after all, but only when called from the 
>> Windows Command prompt! If I call it from a MinGW shell I get an error 
>> (which was what originally made think one wasn't supposed to use 
>> -run). Substituting dmd for the very printargs.exe, here's what is found:
>>
>> When one runs rdmd from the Win CMD shell:
>>
>>  > rdmd dummy.d
>> ARGS: 5 
>> [C:\devel\D.tools\dmd\bin\dmd.exe,-quiet,dummy.d,-ofc:\Home\phoenix\
>> LOCALS~1\Temp\dummy-phoenix-0-0-A46C236CDE107E3B9F053881E4257C2D.exe,-odc:\H 
>>
>> ome\phoenix\LOCALS~1\Temp\]
>>
>> (DMD would run fine)
>> But when one runs rdmd from the MinGW bash shell:
>>
>> $ rdmd dummy.d
>> ARGS: 5 
>> [c:\devel\D.tools\dmd\bin\dmd.exe,-quiet,dummy.d,-ofc:/Home/phoenix/
>> LOCALS~1/Temp\dummy-phoenix-0-0-A46C236CDE107E3B9F053881E4257C2D.exe,-odc:/H 
>>
>> ome/phoenix/LOCALS~1/Temp\]
>>
>> Some of the slashes are inverted, and that makes OPTLINK choke. Weird. 
>> How does rdmd have this different behaviour, I mean, how does it even 
>> know it's running under a different shell/environ/whatever? :/
> 
> It doesn't know. The mingw shell is buggy. It doesn't follow Windows 
> conventions, and so screws up programs that do. I've gotten numerous 
> mysterious bug reports over the years that eventually got traced back to 
> the mingw shell. Stop using it, and the problems disappear <g>.

What "Windows conventions" it doesn't follow?
Any way, for what I see, MingW (or perhaps, more corretly, MSYS) 
"sanitizes" each program (at least non-Unix ones) that is run by the 
bash shell by adapting the program arguments and environment variables 
from Unix paths to Windows paths. In this process the TEMP env var is 
translated incorrectly from "/tmp" to "c:/home/phoenix/LOCALS~1/Temp" 
(the slashes remain Unix ones)

 >  Stop using it, and the problems disappear <g>.
Not something I am in any way willing to do. Unless it's changing to 
Cygwin (if it is any different).
Hum, now that I see it, Mingw seems to be a bit stale, the last version 
of MSYS is from 2004. Maybe I should haste my change to Cygwin? (I was 
already thinking of changing, but for other reasons)

And by the way, how about folding rdmd's functionality into dmd itself? 
It shouldn't take too long. :)



-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d-bugs mailing list