-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
allow a deeper integration with nushell #5088
Comments
as a maintainer of Nushell myself, i totally support the initiative of @fdncred here 😊 |
Sure, let's work together to make this happen! |
As a small small contributor of both nushell and coreutils, Id love to see this happen and would like to help in making this possible. :) |
@dmatos2012 The easiest way for you (or anyone else that is interested) to help is to start playing with my nushell PR listed above. If you checkout my PR and compile it with The current task is to really to find a way forward. e.g. How do we handle spans, which nushell requires for errors? How do we handle parameter parsing? How do we handle streaming. I started with uu_cp because there's not a lot of output with copying. I figured it may be an easy place to start. Then I went to uu_mv, which quickly revealed syntax that I think just needs to be added to nushell. |
I've been thinking about this in the background and looked at nushell/nushell#9463. Here's what I think we should do: Create a list of suitable utils for
|
Thanks @tertsdiepraam. I appreciate your thoughtfulness. Here's some of my thoughts. I generally agree with this approach, which is why I started with Another thing that I started playing around with was porting your tests into nushell. As far as I'm concerned, the more tests, the better, especially when bridging platforms like this. It was not trivial for the couple tests I moved over. I'd like to somehow just dump the tests your community has created for individual commands. We may have to think a little more on that front. I do know that with the Exposing uutils Exit/Panic - Ya, that would be bad but it seems like it's a known issue that we can continue to work on.
I'll take a look through the commands and throw a list together of ones that I'd consider the "crawl" stage, the post it here, but like I said, let's just plan on |
Excellent! I love the "crawl, walk, run" saying! Let's start with Line 214 in f37318d
and Line 1132 in f37318d
and the types used in ( I can add some additional documentation to those types and maybe clear up the naming a bit and then the rest would be up to you. |
I took a swing at bucketing the commands into crawl, walk, run here https://docs.google.com/spreadsheets/d/1MP9V8BTtcy_3DIUT8025yTcGrjkIJ-ZKFT0uvJFw0Lo/edit#gid=0 I guessed at a bunch of them and some may be bucketed wrong, but it's a start. |
I've made a PR to expose most of the necessary types of |
Now, building up on my comment on the PR, I have some pain points specifically for us to solve here. @fdncred. You can check my WIP branch building on yours (very ugly code now), to see some of updates.
Once we define those, I think I could try to port more tests and improve the code, and add some docs. Hopefully we can keep working together, to get close to a fully functional nushell using the |
Excellent observations! Thanks @dmatos2012! Pedantic correction: in GNU, One workaround is to create flags like An example of a short argument that does not have a long counterpart at all is As for For the first version, I think we should simplify as much as possible (e.g. no attributes or other complicated flags). Edit: Maybe SyntaxShape::OneOf(vec![
SyntaxShape::Keyword(
vec![b'='],
SyntaxShape::String,
),
SyntaxShape::Nothing,
]) |
@dmatos2012 Great write up. Thanks for your effort! I like your "ugly" code, mine would've looked worse. 😆 I agree with your points and @tertsdiepraam has some interesting thoughts for work-arounds. One comment I'll throw in is no one said we have to support every parameter in As you brought up, we also need to determine how compatible we want to be with the GNU flags. I'm not sure myself. I want people to feel at home but nushell is already pretty different. I'm not convinced it's important that we be 100% compatible with GNU flags. I think if we have a way to do the same thing but with a different way, perhaps like I'm going to try to get some other nushell core-team members to chime in here about these points. This is the "devil in the details" I was sure that we'd come across. There will be other problems with other commands like You can't tell but I'm bubbling over with excitement for this integration! |
So am I! |
Quick question just to be sure: what platforms should |
We're committed to MacOS, Linux, and Windows. However, we support people in other os's if we can. You can see that we have quite a few release assets to support people https://github.com/nushell/nushell/releases. The only other thing I really see talked about on Discord is Android operating systems. I'm not familiar what those are but we allow people to put compile time |
Alright, our CI already covers all the nushell platforms then. Thanks for the super quick info! |
Today is nushell 0.85.0 release day that will have the coreutils cp command in it 🥳. The release is being finished up as I write this. If anyone is interested in helping out, we'd like to add |
I'm happy to help in about a week. In the meantime if someone else is reading this: feel free to pick this up! |
I was already starting with 'rm' but also not available to keep working on it till the end of the month. 🏖️⛰️. But after, I will be happy to help as well :) So if anyone else wants to take it, go ahead. |
I'd really love to get a "good amount" of commands added for the next release. I'm hoping for 1 a week, so that would be 4, but I'd love to see more. |
Maybe to give this more visibility, you could open an issue per util you want to integrate? I think we could even make them good-first-issues. I think |
Just looking at the crawl, walk, run spreadsheet, here's the commands IMO should come first. After 3, we can play around with the order. Staying on the file-io theme
|
|
I've opened issues on our side as well, we can use those to track whether uutils is ready to be integrated and your issues for the actual integration. |
After looking through the files I got the following questions:
Depending on the answers, I am ready to take on |
If you're gonna tackle one, open an issue for it and we can talk specifics! |
@tertsdiepraam when you have a sec, can you please provide an update on the I just ask because we're getting closer to release time and we need that issue fixed before we release on 17 Oct. We'd like to have that landed well in advance of that, if it's not already landed, so that we can put in the uutils version of cp as the primary and have old-cp as a backup. |
@tertsdiepraam @sylvestre Is it possible to get a coreutils release today/tomorrow maybe? We're getting close to the nushell release date of Oct-17 and need a release in order to ship the If it's not possible, we'll need to roll back this PR nushell/nushell#10678 and wait for our next release 4 weeks later. Just let me know please. Sorry to be a pain. |
let me try now :) |
No need to be sorry! It makes perfect sense. We agreed to do the release before Oct 17, but I'm not sure when @sylvestre was planning to cut the release exactly. |
Still working on it but blocked on |
fixed https://crates.io/crates/coreutils |
Thanks so much @sylvestre. ❤️ We really appreciate your support. |
Thanks |
This is awesome! Sorry that I have been out of it for a bit, but where are we at now with the supported commands? I know the next commands were |
@dmatos2012 none of them have been merged yet. I think we only have a PR for |
For anyone watching this, I've added a list of commands that we'd like to integrate. |
As a maintainer of nushell, I just want to say that we love the effort of
uutils/coreutils
. Good work y'all and please keep up this excellent work!We love it so much that we really want to have a much tighter integration than just calling external executables. I myself, have started to experiment by using the
uu_cp
anduu_mv
crates as internal nushell commands in this PR nushell/nushell#9463.There are some rough edges that we'd need to work together on and I've tried to document different strategies in my PR. Without going into a lot of detail I'll just list a few things.
In general, as you might guess, some things in coreutils may need to be exposed publicly, like command Options, to enable others, like nushell, to utilize them, and other things may need a different level of surgery in nushell or in coreutils.
One thing is for sure, we'd love to partner up and find a way forward because, let's be honest, dealing with some of these file-io and other commands is just difficult, and it would just be great to have one source of truth that works cross-platform like the uutils/coreutils.
The text was updated successfully, but these errors were encountered: