Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] Rebuild for re2 2023.06.02 #1200

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci_support/linux_64_cuda_compiler_version11.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_64_cuda_compiler_versionNone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_aarch64_cuda_compiler_version11.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_aarch64_cuda_compiler_versionNone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_ppc64le_cuda_compiler_version11.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_ppc64le_cuda_compiler_versionNone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
8 changes: 8 additions & 0 deletions .ci_support/migrations/re220230602.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__migrator:
build_number: 1
kind: version
migration_number: 1
commit_message: "Rebuild for re2 2023.06.02"
migrator_ts: 1697153785.6780672
re2:
- 2023.06.02
2 changes: 1 addition & 1 deletion .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/win_64_cuda_compiler_version11.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/win_64_cuda_compiler_versionNone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ python:
- 3.8.* *_cpython
- 3.9.* *_cpython
re2:
- 2023.03.02
- 2023.06.02
snappy:
- '1'
target_platform:
Expand Down
4 changes: 3 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ source:
patches:
- patches/0001-GH-15017-Python-Harden-test_memory.py-for-use-with-A.patch
- patches/0002-GH-37480-Python-Bump-pandas-version-that-contains-re.patch
# backport https://github.com/apache/arrow/pull/38265
- patches/0003-GH-38263-C-Prefer-to-call-string_view-data-instead-o.patch
# testing-submodule not part of release tarball
- git_url: https://github.com/apache/arrow-testing.git
git_rev: 47f7b56b25683202c1fd957668e13f2abafc0f12
folder: testing

build:
number: 8
number: 9
# for cuda support, building with one version is enough to be compatible with
# all later versions, since arrow is only using libcuda, and not libcudart.
skip: true # [cuda_compiler_version not in ("None", cuda_compiler_version_min)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0ff739a0d3c8c4df4b46625f0bb0bc87c6b0d29d Mon Sep 17 00:00:00 2001
From: h-vetinari <[email protected]>
Date: Fri, 28 Jul 2023 13:31:01 +1100
Subject: [PATCH 1/2] GH-15017: [Python] Harden test_memory.py for use with
Subject: [PATCH 1/3] GH-15017: [Python] Harden test_memory.py for use with
ARROW_USE_GLOG=ON (#36901)

Accept output pattern for ARROW_USE_GLOG=ON too.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 2caeef5e4ad232013e769e36fb957cf4f0c5992f Mon Sep 17 00:00:00 2001
From: Dane Pitkin <[email protected]>
Date: Thu, 31 Aug 2023 00:32:26 -0400
Subject: [PATCH 2/2] GH-37480: [Python] Bump pandas version that contains
Subject: [PATCH 2/3] GH-37480: [Python] Bump pandas version that contains
regression for pandas issue 50127 (#37481)

### Rationale for this change
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
From 3c3727e6ad66ce3494e6c2cfe9905e3dfdf7ee00 Mon Sep 17 00:00:00 2001
From: Felipe Oliveira Carvalho <[email protected]>
Date: Fri, 13 Oct 2023 18:15:39 -0300
Subject: [PATCH 3/3] GH-38263 [C++]: Prefer to call string_view::data()
instead of begin() where a char pointer is expected

* Use re2::StringPiece instead of std::string_view when using re2`

* Prefer data() instead of begin()

* Don't rely on missing absl::string_view::ToString()
---
cpp/src/arrow/compute/kernels/scalar_string_ascii.cc | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc b/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc
index a90a7282b..90f5d40b9 100644
--- a/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_string_ascii.cc
@@ -2063,12 +2063,12 @@ struct RegexSubstringReplacer {
regex_find_("(" + options_.pattern + ")", MakeRE2Options<Type>()),
regex_replacement_(options_.pattern, MakeRE2Options<Type>()) {}

- Status ReplaceString(std::string_view s, TypedBufferBuilder<uint8_t>* builder) const {
+ Status ReplaceString(re2::StringPiece s, TypedBufferBuilder<uint8_t>* builder) const {
re2::StringPiece replacement(options_.replacement);

// If s is empty, then it's essentially global
if (options_.max_replacements == -1 || s.empty()) {
- std::string s_copy(s);
+ std::string s_copy{s.data(), s.length()};
RE2::GlobalReplace(&s_copy, regex_replacement_, replacement);
return builder->Append(reinterpret_cast<const uint8_t*>(s_copy.data()),
s_copy.length());
@@ -2079,18 +2079,18 @@ struct RegexSubstringReplacer {
// We might do this faster similar to RE2::GlobalReplace using Match and Rewrite
const char* i = s.data();
const char* end = s.data() + s.length();
- re2::StringPiece piece(s.data(), s.length());
+ re2::StringPiece mutable_s{s};

int64_t max_replacements = options_.max_replacements;
while ((i < end) && (max_replacements != 0)) {
std::string found;
- if (!RE2::FindAndConsume(&piece, regex_find_, &found)) {
+ if (!RE2::FindAndConsume(&mutable_s, regex_find_, &found)) {
RETURN_NOT_OK(builder->Append(reinterpret_cast<const uint8_t*>(i),
static_cast<int64_t>(end - i)));
i = end;
} else {
// wind back to the beginning of the match
- const char* pos = piece.begin() - found.length();
+ const char* pos = mutable_s.data() - found.length();
// the string before the pattern
RETURN_NOT_OK(builder->Append(reinterpret_cast<const uint8_t*>(i),
static_cast<int64_t>(pos - i)));
@@ -2101,7 +2101,7 @@ struct RegexSubstringReplacer {
RETURN_NOT_OK(builder->Append(reinterpret_cast<const uint8_t*>(found.data()),
static_cast<int64_t>(found.length())));
// skip pattern
- i = piece.begin();
+ i = mutable_s.data();
max_replacements--;
}
}