On 15 Oct 2003 at 5:44, Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
But I have come across a little snag. MSYS is a minimalist POSIX environment for Windows. So, it uses front slashes and all that. My little problem arose with FileExists(). Assume a filename 'foo.cfg'. Expand it into a fully qualified pathname with GPC and it becomes '/d/bar/foo.cfg' (where "/d" is the drive d:).
Does realpath (C function) return that, or did we anything special about it (I don't remember all this)?
As indicated in my last post, the problem is solved now by the small patch to filename.pas.
It seems that FileExists cannot cope with this expanded filename, or with the alternative after it has been converted by the Slash2OSDir... stuff (i.e., '\d\bar\foo.cfg'). The file is said not to exist. I wrote a little hack to see how I could solve this:
function MSYSPath2DosPath (Const s : String): String; Var i : Cardinal; begin Result := s; {$ifdef __MSYS__} if (Result [1] in ['/', '']) and (Upcase (Result[2]) in ['A'..'Z']) and (Pos (':', Result) = 0) then begin delete (Result, 1, 1); insert (':', Result, 2); end; {$endif} end;
At the return of this routine, '\d\bar\foo.cfg' or '/d/bar/foo.cfg' becomes 'd:\bar\foo.cfg' or 'd:/bar/foo.cfg'. MSYS and FileExists seem to both be happy with either of these results. I am sure that this problem will exist elsewhere in the RTS and not just with FileExists. The question is how we can solve it in the RTS (perhaps in the Slash2OSDir stuff).
Yes, I think so. Is this `/d/foo/...' form supposed to "exist" at all?
Yes. "/d" is what "d:" is mounted as. This is done automatically by the MSYS runtime. This is an excerpt from the output of "mount".
D:\msys\1.0\bin on /usr/bin type user (binmode,cygexec,noumount) D:\msys\1.0\bin on /bin type user (binmode,cygexec,noumount) D:\msys\1.0 on / type user (binmode,noumount) D:\msys\1.0 on /usr type user (binmode,noumount) d:\mingw on /mingw type user (binmode) d:\src on /src type user (binmode) a: on /a type user (binmode,noumount) c: on /c type user (binmode,noumount) d: on /d type user (binmode,noumount) [...]
So, all is well now. I have run the testsuite and all the tests are passed (with a few skipped ones). I believe that the MSYS version of gpc-20030830 is as solid (or not) as the Mingw and Cygwin versions. An excerpt from the test log:
rm -f *.dat *.o *.s *.i *.gpi *.gpd *.gpc core a.out stderr.out *.exe testmake.tmp dummy.c dummy.pas dummy.out diff_cr*.tmp fixcr fixcr.exe rm -f todo/a.out todo/*.exe todo/*.o todo/*.s todo/*.i todo/*.gpi todo/*.gpd todo/core { gpc --version | head -1; gpc --print-search-dirs | grep install | head -1; hostname || echo "unknown host"; date "+%Y-%m-%d %H:%M:%S"; } | \ sed -e 's,^,Testing ,;N;s,\n.*gcc-lib[/], (,;s,[/].*,),;N;s,\n, (,;s,$,),;N;s/\n/, /' Testing gpc 20030830, based on gcc-3.2.3 (mingw special 20030504-1) (i686-pc-msys) (my-pc), 2003-10-15 17:37:58 echo "gpc -g -O3 -W -Wall -Wundef -Wpointer-arith -Wno-unused " gpc -g -O3 -W -Wall -Wundef -Wpointer-arith -Wno-unused PC="gpc" PFLAGS="--autobuild -g -O3 -W -Wall -Wundef -Wpointer-arith - Wno-unused " SRCDIR="." TEST_MAKE_FLAG=test-make-flag "./test_run" "*.pas" | tee test_log GPC-TEST-BEGIN ========================== [...] TEST writeg.pas: OK TEST writereal.pas: OK TEST y2k.pas: OK ========================== GPC-TEST-END
As you can see, it didn't report the number of passed, skipped, or failed tests - but there is no failed test. I think we can add MSYS to the list of supported platforms now. I will release binaries in due course.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/