From 7701e730b8e871f637f1b9ec753327a36294d0e5 Mon Sep 17 00:00:00 2001 From: Robert Kirkman Date: Thu, 31 Oct 2024 17:09:35 -0500 Subject: [PATCH] fix(main/fish): rename tarball version file to avoid conflict with NDK internal version file Progress on #21130 This seems to be a completely independent issue from other issues because it is reproducible in a clean repo using this command: ``` scripts/run-docker.sh ./build-package.sh -I fish ``` I also tried temporarily unapplying the line `grep -lrw $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/c++/v1 -e '' | xargs -n 1 sed -i 's//\"version\"/g'` from the end of `termux_setup_toolchain_27b.sh` and deleting the `~/.termux-build/_cache` in case it made any difference, but at least in my test, it does not seem to make a difference on the fish package (whether or not `#include "version"` or `include ` is forced in the toolchain) so, it seems like the `fish` package itself has to be patched. --- packages/fish/build.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/fish/build.sh b/packages/fish/build.sh index b1ae61594d02f2..2789c1dbfb66db 100644 --- a/packages/fish/build.sh +++ b/packages/fish/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="The user-friendly command line shell" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="3.7.1" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/fish-shell/fish-shell/releases/download/$TERMUX_PKG_VERSION/fish-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=614c9f5643cd0799df391395fa6bbc3649427bb839722ce3b114d3bbc1a3b250 TERMUX_PKG_AUTO_UPDATE=true @@ -16,6 +16,23 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" " termux_step_pre_configure() { + # fish releases tarballs that conflict with the way the toolchain + # currently is by putting a file in the tarball + # named "version" (not visible directly in the source code on github, + # generated by this code in fish's release workflow: + # https://github.com/fish-shell/fish-shell/blob/master/build_tools/make_tarball.sh#L69 ) + # and, crucially, also placing the folder containing that file named "version" + # in the include path of building fish (since right next to this in the same folder, + # fish does have a file named "config.h" that it uses) + # here is the upstream, conflicting instance of file in internal llvm + # include path named "version" that is probably what propogates into the NDK's + # equivalent file, + # /home/builder/.termux-build/_cache/android-r27b-api-24-v1/sysroot/usr/include/c++/v1/version + # https://github.com/llvm/llvm-project/blob/main/libcxx/include/version + mv version fish_version + find build_tools -type f -exec sed -i {} \ + -e 's/cat version/cat fish_version/g' \ + -e 's/test -f version/test -f fish_version/g' \; CXXFLAGS+=" $CPPFLAGS" }