This is an automated email from the ASF dual-hosted git repository.

paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 9777b853c chore(r): Always use system go for building R packages 
(#3492)
9777b853c is described below

commit 9777b853ceb63ea8bd6d44984103440ed736dce3
Author: Dewey Dunnington <[email protected]>
AuthorDate: Mon Sep 29 17:27:20 2025 -0500

    chore(r): Always use system go for building R packages (#3492)
    
    This PR applies a fix that had already been applied to adbcsnowflake to
    adbcbigquery and adbcflightsql...in the lead up to an attempted CRAN
    submission, I'd removed the bit where we download go for every build and
    left it in for the other two Go-based R package drivers. There were also
    a few other configure changes that hadn't been updated that I applied to
    the BigQuery and FlightSQL wrappers.
    
    Closes #3448.
---
 r/adbcbigquery/.Rbuildignore     |  1 -
 r/adbcbigquery/configure         |  8 +++++++-
 r/adbcbigquery/configure.win     |  9 +++------
 r/adbcbigquery/src/Makevars.in   |  2 +-
 r/adbcbigquery/src/Makevars.win  | 34 ----------------------------------
 r/adbcflightsql/.Rbuildignore    |  1 -
 r/adbcflightsql/configure        |  8 +++++++-
 r/adbcflightsql/configure.win    |  9 +++------
 r/adbcflightsql/src/Makevars.in  |  2 +-
 r/adbcflightsql/src/Makevars.win | 34 ----------------------------------
 10 files changed, 22 insertions(+), 86 deletions(-)

diff --git a/r/adbcbigquery/.Rbuildignore b/r/adbcbigquery/.Rbuildignore
index a62253724..ca7353661 100644
--- a/r/adbcbigquery/.Rbuildignore
+++ b/r/adbcbigquery/.Rbuildignore
@@ -12,6 +12,5 @@
 ^cran-comments\.md$
 ^src/\.go-cache$
 ^src/\.go-path$
-^configure\.win$
 ^\.cache$
 ^compile_commands\.json$
diff --git a/r/adbcbigquery/configure b/r/adbcbigquery/configure
index 84ceb149a..d5aee63ad 100755
--- a/r/adbcbigquery/configure
+++ b/r/adbcbigquery/configure
@@ -105,7 +105,13 @@ fi
 
 # On OSX we need -framework Security because of some dependency somewhere
 if [ `uname` = "Darwin" ]; then
-  PKG_LIBS="-framework Security $PKG_LIBS"
+  PKG_LIBS="-framework Security -lresolv $PKG_LIBS"
+elif uname | grep -e "MSYS" -e "MINGW" >/dev/null; then
+  # Windows
+  PKG_LIBS="$PKG_LIBS"
+else
+  # Linux
+  PKG_LIBS="-lresolv $PKG_LIBS"
 fi
 
 PKG_LIBS="$PKG_LIBS $SYMBOL_ARGS"
diff --git a/r/adbcbigquery/configure.win b/r/adbcbigquery/configure.win
index caf6740f6..ef048ad6a 100755
--- a/r/adbcbigquery/configure.win
+++ b/r/adbcbigquery/configure.win
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# See configure for a description of this process.
-# This is only for development: this file and bootstrap.R will be removed
-# prior to packaging
-if [ -f bootstrap.R ]; then
-  $R_HOME/bin/Rscript bootstrap.R
-fi
+# On Windows, this package only compiles on R >= 4.2 where the normal
+# configure is sufficient
+./configure
diff --git a/r/adbcbigquery/src/Makevars.in b/r/adbcbigquery/src/Makevars.in
index 53fab3fd6..b8e922d02 100644
--- a/r/adbcbigquery/src/Makevars.in
+++ b/r/adbcbigquery/src/Makevars.in
@@ -16,7 +16,7 @@
 # under the License.
 
 PKG_CPPFLAGS=-I$(CURDIR)/src -DADBC_EXPORT=""
-PKG_LIBS=-L$(CURDIR)/go -ladbc_driver_bigquery -lresolv @libs@
+PKG_LIBS=-L$(CURDIR)/go -ladbc_driver_bigquery @libs@
 
 CGO_CC = @cc@
 CGO_CXX = @cxx@
diff --git a/r/adbcbigquery/src/Makevars.win b/r/adbcbigquery/src/Makevars.win
deleted file mode 100644
index df9fb94b9..000000000
--- a/r/adbcbigquery/src/Makevars.win
+++ /dev/null
@@ -1,34 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-PKG_CPPFLAGS=-I$(CURDIR) -DADBC_EXPORT=""
-PKG_LIBS=-L$(CURDIR)/go -ladbc_driver_bigquery
-
-CGO_CC = `"${R_HOME}/bin${R_ARCH_BIN}/R.exe" CMD config CC`
-CGO_CXX = `"${R_HOME}/bin${R_ARCH_BIN}/R.exe" CMD config CXX`
-CGO_CFLAGS = $(ALL_CPPFLAGS)
-GO_BIN = $(CURDIR)/go/tmp/go/bin/go.exe
-
-.PHONY: all gostatic gobin
-all: $(SHLIB)
-$(SHLIB): gostatic
-
-gostatic: gobin
-               (cd "$(CURDIR)/go/adbc"; CC="$(CGO_CC)" CXX="$(CGO_CXX)" 
CGO_CFLAGS="$(CGO_CFLAGS)" "$(GO_BIN)" build -v -tags driverlib -o 
$(CURDIR)/go/libadbc_driver_bigquery.a -buildmode=c-archive "./pkg/bigquery")
-
-gobin:
-               (cd ..; "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" 
"tools/download-go.R")
diff --git a/r/adbcflightsql/.Rbuildignore b/r/adbcflightsql/.Rbuildignore
index eef47c80f..d3227cb7d 100644
--- a/r/adbcflightsql/.Rbuildignore
+++ b/r/adbcflightsql/.Rbuildignore
@@ -12,4 +12,3 @@
 ^cran-comments\.md$
 ^src/\.go-cache$
 ^src/\.go-path$
-^configure\.win$
diff --git a/r/adbcflightsql/configure b/r/adbcflightsql/configure
index ffa51d900..7a666eaf4 100755
--- a/r/adbcflightsql/configure
+++ b/r/adbcflightsql/configure
@@ -105,7 +105,13 @@ fi
 
 # On OSX we need -framework Security because of some dependency somewhere
 if [ `uname` = "Darwin" ]; then
-  PKG_LIBS="-framework Security $PKG_LIBS"
+  PKG_LIBS="-framework Security -lresolv $PKG_LIBS"
+elif uname | grep -e "MSYS" -e "MINGW" >/dev/null; then
+  # Windows
+  PKG_LIBS="$PKG_LIBS"
+else
+  # Linux
+  PKG_LIBS="-lresolv $PKG_LIBS"
 fi
 
 PKG_LIBS="$PKG_LIBS $SYMBOL_ARGS"
diff --git a/r/adbcflightsql/configure.win b/r/adbcflightsql/configure.win
index caf6740f6..ef048ad6a 100755
--- a/r/adbcflightsql/configure.win
+++ b/r/adbcflightsql/configure.win
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# See configure for a description of this process.
-# This is only for development: this file and bootstrap.R will be removed
-# prior to packaging
-if [ -f bootstrap.R ]; then
-  $R_HOME/bin/Rscript bootstrap.R
-fi
+# On Windows, this package only compiles on R >= 4.2 where the normal
+# configure is sufficient
+./configure
diff --git a/r/adbcflightsql/src/Makevars.in b/r/adbcflightsql/src/Makevars.in
index e07e8484e..6221be292 100644
--- a/r/adbcflightsql/src/Makevars.in
+++ b/r/adbcflightsql/src/Makevars.in
@@ -16,7 +16,7 @@
 # under the License.
 
 PKG_CPPFLAGS=-I$(CURDIR)/src -DADBC_EXPORT=""
-PKG_LIBS=-L$(CURDIR)/go -ladbc_driver_flightsql -lresolv @libs@
+PKG_LIBS=-L$(CURDIR)/go -ladbc_driver_flightsql @libs@
 
 CGO_CC = @cc@
 CGO_CXX = @cxx@
diff --git a/r/adbcflightsql/src/Makevars.win b/r/adbcflightsql/src/Makevars.win
deleted file mode 100644
index ca526b379..000000000
--- a/r/adbcflightsql/src/Makevars.win
+++ /dev/null
@@ -1,34 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-PKG_CPPFLAGS=-I$(CURDIR) -DADBC_EXPORT=""
-PKG_LIBS=-L$(CURDIR)/go -ladbc_driver_flightsql
-
-CGO_CC = `"${R_HOME}/bin${R_ARCH_BIN}/R.exe" CMD config CC`
-CGO_CXX = `"${R_HOME}/bin${R_ARCH_BIN}/R.exe" CMD config CXX`
-CGO_CFLAGS = $(ALL_CPPFLAGS)
-GO_BIN = $(CURDIR)/go/tmp/go/bin/go.exe
-
-.PHONY: all gostatic gobin
-all: $(SHLIB)
-$(SHLIB): gostatic
-
-gostatic: gobin
-               (cd "$(CURDIR)/go/adbc"; CC="$(CGO_CC)" CXX="$(CGO_CXX)" 
CGO_CFLAGS="$(CGO_CFLAGS)" "$(GO_BIN)" build -v -tags driverlib -o 
$(CURDIR)/go/libadbc_driver_flightsql.a -buildmode=c-archive "./pkg/flightsql")
-
-gobin:
-               (cd ..; "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" 
"tools/download-go.R")

Reply via email to