-
-
Notifications
You must be signed in to change notification settings - Fork 165
Python bind
for osh
#2092
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
Python bind
for osh
#2092
Conversation
148e75f
to
dfdb011
Compare
f2cf1c4
to
f8ff91a
Compare
f8ff91a
to
179d375
Compare
179d375
to
c26b7d5
Compare
I ran the spec tests locally and got this -
Is that what is expected to work? The code looks reasonable, and this seems like good progress! If so, I can help fix the C++ issues |
Yes, this is what I expect. The failing tests don't have code implemented for them yet. |
I pushed a couple minor commits to pass type checking and translation So make sure to PULL before editing any code It looks like we can get past the rest of the C++ build errors without much work too -- I will look at that This looks VERY promising, thank you! |
OK I pushed some stubs for C++ -- wasn't that bad, although there was one mycpp workaround necessary Let's see what CI results looks like! |
Oh weird there are some http://op.oilshell.org/uuu/github-jobs/8226/interactive.wwz/_tmp/soil/logs/py-all-and-ninja.txt Maybe this is due to older GNU readline versions? Maybe bash added a new flag recently that depends on a new version or something? |
Hmm, I haven't seen that error either. The rl_function_of_keyseq_len fn exists in my bash. I see it in lib/readline/readline.h and lib/readline/bind.c. Looks like that particular fn was added six years ago for bash 5.0. I'm guessing python's readline wrapper uses an older version as its basis? Bash 4.4 used rl_bind_keyseq to do removal by passing a null ptr for the fn to bind to. I'll look into what precise version python's readline was based off of. Using that as a basis is probably easier; bash/readline is old, but it's still changing, and I don't think I want to bring in the latest readline just for this. (Honestly, I'm not sure you want to use readline over a more modern lib, even without the license issue.) |
OK I made a whole bunch of minor changes, and I think this is ready to merge! Here are what the tests look like now
But I think this is great progress! Let me know what you think |
Here's a summary of what I did
Let me know if you have any questions ... in general we have a boatload of tools that make this very mechanical And I think concentrating on just Python is absolutely right for contributors, especially with something as hairy as Thanks for working on this! It DEFINITELY would not get done without your efforts. From working with this PR, I now know a little more about |
Hmmm, looks like the new bind -q spec doesn't pass on non-cpp osh. Apparently, if it's not bound, it should write that to stdout, instead of stderr. |
Yeah I noticed that, though it's arguable how much we have to match bash EXACTLY i.e. we try to avoid "implementing bash bugs", which may be changed in later versions For stdout/stderr, the heuristic I use is --
i.e. I think If it's consistent with the rest of OSH, then we could keep it on stderr Not sure though |
Oh, well...I already changed it. In particular, it failed when Whether bash is mistaken in writing that to stdout instead, or in returning a non-zero status code...I dunno. It does seem like something that could be parsed, though. |
There's a lot of CI checks failing their Anyway, I think my part on the current PR is done. I have nothing else I want to change. |
To check the CI failures, I go here: https://op.oilshell.org/uuu/github-jobs/ and then click on your job: https://op.oilshell.org/uuu/github-jobs/8291/ and then if you click on the first failure, you'll see: https://op.oilshell.org/uuu/github-jobs/8291/cpp-coverage.wwz/_tmp/soil/logs/compare-gcc-clang.txt
This is a mycpp error, which says that you should not use implicit booleans, basically because those 2 things are different in C++ ! We do a literal translation, so you have to be specific about what you want |
Merged, thank you! Please keep us updated on Zulip |
No description provided.