Copilot commented on code in PR #50195:
URL: https://github.com/apache/arrow/pull/50195#discussion_r3957329769


##########
r/configure.win:
##########
@@ -95,8 +95,10 @@ function configure_binaries() {
   # S3, GCS, and re2 support only for Rtools40 (i.e. R >= 4.0)
   "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e 'R.version$major >= 4' | grep 
TRUE >/dev/null 2>&1
   if [ $? -eq 0 ]; then
-    PKG_CFLAGS="${PKG_CFLAGS} -DARROW_R_WITH_S3 -DARROW_R_WITH_GCS" # 
-DARROW_R_WITH_AZURE
-    PKG_LIBS="${PKG_LIBS} -lre2 ${AWS_LIBS} ${GCS_LIBS}" # ${AZURE_LIBS}
+    PKG_CFLAGS="${PKG_CFLAGS} -DARROW_R_WITH_S3 -DARROW_S3_STATIC 
-DARROW_R_WITH_GCS" # -DARROW_R_WITH_AZURE
+    # Order matters. Arrow S3 depends on Arrow (part of PKG_LIBS) and AWS_LIBS,
+    # so -larrow_s3 must come before both. Do not turn this into an append.
+    PKG_LIBS="-larrow_s3 ${PKG_LIBS} -lre2 ${AWS_LIBS} ${GCS_LIBS}" # 
${AZURE_LIBS}

Review Comment:
   `PKG_LIBS` is rebuilt by prepending `-larrow_s3`, which puts it *before* the 
`-L${RWINLIB}/lib...` search paths defined earlier. Linkers typically only 
apply `-L` to subsequent `-l` flags, so this can fail to locate `libarrow_s3`.
   
   Instead, keep the `-L...` entries first and insert `-larrow_s3` into the 
existing `-l...` list (before `-larrow_dataset` / `-larrow`).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to