This is the mail archive of the
mailing list for the libstdc++ project.
Re: [patch] libstdc++/67173 Fix filesystem::canonical for Solaris 10.
- From: Martin Sebor <msebor at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 16 Sep 2015 16:04:15 -0600
- Subject: Re: [patch] libstdc++/67173 Fix filesystem::canonical for Solaris 10.
- Authentication-results: sourceware.org; auth=none
- References: <20150911142140 dot GL2631 at redhat dot com> <55F311D2 dot 8050405 at gmail dot com> <CAH6eHdTjPFof-+ENBLytMsD2AU+6m2WoU020bwGsFLBen4s=yg at mail dot gmail dot com> <55F469CF dot 9010503 at gmail dot com> <20150916144207 dot GY2631 at redhat dot com> <55F9A8A8 dot 3060502 at gmail dot com> <20150916185844 dot GD2631 at redhat dot com>
Tested powerpc64le-linux, x86_64-dragonfly4.1 and x86_64-netbsd5.1,
do you see any reason not to commit this for now?
I see only a couple of potential problems: a missing test for
PATH_MAX in the unlikely event it's not defined (or is obscenely
large), and a missing check to avoid infinite loops due to symlinks.
Any improvements such as hardcoding checks for specific versions of
Solaris or the BSDs are QoI, and this is only an experimental TS, so I
don't want to spend the rest of stage 1 working on one function :-)
My main obstacle to writing good tests right now is having some way to
create and destroy files safely in the tests. It's hard to test
functions like is_symlink() without first creating a symlink in a
known location, and also removing it again cleanly so the next
testsuite run doesn't fail if the file is already present.
One option would be to have libstdc++-v3/testsuite/Makefile create a
new sub-directory as a sandbox for filesystem tests, removing it if it
already exists. Then the tests can put anything they like in that new
dir without fear of trashing the user's files elsewhere on the FS!
I don't know how you feel about Tcl but writing a filesystem.exp
and adding a new "dg-fs" API would let each test can set up the
directory structure it needs.