c9 / install

Cloud9 SSH installer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem compiling tmux on Arch Linux

kusayuzayushko opened this issue · comments

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

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

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

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

What is the version of python?

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 <
notifications@github.com> wrote:

What is the version of python?


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

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

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

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
    node-gyp@1.0.3 node_modules/node-gyp
    ├── which@1.0.9
    ├── rimraf@2.3.2
    ├── osenv@0.1.0
    ├── graceful-fs@3.0.6
    ├── semver@4.3.3
    ├── fstream@1.0.4 (inherits@2.0.1)
    ├── minimatch@1.0.0 (sigmund@1.0.0, lru-cache@2.5.0)
    ├── mkdirp@0.5.0 (minimist@0.0.8)
    ├── nopt@3.0.1 (abbrev@1.0.5)
    ├── tar@1.0.3 (inherits@2.0.1, block-stream@0.0.7)
    ├── glob@4.5.3 (inherits@2.0.1, once@1.3.1, inflight@1.0.4, minimatch@2.0.4)
    ├── npmlog@1.2.0 (ansi@0.3.0, are-we-there-yet@1.0.4, gauge@1.2.0)
    └── request@2.55.0 (caseless@0.9.0, json-stringify-safe@5.0.0, aws-sign2@0.5.0, forever-agent@0.6.0, stringstream@0.0.4, oauth-sign@0.6.0, tunnel-agent@0.4.0, isstream@0.1.2, node-uuid@1.4.3, qs@2.4.1, combined-stream@0.0.7, form-data@0.2.0, mime-types@2.0.10, bl@0.9.4, http-signature@0.10.1, tough-cookie@0.12.1, hawk@2.3.1, har-validator@1.6.1)

> pty.js@0.2.6 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" "pty.js@0.2.6"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! pty.js@0.2.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pty.js@0.2.6 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 pty.js@0.2.6
226 verbose unsafe-perm in lifecycle true
227 info pty.js@0.2.6 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: pty.js@0.2.6 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 pty.js@0.2.6
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" "pty.js@0.2.6"
234 error node v0.12.0
235 error npm  v2.5.1
236 error code ELIFECYCLE
237 error pty.js@0.2.6 install: `node-gyp rebuild`
237 error Exit status 1
238 error Failed at the pty.js@0.2.6 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 pty.js@0.2.6
242 info uninstall pty.js@0.2.6
243 verbose unbuild rmStuff pty.js@0.2.6 from /home/richard/.c9/node_modules
244 info postuninstall pty.js@0.2.6
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

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

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.