Skip to content

Commit 6aa0fe6

Browse files
committed
bash sanitize
1 parent cf523e8 commit 6aa0fe6

2 files changed

Lines changed: 2 additions & 25 deletions

File tree

r/inst/build_arrow_static.sh

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -114,30 +114,10 @@ ${CMAKE_WRAPPER} ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \
114114
-G "${CMAKE_GENERATOR:-Unix Makefiles}" \
115115
${SOURCE_DIR}
116116

117-
sanitize_makeflags() {
118-
printf '%s\n' "$1" |
119-
sed -E \
120-
-e 's/(^|[[:space:]])-j[[:space:]]+[0-9]*([[:space:]]|$)/ /g' \
121-
-e 's/(^|[[:space:]])-j[^[:space:]]*([[:space:]]|$)/ /g' \
122-
-e 's/(^|[[:space:]])([[:alpha:]]*)j[[:alnum:]]*([[:alpha:]]*)($|[[:space:]])/ \2\3 /g' \
123-
-e 's/[[:space:]]+/ /g' \
124-
-e 's/^ //; s/ $//'
125-
}
126-
127-
env | sort
128-
SANITIZED_MAKEFLAGS="$(sanitize_makeflags "${MAKEFLAGS:-}")"
129-
SANITIZED_MFLAGS="$(sanitize_makeflags "${MFLAGS:-}")"
130-
SANITIZED_GNUMAKEFLAGS="$(sanitize_makeflags "${GNUMAKEFLAGS:-}")"
117+
SANITIZED_MAKEFLAGS="${MAKEFLAGS/-jNA/}"
131118
printf 'MAKEFLAGS before sanitize: %s\n' "${MAKEFLAGS:-}"
132-
printf 'MFLAGS before sanitize: %s\n' "${MFLAGS:-}"
133-
printf 'GNUMAKEFLAGS before sanitize: %s\n' "${GNUMAKEFLAGS:-}"
134119
printf 'MAKEFLAGS after sanitize: %s\n' "${SANITIZED_MAKEFLAGS}"
135-
printf 'MFLAGS after sanitize: %s\n' "${SANITIZED_MFLAGS}"
136-
printf 'GNUMAKEFLAGS after sanitize: %s\n' "${SANITIZED_GNUMAKEFLAGS}"
137-
MAKEFLAGS="${SANITIZED_MAKEFLAGS}" \
138-
MFLAGS="${SANITIZED_MFLAGS}" \
139-
GNUMAKEFLAGS="${SANITIZED_GNUMAKEFLAGS}" \
140-
${CMAKE} --build . --target install -- -j"${N_JOBS}"
120+
MAKEFLAGS="${SANITIZED_MAKEFLAGS}" ${CMAKE} --build . --target install -- -j"${N_JOBS}"
141121

142122
if command -v sccache &> /dev/null; then
143123
echo "=== sccache stats after the build ==="

r/tools/nixlibs.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,6 @@ build_libarrow <- function(src_dir, dst_dir) {
527527
# CRAN policy says not to use more than 2 cores during checks
528528
# If you have more and want to use more, set MAKEFLAGS or NOT_CRAN
529529
ncores <- parallel::detectCores()
530-
if (is.na(ncores)) {
531-
ncores <- 2
532-
}
533530
if (!not_cran) {
534531
ncores <- min(ncores, 2)
535532
}

0 commit comments

Comments
 (0)