forked from duckdb/duckdb-r
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·29 lines (25 loc) · 1.08 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -ex
cd $(dirname $0)/src
# The purpose of this is to avoid rebuilding duckdb in every CI/CD run.
# We set the DUCKDB_R_PREBUILT_ARCHIVE environment variable to a file path
# that contains a .tar of all object files.
# This .tar file is cached and restored in CI/CD, keyed by compiler, OS,
# and hash of the duckdb/src subtree.
#
# Depending on the availability of the file, we either use the object files
# (via the rules in include/from-tar.mk), or create them as usual
# (via include/to-tar.mk). In the latter case, if the DUCKDB_R_PREBUILT_ARCHIVE
# environment variable is set, the .tar file is created.
#
# For local installations, this is typically not needed
# because ccache achieves the same purpose but better.
# In CI/CD, this approach gives better results than ccache.
#
# This logic is identical for Windows or non-Windows builds,
# only that we need to-tar-win.mk instead of to-tar.mk on Windows.
if [ -f "${DUCKDB_R_PREBUILT_ARCHIVE}" ] && tar -xm -f ${DUCKDB_R_PREBUILT_ARCHIVE}; then
cp include/from-tar.mk Makevars.duckdb
else
cp include/to-tar.mk Makevars.duckdb
fi