-
-
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
bump(main/fish): 4.0.0 #22609
bump(main/fish): 4.0.0 #22609
Conversation
This probably needs some work for Android. For example, the first error was fixed in libc 0.2.165 version https://github.com/rust-lang/libc/releases/tag/0.2.165 |
We're probably not going to wanna package the beta release anyway, this is just intended for testing. |
Assigning myself as I use the fish shell, so will try to test this out |
Push access for maintainers is enabled on this PR. |
Rust's libc has no support for The integer conversion errors also seem to be Rust libc bugs:
|
and stat64.st_mode This bug was noticed in termux/termux-packages#22609
Looks like fish 4.0.0 is officially released. |
Looks like the 32 Bit builds are failing now. |
It doesn't find the rust compiler anymore and I have no idea why. I added some patch cleanup between builds so you can do repeat builds. Applying patch: Cargo.toml.patch
Downloading https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-x86_64.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 52.4M 100 52.4M 0 0 5693k 0 0:00:09 0:00:09 --:--:-- 5451k
Downloading https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 120k 100 120k 0 0 166k 0 --:--:-- --:--:-- --:--:-- 166k
Archive: /home/builder/.termux-build/fish/tmp/ninja-1.12.1.zip
inflating: /home/builder/.termux-build/_cache/ninja-1.12.1/ninja
-- Android: Targeting API '24' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64'
-- The C compiler identification is Clang 18.0.3
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/builder/.termux-build/_cache/android-r27c-api-24-v1/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Trying to use PCRE2 from the system
CMake Warning at cmake/FindRust.cmake:31 (message):
`rustc` not found in PATH or `/home/builder/.cargo/bin`.
Hint: Check if `rustc` is in PATH or manually specify the location by
setting `Rust_COMPILER` to the path to `rustc`.
Call Stack (most recent call first):
cmake/FindRust.cmake:246 (_findrust_failed)
cmake/Rust.cmake:5 (include)
CMakeLists.txt:28 (include)
CMake Error at cmake/FindRust.cmake:29 (message):
`rustc` not found in PATH or `/home/builder/.cargo/bin`.
Hint: Check if `rustc` is in PATH or manually specify the location by
setting `Rust_COMPILER` to the path to `rustc`.
Call Stack (most recent call first):
cmake/FindRust.cmake:246 (_findrust_failed)
cmake/Rust.cmake:6 (find_package)
CMakeLists.txt:28 (include)
-- Configuring incomplete, errors occurred! |
This makes the error go away if you cherry pick it and place it into the folder with the other patches. |
that's odd, that didn't happen for me locally. i'll try again |
Why is it building |
that could have happened because of |
I didn't force push that backport up. |
Anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to add ino_t
and off_t
to this patch as well I think?
I don't have a good understanding of Rust unfortunately so I can only guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thunder-coding if you have the time it would be much appreciated if you could have another look at this.
Seeing as it's your patch and the upstream PR is also authored by you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happened because the patch failed to apply during the termux_step_pre_configure()
because something inside the version of the rust libc binding crate that enters the $CARGO_HOME/registry/src/*/libc
folder changed a little bit, but only for one of the files that seemed to only be compiled during the 32-bit builds.
The patch just needed to be rebased, I did that like this and it built successfully for all architectures.
diff --git a/packages/fish/libc-src-unix-linux_like-android.diff b/packages/fish/libc-src-unix-linux_like-android.diff
index ac873e2831..4c99bb7b92 100644
--- a/packages/fish/libc-src-unix-linux_like-android.diff
+++ b/packages/fish/libc-src-unix-linux_like-android.diff
@@ -139,13 +139,13 @@ Subject: [PATCH 2/2] fix more incompatible integer types
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/unix/linux_like/android/b32/mod.rs b/src/unix/linux_like/android/b32/mod.rs
-index d132cbaa2590..f7534c241cb5 100644
+index 34010bb..53e2f76 100644
--- a/src/unix/linux_like/android/b32/mod.rs
+++ b/src/unix/linux_like/android/b32/mod.rs
-@@ -5,7 +5,9 @@ use crate::prelude::*;
+@@ -3,7 +3,9 @@ use crate::prelude::*;
+ // The following definitions are correct for arm and i686,
+ // but may be wrong for mips
- pub type c_long = i32;
- pub type c_ulong = u32;
-pub type mode_t = u16;
+pub type mode_t = c_ushort;
+pub type ino_t = u64;
It seems like the upstream PR has been put on hold, and unfortunately I don't know a lot of Rust either only the basics, so I probably can't make a PR for this they would approve either, but I think it can safely be assumed that at some point in the future a very skilled Rust developer will wonder why their own app can't build for Android and fix it, then that fix will hopefully propagate to a future Rust libc binding crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the patch didn't apply why didn't the build stop there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Frankedstein-ed @thunder-coding's patch into applying on top of rust-lang/[email protected]
.
It builds on 32 bit now, but I'm gonna need someone to please verify that on-device before I'm ready to declare it a victory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomJo2000 Yes this package works on device including on my 32-bit device, and I can confirm it appears to be behaving normally and seems to fully work when the appropriate build of the Termux APK is used,
and additionally, the "5u
" printing problem + buggy input does go away, only when I use a build I compiled of the Termux APK containing the PR to fix that:
May as well mark this ready for review since it seems to build for all arches now. |
How do we actually wanna clean this up? |
In my opinion, because it is all in one package and all of the changes are required to build, and it doesn't build at individual commits in the series, it would be a good idea to squash into 1 commit, and add the description of everything into a long commit message in the commit, but we might want to hear from others since recently I was told to split a large commit into 3 separate commits in a different PR and have done so. |
I think we happen to have 1 commit that happens to have to do 3 things.
But neither of them is really independent from the other two. |
9db8948
to
7dd34cc
Compare
To recap the dicussion from the discord. Reconverting to draft until we have this worked out. |
Ok, I am sorry for the delay. I was debugging Fish. fish -c "uname -a"
fish -c "/system/bin/ls"
fish -c "ls" Here is the patch: --- a/build.rs
+++ b/build.rs
@@ -96,7 +96,9 @@ fn detect_cfgs(target: &mut Target) {
Ok(target.has_symbol("localeconv_l"))
}),
("FISH_USE_POSIX_SPAWN", &|target| {
- Ok(target.has_header("spawn.h"))
+ // the command 'fish -c "uname"', and most other uses of fish's -c argument,
+ // are not working if this is enabled.
+ Ok(false)
}),
("HAVE_PIPE2", &|target| {
Ok(target.has_symbol("pipe2")) Here is some information I have been able to obtain by debugging the behavior of this Fish package. There is a function This is where the problem is happening, or at least a point where it's not difficult to divert the codepath away from the place where the problem is happening. There are two possible codepaths in this function. One of them is the Because my patch uses the preprocessor-like cargo macro I do not know exactly whether the true root cause of the problem is a misbehavior on the Fish side of the posix-spawn-related code, or the |
I believe that since there was an unexpected problem, it might be a good idea for others to test this workaround before this is merged to make sure that it is able to completely solve the problem, and also look for any other problems or possibly better solutions. |
Works on my device. |
- build ctermid - add custom libc crate patch for 32bit android builds - backport FindRust.cmake rustup fix This backports: fish-shell/fish-shell@b38551d Co-authored-by: Jia Yuan Lo <[email protected]> Co-authored-by: Yaksh Bariya <[email protected]> Co-authored-by: Robert Kirkman <[email protected]> Co-authored-by: AminurAlam <[email protected]>
This PR is intended for build testing.DO NOT MERGE.
Fish 4.0 transitions the project to Rust.
Meaning we gotta write new patches.
CC: @AminurAlam