Fix require failing in Termux on Android #80
Merged
+20
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note that this change does not make rbtrace actually work in Termux - it just allows an app to start up without an exception when it has
require 'rbtrace'
.The exception is:
It turns out that Android (9, at least) does not include
rindex
- I believe because it has been deprecated for many years;strrchr
is apparently a drop-in replacement.After that, there was another exception about the
SUN_LEN
symbol missing. I added this definition for the macro. That then got the gem able to be required without error.I would have liked to get rbtrace working in Termux, but this is as far as I've been able to progress for now. I'm having trouble with the
ipcs
binary. It's deliberately not provided by Termux'sutil-linux
package for some reason. With root, I can run Stericson Busybox'sipcs
, but it just returns this:I'm hoping that's not just a quirk of the particular kernel on my device. But perhaps the shared memory functionality is not actually suppported on Android? I don't yet know. Anyway.
test.sh
does not work since rbtrace itself does not yet work on Android. The tmpdir change in there gets it one step closer at least -/tmp
does not exist on Android.This commit was tested by simply: