paleolimbot commented on code in PR #1220: URL: https://github.com/apache/arrow-adbc/pull/1220#discussion_r1376183382
########## r/adbcsnowflake/tools/create-go-vendor-archive.R: ########## @@ -0,0 +1,77 @@ +# 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. + +go_bin <- Sys.getenv("GO_BIN", unname(Sys.which("go"))) + +withr::with_dir("src/go/adbc", { + system(paste(shQuote(go_bin), "mod vendor -v")) + + # go mod vendor for arrow/v13 doesn't include some files needed for go build + tmp_zip <- tempfile() + tmp_extract <- tempfile() + local({ + on.exit({ + unlink(tmp_extract, recursive = TRUE) + unlink(tmp_zip) + }) + + curl::curl_download( + "https://github.com/apache/arrow/archive/refs/tags/go/v13.0.0.zip", + tmp_zip + ) + + unzip(tmp_zip, exdir = tmp_extract) + + src_go_arrow_cdata_arrow_dir <- file.path( + tmp_extract, + "arrow-go-v13.0.0/go/arrow/cdata/arrow" + ) + + dst_go_arrow_cdata_dir <- "vendor/github.com/apache/arrow/go/v13/arrow/cdata/" + stopifnot(file.copy(src_go_arrow_cdata_arrow_dir, dst_go_arrow_cdata_dir, recursive = TRUE)) + }) + + # github.com/zeebo/xxh3/Makefile does not end in LF, giving a check NOTE + write("\n", "vendor/github.com/zeebo/xxh3/Makefile", append = TRUE) + + # pragmas in this file give a NOTE Review Comment: They check for warnings they care about during compilation and thus issue NOTEs if there are pragmas supressing them. This is a simple regex search that you can also fool by doing `/*IGNORE*/#pragma diagnostic ...`, but in the absence of an actual compilation warning I prefer to just disable the pragmas. -- 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]
