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/oils.sh requires bash, but should only require /bin/sh (build/common.sh ) #1900

Closed
b9Joker108 opened this issue Apr 5, 2024 · 7 comments

Comments

@b9Joker108
Copy link

b9Joker108 commented Apr 5, 2024

I wish to install your shell in Termux, but your documentation confuses me greatly. Is the shell called: osh, ysh, oils or oils-for-unix? This confuses me greatly. Also, I am unrooted.

BTW, I hope the name of the shell is ysh, as it sounds like the name of a Un*x/*NIX shell.

Any assistance greatly appreciated!

Cheers

@andychu
Copy link
Contributor

andychu commented Apr 5, 2024

Yeah sorry there are 2 tarballs which is confusing now

I recommend installing the oils-for-unix tarball, which has README-native.txt with instructions inside. All you need is a C++ compiler

There is a single binary oils-for-unix, and symlinks osh and ysh

https://www.oilshell.org/blog/2023/03/rename.html#where-are-they-used


It is rough now, so if this is still not clear, then I recommend waiting a few months ... we recently switched to oils-for-unix, so it's new

I think @Melkor333 uses it with Termux though

@b9Joker108
Copy link
Author

b9Joker108 commented Apr 5, 2024

So, I had actually already downloaded and extracted the oils-for-unix tarball, so that is fortuitous and bodes well for the install. Configure worked. I then tried make, which didn't. Hence, the Issue.

Actioning your subsequent advice, I read: 'README-native.txt'. I then executed:

pwd
/data/data/com.termux/files/home/oils-for-unix-0.21.0
❯ vim README-native.txt
❯ sh _build/oils.sh

_build/oils.sh: 80: build/common.sh: Syntax error: Bad function name

This is the context of line 80:

...
78    _compile_one "$compiler" "$variant" "" \                                                        
79     _gen/cpp/build_stamp.cc "_build/obj/$compiler-$variant-sh/_gen/cpp/build_stamp.o"              
80
81    _compile_one "$compiler" "$variant" "" \
82     _gen/data_lang/nil8.asdl.cc "_build/obj/$compiler-$variant-sh/_gen/data_lang/nil8.asdl.o"
83
84    _compile_one "$compiler" "$variant" "" \
85     _gen/data_lang/pretty.asdl.cc "_build/obj/$compiler-$variant-sh/_gen/data_lang/pretty.asdl.o"
...

Knowing what I should change, or edit, is a bit beyond my nooby pay grade. It is also a bit odd, as there is no code on line 80.

@b9Joker108
Copy link
Author

FYI: I shot Samuel an email.

@andychu
Copy link
Contributor

andychu commented Apr 5, 2024

Oh can you try _build/oils.sh without sh?

If bash is on your machine, it should work

build/common.sh line 80 has a shell function named can-compile-32-bit, which works in bash, but not in other shells.

We should relax this -- thanks for testing!

@andychu andychu changed the title Installing shell in Termux _build/oils.sh requires bash, but should only require /bin/sh (build/common.sh ) Apr 5, 2024
@b9Joker108
Copy link
Author

b9Joker108 commented Apr 6, 2024

Oh, I totally misread that output, that it was about common.sh, instead of oils.sh.

Well, I ventured execution of the script with bash, instead of sh (which is symlinked to dash on Termux, following Debian):

❯ bash oils.sh

oils.sh: line 15: build/ninja-rules-cpp.sh: No such file or directory

oils.sh: Building oils-for-unix: _bin/cxx-opt-sh/oils-for-unix

CXX _gen/bin/oils_for_unix.mycpp.cc
CXX _gen/bin/text_files.cc
oils.sh: line 26: compile_one: command not found
oils.sh: line 28: compile_one: command not found
CXX _gen/core/runtime.asdl.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/core/value.asdl.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/cpp/build_stamp.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/data_lang/nil8.asdl.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/data_lang/pretty.asdl.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/frontend/arg_types.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/frontend/consts.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/frontend/help_meta.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/frontend/id_kind.asdl.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/frontend/signal.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/frontend/syntax.asdl.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/osh/arith_parse.cc
oils.sh: line 28: compile_one: command not found
CXX _gen/ysh/grammar_tables.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/core.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/data_lang.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/fanos.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/fanos_shared.c
oils.sh: line 28: compile_one: command not found
CXX cpp/frontend_flag_spec.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/frontend_match.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/frontend_pyreadline.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/libc.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/osh.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/osh_tdop.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/pgen2.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/pylib.cc
oils.sh: line 28: compile_one: command not found
CXX cpp/stdlib.cc
oils.sh: line 28: compile_one: command not found
CXX mycpp/bump_leak_heap.cc
oils.sh: line 28: compile_one: command not found
CXX mycpp/gc_builtins.cc
oils.sh: line 28: compile_one: command not found
CXX mycpp/gc_mops.cc
oils.sh: line 28: compile_one: command not found
CXX mycpp/gc_mylib.cc
oils.sh: line 28: compile_one: command not found
CXX mycpp/gc_str.cc
oils.sh: line 28: compile_one: command not found
CXX mycpp/hash.cc
oils.sh: line 28: compile_one: command not found
CXX mycpp/mark_sweep_heap.cc
oils.sh: line 28: compile_one: command not found
WAIT
real 0.00
user 0.00
sys 0.00
LINK _bin/cxx-opt-sh/oils-for-unix
link: extra operand ‘_bin/cxx-opt-sh/oils-for-unix’
Try 'link --help' for more information.
strip: '_bin/cxx-opt-sh/oils-for-unix': No such file
'osh' -> 'oils-for-unix'
'ysh' -> 'oils-for-unix'

I then restarted Termux, and executed: ysh, osh and oils-for-unix in succession, but no cigar. Which, I expected, given the output.

@Melkor333
Copy link
Collaborator

Melkor333 commented Apr 6, 2024

I think you forgot to ./configure. After that it should work well.
I also didn't install the packages 'globally' but instead added the custom install path to my PATH:

# cat ~/.profile
export PATH="~/.oils/bin:$PATH"
# ./configure --prefix ~/.oils
# _build/oils.sh
# ./install

After that it should work :)
(you need to restart termux after adding the line to ~/.profile)

@andychu
Copy link
Contributor

andychu commented Jun 20, 2024

@andychu andychu closed this as completed Jun 20, 2024
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

3 participants