chore: remove source comments and unused code, translate every missing string (#1965)

* chore(i18n): translate every missing string in all locales

Adds the 87 strings the bottom-screen Dashboard and in-game stats pages
introduced to all 32 locales, plus the 51 older settings strings Japanese
and the 50 Chinese locales were still missing. Every locale now has all
3456 translatable strings with the same placeholders as English.

Also translates 36 entries that were still English where the language
does not use the English word, and makes es-419 touch_app_id use the same
%1$s placeholder as English.

* chore(patches): drop comments from the lines downstream patches add

Removes comment lines and trailing comments from lines our patches add,
with hunk headers recounted. Lines that a later patch uses as context
and the upstream backport 0123 are left as they are.

The gamescope, FEX, proot and xodus series still apply to their pinned
sources, and the patched trees differ only in those comments.
test_hud_frames now finds the HUD writer by its first declaration.

* docs: credit Greenlight, Better xCloud, viture-v2, GameNative and DiRTTelemetryErrorFix

These were credited only in source headers and NOTICE files.

* chore: remove source comments and unused functions

Removes explanatory comments from first-party Kotlin, Java, C, C++,
Rust, TypeScript, Python, shell, Gradle, CMake and workflow files.
License and attribution headers stay, and vendored third-party trees,
generated files and license files are untouched. A shellcheck directive
is kept, and udevmon's fallthrough comments became fallthrough attributes.

Syntax trees and token streams match the previous sources apart from the
comments and Python docstrings. Module docstrings that argparse prints
are kept, and device-smoke.sh prints the same --help text from a heredoc.

Also removes 37 functions and 4 fields that nothing referenced.

* chore: remove comments from the Syncthing integration and the latest main sources

* docs: credit Syncthing and the syncthing-android fork

* chore(i18n): translate the Syncthing strings in all locales

The 107 strings the Syncthing integration added are now in all 32 locales.
sync_web_path_locked names the Syncthing tab by its label.

* docs: credit @xXJSONDeruloXx for the HUD metric readers

The CPU, GPU load, thermal and battery readers come from their
PerformanceHudView pull requests #777, #877, #991, #1406 and #1573.
The FusionHUD credit line is unchanged.

* docs: credit the HUD metric readers to @xXJSONDeruloXx's work
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-01 16:27:27 -05:00
1 parent d730f0fa8b
commit c5577478ca
511 files changed
+6813 -4068

No files matched your search

-9
View File
@@ -1,6 +1,4 @@
#!/usr/bin/bash
# Runs inside an Arch Linux ARM container (menci/archlinuxarm:base-devel) on an arm64 runner. Arch Linux ARM ships
# no FEX package and FEX publishes no Linux binaries.
set -euxo pipefail
VERSION=${FEX_VERSION:-FEX-2610}
WORK=/work
@@ -10,7 +8,6 @@ grep -q '^DisableSandbox' /etc/pacman.conf || sed -i 's/^\[options\]/[options]\n
mv /etc/pacman.d/mirrorlist.new /etc/pacman.d/mirrorlist
pacman -Syu --noconfirm --needed git zstd binutils cmake ninja clang lld llvm python squashfs-tools file patchelf xxhash
# The x86 sysroot is Arch x86_64 and multilib i686 packages unpacked by pacman, never run: no scriptlets or signature checks.
THUNKS=${FEX_THUNKS:-0}
X86ROOT=$WORK/x86root
if [ "$THUNKS" = 1 ]; then
@@ -40,15 +37,12 @@ fi
rm -rf fex-src out && git clone -q --depth 1 --branch "$VERSION" --recurse-submodules --shallow-submodules https://github.com/FEX-Emu/FEX.git fex-src
for p in tools/fex/patches/*.patch; do patch -d fex-src -p1 --no-backup-if-mismatch < "$p"; done
# FEX's x86 toolchain files assume an x86 build machine; here the guest thunks need the x86 sysroot too.
# Arch's clang adds stack protection; its canary load in a guest thunk's prologue clobbered r11 (the host function).
if [ "$THUNKS" = 1 ]; then
for t in fex-src/Data/CMake/toolchain_x86_64.cmake fex-src/Data/CMake/toolchain_x86_32.cmake; do
printf '\nif (X86_DEV_ROOTFS AND NOT X86_DEV_ROOTFS STREQUAL "/")\n set(CMAKE_SYSROOT "${X86_DEV_ROOTFS}")\nendif()\n' >> "$t"
printf '\nset(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-stack-protector")\nset(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-stack-protector")\n' >> "$t"
done
fi
# TUNE_CPU none: the default (native) would tune for the runner's Neoverse cores, not the device.
cmake -S fex-src -B fex-build -G Ninja \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DUSE_LINKER=lld \
@@ -60,8 +54,6 @@ cmake -S fex-src -B fex-build -G Ninja \
ninja -C fex-build
DESTDIR="$WORK/out" ninja -C fex-build install
install -Dm755 /usr/bin/unsquashfs out/usr/local/bin/unsquashfs
# The Linux runtime has no xxhash and no ld.so.cache: the library goes beside libFEXCore and the programs
# that need it find it through RUNPATH.
install -Dm644 "$(readlink -f /usr/lib/libxxhash.so.0)" out/usr/local/lib/libxxhash.so.0
bundled=$(cd out/usr/local/lib && ls -- *.so* | sort -u)
for f in out/usr/local/bin/*; do
@@ -70,7 +62,6 @@ for f in out/usr/local/bin/*; do
readelf -d "$f" | awk '/NEEDED/ { gsub(/[\[\]]/, "", $5); print $5 }' | grep -qxF "$bundled" \
&& patchelf --set-rpath '$ORIGIN/../lib' "$f"
done
# Every NEEDED soname must resolve in a stock guest: bundled here or provided by the runtime (runtime-libs.txt).
for f in out/usr/local/bin/* out/usr/local/lib/*.so* out/usr/local/lib/fex-emu/HostThunks*/*.so; do
[ -f "$f" ] && file "$f" | grep -q ELF || continue
readelf -d "$f" | awk '/NEEDED/ { gsub(/[\[\]]/, "", $5); print $5 }'
@@ -10,7 +10,7 @@ index 7172460..2c80dca 100644
#include <linux/openat2.h>
#include <fcntl.h>
#include <filesystem>
@@ -632,6 +633,163 @@ static bool ShouldSkipOpenInEmu(int flags) {
@@ -632,6 +633,157 @@ static bool ShouldSkipOpenInEmu(int flags) {
return false;
}
@@ -26,19 +26,15 @@ index 7172460..2c80dca 100644
+ return Result;
+}
+
+// openat2() with RESOLVE_IN_ROOT, walked one component at a time: PRoot has no openat2 and fails it with ENOSYS.
+// DirFD is AT_FDCWD only for thunk overlays, which never resolve in the root.
+static int OpenatWithoutOpenat2(int DirFD, const char* Pathname, int Flags, uint32_t Mode) {
+ if (DirFD == AT_FDCWD) {
+ return ::syscall(SYSCALL_DEF(openat), DirFD, Pathname, Flags, Mode);
+ }
+
+ // The kernel's MAXSYMLINKS.
+ constexpr uint32_t MaxSymlinks = 40;
+ uint32_t Symlinks {};
+ std::optional<dev_t> RootDev {};
+
+ // O_NOFOLLOW and O_CREAT | O_EXCL leave a final symlink alone, unless a trailing slash follows it.
+ const bool NoFollow = (Flags & O_NOFOLLOW) || (Flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL);
+
+ char Resolved[PATH_MAX];
@@ -116,7 +112,6 @@ index 7172460..2c80dca 100644
+ }
+
+ if (Buffer.st_dev != *RootDev && IsOnProcFS(DirFD, Resolved)) {
+ // Only procfs has magic links. RESOLVE_IN_ROOT fails them with EXDEV and the callers then open without it.
+ return ::syscall(SYSCALL_DEF(openat), DirFD, Pathname, Flags, Mode);
+ }
+
@@ -145,7 +140,6 @@ index 7172460..2c80dca 100644
+ }
+
+ if (Last) {
+ // openat reports on the final component, which O_CREAT may create.
+ ResolvedLen = CandidateLen;
+ if (TrailingSlash) {
+ Resolved[ResolvedLen++] = '/';
@@ -174,7 +168,7 @@ index 7172460..2c80dca 100644
bool FileManager::ReplaceEmuFd(int fd, int flags, uint32_t mode) {
char Tmp[PATH_MAX + 1];
@@ -678,6 +836,8 @@ uint64_t FileManager::Open(const char* pathname, int flags, uint32_t mode) {
@@ -678,6 +830,8 @@ uint64_t FileManager::Open(const char* pathname, int flags, uint32_t mode) {
// This means a magic symlink (/proc/foo) was involved. In this case we
// just punt and do the access without RESOLVE_IN_ROOT.
fd = ::syscall(SYSCALL_DEF(openat), Path.FD, Path.Path, flags, mode);
@@ -183,7 +177,7 @@ index 7172460..2c80dca 100644
}
}
@@ -931,6 +1091,8 @@ uint64_t FileManager::Openat([[maybe_unused]] int dirfs, const char* pathname, i
@@ -931,6 +1085,8 @@ uint64_t FileManager::Openat([[maybe_unused]] int dirfs, const char* pathname, i
// This means a magic symlink (/proc/foo) was involved. In this case we
// just punt and do the access without RESOLVE_IN_ROOT.
fd = ::syscall(SYSCALL_DEF(openat), Path.FD, Path.Path, flags, mode);
@@ -192,7 +186,7 @@ index 7172460..2c80dca 100644
}
}
@@ -967,6 +1129,8 @@ uint64_t FileManager::Openat2(int dirfs, const char* pathname, FEX::HLE::open_ho
@@ -967,6 +1123,8 @@ uint64_t FileManager::Openat2(int dirfs, const char* pathname, FEX::HLE::open_ho
// This means a magic symlink (/proc/foo) was involved. In this case we
// just punt and do the access without RESOLVE_IN_ROOT.
fd = ::syscall(SYSCALL_DEF(openat2), Path.FD, Path.Path, how, usize);
@@ -26,11 +26,10 @@ index 60b0ef1..4a94009 100644
using FindHandler = uint64_t (MemAllocator32Bit::*)(uint64_t Start, size_t Pages) const;
FindHandler FindPageRangePtr {};
};
@@ -132,6 +135,37 @@ uint64_t MemAllocator32Bit::FindPageRange_TopDown(uint64_t Start, size_t Pages)
@@ -132,6 +135,36 @@ uint64_t MemAllocator32Bit::FindPageRange_TopDown(uint64_t Start, size_t Pages)
return 0;
}
+// Marks each run of host mappings that overlaps the range as used, in full. Returns false if none overlaps.
+bool MemAllocator32Bit::SetHostMappedPages(uint64_t PageAddr, size_t PagesLength) {
+ const int MapsFD = ::open("/proc/self/maps", O_RDONLY | O_CLOEXEC);
+ if (MapsFD == -1) {
@@ -64,7 +63,7 @@ index 60b0ef1..4a94009 100644
void* MemAllocator32Bit::Mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset) {
std::scoped_lock<std::mutex> lk {AllocMutex};
size_t PagesLength = FEXCore::AlignUp(length, FEXCore::Utils::FEX_PAGE_SIZE) >> FEXCore::Utils::FEX_PAGE_SHIFT;
@@ -175,11 +209,17 @@ void* MemAllocator32Bit::Mmap(void* addr, size_t length, int prot, int flags, in
@@ -175,11 +208,16 @@ void* MemAllocator32Bit::Mmap(void* addr, size_t length, int prot, int flags, in
auto AllocateNoHint = [&]() -> void* {
bool Wrapped = false;
@@ -74,7 +73,6 @@ index 60b0ef1..4a94009 100644
// Linear range scan
uint64_t LowerPage = (this->*FindPageRangePtr)(BottomPage, PagesLength);
if (LowerPage == 0) {
+ // A second scan from the start found nothing either: the range is full, as the kernel would say.
+ if (Restarted) {
+ return reinterpret_cast<void*>(-ENOMEM);
+ }
@@ -82,15 +80,12 @@ index 60b0ef1..4a94009 100644
// Try again but this time from the start
BottomPage = Map32Bit ? LastKeyLocation32Bit : LastKeyLocation;
LowerPage = (this->*FindPageRangePtr)(BottomPage, PagesLength);
@@ -206,7 +246,17 @@ restart: {
@@ -206,7 +244,14 @@ restart: {
return (void*)(uintptr_t)-errno;
} else {
// Try again
- if (SearchDown) {
+ if (Map32Bit) {
+ // MAP_32BIT from a 64-bit guest, whose other mappings bypass this allocator: once Counter-Strike 2 had reserved the
+ // low 2GB, stepping one page at a time scanned for ever. Record what the host holds there and rescan the range, or
+ // move past it if that mapping is gone.
+ const bool Marked = SetHostMappedPages(LowerPage, PagesLength);
+ if (SearchDown) {
+ BottomPage = Marked ? UpperPage - 1 : LowerPage - 1;