fix(main/fish): do not patch rust-lang/libc
cargo crate
#24759
Merged
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.
Fixes [Bug]: fish shell file globbing not working #24741
Cherry-pick fish-shell/fish-shell@bbf678e to replace
libc-src-unix-linux_like-android-mod.rs.diff
(sincelibandroid-spawn
does not currently work withfish
)libc-src-unix-linux_like-android.diff
is causing [Bug]: fish shell file globbing not working #24741 because of the problems explained by maurer in android: use proper types for dirent.d_ino, dirent.d_off, stat.st_mode and stat64.st_mode rust-lang/libc#4216 (comment)I have rewritten
libc-src-unix-linux_like-android.diff
in my own alternative way of solving the errorsfish
, not by patching thelibc
cargo crate.fish
is using the typelibc::ino_t
to represent a value for storing thed_ino
member of adirent
struct, which cannot work on 32-bit Android because 32-bit Android'sd_ino
is not anino_t
. It is auint64_t
.fish
to 32-bit Android must explicitly store the value of adirent
d_ino
as au64
anywhere it appears in Rust code.st_mode
-st_mode
ofstat
on 32-bit Android is not amode_t
. It is anunsigned int
, and on Android,unsigned int
is a 32-bit integer. Therefore, any successful port offish
to 32-bit Android must explicitly store the value of astat
st_mode
asu32
.S_IFMT
is a pure typeless literal preprocessor definition, which is (octal)00170000
in Android, preprocessor definitions do not really exist in Rust so there is unfortunately no correct alternative to a hardcoded integer literal for this on 32-bit AndroidI previously read android: use proper types for dirent.d_ino, dirent.d_off, stat.st_mode and stat64.st_mode rust-lang/libc#4216 in January 2025, however, I unfortunately did not have the experience necessary at the time to fully understand how to solve this specific problem, so at the time, I did not change the version written by thunder-coding because I did not know how to make a better way to bypass the errors
stat.h
anddirent.h
files, and I have been able to use that experience to successfully create what appears to be a correct solution to [Bug]: fish shell file globbing not working #24741The original errors, repeated here for convenient reference by others: