assignUser commented on code in PR #39148: URL: https://github.com/apache/arrow/pull/39148#discussion_r1423182640
########## r/bootstrap.R: ########## @@ -0,0 +1,83 @@ +# 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. + +if (!dir.exists('../cpp')) { + cli::cli_alert_warning("Arrow C++ sources not found, skipping bootstrap.") + q(save = "no") +} + +pkg_version <- package_version(desc::desc_get("Version")) +is_release <- is.na(pkg_version[1, 4]) || pkg_version[1, 4] < "100" +# for testing and CI +force_bootstrap <- identical(tolower(Sys.getenv("ARROW_FORCE_BOOTSTRAP", unset = "false")), "true") + +get_checksum_version <- function() { + url_exists <- function(url) { + headers <- curlGetHeaders(url) + attr(headers, "status") == 200 + } + # Run update-checksums.R manually if the checksums already exists + # but have an unexpected version. + if (dir.exists("tools/checksums") || force_bootstrap) { + cli::cli_alert_success("Found existing checksums, skipping download.") + return(NA) + } + + # We currently don't support prebuild binaries with a differing version. + jfrog_url <- "https://apache.jfrog.io/artifactory/arrow/r/%s/libarrow" + matching_url <- url_exists(sprintf(jfrog_url, pkg_version[1, 1:3])) + if (matching_url) { + version <- pkg_version[1, 1:3] + } else { + cli::cli_abort("No matching checksums found, can't proceed.") + } + version +} + +cli::cli_alert_info("Vendoring C++ sources") +system2("make", c("sync-cpp")) + +if (!is_release && !force_bootstrap) { + cli::cli_alert_warning("Skipping releases preparations for dev version.") + q(save = "no") +} + +cli::cli_alert_info("Installing dependencies") +devtools::install_dev_deps(".", upgrade = "never") +devtools::install_cran("styler") + +cli::cli_alert_info("Removing badges from Readme.md") +system2("sed", c("-i", "-e", "'/^<!--- badges: start -->$/,/^<!--- badges: stop -->$/d'", "README.md")) Review Comment: No the first make build/devtools::build() happens after the cran branch is created of the rc branch. (and these changes would be rebased onto the final release branch as well) But maybe it is time to integrate the cran branch into the normal process within 'apache/arrow' (aided by these new automations) instead of haiving it different contributor forks (potentially getting lost...) -- 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]
