public inbox for goredo-devel@lists.stargrave.org
Atom feed
From: Rafael Fourquet <fourquet.rafael@gmail•com>
To: goredo-devel@lists.cypherpunks.su
Subject: goredo gets confused with relative paths and symlinks
Date: Thu, 23 Oct 2025 15:54:36 +0200 [thread overview]
Message-ID: <CAJoaZ9Lv3VL0B_hqzZWSd4FUGr3bOZVyDhWE2F2ie1OsqGRZ-g@mail.gmail.com> (raw)
Hi, thanks for this clean and sane implementation of redo!
`redo` fails to see an executable do file when called from a directory
accessed through a symlink, and falls back to
calling `/bin/sh` on the do script, which is unfortunate when the
script depends on `bash` or other languages.
For example:
$ cd /tmp/goredo-test
$ tree -a
.
├── a
│ └── b
├── b -> a/b
├── .redo
│ ├── test1.dep
│ └── test1.lock
├── test1
└── test1.do
$ cat test1.do
#!/bin/bash
# a-b-c is not valid syntax for `/bin/sh`
function a-b-c () {
echo 1
}
a-b-c
$ cd b; redo /tmp/goredo-test/test1
redo ../test1 ...
test1.do: line 5: `a-b-c': not a valid identifier
err ../test1 (0.003s): exit status 2
So the problem is that from within `/tmp/goredo-test/b`, `../test1.do`
doesn't exist, and therefore makes goredo believe
it's not executable (in "Prepare command line" from run.go).
This simple change seems enough to fix the issue, but I don't know
whether if leads to other problems:
--- a/run.go
+++ b/run.go
@@ -375,7 +375,7 @@ func runScript(tgt *Tgt, errs chan error, forced,
traced bool) error {
// Prepare command line
var cmdName string
var args []string
- if err = unix.Access(doFile.rel, unix.X_OK); err == nil {
+ if err = unix.Access(doFile.a, unix.X_OK); err == nil {
cmdName = doFile.a
args = make([]string, 0, 3)
} else {
next reply other threads:[~2025-10-23 13:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 13:54 Rafael Fourquet [this message]
2025-10-23 14:10 ` goredo gets confused with relative paths and symlinks goredo
2025-10-23 14:58 ` Rafael Fourquet
2025-10-24 12:12 ` Sergey Matveev
2025-10-24 13:45 ` Rafael Fourquet
2025-10-24 13:59 ` Sergey Matveev
2025-10-24 12:03 ` Sergey Matveev
2025-10-26 14:34 ` Sergey Matveev