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
less failling to run #2164
Comments
Thanks for reporting @thiblahute! That's a weird one. Do you still have errors or random |
Also, I think this may have already been fixed on master, if you could try that too, please. |
hey @scopatz -- it's mostly fixed on my end, although opening an empty file with |
hmm weird. It works for me. Do you have less aliased to anything? |
No idea why, but it works for me, too, now... I was really sure it bailed on me before but I'll defer to my lying eyes. |
weird... every once out of a bunch of times it does just quit. i'll see if I can duplicate that for a nonempty file... |
damn. yeah, sometimes |
software == the worst |
Yes, it does not matter if it is an empty file or not, also I noticed
OK I now have a pretty good hint, basically it only happens when I am inside a Example:
while running from outside that env works just fine. I will try with master. |
Same thing on master in a venv. |
Nice, OK, I can reproduce this via the subprocess method. |
@thiblahute, I am a bit confused about your workflow. Are you running xonsh from within |
It seems like you might have xonsh at the top-level. If I go |
Basically I have Also |
@thiblahute what does you xonshrc look like? Also, as a potential fix, could you try adding the following to your xonshrc: __xonsh_commands_cache__.threadable_predictors['gst-uninstalled'] = lambda args: False |
Well it is a bit funky and hacky, but here we go: import os
from subprocess import run as r
from subprocess import check_output as c
$FLATPAK_ENVPATH = "/home/thiblahute/devel/pitivi/flatpak/"
def obuild(full=False):
d = os.path.expanduser($MGST + '/gst-build/odroidbuild')
r('ninja', cwd=d)
tmpf = '/tmp/obuildrsync'
with open(tmpf, 'w') as f:
cmd = ["find", "."]
if not full:
cmd += ["-cmin", "-5"]
cmd += ["-name", "*.so*"]
f.write(c(cmd, cwd=d).decode())
r(['rsync', '-a', '--progress', '--files-from', tmpf, './', 'odroid:/home/thiblahute/devel/gstreamer/gst-build/build/'], cwd=d)
def parse_file(path):
with open(os.path.expanduser(path)) as a:
for l in a.readlines():
if l.endswith('\\'):
print("Can not evaluate %s" % l)
continue
if l.startswith("alias"):
vs=l.replace('alias', '').strip().split('=')
aliases[vs[0]] = vs[1].replace('"', '').replace("'", '')
elif l.startswith("export"):
vs=l.replace('export', '').strip().split('=')
if vs[0] == 'PATH':
vs[1] = vs[1].replace('$PATH', os.pathsep.join(__xonsh_env__['PATH']))
__xonsh_env__[vs[0]] = vs[1].replace('"', '').replace("'", '')
parse_file('~/.envvars')
parse_file('~/.envvars.local')
parse_file('~/.aliases')
parse_file('~/.aliases.local')
aliases["pitivi-git"] = ["source", "~/bin/pitivi-xonsh-env"]
__xonsh_env__['BASH_COMPLETIONS'] = ['/usr/share/bash-completion/completions/git',
'/usr/share/bash-completion/completions/systemctl']
$SHELL='/usr/bin/xonsh'
xontrib powerline
xontrib prompt_vi_mode
__xonsh_commands_cache__.threadable_predictors['gst-uninstalled'] = lambda args: False Last addition Moreover, emptying my xonshrc does not solve the issue either. |
Wait, so what actually runs the gst-uninstalled? |
No I run it after starting xonsh. |
Can you try starting xonsh with |
And what command are you using to run gst-uninstalled? Just to be exact, are there any aliases etc? |
No, no alias, just running `./gst-uninstall` lead to that issue.
…On Sat, Feb 11, 2017 at 7:44 PM, Anthony Scopatz ***@***.***> wrote:
And what command are you using to run gst-uninstalled? Just to be exact,
are there any aliases etc?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2164 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFGYV9OKU2ZslrxuDjFZLDWz3FE9aluks5rbjm2gaJpZM4L53o4>
.
|
Ok then that commands cache trick should have worked. Can you run the following with the commands cache False set and report back please? $ x = ![./gst-uninstall]
$ x.specs |
OK, sorry about that the script is `gst-uninstalled.py` and replacing your
line with
`__xonsh_commands_cache__.threadable_predictors['gst-uninstalled.py'] =
lambda args: False` does fix the issue.
Any idea how to properly fix it or should I just keep using that line ? :)
Usually I used to use `ninja -C build/ uninstalled` to get into the GStreamer uninstalled env, it does not work with your cache trick though (I can change my way of doing it anyway).
…On Sat, Feb 11, 2017 at 7:56 PM, Anthony Scopatz ***@***.***> wrote:
Ok then that commands cache trick should have worked. Can you run the
following with the commands cache False set and report back please?
$ x = ![./gst-uninstall]
$ x.specs
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2164 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFGYdjwU1heHDL7jGhXHzR7MWnwMlZyks5rbjyKgaJpZM4L53o4>
.
|
@thiblahute That is the correct fix for now. Much more than other codes, I think gst-uninstalled.py is misbehaving here, though we'll support it to the best of our ability. Your more general case of $ python3 -c "import subprocess; subprocess.call(['/usr/bin/xonsh'])" is again something where users will have to manually turnoff the threadability (temporarily?) for calling Python in a subprocess. Basically, right now xonsh can't capture output, stream output, and remain interactive on the main thread. (This is due to some limitations in subprocess.) So we have a special mechanism for handling when we want to run on the main thread and we don't care about streaming output. gst-streamer.py, by running xonsh indirectly, is trying to have it all. In generaly, if you are having problems like this, such as with ninja, you can add a similar lambda. __xonsh_commands_cache__.threadable_predictors['ninja'] = lambda args: False Or if you wanted to get fancier, you could do: __xonsh_commands_cache__.threadable_predictors['ninja'] = lambda args: 'uninstall' not in args #2119 is another issue to add an easier way to register these kinds of functions. |
Also, please feel free to close this whenever you think it is ready! |
Got it, not ideal but good enough for now! Thanks a lot for you help here! |
OK, one more question, what if I have an alias to launch the GSTreamer uninstalled env (ie |
Yeah, agreed it is not ideal. @astronouth7303 has been leading the way to try to fix this.
If it is a simple alias, you don't need to do anything since it will resolve the basename of the underlying binary. If you have a callable (function) alias, you may need to decorate it as unthreadable and/or uncapturable. See the docs here: http://xon.sh/tutorial.html#unthreadable-aliases |
(That effort is #2159 for the record.) |
Trying to run
less
fails and start running it in the background as follow:I did not press Z or anything it just happened without doing anything.
I do not have much configs (yet) just a few aliases and 'exports'.
The text was updated successfully, but these errors were encountered: