Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run Zsh #91

Closed
ghost opened this issue Apr 9, 2016 · 42 comments
Closed

Can't run Zsh #91

ghost opened this issue Apr 9, 2016 · 42 comments

Comments

@ghost
Copy link

ghost commented Apr 9, 2016

"apt-get install zsh" is ok
oh-my-zsh is ok
but when run :

compaudit:105: wait failed: invalid argument
compdef:95: wait failed: invalid argument
_update_zsh_update:1: wait failed: invalid argument
/root/.oh-my-zsh/oh-my-zsh.sh:3: wait failed: invalid argument

Sorry my english!

@Gingernaut
Copy link

I have the same issue. Additionally, after every command in zsh I get the following error :zsh: wait failed: invalid argument. Here's a screenshot of the issue:
capture

@ta-vroom
Copy link

Fish works https://medium.com/@rubiimeow/first-thoughts-and-a-quick-setup-guide-on-bash-for-windows-7da4674f6f74#.lgr60o2k2. I know its not the same but at least it's something.

@mcornella
Copy link

Ok, I've investigated the zsh failures and I've found the culprit. It's a (somewhat) long read, so bucle up.


Part 1: wait3() with getrusage not properly implemented

After installing it with apt install zsh, here's what running zsh outputs:

root@localhost:~# zsh    <--- bash prompt
compaudit:105: wait failed: invalid argument
compdef:95: wait failed: invalid argument
localhost#     <--- zsh prompt

Those compaudit and compdef errors are thrown because compinit is run in /etc/zsh/zshrc. If I start zsh without loading startup files the errors don't show up anymore:

root@localhost:~# zsh -f
localhost#

and tracing the execution of those startup files with zsh -x show the errors happen in:

  • compaudit's getent (line 107):

    +compaudit:103> local GROUP GROUPMEM _i_pw _i_gid
    +compaudit:104> (( UID == EUID  ))
    +compaudit:105> getent group root
    +compaudit:105> IFS=: +compaudit:105> read GROUP _i_pw _i_gid GROUPMEM
    compaudit:105: wait failed: invalid argument
    
  • compdef's bindkey | read (line 356):

    +compdef:94> [[ -n yes ]]
    +compdef:95> bindkey '\e~'
    +compdef:95> IFS='  ' +compdef:95> read -A opt
    compdef:95: wait failed: invalid argument
    

Those two lines have in common that a fork() has to happen: both external and piped commands are not properly exited (notice the jobs command shows weird results):

localhost# which ls
/bin/ls
localhost# ls
zsh: wait failed: invalid argument
localhost# jobs
zsh: wait failed: invalid argument
[1]    running    ls
[12]    running
[15]    running

Other commands, like zsh builtins (no fork), work correctly:

localhost# which pwd
pwd: shell built-in command
localhost# pwd
/root
localhost#

That said, the culprit seems to be some wait function: looking for the wait failed string in the zsh codebase we easily find it:

signals.c (line 482):

/* check for WAIT error */
if (pid == -1) {
  if (errno != ECHILD)
  zerr("wait failed: %e", errno);
  /* WAIT changed errno, so restore the original */
  errno = old_errno;
  break;
}

If we look up a little bit we find the call that sets the pid variable:

#ifdef HAVE_WAIT3
# ifdef HAVE_GETRUSAGE
  struct rusage ru;
  pid = wait3((void *)&status, WAITFLAGS, &ru);
# else
  pid = wait3((void *)&status, WAITFLAGS, NULL);
# endif
#else
# ifdef HAVE_WAITPID
  pid = waitpid(-1, &status, WAITFLAGS);
# else
  pid = wait(&status);
# endif
#endif

At this point I set up a test bench with those 4 calls to see which one fails and why.
You can look up the code at the following gist.

Here are the results:

# make test
./wait3_getrusage
wait failed: Invalid argument
make: [test] Error 22 (ignored)
./wait3
./waitpid
./wait

Furthermore, an strace of each executable shows (only relevant info shown):

# strace ./wait3_getrusage
wait4(-1, 0x7ff5fffef628, WNOHANG|WSTOPPED|WCONTINUED, 0x7ff5fffef630) = -1 EINVAL (Invalid argument)

# strace ./wait3
wait4(-1, 0x7ff5fffef6c8, WNOHANG|WSTOPPED|WCONTINUED, NULL) = -1 ECHILD (No child processes)

# strace ./waitpid
wait4(-1, 0x7ff5fffef6b8, WNOHANG|WSTOPPED|WCONTINUED, NULL) = -1 ECHILD (No child processes)

# strace ./wait
wait4(-1, 0x7ff5fffef6b8, WNOHANG|WSTOPPED|WCONTINUED, NULL) = -1 ECHILD (No child processes)

So it seems all 4 functions end up running the same wait4() syscall, with the exception that the first version passes a struct rusage to it while the rest set the parameter to NULL.

So, to conclude, #BashOnUbuntuOnWindows should properly implement that syscall or ignore the rusage parameter in a safe way.

Meanwhile, we can trick the zsh compilation to use one of the above calls that work correctly. To do so, follow the instructions of this gist.


Note there are several other things that don't work yet within zsh, like subshells process substitution and named pipes. I'll document this on a later post. A normal installation of Oh My Zsh seems to work ok though.

@russalex
Copy link
Contributor

First off: @mcornella, excellent write-up. Thanks!

We have this one on our radar and will look into it.

@asvnpr
Copy link

asvnpr commented Apr 12, 2016

@mcornella amazing write up! your gist also let me install zsh so thanks!!

@ghost
Copy link

ghost commented Apr 13, 2016

I try build zsh from master branch follow @mcornella's guide at https://gist.github.com/mcornella/ef57daa66fa9c97aa221de0ad4ec77a9, but got same issue.

root@localhost:~# zsh
compaudit:105: wait failed: invalid argument
compdef:95: wait failed: invalid argument
_update_zsh_update:1: wait failed: invalid argument
/root/.oh-my-zsh/oh-my-zsh.sh:3: wait failed: invalid argument

My SHELL Path :

root@localhost:~# echo $SHELL
/usr/bin/zsh

My root path

root@localhost:~/zsh# cd /root
root@localhost:~# ls -all
total 52
drwx------ 2 root root    0 Apr 13 08:13 .
drwxrwxr-x 2 root root    0 Jan  1  1970 ..
-rw------- 1 root root 9305 Apr 13 08:31 .bash_history
-rw-r--r-- 1 root root 3106 Feb 20  2014 .bashrc
lrwxrwxrwx 1 root root   21 Apr 13 02:02 .gitconfig -> /root/.gittool/gitcfg
drwxrwxrwx 2 root root    0 Apr 13 02:02 .gittool
drwxr-xr-x 2 root root    0 Apr 13 08:13 .oh-my-zsh
-rw-r--r-- 1 root root  140 Feb 20  2014 .profile
drwx------ 2 root root    0 Apr 13 02:34 .ssh
drwxrwxrwx 2 root root    0 Apr 13 08:29 zsh
-rw-r--r-- 1 root root 2847 Apr 13 08:13 .zshrc
-rw-r--r-- 1 root root 2847 Apr 13 03:16 .zshrc.omz-uninstalled-20160413031837
-rw-r--r-- 1 root root 2839 Apr 13 07:34 .zshrc.omz-uninstalled-20160413075724
-rw-r--r-- 1 root root 2847 Apr 13 03:13 .zshrc.pre-oh-my-zsh

@mcornella
Copy link

You probably still have the Ubuntu zsh installed. Try apt purge zsh zsh-common.

@ghost
Copy link

ghost commented Apr 13, 2016

@mcornella : finally, after I comment out HAVE_WAIT3 1 in config.h, when I call this command :

root@localhost:~/zsh# checkinstall -y --pkgname=zsh --pkgversion=$ZSH_VERSION --pkglicense=MIT make install install.info

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs?  [y]: y

Preparing package documentation...OK

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values:

0 -  Maintainer: [ root@KIETVA-LT ]
1 -  Summary: [ Package created with checkinstall 1.6.2 ]
2 -  Name:    [ zsh ]
3 -  Version: [ 5.0.2 ]
4 -  Release: [ 1 ]
5 -  License: [ MIT ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ zsh ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ zsh ]
12 - Conflicts: [  ]
13 - Replaces: [  ]

Enter a number to change any of them or press ENTER to continue:

Installing with make install install.info...

========================= Installation results ===========================
make[1]: Entering directory `/root/zsh/Src'
make[2]: Entering directory `/root/zsh/Src'
make[3]: Entering directory `/root/zsh/Src/Builtins'
make[3]: Leaving directory `/root/zsh/Src/Builtins'
make[3]: Entering directory `/root/zsh/Src/Modules'
make[4]: Entering directory `/root/zsh/Src/Zle'
make[4]: `complete.mdh' is up to date.
make[4]: Leaving directory `/root/zsh/Src/Zle'
make[3]: Leaving directory `/root/zsh/Src/Modules'
make[3]: Entering directory `/root/zsh/Src/Zle'
make[3]: Leaving directory `/root/zsh/Src/Zle'
make[2]: Leaving directory `/root/zsh/Src'
rm -f stamp-modobjs.tmp
make[2]: Entering directory `/root/zsh/Src'
echo '' builtin.o compat.o cond.o exec.o glob.o hashtable.o hashnameddir.o hist.o init.o input.o jobs.o lex.o linklist.o loop.o math.o mem.o module.o options.o params.o parse.o pattern.o prompt.o signals.o signames.o sort.o string.o subst.o text.o utils.o watch.o >> ../Src/stamp-modobjs.tmp
make[3]: Entering directory `/root/zsh/Src/Builtins'
make[3]: Leaving directory `/root/zsh/Src/Builtins'
make[3]: Entering directory `/root/zsh/Src/Modules'
make[3]: Leaving directory `/root/zsh/Src/Modules'
make[3]: Entering directory `/root/zsh/Src/Zle'
make[3]: Leaving directory `/root/zsh/Src/Zle'
make[2]: Leaving directory `/root/zsh/Src'
`stamp-modobjs' is up to date.
/bin/sh ../mkinstalldirs /bin
/usr/bin/install -c  zsh /bin/zsh-5.0.2
if test -f /bin/zsh; then \
            rm -f /bin/zsh.old; \
            ln /bin/zsh /bin/zsh.old; \
        else :; fi
rm -f /bin/zsh.new
ln /bin/zsh-5.0.2 /bin/zsh.new
mv /bin/zsh.new /bin/zsh
make[1]: Leaving directory `/root/zsh/Src'
make[1]: Entering directory `/root/zsh/Src'
make[2]: Entering directory `/root/zsh/Src'
make[3]: Entering directory `/root/zsh/Src/Builtins'
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  rlimits.so /usr/lib/zsh/5.0.2/zsh/rlimits.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  sched.so /usr/lib/zsh/5.0.2/zsh/sched.so
make[3]: Leaving directory `/root/zsh/Src/Builtins'
make[3]: Entering directory `/root/zsh/Src/Modules'
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  attr.so /usr/lib/zsh/5.0.2/zsh/attr.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  cap.so /usr/lib/zsh/5.0.2/zsh/cap.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  clone.so /usr/lib/zsh/5.0.2/zsh/clone.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  curses.so /usr/lib/zsh/5.0.2/zsh/curses.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  datetime.so /usr/lib/zsh/5.0.2/zsh/datetime.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  example.so /usr/lib/zsh/5.0.2/zsh/example.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  files.so /usr/lib/zsh/5.0.2/zsh/files.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  langinfo.so /usr/lib/zsh/5.0.2/zsh/langinfo.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  mapfile.so /usr/lib/zsh/5.0.2/zsh/mapfile.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  mathfunc.so /usr/lib/zsh/5.0.2/zsh/mathfunc.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  newuser.so /usr/lib/zsh/5.0.2/zsh/newuser.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  parameter.so /usr/lib/zsh/5.0.2/zsh/parameter.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  regex.so /usr/lib/zsh/5.0.2/zsh/regex.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh/net
/usr/bin/install -c  socket.so /usr/lib/zsh/5.0.2/zsh/net/socket.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  stat.so /usr/lib/zsh/5.0.2/zsh/stat.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  system.so /usr/lib/zsh/5.0.2/zsh/system.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh/net
/usr/bin/install -c  tcp.so /usr/lib/zsh/5.0.2/zsh/net/tcp.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  termcap.so /usr/lib/zsh/5.0.2/zsh/termcap.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  terminfo.so /usr/lib/zsh/5.0.2/zsh/terminfo.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  zftp.so /usr/lib/zsh/5.0.2/zsh/zftp.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  zprof.so /usr/lib/zsh/5.0.2/zsh/zprof.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  zpty.so /usr/lib/zsh/5.0.2/zsh/zpty.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  zselect.so /usr/lib/zsh/5.0.2/zsh/zselect.so
make[4]: Entering directory `/root/zsh/Src/Zle'
make[4]: `complete.mdh' is up to date.
make[4]: Leaving directory `/root/zsh/Src/Zle'
make[4]: Entering directory `/root/zsh/Src/Zle'
make[4]: `complete.export' is up to date.
make[4]: Leaving directory `/root/zsh/Src/Zle'
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  zutil.so /usr/lib/zsh/5.0.2/zsh/zutil.so
make[3]: Leaving directory `/root/zsh/Src/Modules'
make[3]: Entering directory `/root/zsh/Src/Zle'
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  compctl.so /usr/lib/zsh/5.0.2/zsh/compctl.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  complete.so /usr/lib/zsh/5.0.2/zsh/complete.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  complist.so /usr/lib/zsh/5.0.2/zsh/complist.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  computil.so /usr/lib/zsh/5.0.2/zsh/computil.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  deltochar.so /usr/lib/zsh/5.0.2/zsh/deltochar.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  zle.so /usr/lib/zsh/5.0.2/zsh/zle.so
/bin/sh ../../mkinstalldirs /usr/lib/zsh/5.0.2/zsh
/usr/bin/install -c  zleparameter.so /usr/lib/zsh/5.0.2/zsh/zleparameter.so
make[3]: Leaving directory `/root/zsh/Src/Zle'
make[2]: Leaving directory `/root/zsh/Src'
make[1]: Leaving directory `/root/zsh/Src'
if test x/usr/share/zsh/functions != x && test x/usr/share/zsh/functions != xno; then \
          test x/usr/local/share/zsh/site-functions != xno && \
            /bin/sh ./mkinstalldirs /usr/local/share/zsh/site-functions; \
          sdir_top="." fndir="/usr/share/zsh/functions" dir_top="." \
          scriptdir="/usr/share/zsh/5.0.2/scripts" \
          FUNCTIONS_SUBDIRS="yes" \
          INSTALL_DATA="/usr/bin/install -c -m 644" \
          INSTALL_PROGRAM="/usr/bin/install -c" \
          DESTDIR="" VERSION="5.0.2" \
          /bin/sh ./Config/installfns.sh || exit 1; \
        fi; \
        exit 0
make[1]: Entering directory `/root/zsh/Doc'
/bin/sh ../mkinstalldirs /usr/share/man/man1
for file in zsh.1 zshbuiltins.1 zshcalsys.1 zshcompctl.1 zshcompwid.1 zshcompsys.1 zshcontrib.1 zshexpn.1 zshmisc.1 zshmodules.1 zshoptions.1 zshparam.1 zshroadmap.1 zshtcpsys.1 zshzftpsys.1 zshzle.1 zshall.1; do \
            test -s ./$file || exit 1; \
            /usr/bin/install -c -m 644 ./$file /usr/share/man/man1/`echo $file | sed 's|zsh|zsh|'` || exit 1; \
        done
make[1]: Leaving directory `/root/zsh/Doc'
make[1]: Entering directory `/root/zsh/Doc'
/bin/sh ../mkinstalldirs /usr/share/info
rm -rf infodir
mkdir infodir
if ( \
            sed '/^@setfilename/s|zsh|zsh|' \
                < ./zsh.texi > infodir/tzsh.texi && \
            (cd infodir && makeinfo tzsh.texi) && \
            for file in infodir/zsh.info*; do \
                /usr/bin/install -c -m 644 $file /usr/share/info || exit 1; \
            done \
        ); then \
            if /bin/sh -c 'install-info --version' >/dev/null 2>&1; then \
              install-info --info-dir=/usr/share/info \
                /usr/share/info/zsh.info; \
            else true; fi; \
            rm -rf infodir; \
            exit 0; \
        else \
            rm -rf infodir; \
            exit 1; \
        fi
tzsh.texi:433: warning: @item missing argument
tzsh.texi:1083: warning: @item missing argument
tzsh.texi:1654: warning: @item missing argument
tzsh.texi:14688: warning: @item missing argument
tzsh.texi:22648: @itemx must follow @item
tzsh.texi:23263: warning: @item missing argument
tzsh.texi:23408: warning: @item missing argument
tzsh.texi:23841: warning: @item missing argument
tzsh.texi:23869: warning: @item missing argument
tzsh.texi:24984: warning: @item missing argument
tzsh.texi:24987: warning: @item missing argument
tzsh.texi:24990: warning: @item missing argument
rm: cannot remove ‘infodir’: Directory not empty
make[1]: *** [install.info] Error 1
make[1]: Leaving directory `/root/zsh/Doc'
make: *** [install.info] Error 2

****  Installation failed. Aborting package creation.

Restoring overwritten files from backup...OK

Cleaning up...OK

Bye.

Could you tell me any idea can resole this problem ? Sorry, It's a short time using linux terminal.

@mcornella
Copy link

The checkinstall command also failed in my case but zsh was installed. I didn't have the time to figure out why though.

@bbonora
Copy link

bbonora commented Apr 14, 2016

@at-kietva This failed for me too but if you type zsh when you first open the prompt, I think it might work. At least that's what I had to do. It doesn't work by default though.

@mcornella
Copy link

I've updated the initial gist to reflect this: https://gist.github.com/mcornella/ef57daa66fa9c97aa221de0ad4ec77a9#file-build-zsh-txt-L51-L55

@mcornella
Copy link

Ok, I've made room for the second part of the report. This one is much shorter, and it's just the output of the make check commands failures. This is from the 5.0.2 version of zsh, so it is actually possible that another version reports more or less failures. Here goes:

Part 2: zsh failed tests

1. Process subsitution

That is, a simple cat <(echo foo | cat) fails. If I recall correctly, it also fails on bash. That uses FIFOs, so it might just be that, and its already a known issue by the BashOnWindows team.

./A02alias.ztst: starting.
This test hangs the shell when it fails...
Test ./A02alias.ztst failed: bad status 1, expected 0 from:
  print -u $ZTST_fd 'This test hangs the shell when it fails...'
  alias cat='LC_ALL=C cat'
  cat <(echo foo | cat)
Error output:
(eval):3: doesn't look like your system supports FIFOs.
Was testing: Alias expansion works at the end of parsed strings
./A02alias.ztst: test failed.

Test D03 is also skipped because of this:

./D03procsubst.ztst: starting.
./D03procsubst.ztst: skipped (process substitution is not supported)
2. Accessed time attribute not implemented?

This is part of a bigger test that tests a bunch of conditions but I'm focused on the atime attribute one because it's the one that errors out. The others are visible in the log as warnings. I'm not sure this is a very important feature though, but since it failed I'm reporting it.

The test is simple:

touch accessed not_accessed
sleep 2 && cat accessed
# the -N option means 'unread file'
[[ -N not_accessed && ! -N accessed ]]

This should return true but doesn't because the accessed file is reported as unread as well, given that the atime attribute is not actually updated when running the cat command.

./C02cond.ztst: starting.
Warning: Not testing [[ -b blockdevice ]] (no devices found)
Warning: Not testing [[ -f blockdevice ]] (no devices found)
Warning: Not testing [[ -p pipe ]] (FIFOs not supported)
Warning: Not testing [[ ! -r file ]] (root reads anything)
This test takes two seconds...
Test ./C02cond.ztst failed: bad status 1, expected 0 from:
  print -u $ZTST_fd 'This test takes two seconds...'
  sleep 2
  cat unmodified
  touch newnewnew
  if [[ $OSTYPE == "cygwin" ]]; then
    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported on Cygwin)"
    true
  elif [[ "$(find . -prune -fstype nfs 2>/dev/null)" == "." ]]; then
    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported with NFS)"
    true
  elif test -f /etc/mtab && { grep $(df . 2>/dev/null| tail -n1 | awk '{print $1}') /etc/mtab | grep -q noatime; }; then
    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported with noatime file system)"
    true
  else
    [[ -N newnewnew && ! -N unmodified ]]
  fi
Was testing: -N cond
./C02cond.ztst: test failed.
The following may (or may not) help identifying the cause:
  This test can fail on NFS-mounted filesystems as the access and
  modification times are not updated separately.  The test will fail
  on HFS+ (Apple Mac OS X default) filesystems because access times
  are not recorded.  Also, Linux ext3 filesystems may be mounted
  with the noatime option which does not update access times.
  Failures in these cases do not indicate a problem in the shell.
3. Completion test failed

This one I cannot figure out why it fails; it's probably nothing to do with #BashOnWindows but I'm putting it out here in case someone knows why it happens. It consists on a difference between what the completion returns and what it should return.
Here's the log:

./Y01completion.ztst: starting.
*** /tmp/zsh.ztst.out.13298     Mon Apr 11 15:45:09 2016
--- /tmp/zsh.ztst.tout.13298    Mon Apr 11 15:45:09 2016
***************
*** 1,7 ****
  line: {: }{}
  DESCRIPTION:{file}
- DI:{dir1}
- DI:{dir2}
  FI:{file1}
  FI:{file2}
  line: {: dir1/}{}
--- 1,5 ----
Test ./Y01completion.ztst failed: output differs from expected as shown above for:
  comptest $': \t\t\t\t\t\t\t'
Was testing: directories and files
./Y01completion.ztst: test failed.

Full log:

# make check
cd Test ; make check
make[1]: Entering directory `/root/dev/zsh/Test'
if test -n "gcc"; then \
          cd .. && DESTDIR= \
          make MODDIR=`pwd`/Test/Modules install.modules > /dev/null; \
        fi
if ZTST_testlist="`for f in ./*.ztst; \
           do echo $f; done`" \
         ZTST_srcdir="." \
         ZTST_exe=../Src/zsh \
         ../Src/zsh +Z -f ./runtests.zsh; then \
         stat=0; \
        else \
         stat=1; \
        fi; \
        sleep 1; \
        rm -rf Modules .zcompdump; \
        exit $stat
./A01grammar.ztst: starting.
This test hangs the shell when it fails...
./A01grammar.ztst: all tests successful.
./A02alias.ztst: starting.
This test hangs the shell when it fails...
Test ./A02alias.ztst failed: bad status 1, expected 0 from:
  print -u $ZTST_fd 'This test hangs the shell when it fails...'
  alias cat='LC_ALL=C cat'
  cat <(echo foo | cat)
Error output:
(eval):3: doesn't look like your system supports FIFOs.
Was testing: Alias expansion works at the end of parsed strings
./A02alias.ztst: test failed.
./A03quoting.ztst: starting.
./A03quoting.ztst: all tests successful.
./A04redirect.ztst: starting.
./A04redirect.ztst: all tests successful.
./A05execution.ztst: starting.
./A05execution.ztst: all tests successful.
./A06assign.ztst: starting.
./A06assign.ztst: all tests successful.
./A07control.ztst: starting.
./A07control.ztst: all tests successful.
./B01cd.ztst: starting.
./B01cd.ztst: all tests successful.
./B02typeset.ztst: starting.
./B02typeset.ztst: all tests successful.
./B03print.ztst: starting.
./B03print.ztst: all tests successful.
./B04read.ztst: starting.
./B04read.ztst: all tests successful.
./B05eval.ztst: starting.
./B05eval.ztst: all tests successful.
./B06fc.ztst: starting.
./B06fc.ztst: all tests successful.
./B07emulate.ztst: starting.
./B07emulate.ztst: all tests successful.
./C01arith.ztst: starting.
./C01arith.ztst: all tests successful.
./C02cond.ztst: starting.
Warning: Not testing [[ -b blockdevice ]] (no devices found)
Warning: Not testing [[ -f blockdevice ]] (no devices found)
Warning: Not testing [[ -p pipe ]] (FIFOs not supported)
Warning: Not testing [[ ! -r file ]] (root reads anything)
This test takes two seconds...
Test ./C02cond.ztst failed: bad status 1, expected 0 from:
  print -u $ZTST_fd 'This test takes two seconds...'
  sleep 2
  cat unmodified
  touch newnewnew
  if [[ $OSTYPE == "cygwin" ]]; then
    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported on Cygwin)"
    true
  elif [[ "$(find . -prune -fstype nfs 2>/dev/null)" == "." ]]; then
    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported with NFS)"
    true
  elif test -f /etc/mtab && { grep $(df . 2>/dev/null| tail -n1 | awk '{print $1}') /etc/mtab | grep -q noatime; }; then
    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported with noatime file system)"
    true
  else
    [[ -N newnewnew && ! -N unmodified ]]
  fi
Was testing: -N cond
./C02cond.ztst: test failed.
The following may (or may not) help identifying the cause:
  This test can fail on NFS-mounted filesystems as the access and
  modification times are not updated separately.  The test will fail
  on HFS+ (Apple Mac OS X default) filesystems because access times
  are not recorded.  Also, Linux ext3 filesystems may be mounted
  with the noatime option which does not update access times.
  Failures in these cases do not indicate a problem in the shell.
./C03traps.ztst: starting.
This test takes at least three seconds...
This test, too, takes at least three seconds...
Another test that takes three seconds
./C03traps.ztst: all tests successful.
./C04funcdef.ztst: starting.
./C04funcdef.ztst: all tests successful.
./C05debug.ztst: starting.
./C05debug.ztst: all tests successful.
./D01prompt.ztst: starting.
./D01prompt.ztst: all tests successful.
./D02glob.ztst: starting.
./D02glob.ztst: all tests successful.
./D03procsubst.ztst: starting.
./D03procsubst.ztst: skipped (process substitution is not supported)
./D04parameter.ztst: starting.
./D04parameter.ztst: all tests successful.
./D05array.ztst: starting.
./D05array.ztst: all tests successful.
./D06subscript.ztst: starting.
./D06subscript.ztst: all tests successful.
./D07multibyte.ztst: starting.
Testing multibyte with locale en_US.UTF-8
    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported on Cy    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported with   elif test -f /etc/mtab && { grep $(df . 2>/dev/null| tail -n1 | awk '{print    print -u$ZTST_fd "Warning: not testing [[ -N file ]] (not supported with ./D07multibyte.ztst: all tests successful.a problem in the shell.esl
./D08cmdsubst.ztst: starting.
./D08cmdsubst.ztst: all tests successful.
./D09brace.ztst: starting.
./D09brace.ztst: all tests successful.
./E01options.ztst: starting.
This test hangs the shell when it fails...
./E01options.ztst: all tests successful.
./E02xtrace.ztst: starting.
./E02xtrace.ztst: all tests successful.
./V01zmodload.ztst: starting.
./V01zmodload.ztst: all tests successful.
./V02zregexparse.ztst: starting.
./V02zregexparse.ztst: all tests successful.
./V03mathfunc.ztst: starting.
./V03mathfunc.ztst: all tests successful.
./V04features.ztst: starting.
./V04features.ztst: all tests successful.
./V05styles.ztst: starting.
./V05styles.ztst: all tests successful.
./V06parameter.ztst: starting.
./V06parameter.ztst: all tests successful.
./V07pcre.ztst: starting.
Testing PCRE multibyte with locale en_US.UTF-8
./V07pcre.ztst: all tests successful.
./Y01completion.ztst: starting.
*** /tmp/zsh.ztst.out.13298     Mon Apr 11 15:45:09 2016
--- /tmp/zsh.ztst.tout.13298    Mon Apr 11 15:45:09 2016
***************
*** 1,7 ****
  line: {: }{}
  DESCRIPTION:{file}
- DI:{dir1}
- DI:{dir2}
  FI:{file1}
  FI:{file2}
  line: {: dir1/}{}
--- 1,5 ----
Test ./Y01completion.ztst failed: output differs from expected as shown above for:
  comptest $': \t\t\t\t\t\t\t'
Was testing: directories and files
./Y01completion.ztst: test failed.
./Y02compmatch.ztst: starting.
./Y02compmatch.ztst: all tests successful.
./Y03arguments.ztst: starting.
./Y03arguments.ztst: all tests successful.
**************************************
36 successful test scripts, 3 failures, 1 skipped
**************************************
make[1]: *** [check] Error 1
make[1]: Leaving directory `/root/dev/zsh/Test'
make: *** [check] Error 2

Thanks and Godspeed!

@russalex
Copy link
Contributor

Fixed on internal builds. I am not a zsh person so I have note tested everything, but:

 russ@RUSSALEX-DESK:~$ zsh
 russ@RUSSALEX-DESK ~ % ls -la
 total 84
 drwxr-xr-x 2 russ russ     0 Apr 27 01:00 .
 drwxr-xr-x 2 root root     0 Jan  1  1970 ..
 -rw------- 1 russ russ    24 Apr 26 19:04 .bash_history
 -rw-r--r-- 1 russ russ   220 Apr 26 19:03 .bash_logout
 -rw-r--r-- 1 russ russ  3636 Apr 26 19:04 .bashrc
 drwxrwxrwx 2 russ russ     0 Apr 26 19:22 bin
 -rw-rw-rw- 1 russ russ    48 Apr 26 19:24 .gitconfig
 -rw-rw-rw- 1 russ russ    16 Apr 26 19:11 .node_repl_history
 -rw-r--r-- 1 russ russ   675 Apr 26 19:03 .profile
 drwxrwxrwx 2 russ russ     0 Apr 26 19:07 projects
 drwxrwxrwx 2 russ russ     0 Apr 26 19:20 tmp
 -rw------- 1 russ russ   625 Apr 26 19:04 .viminfo
 -rw-rw-rw- 1 russ russ 35211 Apr 27 00:55 .zcompdump
 -rw------- 1 russ russ    49 Apr 27 01:00 .zsh_history
 -rw-r--r-- 1 russ russ  1295 Apr 27 00:56 .zshrc
 russ@RUSSALEX-DESK ~ %

@codecat
Copy link

codecat commented Apr 27, 2016

Can you try Oh My Zsh?

@keichinger
Copy link

@russalex is there any rough estimation when this build might be coming to an Insider Build?

@mcornella
Copy link

Hi @russalex, thank you for the update. 2 things:

First, do you know when's the soonest time end users can get the fix? If not, do you know where we can look at the deployment schedule for updates?

And second, could you run the following test to see if process substitution works on the fixed version?

cat <(echo it works | cat)

Thanks a lot!

@aseering
Copy link
Contributor

For what it's worth, process substitution under bash is being investigated with issue #266 . I don't know how zsh does process substitution but would assume that they're related.

@russalex
Copy link
Contributor

russalex commented May 6, 2016

Sorry for the late replies here.

@cH40z-Lord, I wish I could give more information on the schedule. Unfortunately I can not. Best I can say is to stick on the Insider Fast right to get things as quickly as possible.

@angelog, Never tried myzsh before so this will not be a fair test. It did install with no errors but I do not believe the prompt displayed correctly:
➜ ~
For fun, I set my theme to random. Some look to work while others fail with errors like:

russ@RUSSALEX-DESK:~$ zsh
[oh-my-zsh] Random theme '/home/russ/.oh-my-zsh/themes/trapd00r.zsh-theme' load
d...
prompt_jnrowe_precmd:3: command not found: zsh_path
russ@RUSSALEX-DESK:-> (0)
>

My suggestion on this one would be to start a new issue here (and possibly on our uservoice page) when the zsh fixes go out.

@kameleon83 mcornella , @benhillis is talking about process substitution on #266 (as @aseering points out). Looks like we still have the same bug under zsh

@mcornella
Copy link

@russalex that's a known issue on ohmyzsh. Some themes require loading plugins, which is not done automatically, so random doesn't really work reliably.

@angelog as far as I've tested, most of ohmyzsh should work ok, except where process substitution is used. Some plugins may not work as well, but that's a bigger testing effort that I can't do right know. If in the future something doesn't work you can always open an issue on the official repo and I'll do my best to help.

@filipeaguiar
Copy link

And is nice to remember that even in Linux/Mac, Oh My Zsh uses patched fonts for some of the themes.

@ghost
Copy link
Author

ghost commented May 11, 2016

Hello guys,
With the new update of Windows build 14342, zsh working properly.
Oh My Zsh also works.
It's awesome.

@benhillis
Copy link
Member

@kameleon83 Thank you for confirming! Please do let us know if you encounter unexpected behavior with zsh or OhMyZsh.

@ghost
Copy link
Author

ghost commented May 11, 2016

@benhillis Of course. I will do it ;-)

@russalex russalex added the fixed label May 11, 2016
@ghost
Copy link

ghost commented May 12, 2016

so and how to run this by default? chsh doesn't do anything. always have to run zsh as user. strange thing, as root it get's executed by default

@ghost
Copy link
Author

ghost commented May 12, 2016

@lama0900 Hello just write in ".bashrc"
exec zsh

@ghost
Copy link

ghost commented May 12, 2016

thank you 👍 . is that behaviour different from "proper" ubuntu? b/c never did something like that..

@ghost
Copy link
Author

ghost commented May 12, 2016

It is still in beta. We must send the bug to insider hub. I did not do it.
After I use archlinux and not Ubuntu usually so uncertain behavior of it

P.S.: Sorry for my english. I'm french and I translate by google

@ghost
Copy link

ghost commented May 12, 2016

@kameleon83 thank you anyway. at least, working for me! 👍

@benhillis
Copy link
Member

@lama0900 @kameleon83 On native Ubuntu it's the login process that decides which shell to launch. It queries the /etc/passwd file and invokes your default shell (which can be modified by chsh). Currently we do not run the Ubuntu login process and launch /bin/bash directly.

This has been suggested on our user voice forum, I would encourage you to upvote that thread to help us prioritize what our team works on in the future.

@falltodis
Copy link

@kameleon83 Not work on 10342

@ghost
Copy link
Author

ghost commented May 15, 2016

@falltodis 10342 or 14342?

@falltodis
Copy link

@kameleon83 Sorry! It's 14342

@codecat
Copy link

codecat commented May 18, 2016

Can confirm this works now on the latest build! 👍

@johnkchiu
Copy link

Has anyone figure out how to get the correct patched fonts for Oh My Zsh themes?

My looks like this -
image

@ghost
Copy link
Author

ghost commented May 19, 2016

Hello, I use oh-my-zsh with the theme "ys"
image

@brianjking
Copy link

@johnkchiu I'd assume you'd likely need to install Powerline patched fonts?

@brianjking
Copy link

@johnkchiu I got it working by installing newest release of Conemu https://github.com/Maximus5/ConEmu/releases/tag/v16.05.15 and ensuring Powerline was installed.

sudo pip install powerline-status
https://powerline.readthedocs.io/en/latest/installation/linux.html#installation-on-linux

conemu

@johnkchiu
Copy link

ComEmu + Powerline fonts helped, but I'm still getting some unresolved chars. Thanks for the tip.

@benhillis
Copy link
Member

Closing this issue out since zsh now works. Feel free to continue the discussion here though!

@bootstraponline
Copy link

@brianjking I followed your steps and the fonts still don't render with ConEmu 160619 and sudo pip install powerline-status

# zsh --version
zsh --version
zsh 5.1.1 (x86_64-ubuntu-linux-gnu)

# lsb_release -a
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:        16.04
Codename:       xenial

win10_bash_zsh_theme

Has anyone successfully rendered the agnoster theme on Xenial?

@bootstraponline
Copy link

bootstraponline commented Jul 3, 2016

I figured it out. You have to clone https://github.com/powerline/fonts then manually double click and install one of the Powerline fonts. After configuring ConEmu, then the symbols will display.

powerline_windows_conemu
powerline_working

I documented the configuration on my wiki.

@filipesilva
Copy link

@bootstraponline wiki config worked for me, was having the font problem as well. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests