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

The install script answers questions by itself #6160

Open
kid-with-phone opened this issue Aug 15, 2024 · 1 comment
Open

The install script answers questions by itself #6160

kid-with-phone opened this issue Aug 15, 2024 · 1 comment

Comments

@kid-with-phone
Copy link

[WARNING] Missing dependencies -- the following commands are required for opam to
          operate:
  - bwrap: Sandboxing tool bwrap was not found. You should install 'bubblewrap'. See
    https://opam.ocaml.org/doc/FAQ.html#Why-does-opam-require-bwrap.
[ERROR] Sandboxing is not working on your platform android:
        /data/data/com.termux/files/usr/bin/opam: "create_process" failed on
        /data/data/com.termux/files/home/.opam/opam-init/hooks/sandbox.sh: No such file
        or directory
Do you want to disable it?  Note that this will result in less secure package builds,
so please ensure that you have some other isolation mechanisms in place (such as
running within a container or virtual machine). [y/n] n
Do you want opam to configure bash?
> 1. Yes, update ~/.bash_profile
  2. Yes, but don't setup any hooks. You'll have to run eval
     $(opam env) whenever you change your current 'opam switch'
  3. Select a different shell
  4. Specify another config file to update instead
  5. No, I'll remember to run eval $(opam env) when I need opam

[1/2/3/4/5] 5

Here I did not type 'n' or or '5' press Enter, it typed the answer by itself and continued.
This happens for all questions after "Where should opam be installed", both in install.sh and opam init.

~ $ opam config report
# opam config report
# opam-version         2.2.0
# self-upgrade         no
# system               arch=arm64 os=linux os-distribution=android os-version=10
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 7
# current-switch       none set
~ $
@kit-ty-kate
Copy link
Member

That's fairly strange. This kind of behaviour would mean that either stdin is closed or Unix.isatty Unix.stdin (from the OCaml standard library) somehow returns false. I'm not sure if there is a special way to detect if the input of a terminal is available with termux compared to a regular POSIX environment.
Looking around didn't really give me any hint that it would be different so i have no idea what's happening.

I'll try to ask around if there are other people using android/termux

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

No branches or pull requests

2 participants