From a880e7226ec85648b8c21b4d331aef3b30973ee5 Mon Sep 17 00:00:00 2001 From: its-pointless Date: Fri, 6 Mar 2020 22:20:17 +1100 Subject: [PATCH] rust-1.41.1 (#5009) * Update rust to 1.41.1 * CI: free additional space in VM, otherwise Rust v1.41.1 build will fail --- .github/workflows/packages.yml | 6 ++++++ packages/rust/build.sh | 32 ++++++++++++++++++++++++-------- packages/rust/config.toml | 2 +- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 5034dd4c8..8fbe2b18f 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -24,6 +24,12 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 1000 + - name: Free additional disk space on host + run: | + sudo apt purge -yq $(dpkg -l | grep '^ii' | awk '{ print $2 }' | grep -P '(cabal-|dotnet-|ghc-|libmono|php)') \ + java-common liblldb-6.0 libllvm6.0:amd64 liblxc-common libx11-6:amd64 mono-runtime-common monodoc-manual \ + powershell ruby + sudo apt autoremove -yq - name: Build run: | BASE_COMMIT=$(jq --raw-output .pull_request.base.sha "$GITHUB_EVENT_PATH") diff --git a/packages/rust/build.sh b/packages/rust/build.sh index a431cc7d0..65aca0d8c 100644 --- a/packages/rust/build.sh +++ b/packages/rust/build.sh @@ -2,11 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://www.rust-lang.org/ TERMUX_PKG_DESCRIPTION="Systems programming language focused on safety, speed and concurrency" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Kevin Cotugno @kcotugno" -TERMUX_PKG_VERSION=1.40.0 +TERMUX_PKG_VERSION=1.41.1 TERMUX_PKG_SRCURL=https://static.rust-lang.org/dist/rustc-$TERMUX_PKG_VERSION-src.tar.xz -TERMUX_PKG_SHA256=6e2aa3a91697f4b225c6b394cbae6b97666f061dba491f666a5281698fe2aace +TERMUX_PKG_SHA256=ebac9861b43c7207af36e24402dfdc5463a4df4bdb015ccb2b165251c0fdcf7c TERMUX_PKG_DEPENDS="libc++, clang, openssl, lld, zlib, libllvm" - termux_step_configure() { termux_setup_cmake termux_setup_rust @@ -18,9 +17,9 @@ termux_step_configure() { # like 30 to 40 + minutes ... so lets get it right # upstream only tests build ver one version behind $TERMUX_PKG_VERSION - rustup install 1.39.0 - rustup default 1.39.0-x86_64-unknown-linux-gnu - export PATH=$HOME/.rustup/toolchains/1.39.0-x86_64-unknown-linux-gnu/bin:$PATH + rustup install 1.40.0 + rustup default 1.40.0-x86_64-unknown-linux-gnu + export PATH=$HOME/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/bin:$PATH local RUSTC=$(which rustc) local CARGO=$(which cargo) @@ -42,11 +41,16 @@ termux_step_configure() { export CC_x86_64_unknown_linux_gnu=gcc export CFLAGS_x86_64_unknown_linux_gnu="-O2" unset CC CXX CPP LD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS PKG_CONFIG AR RANLIB - # rust checks libs in PREFIX/lib because both host and target are x86_64. It then can't libc.so and libdl.so because rust program doesn't know - # where those are. Putting them temporarly in $PREFIX/lib prevents that failure + # we can't use -L$PREFIX/lib since it breaks things but we need to link against libLLVM-9.so + ln -sf $PREFIX/lib/libLLVM-9.0.1.so $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/ + + # rust checks libs in PREFIX/lib because both host and target are x86_64. It then can't find libc.so and libdl.so because rust program doesn't + # know where those are. Putting them temporarly in $PREFIX/lib prevents that failure + if [ $TERMUX_ARCH = "x86_64" ]; then cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/x86_64-linux-android/$TERMUX_PKG_API_LEVEL/libc.so $TERMUX_PREFIX/lib/ cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/x86_64-linux-android/$TERMUX_PKG_API_LEVEL/libdl.so $TERMUX_PREFIX/lib/ + mv $TERMUX_PREFIX/lib/libtinfo.so.6 $TERMUX_PREFIX/lib/libtinfo.so.6.tmp fi } @@ -62,6 +66,10 @@ termux_step_make_install() { cd "$TERMUX_PREFIX/lib" rm -f libc.so libdl.so + if [ $TERMUX_ARCH = "x86_64" ]; then + mv $TERMUX_PREFIX/lib/libtinfo.so.6.tmp $TERMUX_PREFIX/lib/libtinfo.so.6 + fi + ln -sf rustlib/$CARGO_TARGET_NAME/lib/*.so . ln -sf $TERMUX_PREFIX/bin/lld $TERMUX_PREFIX/bin/rust-lld @@ -72,4 +80,12 @@ termux_step_make_install() { rust-installer-version \ manifest-* \ x86_64-unknown-linux-gnu + rm $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libLLVM-9.0.1.so + } +termux_step_post_massage() { + if [ $TERMUX_ARCH = "x86_64" ]; then + rm lib/libtinfo.so.6 + fi +} + diff --git a/packages/rust/config.toml b/packages/rust/config.toml index 717d3d38e..0339f9d8a 100644 --- a/packages/rust/config.toml +++ b/packages/rust/config.toml @@ -29,7 +29,7 @@ channel = "stable" rpath = false [target.x86_64-unknown-linux-gnu] -llvm-config = "/usr/bin/llvm-config-8" +llvm-config = "/usr/bin/llvm-config-9" [target.@triple@] android-ndk = "@TERMUX_STANDALONE_TOOLCHAIN@"