Cargo rust build fail
Hello, actually I don't know if that makes sense to try but I wanted to install this project https://github.com/marin-m/SongRec on termux
And after a few commands :
I'm having a compilation error I can't find a fix for
I attached the error as a file here
Any ideas what I'm missing ?
thank you for your time
GitHub
GitHub - marin-m/SongRec: An open-source Shazam client for Linux, w...
An open-source Shazam client for Linux, written in Rust. - marin-m/SongRec
23 Replies
you should do RUST_BACKTRACE=1 cargo install etc
then show it here
someone might be able to help
https://docs.rs/crate/gettext-sys/0.19.9/source/build.rs#172
it can't find ld, install binutils-bin
Do you have
ld
in PATH?
Oh, I think it's lld
that provides ld
Just type ld in terminal and install the one it recommendssorry I didn't realize ld was a command, just made it (the ld tool) answer by doing pkg install binutils (without -bin behind)
trying again the build
damn actually this one is so long I don't even have the beginning of it
I removed backtrace because I thought it was causing it but no
I managed to make it go a bit further with pkg install libacl (a line in the log said it was missing)
But I have more errors...
you'll need to patch that
the source code contains some functions that aren't available in the bionic libc
such as
pthread_cancel
for example
you either want it to be packaged, so you don't need extra hassle to use it, or you can patch it yourselfthank you for your answer, so you're saying this bionic libc a specific one for termux or to aarch64 ?
I don't know anything about rust, patching it myself sounds ambitious...
I'm going to check these methods maybe I can find packages to support it, if that was what you were suggesting to do else
Specific to Android
error message of this build:
technically, from a certain perspective, this software is already prepatched here,
https://github.com/termux/termux-packages/blob/8c8b7ea67ded9c969d9f7e7de7425744ff5de151/ndk-patches/libintl.h#L35
but from the perspective of the gettext-sys cargo crate, it's not, and somehow, it can't find that by itself
failing code (Android-unaware Rust): https://github.com/gettext-rs/gettext-rs/blob/c15b78f5ad8a5e5f9a117ff4c0e785ded0b124f6/gettext-sys/build.rs#L100-L129
Documentation: https://github.com/gettext-rs/gettext-rs/tree/master/gettext-sys#environment-variables
how to force a build of this app to complete:
GitHub
termux-packages/ndk-patches/libintl.h at 8c8b7ea67ded9c969d9f7e7de7...
A package build system for Termux. Contribute to termux/termux-packages development by creating an account on GitHub.
GitHub
gettext-rs/gettext-sys at master · gettext-rs/gettext-rs
GNU Gettext FFI binding for Rust. Contribute to gettext-rs/gettext-rs development by creating an account on GitHub.
GitHub
gettext-rs/gettext-sys/build.rs at c15b78f5ad8a5e5f9a117ff4c0e785de...
GNU Gettext FFI binding for Rust. Contribute to gettext-rs/gettext-rs development by creating an account on GitHub.
however
the
gettext-related
problem is only one of the problems here.
This app depends on the oboe-sys
crateand it is an audio app, so basically you need the audio part to work which the
oboe-sys
crate is necessary for,
and unfortunately, I have not been able to get the audio of any app that uses the oboe-sys
crate to work. you will see some more errors if you try to run the build I showed how to force above.
those other errors basically come from the oboe-sys
crate.
I have been able to successfully force the GUI parts of GUI rust apps that attempted to pull in the oboe-sys
crate to run before, by heavily patching the app until its audio was completely disabled. and then I was able to see the GUI.
Example:GitHub
blocktopograph, a bevy engine hello world in termux · termux-user-...
- very buggy
- crashes 6 out of every 7 times i launch it, but stays running the 7th time
- audio backend is disabled
however, this is not a GUI app and it's an app that is centered around Audio functionality anyway, so that wouldn't be helpful here
In order to make this app work in Termux, the next steps would be to try to figure out if there is any way to either fix the
oboe-sys
crate to work in Termux (which seems very hard for me and maybe someone else can figure out how to do it),
or maybe find some way to, instead of allowing it to default to the oboe-sys
crate, divert it to get the app to use one of the audio APIs that already works in Termux, like Portaudio, Pulseaudio, OpenAL, or OpenSLES
Some functionality of the program might still work from that build, though, ^
i'm not sure how much. you could try it and check,
for me, the songrec audio-file-to-fingerprint
, songrec audio-file-to-recognized-song
and songrec help
subcommands seem to work
the songrec listen
, songrec recognize
and songrec microphone-to-recognized-song
subcommands all produce the error i've seen before in other programs that attempt to run the oboe-sys
crate
@owokitty did you manage to patch that softwares that used oboe-sys crate?
it depends what you mean, so far I have not been able to get any app that uses oboe-sys crate to have working speaker/microphone connection. i have only been able to force-build them, and get partial functionality (the parts that do not use speaker or microphone)
thank you so much for digging this up ! I struggled a bit with my old phone running out of space, but your commands to force build did work !
Actually from the start I didn't even imagine being able to record with termux directly, as you are talking about on the audio part of the program !
Of course it would be ideal but I'm afraid I don't have enough knowledge to continue researches, but thanks to you it might one day work
On my side I will open an issue on songrec to suggest adding support for termux as it would really be useful
there seem to be an issue on termux which is not there on linux with m4a files, seems to work well with mp3 though
I see, you can use
ffmpeg
to convert anything you need to MP3 if needed
and, if it works for you, there are several ways to record audio to files with microphone in termux, the easiest way is the termux-microphone-record
command, to enable it you would just need to install the Termux:API app, and then grant microphone permission to this app manually in Android settings, then Termux will be able to record from microphone recording apps that do work,
from there you could possibly make a script to record a file and then convert it to MP3, and then pass the file to songrec
Termux:API | F-Droid - Free and Open Source Android App Repository
Access Android functions from Termux
my record app was able to record mp3 files, so doing "open with" termux I can bring the file in termux and use the command, easy does it !
Concerning the issue here it is, I hope I will get some attention: https://github.com/marin-m/SongRec/issues/195
GitHub
[Feature Request] Termux support · Issue #195 · marin-m/SongRec
Hello, this issue follows the discussion someone created a few days ago here As this gave me hope this could be a feature in future builds All the following was found on Termux's discord and in...