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


##########
r/tools/nixlibs.R:
##########
@@ -625,30 +625,35 @@ build_libarrow <- function(src_dir, dst_dir) {
   env_var_list <- with_cloud_support(env_var_list)
   env_var_list <- with_wasm_support(env_var_list)
 
-  # turn_off_all_optional_features() needs to happen after
-  # with_cloud_support(), since it might turn features ON.
+  # turn_off_all_optional_features() and turn_off_unvendored_features() need to
+  # happen after with_cloud_support(), since it might turn features ON.
   thirdparty_deps_unavailable <- !download_ok &&
     !dir.exists(thirdparty_dependency_dir) &&
     !env_is("ARROW_DEPENDENCY_SOURCE", "system")
   do_minimal_build <- env_is("LIBARROW_MINIMAL", "true")
+  # Thirdparty source tarballs shipped in the package
+  vendored <- usable_vendored_dependencies(src_dir)
 
   if (do_minimal_build) {
     env_var_list <- turn_off_all_optional_features(env_var_list)
   } else if (thirdparty_deps_unavailable) {
     cat(paste0(
       "*** Building C++ library from source, but downloading thirdparty 
dependencies\n",
-      "    is not possible, so this build will turn off all thirdparty 
features.\n",
+      "    is not possible, so this build will turn off the thirdparty 
features\n",
+      "    whose sources are not included in the package.\n",
       "    See installation guide for details:\n",
       "    https://arrow.apache.org/docs/r/articles/install.html\n";
     ))
-    env_var_list <- turn_off_all_optional_features(env_var_list)
+    env_var_list <- turn_off_unvendored_features(env_var_list, names(vendored))
   } else if (dir.exists(thirdparty_dependency_dir)) {
     # Add the *_SOURCE_URL env vars
     env_var_list <- set_thirdparty_urls(env_var_list)
   }
-  # Some thirdparty dependencies are required even for a minimal build, so they
-  # can't be turned off like the ones above.
-  env_var_list <- with_vendored_dependencies(env_var_list)
+  # Point the build at the vendored sources of the thirdparty dependencies.
+  # Some of them are required even for a minimal build, so they can't be turned
+  # off like the ones above.
+  env_var_list <- with_vendored_dependencies(env_var_list, vendored)
+  use_vendored_checksums(src_dir, env_var_list, vendored)

Review Comment:
   The checksum rewrite persists in `tools/cpp/thirdparty/versions.txt` after 
the build. Reinstalling from the same source tree with an upstream archive 
supplied through `ARROW_*_URL` or `ARROW_THIRDPARTY_DEPENDENCY_DIR` leaves its 
trimmed checksum in place, so CMake rejects the archive. Save and restore the 
original file around the build, including failure paths.



-- 
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