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

Termbox broken in Mac #110

Open
hmohammadalt opened this Issue Oct 12, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@hmohammadalt

hmohammadalt commented Oct 12, 2018

error: failed to run custom build command for termbox-sys v0.2.11
process didn't exit successfully: /var/folders/9n/hm_m4l7s6m56j8vr8lscty240000gn/T/cargo-installhWL7KA/release/build/termbox-sys-6bc601969fa0e77e/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 "/Users/alt/.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 "/Users/alt/.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 "/Users/alt/.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 "/Users/alt/.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 "/Users/alt/.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 "/Users/hmohammed.alt/.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 "/Users/alt/.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 "/Users/alt/.cargo/registry/src/github.com-1ecc6299db9ec823/termbox-sys-0.2.11/.termbox/wscript", line 11, in options
opt.load('compiler_c')
File "/Users/alt/.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 "/Users/alt/.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_special_tools('c_*.py',ban=['c_dumbpreproc.py'])
File "/Users/alt/.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 "/Users/alt/.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 "/Users/alt/.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()', /Users/alt/.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: failed to compile amp v0.5.1, intermediate artifacts can be found at /var/folders/9n/hm_m4l7s6m56j8vr8lscty240000gn/T/cargo-installhWL7KA

Caused by:
build failed

@jmacdonald

This comment has been minimized.

Owner

jmacdonald commented Oct 12, 2018

Hi @hmohammadalt! This is an issue with termbox, the library used to render Amp's UI. If your python executable points to v3.7, the build process for termbox fails. If I have a chance, I'll create a PR to help expedite that issue. I'm happy to provide instructions to work around the problem, but they involve pointing python to python2 and that may not be what you want in general. 🙂

@jmacdonald

This comment has been minimized.

Owner

jmacdonald commented Oct 12, 2018

I should add: moving away from termbox is a goal for Amp. Having python as a build dependency is really sub-optimal, and there's no reason we can't rewrite termbox in Rust.

@hmohammadalt

This comment has been minimized.

hmohammadalt commented Oct 15, 2018

great, so what workaround I should do to make it work now, I have anaconda installed, if I activate python2.7 will it work ?

@matthias-t

This comment has been minimized.

matthias-t commented Oct 31, 2018

You don't need to rewrite termbox in Rust. There's already termion

@jmacdonald

This comment has been minimized.

Owner

jmacdonald commented Nov 2, 2018

@hmohammadalt yep! When termbox's build script calls python, that needs to resolve to python 2.x. As long as you settle that, it should build. 🙂

@matthias-t termion is considerably more low-level than termbox. Amp already has a termion-backed Terminal implementation that works, but termbox manages an in-memory buffer that sidesteps flicker issues that occur in termion. That's one of the major blockers to us adopting it wholesale (and trust me, I do want to adopt it 🙂).

Implementing that same buffer for amp's TermionTerminal type is the next thing in my queue, so sit tight! You can track migration progress towards termion here, if you're interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment