Subject: Re: goredo gets confused with relative paths and symlinks

From: Rafael Fourquet <[email-masked]>
Date: Fri, 24 Oct 2025 15:45:30 +0200

Thanks for answering!

> Here your message seems to be cut for some reason.
> There are no exact examples.

The archive seems to have it:
http://lists.cypherpunks.su/archive/goredo-devel/[email-masked]/

> Questions and problems with symlinks were raised a while ago in that
> maillist and I remember that basically they are not solvable in general
> case. spacefrogg's advice not to use symlinks is best we can do.

I understand, and am fine with avoiding symlinks within my "redo projects".
But I will always have symlinks somewhere else, and when I call redo from
one of these paths containing symlinks, it would be a small QOL improvement
if that would work out of the box.

> As I can see, Access() will be called only if do-file is found. It
> should return earlier if it was not. Or maybe symlinks completely breaks
> absolute/relative paths resolution and indeed it deals with different
> views to the same file?

It seems that's exactly what happens. The do file was determined to exist
(and `doFile.a` does indeed exist, and is executable), but
the `Access()` call is done on `doFile.rel`, which does not exist in the context
of my example.

So `Access()` was meant to determine whether the file is
executable, but it returns an error because the file was inexistant.
Adding debug statements in the code reveals:
` unix.Access returned error: no such file or directory`
with this line added in the else branch:
`fmt.Printf("unix.Access returned error: %v\n", err)`.

I don't know the codebase of goredo, so I will accept if calling
`redo /some/dir/file` from within an arbitrary path on my fs
(which happens to contain a symlink) can fail.
But I don't think that calling `/bin/sh` on that executable file is acceptable.
It can lead to very confusing errors, and could possibly have disastrous
side-effects if the intended interpreter has commands which are
also valid in `sh` with different semantics.