From a56ce03d8dee80df24f077384db233e010224e3c Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Tue, 17 Oct 2023 03:44:24 +0200 Subject: [PATCH 1/5] don't use expr to check for 10.13 --- r/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/configure b/r/configure index addf7b59c7f..362e6719911 100755 --- a/r/configure +++ b/r/configure @@ -264,7 +264,7 @@ set_pkg_vars () { PKG_CFLAGS="$PKG_CFLAGS $ARROW_R_CXXFLAGS" fi - if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13'; then + if [ "$UNAME" = "Darwin" ] && [ $(sw_vers -productVersion) = "10.13" ]; then # avoid C++17 availability warnings on macOS < 11 PKG_CFLAGS="$PKG_CFLAGS -D_LIBCPP_DISABLE_AVAILABILITY" fi From 080d52e100d3ec506b19595f300565942e3db34c Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Tue, 17 Oct 2023 04:53:17 +0200 Subject: [PATCH 2/5] Revert "don't use expr to check for 10.13" This reverts commit a56ce03d8dee80df24f077384db233e010224e3c. --- r/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/configure b/r/configure index 362e6719911..addf7b59c7f 100755 --- a/r/configure +++ b/r/configure @@ -264,7 +264,7 @@ set_pkg_vars () { PKG_CFLAGS="$PKG_CFLAGS $ARROW_R_CXXFLAGS" fi - if [ "$UNAME" = "Darwin" ] && [ $(sw_vers -productVersion) = "10.13" ]; then + if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13'; then # avoid C++17 availability warnings on macOS < 11 PKG_CFLAGS="$PKG_CFLAGS -D_LIBCPP_DISABLE_AVAILABILITY" fi From 1780fe45cf9b7c5fa6930f6c97eae5d26c06a354 Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Tue, 17 Oct 2023 04:54:12 +0200 Subject: [PATCH 3/5] redirect all output --- r/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/configure b/r/configure index addf7b59c7f..785bc218395 100755 --- a/r/configure +++ b/r/configure @@ -264,7 +264,7 @@ set_pkg_vars () { PKG_CFLAGS="$PKG_CFLAGS $ARROW_R_CXXFLAGS" fi - if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13'; then + if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13' >/dev/null 2>&1; then # avoid C++17 availability warnings on macOS < 11 PKG_CFLAGS="$PKG_CFLAGS -D_LIBCPP_DISABLE_AVAILABILITY" fi From efd3f83c7726c405f673be12ecef221d29369ae2 Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Tue, 17 Oct 2023 17:10:56 +0200 Subject: [PATCH 4/5] add comment --- r/configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/r/configure b/r/configure index 785bc218395..e4815c7a85a 100755 --- a/r/configure +++ b/r/configure @@ -264,6 +264,8 @@ set_pkg_vars () { PKG_CFLAGS="$PKG_CFLAGS $ARROW_R_CXXFLAGS" fi + # 'expr :' always outputs the number of matched characters, to avoid noise in the log we + # redirect the output to /dev/null if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13' >/dev/null 2>&1; then # avoid C++17 availability warnings on macOS < 11 PKG_CFLAGS="$PKG_CFLAGS -D_LIBCPP_DISABLE_AVAILABILITY" From 053aae87f44515c67cdc3c21a6689d7064e28f40 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Tue, 17 Oct 2023 10:17:16 -0500 Subject: [PATCH 5/5] Update r/configure Add both the rationale behind using expr --- r/configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/r/configure b/r/configure index e4815c7a85a..c957c9946fb 100755 --- a/r/configure +++ b/r/configure @@ -264,8 +264,9 @@ set_pkg_vars () { PKG_CFLAGS="$PKG_CFLAGS $ARROW_R_CXXFLAGS" fi - # 'expr :' always outputs the number of matched characters, to avoid noise in the log we - # redirect the output to /dev/null + # We use expr because the product version returns more than just 10.13 and we want to + # match the substring. However, expr always outputs the number of matched characters + # to stdout, to avoid noise in the log we redirect the output to /dev/null if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13' >/dev/null 2>&1; then # avoid C++17 availability warnings on macOS < 11 PKG_CFLAGS="$PKG_CFLAGS -D_LIBCPP_DISABLE_AVAILABILITY"