Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Problem compiling tmux on Arch Linux #31

Open
kusayuzayushko opened this issue Mar 20, 2015 · 10 comments
Open

Problem compiling tmux on Arch Linux #31

kusayuzayushko opened this issue Mar 20, 2015 · 10 comments

Comments

@kusayuzayushko
Copy link

Error:

configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
:Compiling Tmux
depbase=`echo arguments.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DPACKAGE_NAME=\"tmux\" -DPACKAGE_TARNAME=\"tmux\" -DPACKAGE_VERSION=\"1.9\"-\
DPACKAGE_STRING=\"tmux\ 1.9\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" - \
DPACKAGE=\"tmux\" -DVERSION=\"1.9\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 - \
DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 - \
DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 - \
DHAVE_CURSES_H=1 -DHAVE_DIRENT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_INTTYPES_H=1 - \
DHAVE_NCURSES_H=1 -DHAVE_PATHS_H=1 -DHAVE_PTY_H=1 -DHAVE_STDINT_H=1 - \
DHAVE_SYS_DIR_H=1 -DHAVE_TERM_H=1 -DHAVE_BSD_TYPES=1 -DHAVE_PROC_PID=1 -I.  \ 
-I/home/kusayu/.c9/local/include -I/home/kusayu/.c9/local/include -\
I/home/kusayu/.c9/local/include/ncurses -DTMUX_CONF="\"/etc/tmux.conf\""  -iquote. -\
I/usr/local/include     -I/home/kusayu/.c9/local/include -I/home/kusayu/.c9/local/include/ncurses -\
D_GNU_SOURCE -std=gnu99  -O2   -MT arguments.o -MD -MP -MF $depbase.Tpo -c -o arguments.o \
arguments.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/string.h:634:0,
                 from arguments.c:22:
compat.h:196:8: error: expected identifier or ‘(’ before ‘__extension__’
 char  *strsep(char **, const char *);
        ^
compat.h:196:8: error: expected identifier or ‘(’ before ‘)’ token
 char  *strsep(char **, const char *);
        ^
Makefile:842: recipe for target 'arguments.o' failed                                                                                                                          
make: *** [arguments.o] Error 1

UPD:

>>>tmux -V   
tmux 1.9a
>>>which tmux
/usr/bin/tmux
@microbug
Copy link

microbug commented Apr 4, 2015

I'm having the same problem: anyone got a solution?

@nightwing
Copy link
Member

Interesting, it seems to try to install tmux even though you have it installed

Maybe there is a bug in version checking at https://github.com/c9/install/blob/master/install.sh#L283.
Could you try running

has() {
  type "$1" > /dev/null 2>&1
  return $?
}
check_tmux_version(){
  echo "tmux: $1"
  if [ ! -x $1 ]; then
    return 1
  fi
  tmux_version=$($1 -V | sed -e's/[a-z ]//g')  
  echo "tmux_version: $tmux_version"
  if [ ! "$tmux_version" ]; then
    return 1
  fi

  if [ $(python -c "ok = 1 if 1.7<=$tmux_version else 0; print ok") -eq 1 ]; then
    return 0
  else
    return 1
  fi
}

echo has "tmux" 
echo `tmux -V`
check_tmux_version `which tmux`;

to see where it goes wrong

@microbug
Copy link

microbug commented Apr 4, 2015

Terminal output:

[richard@server ~]$ check_tmux_version `which tmux`;
tmux: /usr/bin/tmux
tmux_version: 1.9
  File "<string>", line 1
    ok = 1 if 1.7<=1.9 else 0; print ok
                                      ^
SyntaxError: invalid syntax
-bash: [: -eq: unary operator expected

@nightwing
Copy link
Member

What is the version of python?

@burlingk
Copy link

burlingk commented Apr 4, 2015

It has been a while since I made it happened, but I once if thened my way
through the install file to get it up and going.

Some extra code is needed to make it properly detect the python version as
well, because Arch is set up to install Python2 and Python3 at the same
time.

On Sat, Apr 4, 2015 at 4:27 PM, Harutyun Amirjanyan <
[email protected]> wrote:

What is the version of python?


Reply to this email directly or view it on GitHub
#31 (comment).

@microbug
Copy link

microbug commented Apr 4, 2015

Python is version 3.4.3 .
The command line output was supposed to be this, not what I posted before (doubt it makes much of a difference though):

 [richard@server ~]$ bash script.sh
has tmux
tmux 1.9a
tmux: /usr/bin/tmux
tmux_version: 1.9
  File "<string>", line 1
    ok = 1 if 1.7<=1.9 else 0; print ok
                                      ^
SyntaxError: invalid syntax
script.sh: line 16: [: -eq: unary operator expected

@nightwing
Copy link
Member

indeed it was caused by wrong python version, i tried to make it's usage more consistent
#43
@microbug could you try installing with the version from that pull request by running
curl -L https://raw.githubusercontent.com/c9/install/python/install.sh | bash

@microbug
Copy link

microbug commented Apr 5, 2015

EDIT: I installed python2 and tried, and it didn't make a difference. Python3 is the default one though so that may be why.

If tmux is not installed the same error as in the first post occurs. If it is, the tmux section works fine but the script fails when installing pty.js:

:Installing pty.js
    [email protected] node_modules/node-gyp
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected] ([email protected])
    ├── [email protected] ([email protected], [email protected])
    ├── [email protected] ([email protected])
    ├── [email protected] ([email protected])
    ├── [email protected] ([email protected], [email protected])
    ├── [email protected] ([email protected], [email protected], [email protected], [email protected])
    ├── [email protected] ([email protected], [email protected], [email protected])
    └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

> [email protected] install /home/richard/.c9/node_modules/pty.js
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Python executable "python" is v3.4.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (/home/richard/.c9/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:108:14)
gyp ERR! stack     at /home/richard/.c9/node/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:97:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:735:7)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at maybeClose (child_process.js:1008:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
gyp ERR! System Linux 3.19.2-1-ARCH
gyp ERR! command "node" "/home/richard/.c9/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/richard/.c9/node_modules/pty.js
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Linux 3.19.2-1-ARCH
npm ERR! argv "/home/richard/.c9/node/bin/node" "/home/richard/.c9/node/bin/npm" "install" "[email protected]"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/richard/.c9/npm-debug.log

~/.c9/debug.log is long so here is the relevant bit:

225 info install [email protected]
226 verbose unsafe-perm in lifecycle true
227 info [email protected] Failed to exec install script
228 verbose unlock done using /home/richard/.c9/tmp/.npm/_locks/pty-js-789d6662ef081735.lock for /home/richard/.c9/node_modules/pty.js
229 verbose stack Error: [email protected] install: `node-gyp rebuild`
229 verbose stack Exit status 1
229 verbose stack     at EventEmitter.<anonymous> (/home/richard/.c9/node/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
229 verbose stack     at EventEmitter.emit (events.js:110:17)
229 verbose stack     at ChildProcess.<anonymous> (/home/richard/.c9/node/lib/node_modules/npm/lib/utils/spawn.js:14:12)
229 verbose stack     at ChildProcess.emit (events.js:110:17)
229 verbose stack     at maybeClose (child_process.js:1008:16)
229 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
230 verbose pkgid [email protected]
231 verbose cwd /home/richard/.c9
232 error Linux 3.19.2-1-ARCH
233 error argv "/home/richard/.c9/node/bin/node" "/home/richard/.c9/node/bin/npm" "install" "[email protected]"
234 error node v0.12.0
235 error npm  v2.5.1
236 error code ELIFECYCLE
237 error [email protected] install: `node-gyp rebuild`
237 error Exit status 1
238 error Failed at the [email protected] install script 'node-gyp rebuild'.
238 error This is most likely a problem with the pty.js package,
238 error not with npm itself.
238 error Tell the author that this fails on your system:
238 error     node-gyp rebuild
238 error You can get their info via:
238 error     npm owner ls pty.js
238 error There is likely additional logging output above.
239 verbose exit [ 1, true ]
240 verbose unbuild node_modules/pty.js
241 info preuninstall [email protected]
242 info uninstall [email protected]
243 verbose unbuild rmStuff [email protected] from /home/richard/.c9/node_modules
244 info postuninstall [email protected]
245 verbose gentlyRm vacuuming /home/richard/.c9/node_modules/pty.js
246 silly gentlyRm purging /home/richard/.c9/node_modules/pty.js
247 silly gentlyRm quitting because other entries in /home/richard/.c9/node_modules

@nightwing
Copy link
Member

Thanks for the update. I've pushed a fix for this to #43.

@WowSuchRicky
Copy link

Just now had the same issue happen to me in Arch as well. Same deal with ncurses - already had it installed, but had to jimmy-rig the installer by tarballing the ncurses-5.9 folder after patching with http://pastebin.com/raw/ewxjBXV6 and then run the install script again. Technically gcc5.x's fault, but I did already have the package.

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

No branches or pull requests

5 participants