mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
Travis: Cache third-party build directory.
Instead of just caching the third-party build output, cache the full build directory. Always run make to ensure that updated dependencies are downloaded.
This commit is contained in:
parent
b480eb069b
commit
10cdf8c286
@ -15,10 +15,8 @@ rm -f "${HOME}/.cache/pip/selfcheck.json"
|
|||||||
|
|
||||||
# Update the third-party dependency cache only if the build was successful.
|
# Update the third-party dependency cache only if the build was successful.
|
||||||
if [[ -f "${SUCCESS_MARKER}" ]]; then
|
if [[ -f "${SUCCESS_MARKER}" ]]; then
|
||||||
if [[ ! -f "${CACHE_MARKER}" ]] || [[ "${BUILD_NVIM_DEPS}" == true ]]; then
|
rm -rf "${HOME}/.cache/nvim-deps"
|
||||||
echo "Updating third-party dependency cache."
|
mv -T "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
|
||||||
rm -rf "${HOME}/.cache/nvim-deps"
|
touch "${CACHE_MARKER}"
|
||||||
mv -T "${DEPS_INSTALL_PREFIX}" "${HOME}/.cache/nvim-deps"
|
echo "Updated third-party dependencies (timestamp: $(stat -c '%y' "${CACHE_MARKER}"))."
|
||||||
touch "${CACHE_MARKER}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
@ -11,19 +11,21 @@ build_deps() {
|
|||||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf "${DEPS_INSTALL_PREFIX}"
|
rm -rf "${DEPS_BUILD_DIR}"
|
||||||
|
|
||||||
# If there is a valid cache and we're not forced to recompile,
|
# If there is a valid cache and we're not forced to recompile,
|
||||||
# use cached third-party dependencies.
|
# use cached third-party dependencies.
|
||||||
if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then
|
if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then
|
||||||
echo "Using third-party dependencies from Travis's cache (last updated: $(stat -c '%y' "${CACHE_MARKER}"))."
|
echo "Using third-party dependencies from Travis's cache (last updated: $(stat -c '%y' "${CACHE_MARKER}"))."
|
||||||
|
|
||||||
mkdir -p "$(dirname "${DEPS_INSTALL_PREFIX}")"
|
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
|
||||||
ln -Ts "${HOME}/.cache/nvim-deps" "${DEPS_INSTALL_PREFIX}"
|
mv -T "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
|
||||||
return
|
else
|
||||||
|
mkdir -p "${DEPS_BUILD_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "${DEPS_BUILD_DIR}"
|
# Even if we're using cached dependencies, run CMake and make to
|
||||||
|
# update CMake configuration and update to newer deps versions.
|
||||||
cd "${DEPS_BUILD_DIR}"
|
cd "${DEPS_BUILD_DIR}"
|
||||||
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
|
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
|
||||||
cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
|
cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
|
||||||
@ -79,7 +81,7 @@ build_nvim() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
asan_check "${LOG_DIR}"
|
asan_check "${LOG_DIR}"
|
||||||
|
|
||||||
|
|
||||||
cd "${TRAVIS_BUILD_DIR}"
|
cd "${TRAVIS_BUILD_DIR}"
|
||||||
}
|
}
|
||||||
|
14
.travis.yml
14
.travis.yml
@ -3,9 +3,7 @@ language: c
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# To build third-party dependencies, set this to 'true'.
|
# To force rebuilding of third-party dependencies, set this to 'true'.
|
||||||
# TODO: Change deps caching to detect updated dependencies automatically, but
|
|
||||||
# still don't rebuild deps every time.
|
|
||||||
- BUILD_NVIM_DEPS=false
|
- BUILD_NVIM_DEPS=false
|
||||||
# Travis has 1.5 virtual cores according to
|
# Travis has 1.5 virtual cores according to
|
||||||
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||||
@ -19,9 +17,9 @@ env:
|
|||||||
# Build directory for Neovim.
|
# Build directory for Neovim.
|
||||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||||
# Build directory for third-party dependencies.
|
# Build directory for third-party dependencies.
|
||||||
- DEPS_BUILD_DIR="$TRAVIS_BUILD_DIR/deps-build"
|
- DEPS_BUILD_DIR="$HOME/nvim-deps"
|
||||||
# Directory where compiled third-party dependencies are stored.
|
# Directory where third-party dependency sources are downloaded to.
|
||||||
- DEPS_INSTALL_PREFIX="$HOME/nvim-deps-install"
|
- DEPS_DOWNLOAD_DIR="$TRAVIS_BUILD_DIR/deps-downloads"
|
||||||
# Install directory for Neovim.
|
# Install directory for Neovim.
|
||||||
- INSTALL_PREFIX="$HOME/nvim-install"
|
- INSTALL_PREFIX="$HOME/nvim-install"
|
||||||
# Log directory for Clang sanitizers and Valgrind.
|
# Log directory for Clang sanitizers and Valgrind.
|
||||||
@ -32,8 +30,8 @@ env:
|
|||||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
||||||
-DUSE_GCOV=ON
|
-DUSE_GCOV=ON
|
||||||
-DBUSTED_OUTPUT_TYPE=plainTerminal
|
-DBUSTED_OUTPUT_TYPE=plainTerminal
|
||||||
-DDEPS_PREFIX=$DEPS_INSTALL_PREFIX"
|
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr"
|
||||||
- DEPS_CMAKE_FLAGS="-DDEPS_INSTALL_DIR:PATH=$DEPS_INSTALL_PREFIX"
|
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
|
||||||
# Additional CMake flags for 32-bit builds.
|
# Additional CMake flags for 32-bit builds.
|
||||||
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
||||||
-DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
|
-DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
|
||||||
|
Loading…
Reference in New Issue
Block a user