[darcs-devel] darcs and ssh issues
Tommy Pettersson
ptp at lysator.liu.se
Sun Dec 10 13:58:06 PST 2006
On Tue, Nov 21, 2006 at 04:18:23PM +0100, Eric Y. Kow wrote:
> 4. darcs-ssh directory
> * not being cleaned up - needs fixing
> * being created in places like _darcs/pristine - urgently needs fixing
I've been looking into this a little this week and weekend. I
think I have a somewhat clear picture of what's going on, but
unfortunately no brilliant solution.
A running darcs is jumping around quite a lot between
directories, and it is seldom specified in the code when, how
and what a function supposes or requires for paths and
directories to act in and on. One thing that has struck me as
particularly unintuitive is that
darcs something --use-some-command="./test"
looks for test in the repo root dir. But that could be just me.
Anyway, I've been generating and looking at call graphs of darcs
get runs, which supposedly can create a darcs-ssh in
_darcs/pristine/. I have however not been able to achieve that,
nor see how it could happen, though I can easily provoke a
darcs-ssh in _darcs/patches. It seems like the control master is
started three times during a get, twice from the invocation dir
and once from the resulting _darcs/patches dir (which only
matters for tempdir_loc), but should it really be started three
times, or am I misinterpreting (not unlikely, I've mostly looked
at graphs, not at code)?
So my (best) idea (so far) is to couple the entire remote
machinery to the Repository data structure. Wouldn't that make
good sense for a union-Pull from multiple external repos? I
imagine, when a repo is identified, the correct set of tools for
accessing it (if it's remote) are determined, perhaps not right
away, but dormant in unsafePerformeIO, since the result should
be independent of darcs' IO-ing anyway. The Repository data
structure contains all needed information (I think), at least
for calling tempdir_loc withCurrentDirectory(<repo root>).
The not so god thing with such solution is it would not let
itself go directly to stable. It would be tiresome to merge it
with the Repository module changes in unstable. (Hey, we
darcsers are not used to do big manual merges, and damn proud of
it!)
Quick fixes for the stable release includes:
1. Not allowing darcs to run without a proper temp dir (telling the
user how to set up one).
2. Have darcs sometimes fail mysteriously in mid-operation, telling
the user to set up a temp dir.
3. Let tempdir_loc silently remove _darcs/* suffixes from the
current path, and according to Murphy's Law fail with "Bug in
tempdir_loc: impossible".
Number 3 could have the bonus of adhering to the user's setting
in _darcs/prefs/tmpdir when possible.
I think defying Murphy is the simplest and best solution for
darcs 1.0.9.
Another idea is to try to find (and create) a _darcs/tmp after
everything else fails but before resorting to the current
directory. Darcs could start every invocation by clearing that
directory (if last invocation failed to clean up after itself).
> 5. weird hanging [uh-oh!]
> * sporadic, appears to only occur with --disable-ssh-cm
I intended to look into this too, but I have not been able to
reproduce it. Perhaps I don't have the "right" ssh tools
installed?
--
Tommy Pettersson <ptp at lysator.liu.se>
More information about the darcs-devel
mailing list