-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
rust package is broken #15851
Comments
can repro |
commit 0727af2 broke it I suppose. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Known issue when updating LLVM, someone will need to update or rebuild the rust package. |
Also experiencing this issue. Note that _LLVM_MAJOR_VERSION=$(. $TERMUX_SCRIPTDIR/packages/libllvm/build.sh; echo $LLVM_MAJOR_VERSION)
_LLVM_MAJOR_VERSION_NEXT=$((_LLVM_MAJOR_VERSION + 1))
TERMUX_PKG_DEPENDS="libc++, clang, openssl, lld, zlib, libllvm (<< $_LLVM_MAJOR_VERSION_NEXT)" but it must somehow be keeping edit: this is incorrect |
@gabldotink, no, that's intentional. The idea is that if LLVM is updated, rather than breaking the current rust package, it won't allow you to install the rust linked against the old LLVM 15. Someone will need to rebuild rust against LLVM 16, as has always happened on past LLVM updates. |
Facing the same issue when trying to install rust |
So you made the commit knowing this would be the case beforehand? Yet you did not come to the logical conclusion that this would be something that should be coordinated to avoid situations like these? |
This is partly due to the behavior of
I have no idea whether this behavior of |
Yep, this happens every six months with every major LLVM update I put out.
Read the comment I linked, where I notified the two devs who had most recently updated the rust package ahead of time.
That makes no difference. What makes a difference is letting the recent maintainers know, as this is a long-standing known issue when updating LLVM or any other commonly used library, ie some of the dependencies break because they don't work with the latest library version. With the Rust package, usually one of the volunteer maintainers steps up and updates it. If nobody has done so this time, perhaps one of you can do so. |
i'd like to, but i have no idea how as i have never built rust before (i have only used rustup and it does not work on android) |
I see that the older version of llvm is also removed? https://termux.mentality.rip/termux-main/pool/main/libl/libllvm/ |
I am experiencing the same issue right now. Can I downgrade llvm? |
same issue here. android termux |
Is there no workaround? Can we manually install older version of |
Try this:
As long as you haven't cleaned your downloaded Termux package cache lately, which most people don't, that should work. You may need to check the libllvm version you last installed though, as if it wasn't 15.0.7-3, you will have to substitute the version you have in this command. If that works, don't update your packages until rust is rebuilt against LLVM 16 and you should be good for a bit. |
Hmm I am working with a fresh install of termux, so I don't have a cache. I am new to the ecosystem, I am pretty surprised there is a breaking update every six months and there is no version archiving. I don't think it should be on you to do the upgrade for llvm @buttaface but it seems crazy there is no failsafe for the end user. This seems like a termux level decision, still I am just shocked |
I would characterize this as more of a bleeding-edge repo, we're currently listed as the fifth most up-to-date package repo at repology. One of the hazards of updating quickly is breaking dependencies that don't update as quick, which is why many package repos go slower or maintain a more stable branch too. We could mitigate this somewhat by keeping a couple older versions on the server, and having commands to roll back broken packages to those older versions, but have not done so. |
Thank you! this saved my ass. I'll just use apt from now on instead of pkg to avoid breaking my system (@xtkoba thanks for the tip on how pkg works). |
https://mirror.nevacloud.com/applications/termux/termux-main/ |
If you are impatient you can grab the build artifacts produced by #15876 https://github.com/termux/termux-packages/actions/runs/4573314657 |
Can someone try out the new rust build and let us know if it works well? Download the right zip artifact for your architecture here and unzip and untar it. Then, update to LLVM 16 and run |
I tried to compile
But if I run the build command again it passes and the resulting binary works normally. Idk if it's because of my |
There are sporadic linker crashes with lld 16, #15867, so that's unrelated. What was the clang installation issue? Paste an error if you still have it. |
grex builds successfully, but |
Updated and it seems to be working fine. Thanks |
@s-cerevisiae, question for you: what CPU were you running on when you hit that linker error? I'm reporting the linker issue upstream and we're only seeing it on certain AArch64 devices. If you're unsure, this command should tell you the model number, |
i'm learning English so be patient with my English. there is a patched Glibc for Termux thanks to @Maxython that really made it easy to run this method needs just little work and it's extremely easy: just switch your Termux package manager to Pacman by switching to its
then install glibc and other important libs and tools
maybe there is another way to download them but that is how i do it. now for glibc based binaries to run smoothly put
in your Terrmux login script. if you don't want to always now get the
now that the binary is is in your home. make it executable: now you need to patch it against the right dynamic linker/loader before you run it. you either patch your binaries the manual way:
or you can use this script autopatchelf.zip that i found here check it up if you are a paranoia. i have no programming or scripting skills so if one of you could improve it for me i would appreciate that. it feels slow than it should have been but it does what it was supposed to do perfectly really. what i like about it is that: it checks the binary's dependencies before patching it, and tells you what shared object wasn't found. it also patches all the binaries in the sub dirs recursively. EDIT: i forgot this line:
put this in your put the script in your
recursicely:
non-recursively:
after you patch it run the rustup installer tool. choose your option from the prompt. when finshed stable toolchain is ready. now simply patch the bianries by using the script. first patch
now go to the toolchain directory.
copy lib/ to glibc dir for shared libs to be ready for the binaries.
and now patch the binaries in
and
now copy this dirs over their respective dirs in glibc dir
that is done. now install the
if anything seems confusing or i wrote it wrong i will try to make it clear, though my English is not good. |
Create |
thanks for pointing this out @sylirre. i will do this from now on. i have seen your Reddit comment. |
how did you fix this error
im compiling a simple hello world by doing cargo new -- warning: |
@dhuux |
you need to run it from tmux directory, no storage, and obviously use chmod for it , or simply run "bash autopatch" |
what is going on? |
I modified autopatch elf so it does not rpath the same path multiple times, aka it deletes duplicates
|
@dhuux, I just have two questions about your guide about installing rust on glibc in Termux:
|
i don't know how to explain this well but binaries (processes) did't work well with one another under the special shell when the binaries are in other dirs than i think it was gradle that couldn't spawn jvm without unsetting
i found
but that is not all. it won't only patch the binaries in the bin folder but also the ones in the lib folder and all the sub folders if there are any. it also checks the architecture of the binary file, looks for its depencies in the paths you set and tells you which shared object is missing from that path. i mean it's just a small script but i find it handy. i mean get the binary file from somewhere, run autopatchelf on it, and thanks for your work my friend. |
never encountered this problem. i'm really not skilled at these things. but are you sure you did:
as well? i tried your example and other random tools, i haven't seen any problems yet. |
i have just decided to learn rust as my first language by making little tui scripts and then converting them into little gui apps so i don't get bored easily. now i set egui/eframe up, then built the project's example. the web part is working wonderfully, but the native executable needs glibc based mesa compiled for i can't use a glibc based program with the Termux's bionic mesa drivers, can i? i tested it with the Archlinux's ARM one. but as you can see, i can only run the binary under proot by using Termux-chroot script for setting up the proot environment. without Termux-chroot, the executable would throw |
my device is old. a 6 year old device and it's not that bad when building/compiling. imagine people with the modern high end devices! |
The latest high-end Android chips are basically laptop chips, as the Snapdragon 8 Gen chips benchmark faster than all core i5 laptop chips and the low-end core i7 laptop chips that have the same number of cores, while using much less electrical power. Apple's M-series AArch64 chips, which come in all the high-end iPads now, benchmark faster than all x86_64 laptop chips and many x86_64 desktop chips too, while using a fraction of the electrical power. This is why many server vendors are switching over to AArch64 too, like Amazon and their in-house designed Graviton AArch64 chip that you can rent on AWS. X86_64 vendors like Intel and AMD are dead men walking, only a matter of time, ie porting most worthwhile software over from x86_64 to AArch64. |
and they are only getting better.
could be a good deal for someone like me. it would be much cheaper than Samsung's and Apple's flagships but i can't find cheap and good at the same time things here unfortunately. maybe in 10 years there will be a new method other than the current EUV lithography that mass produces extremely cheap and powerful chips then we can have Android/Fuchsia/Harmony/Linux phones which are capable of building LLVM+CLANG from source in 15 minutes and i will finally buy these powerful phones under $300 here in Somalia. it seem giants are embracing Arm Architecture for good. too bad we can't run |
This comment was marked as off-topic.
This comment was marked as off-topic.
What's the error?
Not the official NDK, only our patched ndk-sysroot in Termux. |
when i changed it to the path of the Termux NDK the build had completed successfully. |
It looks like the issue is compiling C++ code, the If so, you can try it again now in Termux and open a separate issue with any problems you see, which someone may help you with. |
when i switched to the Termux ndk it compiled successfully. so the problem has something to do with the llvm toolchain i replaced in the official NDK. maybe when i replaced the toolchain i was supposed to tell the NDK that i replaced the toolchain shipped in the NDK with a new one. but i don't know how. |
i will do that. thanks. |
This can be fixed quite easily by adjusting the export PATH="~/.cargo/bin:~/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin:$PATH"
The
I also tested |
firstly i wanted to say i'm really grateful for what you developers and nice project maintianers do for us (newbies). you made the android phones useful and fun for a lot of people.
rustup installer tool i was talking about gradle and glibc based openjdk.
web app is fine. but the native app wouldn't run without glibc based mesa. if you did run it under termux without compiled glibc based mesa for Termux. how? if you built the mesa library and have it on your phone please release it. |
@dhuux When I run ./rustup-init I get the error: error while loading shared libraries: libdl.so: cannot open shared object file: No such file or directory |
@ly132806 do |
Problem description
Rust got uninstalled after upgrading and can't install it back
What steps will reproduce the bug?
Just run:
$ apt update; apt upgrade; apt install rust
What is the expected behavior?
Rust to be installable
System information
termux-info:
The text was updated successfully, but these errors were encountered: