jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.73k stars 105 forks source link

Compilation error when building on Antergos #113

Open adds68 opened 5 years ago

adds68 commented 5 years ago

error: failed to run custom build command for termbox-sys v0.2.11 process didn't exit successfully: /home/adds68/git-repos/amp/src/amp-0.5.2/target/release/build/termbox-sys-4917c904e931f5ce/build-script-build (exit code: 101) --- stdout running: "rm" "-rf" ".termbox" running: "git" "clone" "https://github.com/nsf/termbox" ".termbox" waf configure: setting CFLAGS to: -m64 -fPIC running: "./waf" "configure" "--prefix=/" Traceback (most recent call last): File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Node.py", line 285, in ant_iter raise StopIteration StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Scripting.py", line 98, in waf_entry_point run_commands() File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Scripting.py", line 155, in run_commands parse_options() File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Scripting.py", line 128, in parse_options Context.create_context('options').execute() File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Options.py", line 138, in execute super(OptionsContext,self).execute() File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Context.py", line 92, in execute self.recurse([os.path.dirname(g_module.root_path)]) File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Context.py", line 133, in recurse user_function(self) File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/wscript", line 11, in options opt.load('compiler_c') File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Context.py", line 89, in load fun(self) File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Tools/compiler_c.py", line 36, in options opt.load_specialtools('c*.py',ban=['c_dumbpreproc.py']) File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Context.py", line 296, in load_special_tools lst=self.root.find_node(waf_dir).find_node('waflib/extras').ant_glob(var) File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Node.py", line 334, in ant_glob ret=[x for x in self.ant_iter(accept=accept,pats=[to_pat(incl),to_pat(excl)],maxdepth=kw.get('maxdepth',25),dir=dir,src=src,remove=kw.get('remove',True))] File "/home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/.waf3-1.8.0-5c05be2d0e42d5c2c81403948a2d295b/waflib/Node.py", line 334, in ret=[x for x in self.ant_iter(accept=accept,pats=[to_pat(incl),to_pat(excl)],maxdepth=kw.get('maxdepth',25),dir=dir,src=src,remove=kw.get('remove',True))] RuntimeError: generator raised StopIteration

--- stderr Cloning into '.termbox'... thread 'main' panicked at 'assertion failed: cmd.stdout(Stdio::inherit()).stderr(Stdio::inherit()).status().unwrap().success()', /home/adds68/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/build.rs:88:5 note: Run with RUST_BACKTRACE=1 for a backtrace.

warning: build failed, waiting for other jobs to finish... error: build failed ==> ERROR: A failure occurred in build(). Aborting...

robbinhan commented 5 years ago

+1

wblondel commented 5 years ago

Same problem, and same trace!

$ rustc --version rustc 1.30.1

$ git --version git version 2.19.1

$ python --version Python 3.7.1

$ cmake --version cmake version 3.12.4

pbgc commented 5 years ago

This seems a problem with Termbox and not with Amp. Did you saw #110 ? Your python needs to resolve to python 2.x. to be able to compile Termbox.

wblondel commented 5 years ago

Ok, thanks, now we know what is the problem.

I found a solution on the ArchWiki: https://wiki.archlinux.org/index.php/python#Python_2 Read from "Finally, you may not be able to control the script calls, but there is a way to trick the environment. "

I followed the instructions and it worked.

jmacdonald commented 5 years ago

Thanks for the assist, @pbgc! The termion branch, once merged, will fix this by removing termbox as a dependency. 🙂

craftyguy commented 5 years ago

This is because termbox includes an older version of waf which does not have Python 3.7 support... https://github.com/nsf/termbox/issues/117

IMHO, "just use python 2.7" seems like a terrible solution. (termbox builds with Python 3.6, for example)

jmacdonald commented 5 years ago

@craftyguy you can use Python 3.6! The trick is that Arch's python package points to 3.7, and there's no easy way to point to <= 3.6. I'll update its build script to bring in python2 as a build dependency and alias it during the build. Then it can be installed temporarily with makepkg -sri, at least until we've moved away from termbox and it's no longer a dependency at all. :slightly_smiling_face: