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

Package request: Ansible #1815

Closed
luca-af opened this issue Nov 20, 2017 · 36 comments
Closed

Package request: Ansible #1815

luca-af opened this issue Nov 20, 2017 · 36 comments
Labels
package request A new package was requested.

Comments

@luca-af
Copy link

luca-af commented Nov 20, 2017

IT automation platform
Source Code: https://github.com/ansible/ansible

@fornwall fornwall added the package request A new package was requested. label Nov 21, 2017
@SDRausty

This comment was marked as spam.

@luca-af
Copy link
Author

luca-af commented Dec 1, 2017

Why I have to use an Arch Linux chroot inside termux?

@Neo-Oli
Copy link
Member

Neo-Oli commented Dec 1, 2017

@elroncio You don't have to. Ansible may eventually be packaged natively. This is just one possible solution to run it today.

@ghost
Copy link

ghost commented Dec 1, 2017

@Neo-Oli I can give a try at compiling!

@luca-af
Copy link
Author

luca-af commented Dec 2, 2017

@Neo-Oli I know, but I don't understand why this could be a good solution. I could also run a chroot with any other linux version, but I don't see the point in doing so.

@Neo-Oli
Copy link
Member

Neo-Oli commented Dec 2, 2017

@elroncio I agree that it is a bad solution and would love to see Ansible becoming available in Termux.

@vishalbiswas
Copy link
Contributor

I tried pip2 install ansible and it goes on forever.
If anybody has more patience than me, does it install successfully?

@Grimler91
Copy link
Member

@vishalbiswas It was quite fast for me, had to install the dependency pynacl using the steps in #1628 but the actual installation of ansible finished without errors quite quick. I installed from the git repo instead of with pip though.

Importing it doesn't throw an error but I haven't tested it further.

(And since it seems to be quite easy to install through pip I guess we can close this package request, any objections?)

@SDRausty

This comment was marked as spam.

@Neo-Oli
Copy link
Member

Neo-Oli commented Dec 2, 2017

@Grimler91 Maybe you could add a (short) wiki article outlining the steps to install it?

@Grimler91
Copy link
Member

@Neo-Oli yeah that's a good idea. We can have a section for python packages that require special treatment.

@SDRausty

This comment was marked as spam.

@SDRausty

This comment was marked as spam.

@SDRausty

This comment was marked as spam.

@Grimler91
Copy link
Member

@SDRausty I think that everyone think that installing a chroot environment to be able to run a quite small package like ansible is a bit of an overkill.

Thanks for pointing out that it is available through arch in termux. Arch linux in termux is indeed helpful to run packages that aren't available natively in termux yet. Hopefully all package requests will all be available in termux natively sooner or later.

@SDRausty

This comment was marked as spam.

@Grimler91
Copy link
Member

Closing this as we have outlined the steps on how to install it from pip (in short, first install pynacl following instructions in #1628 and then install ansible through pip).

@tcaddy
Copy link

tcaddy commented Jul 31, 2018

I can install ansible with pip but get this error when I run it

screenshot_20180731-123927

@ghost
Copy link

ghost commented Jul 31, 2018

@tcaddy Python in Termux does not support sem_open()

@SDRausty

This comment was marked as spam.

@ghost
Copy link

ghost commented Jul 31, 2018

@SDRausty It may be available only after recompiling python with api 24 enabled toolchain, currently it is built with api 21.

@pycadelic
Copy link

Any chance this sem_open thing can be fixed?

I'm on Oreo and running into it still, in this case with flake8.

ˋˋˋ
$ flake8 db.py
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/synchronize.py", line 28, in
from _multiprocessing import SemLock, sem_unlink
ImportError: cannot import name 'SemLock' from '_multiprocessing' (/data/data/com.termux/files/usr/lib/python3.7/lib-dynload/_multiprocessing.cpython-37m.so)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/bin/flake8", line 11, in
sys.exit(main())
File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/flake8/main/cli.py", line 16, in main
app.run(argv)
File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/flake8/main/application.py", line 412, in run
self._run(argv)
File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/flake8/main/application.py", line 400, in _run
self.run_checks()
File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/flake8/main/application.py", line 318, in run_checks
self.file_checker_manager.run()
File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/flake8/checker.py", line 338, in run
self.run_parallel()
File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/flake8/checker.py", line 286, in run_parallel
pool = multiprocessing.Pool(self.jobs, _pool_init)
File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/context.py", line 119, in Pool
context=self.get_context())
File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/pool.py", line 159, in init
self._setup_queues()
File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/pool.py", line 273, in _setup_queues self._inqueue = self._ctx.SimpleQueue() File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/context.py", line 112, in SimpleQueue
return SimpleQueue(ctx=self.get_context())
File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/queues.py", line 332, in init self._rlock = ctx.Lock() File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/context.py", line 66, in Lock
from .synchronize import Lock
File "/data/data/com.termux/files/usr/lib/python3.7/multiprocessing/synchronize.py", line 32, in
" synchronization primitives needed will not" +
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.
ˋˋˋ

@its-pointless
Copy link
Contributor

only way it could happen is if we compile python using api-24. Im not sure even then. I will investigate...

@its-pointless
Copy link
Contributor

Yeah it won't work.

@rathel
Copy link

rathel commented Jan 3, 2019

Any way to fix this? I run into this when I pip install ansible
https://pasteboard.co/HULFOIC.png

@Grimler91
Copy link
Member

@rathel header files are in the -dev packages. You are missing openssl/opensslv.h so I would try to install openssl-dev.

@Hotschmoe
Copy link

Any known work arounds for this? I can install ansible cleanly but it can't run due to sem_open() which if I understand, the python multiprocessing on android is to blame.

@its-pointless
Copy link
Contributor

no there aren't. Sem_open is not available.

@Hotschmoe
Copy link

Is there a previous version of ansible that does not rely on multiprocessing? I thought I had read that it was introduced in 1.9.x I'll try it tonight if I can

@Hotschmoe
Copy link

so
pip2 install 'ansible<1.9.0'
works well to get around the sem_open() and multiprocessing errors. Ansible now runs correctly. problem is it is so outdated none of the playbooks im trying work due to operations in 1.9.x and forward including 'become' and 'dnf'

@Hotschmoe
Copy link

could we get around the sem_open issue making an ansible branch for termux that replaces all the multiprocessing calls? Like in this issue: asciinema/asciinema#271

@pschmitt
Copy link
Contributor

For what it's worth you can give my alternative a try. It enables the usage of modern Ansible versions on Termux by creating a proot alpine image and installing ansible in it.
You can reach the host via SSH. It's a work in progress, but Ansible 2.8 and 2.9 work fine.

https://github.com/pschmitt/termux.sh#ansible

@shuhaowu
Copy link

shuhaowu commented Feb 4, 2020

Why does it work in a proot?

@pschmitt
Copy link
Contributor

pschmitt commented Feb 5, 2020

Why does it work in a proot?

🤷‍♂️

@shuhaowu
Copy link

I can confirm that python3's import multiprocess.synchronize definitely works within a proot-ed debian. Not sure why.

@shuhaowu
Copy link

I can confirm that python3's import multiprocess.synchronize definitely imports properly within a proot-ed debian. I can see that if __ANDROID__ is defined in the compiler, sem_unlink is not defined during the build, which may be why the import fails (as the import line tries to import sem_unlink). The prooted build is built without this option turned off.

@ghost ghost deleted a comment from BILRIDGEWAY Jun 26, 2020
@ghost ghost locked and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package request A new package was requested.
Projects
None yet
Development

No branches or pull requests