ardagnir / athame

Full vim for your shell (bash, zsh, gdb, python, etc)
GNU General Public License v3.0
1.62k stars 32 forks source link

Athame Failure: TMPDIR environment variable not set #85

Open atsalolikhin-spokeo opened 3 years ago

atsalolikhin-spokeo commented 3 years ago

Hello,

I just installed athame on macOS Catalina. All 5 tests failed, but I am trying it anyway.

I'm getting the error

Athame Failure: TMPDIR environment variable not set

I did set TMPDIR but I'm getting the error anyway.

Any advice?

ardagnir commented 3 years ago

You might need to set it outside the shell or use export. The exact way environment variables are inherited seems to differ based on shell/os/etc, but this is a simple getenv call so it probably isn’t set at the level readline/zsh is reading it

atsalolikhin-spokeo commented 3 years ago

Thanks @ardagnir . I tried setting TMPDIR outside and inside the shell (both times with export TMPDIR=/tmp, but I am still getting the error that TMPDIR isn't set.

BTW, my shell is bash, not zsh. Does that matter?

ardagnir commented 3 years ago

The shell shouldn't matter. Athame's not doing anything tricky to get tmpdir so it should work if it's set, but you can also just change athame.c:106 to hardcode the tmpdir. Just replace getenv(temp_dir_loc) with the value of TMPDIR

atsalolikhin-spokeo commented 3 years ago

Got it, thanks, @ardagnir .

When building Athame with ./readline_athame_setup.sh --prefix=$HOME/local/, I see:

/bin/sh ../support/shlib-install -O darwin20.3.0 -V apple -d /Users/atsalolikhin/git/athame/readline-8.0_tmp/../test/build/Users/atsalolikhin/local/lib -b /Users/atsalolikhin/git/athame/readline-8.0_tmp/../test/build/Users/atsalolikhin/local/bin -i "/Users/atsalolikhin/git/homebrew/bin/ginstall -c -m 644" libreadline.8.0.dylib
install: you may need to run ldconfig
Bash isn't set to use system readline or is not using readline 8. Setting up local bash for testing.
...
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"darwin20.3.0"' -DCONF_MACHTYPE='"x86_64-apple-darwin20.3.0"' -DCONF_VENDOR='"apple"' -DLOCALEDIR='"//share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H -DMACOSX   -I. -I/Users/atsalolikhin/git/athame/test/build/Users/atsalolikhin/local/include -I. -I./include -I./lib -I./lib/intl -I/Users/atsalolikhin/git/athame/bash-4.4_tmp/lib/intl  -g -O2 -Wno-parentheses -Wno-format-security -c y.tab.c
/usr/homes/chet/src/bash/src/parse.y:5741:21: error: implicit declaration of function 'count_all_jobs' is invalid in
      C99 [-Werror,-Wimplicit-function-declaration]
              temp = itos (count_all_jobs ());
                           ^
1 error generated.
make: *** [y.tab.o] Error 1

Make failed: Are you sure you have readline 8 installed? readline_athame_setup.sh installs readline 8 patched with athame. You may want to run it first.
This may also fail if you have a versionless libreadline.so symlinked to libreadline.so.7

Help?

I see this:

[~/git/athame] master(+1/-1) ±    find . -print |grep libreadline
./test/build/Users/atsalolikhin/local/lib/libreadline.8.0.dylib
./test/build/Users/atsalolikhin/local/lib/libreadline.a
./test/build/Users/atsalolikhin/local/lib/libreadline.8.dylib
./test/build/Users/atsalolikhin/local/lib/libreadline.dylib
./readline-8.0_tmp/shlib/libreadline.8.0.dylib
./readline-8.0_tmp/libreadline.a
[~/git/athame] master(+1/-1) ±

And this:

[~/git/athame] master(+1/-1) ± type bash
bash is /Users/atsalolikhin/git/homebrew/bin/bash
[~/git/athame] master(+1/-1) ± otool -L /Users/atsalolikhin/git/homebrew/bin/bash
/Users/atsalolikhin/git/homebrew/bin/bash:
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /Users/atsalolikhin/git/homebrew/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.7.0)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
        /usr/lib/libcharset.1.dylib (compatibility version 2.0.0, current version 2.0.0)
[~/git/athame] master(+1/-1) ±

Here is the system bash (which is older, which is why I use brew's bash instead):

[~/git/athame] master(+1/-1) ± otool -L /bin/bash
/bin/bash:
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
[~/git/athame] master(+1/-1) ±

I don't see readline:

[~/git/athame] master(+1/-1) ± find /usr/lib |grep readline
[~/git/athame] master(+1/-1) ±
atsalolikhin-spokeo commented 2 years ago

I just tried this again and I'm still getting:

$ ./readline_athame_setup.sh --prefix=$HOME/local/
...
gcc  -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"darwin20.6.0"' -DCONF_MACHTYPE='"x86_64-apple-darwin20.6.0"' -DCONF_VENDOR='"apple"' -DLOCALEDIR='"//share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H -DMACOSX   -I. -I/Users/atsalolikhin/git/athame/test/build/Users/atsalolikhin/local/include -I. -I./include -I./lib -I./lib/intl -I/Users/atsalolikhin/git/athame/bash-4.4_tmp/lib/intl -I/Users/atsalolikhin/git/homebrew/opt/readline/include -g -O2 -Wno-parentheses -Wno-format-security -c y.tab.c
/usr/homes/chet/src/bash/src/parse.y:5741:21: error: implicit declaration of function 'count_all_jobs' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
              temp = itos (count_all_jobs ());
                           ^
1 error generated.
make: *** [y.tab.o] Error 1

Make failed: Are you sure you have readline 8 installed? readline_athame_setup.sh installs readline 8 patched with athame. You may want to run it first.
This may also fail if you have a versionless libreadline.so symlinked to libreadline.so.7

Here is my libreadline:

[~/git/athame] master(+1/-1)+* ± ls -1  ~/git/homebrew/opt/readline/lib/*readline*
/Users/atsalolikhin/git/homebrew/opt/readline/lib/libreadline.8.1.dylib
/Users/atsalolikhin/git/homebrew/opt/readline/lib/libreadline.8.dylib
/Users/atsalolikhin/git/homebrew/opt/readline/lib/libreadline.a
/Users/atsalolikhin/git/homebrew/opt/readline/lib/libreadline.dylib
[~/git/athame] master(+1/-1)+* ±

I set the following variables per the output of brew info readline:


For compilers to find readline you may need to set:
  export LDFLAGS="-L/Users/atsalolikhin/git/homebrew/opt/readline/lib"
  export CPPFLAGS="-I/Users/atsalolikhin/git/homebrew/opt/readline/include"

For pkg-config to find readline you may need to set:
  export PKG_CONFIG_PATH="/Users/atsalolikhin/git/homebrew/opt/readline/lib/pkgconfig"