Skip to content
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

Build xxh-shell for any kernel and architecture #73

Open
anki-code opened this issue Apr 1, 2020 · 8 comments
Open

Build xxh-shell for any kernel and architecture #73

anki-code opened this issue Apr 1, 2020 · 8 comments

Comments

@anki-code
Copy link
Member

For community:
⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@anki-code
Copy link
Member Author

anki-code commented Apr 1, 2020

I've added getting arch and kernel from host but xxh-shells build scripts is not support building shells for any systems.

Also every portable shell should have the portable binary for every system. Only zsh-bin has it now.

This is a complex goal but it could be achieved if we can make a clear strategy how to do it. PRs or thoughts are welcome.

One of the ways is create prebuilt packages like docker images. To run the portable shell you can just build it for the platform and use it as all in one xxh package.

@anki-code anki-code changed the title Build for any kernel and architecture Build xxh-shell for any kernel and architecture Apr 4, 2020
@network-shark
Copy link

I have a tried to get zsh working on freebsd with success , but with a lot of hacks and not reliable I just want to check how much code have to be changed.

The main problem I have now is that packages_operations() is not aware of any platform or kernel variable which have to be passed to the build.sh of zsh in my case.

To install the right zsh/bin to the remote system , $arch and $kernel needs to be passed to the build.sh

First I thought it make sense to pass them via the config file, but if you just init your shell on the local device, you will not know which platforms you need int the future.

Maybe it make sense to create something like init() where you have to add the paltform for your remote system which is then added to the config file ?

best regards, sharky

@anki-code
Copy link
Member Author

My current vision how it could be solved:

  1. Installation of the package (xxh +I) doesn't build the shell. (At the current version it do it during install process)
  2. Connecting command (xxh host) gets the kernel and arch and put it to the xxh shell build script. (At the current version we have getting these parameters and they passed to the build script.)
  3. The xxh shell build script creates build_<kernel>_<arch> directory and put there the files.
  4. Finally this directory should used for the remote host.

I think there will changes around using build directory and all xxh packages should be fixed.

@anki-code
Copy link
Member Author

anki-code commented Nov 17, 2020

Hi @network-shark! Thank you for bumping this thread! Please put your like to the first message to count statistics.

Will the described process above work for you or you made more significant changes?

@agnosticlines
Copy link

agnosticlines commented Aug 10, 2022

Hey sorry for the bump, this seems more relevant now with the increase of ARM servers and hosts in production, is there any implementation for arch specific xxh shells?

Am I right in my understanding that if I do an if statement on the $ARCH variable coming from build.sh and download the appropriate arch it will extract that when needed and copy it to the system? Or do both have to be copied to work

Update:

Tried it and it doesn't work, but I'm not sure if it's because macOS isn't populating the kernel and arch variables, because when I add debug print, it seems like on my M1 mac the ARCH is set to x86_64

Install xxh-shell-nushell2+git+git@github.com:agnosticlines/xxh-shell-nushell2.git to local /Users/agnosticlines/.xxh/.xxh/shells/xxh-shell-nushell2
Git clone git@github.com:agnosticlines/xxh-shell-nushell2.git
RUN SHELL COMMAND CAPTURED: git clone  --depth 1 git@github.com:agnosticlines/xxh-shell-nushell2.git /Users/agnosticlines/.xxh/.xxh/shells/xxh-shell-nushell2 1>&2
Build xxh-shell-nushell2
RUN SHELL COMMAND: /Users/agnosticlines/.xxh/.xxh/shells/xxh-shell-nushell2/build.sh  -K 'linux' -A 'x86_64' 1>&2
ARCH IS x86_64
--2022-08-11 11:31:17--  https://github.com/nushell/nushell/releases/download/0.66.2/nu-0.66.2-x86_64-unknown-linux-gnu.tar.gz

Update:

Ah, it's the install flag not building if the arch is different, it only builds on install, got you :-) This would be an awesome thing to implement

Either way I love the project, bought you some coffees on that link and would love if you could set up a proper method of supporting you monthly @anki-code :-)

I feel like an easy way to do this would be to just add a flag that grabs the repo locally or from git and then builds it on the target host, but it sounds like youre planning something way more fancy :)

I see now that kernel can double up as OS detection, may be interesting to distinguish glibc versions too, as some applications wont run on older glibc versions, but this is probably super overkill :)

@anki-code
Copy link
Member Author

anki-code commented Aug 11, 2022

Hey @agnosticlines ! I'm very appreciate your donation! I have no sponsorship enabled on Github and probably it takes some research of services like this.

This feature is highly desirable but the trick is not every shell could be build for any architecture. The zsh is most close to solve this. And probably xonsh too because of ability to run python everywhere.

I think we must have a way to adopt the algorithm of building to any target OS. PRs is very welcome!

Personally I have not enough time to implement this now. But I think I can spend some time to review the code again and estimate the work soon.

@Yu-Vitaqua-fer-Chronos
Copy link

Heya, any news on this? I'm using Termux to connect to my x64 server but fail to because of building errors

@anki-code
Copy link
Member Author

anki-code commented Sep 22, 2022

Hi @Mythical-Forest-Collective you can fork any xxh-shell and make x64 version.

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

No branches or pull requests

4 participants