Test failure on macOS: "test/: no .do file"

35 views
Skip to first unread message

sha...@gmail.com

unread,
Jul 16, 2019, 11:29:23 AM7/16/19
to redo
Hello,

Testing redo in a fresh clone fails on my macOS 10.14.3 (Mojave) with "do: test/: no .do file".

The same error happens if I do `git checkout redo-0.41` first.

How do I debug it?

Full log:

Cloning into 'redo'...
remote: Enumerating objects: 43, done.
remote: Counting objects: 100% (43/43), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 3976 (delta 18), reused 23 (delta 13), pack-reused 3933
Receiving objects: 100% (3976/3976), 1.00 MiB | 1.84 MiB/s, done.
Resolving deltas: 100% (2019/2019), done.
$ git rev-parse --short HEAD
8924fa3
$ cd redo
$ ./do -j10 test
do  bin/all
do    redo/version/all
do      redo/version/vars
do        redo/version/gitvars
do      redo/version/_version.py
do    redo/py
do      redo/whichpython
Trying: intentionally-missing
Trying: python2.7
do    redo/sh
 dash...               missing
 /usr/xpg4/bin/sh...   missing
 ash...                missing
 posh...               missing
 lksh...               missing
 mksh...               missing
 ksh...                failed    F12 F24 s47 s47a F47b W89c F102 W118
 ksh88...              missing
 ksh93...              missing
 pdksh...              missing
 zsh...                warnings  W47c W89c W118
 bash...               warnings  W5 W32 W47c s60 W118
 busybox...            missing
 /bin/sh...            warnings  W5 W32 W47c s60 W94 W118
Selected mostly good shell: /bin/zsh
do    bin/list
do    bin/redo-always
do    bin/redo-ifchange
do    bin/redo-ifcreate
do    bin/redo-log
do    bin/redo-ood
do    bin/redo
do    bin/redo-sources
do    bin/redo-stamp
do    bin/redo-targets
do    bin/redo-unlocked
do    bin/redo-whichdo
do: Removing stamp files...
redo  bin/all
redo    redo/version/all
do: Incremental mode. Use -c for clean rebuild.
do  test/
do: test/: no .do file (/Users/asha/src/redo)
./do: minimal/do test failed
$

Alexey

sha...@gmail.com

unread,
Jul 22, 2019, 5:55:23 AM7/22/19
to redo
Hello,

## Debugging the original problem

I've found the cause of the problem. On my MacOS, running `./do test` selects zsh as the "mostly good shell". This is zsh that I have:

$ zsh --version
zsh 5.3 (x86_64-apple-darwin18.0)

For unclear reason, `minimal/do` is not running zsh in sh compatible mode. Which causes `_normpath` function to return incorrect result, because it ignores `IFS=/` line:

NP start path='/Users/asha/src/redo/test/' relto='/Users/asha/src/redo'
NP out='/Users/asha/src/redo/test//' (done)

While it should be (note the double slash above):

NP start path='/Users/asha/src/redo/test/' relto='/Users/asha/src/redo'
NP out='/Users/asha/src/redo/test/' (done)

I don't know how to solve this problem. However, `brew install dash` is a good enough work-around for me.

## Next problem

With the `brew install dash` work-around I get a different problem on my system:

...
do    t/all
do      t/flush-cache
do      t/000-set-minus-e/all
do      t/100-args/all
do        t/100-args/test.args
do        t/100-args/test2.args
do        t/100-args/passfailtest
/Users/asha/src/redo/t/100-args/passfailtest: skipping: not supported in minimal/do.
do        t/100-args/noargs/run
/Users/asha/src/redo/t/100-args/all: skipping: not supported in minimal/do.
do      t/101-atime/all
do        t/101-atime/atime
do          t/101-atime/atime2
do      t/102-empty/all
do        t/102-empty/silencetest
do          t/102-empty/silence
do          t/102-empty/silence
/Users/asha/src/redo/t/102-empty/silencetest: skipping: not supported in minimal/do.
do        t/102-empty/touchtest
do          t/102-empty/touch1
do          t/102-empty/touch1
do          t/102-empty/touch1
do          t/102-empty/touch1
do        t/102-empty/blank
do      t/103-unicode/all
do        t/103-unicode/unicode
do          t/103-unicode/test-uniçøðë/test1
do      t/104-space/all
do        t/104-space/space dir/test
do          t/104-space/space dir/space file
do            t/104-space/space dir/space 2
do          t/104-space/space dir/space file
do      t/105-sympath/all
do        t/105-sympath/y/1.dyn
do        t/105-sympath/y/2.dyn
do        t/105-sympath/y/3.dyn
do        t/105-sympath/4.dyn
do        t/105-sympath/y/5.dyn
/Users/asha/src/redo/t/105-sympath/all: skipping: not supported in minimal/do.
do      t/110-compile/all
do        t/110-compile/hello
do          t/110-compile/LD
do          t/110-compile/hello.o
do            t/110-compile/CC
do            ../../../../usr/include/stdio.h
do: ../../../../usr/include/stdio.h: no .do file (/Users/asha/src/redo)
do:         hello.o: got exit code 1
do:       hello: got exit code 1
do:     all: got exit code 1
do:   all: got exit code 1
do: test: got exit code 1
./do: minimal/do test failed

Any ideas on how to proceed?

Alexey

вторник, 16 июля 2019 г., 18:29:23 UTC+3 пользователь sha...@gmail.com написал:

Avery Pennarun

unread,
Jul 24, 2019, 3:34:44 AM7/24/19
to Alexey Shamrin, redo
On Mon, Jul 22, 2019 at 5:55 AM <sha...@gmail.com> wrote:
> I've found the cause of the problem. On my MacOS, running `./do
> test` selects zsh as the "mostly good shell". This is zsh that I
> have:
>
> $ zsh --version
> zsh 5.3 (x86_64-apple-darwin18.0)
>
> For unclear reason, `minimal/do` is not running zsh in sh
> compatible mode. Which causes `_normpath` function to return
> incorrect result, because it ignores `IFS=/` line:
>
> NP start path='/Users/asha/src/redo/test/' relto='/Users/asha/src/redo'
> NP out='/Users/asha/src/redo/test//' (done)
>
> While it should be (note the double slash above):
>
> NP start path='/Users/asha/src/redo/test/' relto='/Users/asha/src/redo'
> NP out='/Users/asha/src/redo/test/' (done)

Hey, thanks for tracking this down! I was able to get a copy of zsh
5.3 and reproduce the problem.

Interestingly, you were wrong about one thing: it *was* running in
compatibility mode, but its compatibility mode apparently has a bug.
with IFS=/, most shells will split "/a/b/c" into four parts (blank,
a, b, c) but zsh (in sh mode) will split it into five parts (blank,
a, b, c, blank).

I added a workaround to minimal/do, and a warning to shelltest.od. (I
wasn't quite willing to make this a 'fail', although it should be,
since every other shell I have can agree on the right answer).

> ./do: minimal/do test failed
>
> Any ideas on how to proceed?

For what it's work, if you just run
./do build
it won't run the tests, but you still have a working version of redo
afterward. Only minimal/do was acting weird. Once that works, you can
even run the tests under the full version of redo:
bin/redo -j10 test
and it should pass.

Anyway, it should be fixed now. Please test :)

Thanks,

Avery

Alexey Shamrin

unread,
Jul 24, 2019, 7:36:04 AM7/24/19
to Avery Pennarun, redo
Hi,

Thank you for fixing zsh issue! Now I can get past this point both
with and without `dash` installed.

The only remaining issue is a test failure in t/110-compile test. I
can see it failing both in minimal/do and in bin/redo:

$ bin/redo test
...
redo: no rule to redo '/usr/include/stdio.h'

The test script references /usr/include.stdio.h, but /usr/include is
missing. It's no longer guaranteed to be there on MacOS:
https://apple.stackexchange.com/a/338150

Why does t/110-compile/hello.o.do reference stdio.h? Can it be removed?

In the meantime, I've fixed the test with `xcrun --show-sdk-path`
command. The following patch makes both minimal/do and bin/redo pass
the tests for me. Yay!

$ git diff
diff --git a/t/110-compile/hello.o.do b/t/110-compile/hello.o.do
index 0b46cff..edb18f1 100644
--- a/t/110-compile/hello.o.do
+++ b/t/110-compile/hello.o.do
@@ -1,4 +1,4 @@
-redo-ifchange CC hello.c /usr/include/stdio.h
+redo-ifchange CC hello.c $(xcrun --show-sdk-path)/usr/include/stdio.h
redo-ifcreate stdio.h
../sleep 3
./CC hello.c

Alexey
Reply all
Reply to author
Forward
0 new messages